@qaecy/cue-ui 0.0.35 → 0.0.37
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/112.js +1 -1
- package/376.js +1 -1
- package/382.js +1 -0
- package/493.js +1 -1
- package/5.js +1 -1
- package/611.js +1 -1
- package/675.js +1 -0
- package/773.js +1 -1
- package/834.js +1 -0
- package/872.js +1 -0
- package/953.js +1 -0
- package/README.md +63 -2
- package/common.js +1 -1
- package/index.js +1 -1
- package/main.js +1 -1
- package/package.json +1 -1
- package/368.js +0 -1
- package/446.js +0 -1
- package/499.js +0 -1
- package/919.js +0 -1
package/872.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[170,872],{503(se,Q,u){var S=u(6119);function O(F){var l=0;if(F&&F.length>0){l+=Math.abs(z(F[0]));for(var R=1;R<F.length;R++)l-=Math.abs(z(F[R]))}return l}function z(F){var l,R,p,a,g,M,D=0,k=F.length;if(k>2){for(M=0;M<k;M++)M===k-2?(p=k-2,a=k-1,g=0):M===k-1?(p=k-1,a=0,g=1):(p=M,a=M+1,g=M+2),l=F[p],R=F[a],D+=(s(F[g][0])-s(l[0]))*Math.sin(s(R[1]));D=D*S.RADIUS*S.RADIUS/2}return D}function s(F){return F*Math.PI/180}se.exports.geometry=function m(F){var R,l=0;switch(F.type){case"Polygon":return O(F.coordinates);case"MultiPolygon":for(R=0;R<F.coordinates.length;R++)l+=O(F.coordinates[R]);return l;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(R=0;R<F.geometries.length;R++)l+=m(F.geometries[R]);return l}},se.exports.ring=z},5341(se){se.exports=function u(S){if(!S||!S.type)return null;var m=Q[S.type];return m?"geometry"===m?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:S}]}:"feature"===m?{type:"FeatureCollection",features:[S]}:"featurecollection"===m?S:void 0:null};var Q={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},6756(se,Q,u){"use strict";u.d(Q,{BK:()=>S,In:()=>P,Kz:()=>p,Mc:()=>g,U6:()=>O,g0:()=>M,g8:()=>z,r:()=>m,u9:()=>F});const S=["#2B5DE6","#1A2B50","#C5E045","#6FA8FF","#00C2E0","#5847EB","#008585","#4ADE80","#0F4C81","#8B5CF6","#FACC15","#FB923C","#F43F5E","#E879F9","#D97706","#334155","#64748B","#94A3B8","#C7D2FE","#F8FAFC"];function m(b){switch(b){case"primary":default:return"#2859e1";case"accent":return"#e2f552";case"tertiary":return"#ffffff"}}function O(b){switch(b){case"primary":default:return"#1744c2";case"accent":return"#b8cc3f";case"tertiary":return"#eeeeee"}}function z(b){const[A,U,B]=function s(b,A){if(void 0===b)return[];const B=window.getComputedStyle(b.nativeElement);return A.map(X=>B.getPropertyValue(X).trim()||"")}(b,["--cue-chart-text-color","--cue-chart-border-background-color","--chart-graph-edge-color"]);return{text:A,borderBackground:U,edgeColor:B}}const F={fontFamily:"Poppins, sans-serif",fontWeight:"normal",color:"#333"};function P(b){return b>=1e6?`${(b/1e6).toFixed(1)}m`:b>=1e3?`${(b/1e3).toFixed(0)}k`:b.toString()}function p(b,A,U,B){if(1===B)return b;const X=D(b),h=D(A),C=U/(B-1);return`rgb(${Math.round(X.r+(h.r-X.r)*C)}, ${Math.round(X.g+(h.g-X.g)*C)}, ${Math.round(X.b+(h.b-X.b)*C)})`}const g=(b,A)=>void 0===A?b:A.children??[];function M(b,A,U=.05,B="Other"){const X=b.reduce((x,L)=>x+k(L),0),h=[],C=[];if(b.forEach(x=>{let L,w;L=void 0===x.value&&Array.isArray(x.children)&&x.children.length>0?x.children.reduce((Z,J)=>Z+k(J),0):void 0!==x.value?x.value:0,Array.isArray(x.children)&&x.children.length>0&&(w=M(x.children,A,U,B));const W={...x,value:L,children:w};A&&X>0&&L/X<U?C.push(W):h.push(W)}),A&&C.length>0){const x=C.reduce((L,w)=>L+w.value,0);h.push({id:"__grouped_small__",name:B,value:x,children:C,isGroup:!0})}return h}function D(b){const A=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(b);return A?{r:parseInt(A[1],16),g:parseInt(A[2],16),b:parseInt(A[3],16)}:{r:0,g:0,b:0}}function k(b){return"number"==typeof b.value?b.value:Array.isArray(b.children)&&b.children.length>0?b.children.reduce((A,U)=>A+k(U),0):0}},4853(se,Q,u){"use strict";u.d(Q,{H:()=>b});var S=u(7705),m=u(5802),O=u(7089),z=u(7023),s=u(5381),F=u(5971),l=u(3319),R=u(356),P=u(6279),p=u(5547);const a=()=>({position:"bottomleft"}),g=(A,U)=>U.label||A;function M(A,U){if(1&A){const B=p.RV6();p.j41(0,"cue-menu-item",4),p.bIt("click",function(){const h=m.eBV(B).$implicit;return m.Njj(h.action())}),p.EFF(1),p.k0s()}if(2&A){const B=U.$implicit;p.Y8G("selected",B.selected),p.R7$(),p.JRh(B.label)}}function D(A,U){if(1&A&&(p.j41(0,"cue-menu-wrap"),p.Z7z(1,M,2,2,"cue-menu-item",3,g),p.k0s()),2&A){const B=p.XpG();p.R7$(),p.Dyx(B.contextMenuItems())}}function k(A,U){if(1&A){const B=p.RV6();p.j41(0,"cue-button",5),p.bIt("click",function(h){const C=m.eBV(B).$implicit,x=p.XpG();return m.Njj(x.handleClick(h,C))}),p.nrm(1,"cue-button-icon",6),p.k0s()}if(2&A){const B=U.$implicit,X=p.XpG(),h=p.sdS(1);p.Y8G("cueTooltip",B.label)("variant",B.variant?B.variant:X.variant())("size",X.size())("cueContextMenu",h)("contextMenuData",p.lJ4(7,a))("cueContextEnabled",void 0!==B.contextMenuItems&&B.contextMenuItems.length>0),p.R7$(),p.Y8G("icon",B.icon)}}let b=(()=>{class A{items=S.hFB.required();noGap=(0,S.hFB)(!0);direction=(0,S.hFB)("row");size=(0,S.hFB)("xs");variant=(0,S.hFB)("tertiary");mouseEnter=(0,S.CGW)();mouseLeave=(0,S.CGW)();contextMenuItems=(0,m.vPA)([]);handleClick(B,X){B.stopPropagation(),X.contextMenuItems&&X.contextMenuItems.length>0?this.contextMenuItems.set(X.contextMenuItems):X.action&&(this.contextMenuItems.set([]),X.action())}static \u0275fac=function(X){return new(X||A)};static \u0275cmp=p.VBU({type:A,selectors:[["cue-entity-menu"]],inputs:{items:[1,"items"],noGap:[1,"noGap"],direction:[1,"direction"],size:[1,"size"],variant:[1,"variant"]},outputs:{mouseEnter:"mouseEnter",mouseLeave:"mouseLeave"},decls:5,vars:2,consts:[["contextMenu",""],["gap","s","justify","end",2,"width","100%",3,"mouseenter","mouseleave","direction","noGap"],["trigger","leftclick",3,"cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"selected"],[3,"click","selected"],["trigger","leftclick",3,"click","cueTooltip","variant","size","cueContextMenu","contextMenuData","cueContextEnabled"],[3,"icon"]],template:function(X,h){1&X&&(p.DNE(0,D,3,0,"ng-template",null,0,p.C5r),p.j41(2,"cue-flexcontainer",1),p.bIt("mouseenter",function(){return h.mouseEnter.emit()})("mouseleave",function(){return h.mouseLeave.emit()}),p.Z7z(3,k,2,8,"cue-button",2,g),p.k0s()),2&X&&(p.R7$(2),p.Y8G("direction",h.direction())("noGap",h.noGap()),p.R7$(),p.Dyx(h.items()))},dependencies:[s.n,F.$,O.d,l.a,z.Q,R.M,P.D],encapsulation:2,changeDetection:0})}return A})()},1024(se,Q,u){"use strict";u.d(Q,{p:()=>O});var S=u(5547);const m=["*"];let O=(()=>{class z{static \u0275fac=function(l){return new(l||z)};static \u0275cmp=S.VBU({type:z,selectors:[["cue-key-val-list"]],ngContentSelectors:m,decls:2,vars:0,consts:[[1,"key-val-list"]],template:function(l,R){1&l&&(S.NAR(),S.rj2(0,"div",0),S.SdG(1),S.eux())},styles:[".key-val-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:var(--cue-grid-gap-s)}"]})}return z})()},9421(se,Q,u){"use strict";u.d(Q,{F:()=>l});var S=u(7705),m=u(5802),O=u(2271),z=u(7335),s=u(2245),F=u(5547);let l=(()=>{class R{entityMenuDirective;size=(0,S.hFB)("m");key=S.hFB.required();val=S.geq.required();options=(0,S.hFB)([]);suffix=(0,S.hFB)("");valueChange=(0,S.CGW)();editModeEnabled=(0,m.vPA)(!1);valueChanged=(0,O.EW)(()=>this.val()!==this.newValue());newValue=(0,O.uu)(()=>this.val());labelSize=(0,O.EW)(()=>{switch(this.size()){case"s":return"xs";case"m":return"s";case"l":return"m";case"xl":return"l"}});onKeyPress(p){this.editModeEnabled()&&("Escape"===p.key?(this._reset(),p.stopPropagation()):"Enter"===p.key&&this._emitChange())}saveCancelMenu=(0,O.EW)(()=>{const p=[{icon:"close",label:"Cancel",action:()=>this._reset()}];return this.valueChanged()&&p.push({icon:"save",label:"Save",action:()=>this._emitChange()}),p});selectionChange(p){this.newValue.set(p?.toString()??"")}inputChange(p){this.newValue.set(p)}_emitChange(){this.valueChange.emit(this.newValue()),this.val.set(this.newValue()),this.editModeEnabled.set(!1)}_reset(){this.newValue.set(this.val()),this.editModeEnabled.set(!1)}static \u0275fac=function(a){return new(a||R)};static \u0275cmp=F.VBU({type:R,selectors:[["cue-key-val"]],viewQuery:function(a,g){if(1&a&&F.GBs(z.e,5),2&a){let M;F.mGM(M=F.lsd())&&(g.entityMenuDirective=M.first)}},hostBindings:function(a,g){1&a&&F.bIt("keydown",function(D){return g.onKeyPress(D)},F.EBC)},inputs:{size:[1,"size"],key:[1,"key"],val:[1,"val"],options:[1,"options"],suffix:[1,"suffix"]},outputs:{val:"valChange",valueChange:"valueChange"},decls:8,vars:5,consts:[[1,"key-val-container"],[3,"size"],[1,"value-content"]],template:function(a,g){1&a&&(F.j41(0,"dl",0)(1,"dt")(2,"cue-typography",1),F.EFF(3),F.k0s()(),F.j41(4,"dd")(5,"cue-typography",1)(6,"span",2),F.EFF(7),F.k0s()()()()),2&a&&(F.R7$(2),F.Y8G("size",g.labelSize()),F.R7$(),F.JRh(g.key()),F.R7$(2),F.Y8G("size",g.size()),F.R7$(2),F.Lme("",g.val()," ",g.suffix()))},dependencies:[s.Typography],styles:[".key-val-container[_ngcontent-%COMP%]{margin:0;display:flex;flex-direction:column;gap:var(--cue-grid-gap-s, 8px)}dt[_ngcontent-%COMP%], dd[_ngcontent-%COMP%]{margin:0}.read-mode-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;width:100%;position:relative}.read-mode-container.interactive[_ngcontent-%COMP%]:hover{cursor:pointer}.value-content[_ngcontent-%COMP%]{flex:1}[_nghost-%COMP%]{color:var(--cue-typography-text-color, inherit)}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%], .value-content[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}dt[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%], dd[_ngcontent-%COMP%] cue-typography[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{color:var(--cue-typography-text-color, inherit)!important}[_ngcontent-%COMP%]:deep(cue-svg-icon), [_ngcontent-%COMP%]:deep(cue-entity-menu cue-svg-icon){color:var(--cue-icon-color, inherit)!important}.dirty-indicator[_ngcontent-%COMP%]{opacity:.8;margin-left:4px;color:var(--cue-typography-text-color, inherit)!important;font-weight:700;font-size:.4em;transform:translateY(-1em)}"]})}return R})()},7517(se,Q,u){"use strict";u.d(Q,{P:()=>M});var S=u(7705),m=u(2271),O=u(2245),z=u(1359),s=u(5381),F=u(5802),l=u(5547);const R=(D,k)=>k.category;function P(D,k){if(1&D){const b=l.RV6();l.j41(0,"cue-flexcontainer",1)(1,"cue-checkbox",2),l.bIt("checkedChange",function(){F.eBV(b);const U=l.XpG();return F.Njj(U.toggleAll())}),l.k0s()()}if(2&D){const b=l.XpG();l.R7$(),l.Y8G("checked",b.allVisible())}}function p(D,k){if(1&D&&(l.j41(0,"cue-typography",3),l.EFF(1),l.k0s()),2&D){const b=l.XpG().$implicit;l.R7$(),l.JRh(b.category)}}function a(D,k){if(1&D){const b=l.RV6();l.j41(0,"cue-flexcontainer",1)(1,"cue-checkbox",4),l.bIt("checkedChange",function(){const U=F.eBV(b).$implicit,B=l.XpG(2);return F.Njj(B.toggleSingle(U))}),l.k0s(),l.j41(2,"cue-typography",5),l.bIt("click",function(){const U=F.eBV(b).$implicit,B=l.XpG(2);return F.Njj(B.toggleSingle(U))}),l.EFF(3),l.k0s()()}if(2&D){const b=k.$implicit;l.R7$(),l.Y8G("checked",b.visible)("color",b.color),l.R7$(2),l.JRh(b.label)}}function g(D,k){if(1&D&&(l.nVh(0,p,2,1,"cue-typography",3),l.Z7z(1,a,4,3,"cue-flexcontainer",1,l.Vm6)),2&D){const b=k.$implicit;l.vxM(b.category?0:-1),l.R7$(),l.Dyx(b.items)}}let M=(()=>{class D{layers=(0,S.geq)([]);visibilityChange=(0,S.CGW)();layerChange=(0,S.CGW)();visibilityAll=(0,S.CGW)();showCheckAll=(0,m.EW)(()=>this.layers().length>1);allVisible=(0,m.EW)(()=>this.layers().every(b=>b.visible));groupedLayers=(0,m.EW)(()=>{const b=[];for(const A of this.layers()){const U=A.category,B=b.find(X=>X.category===U);B?B.items.push(A):b.push({category:U,items:[A]})}return b});toggleAll(){const b=this.allVisible(),A=this.layers().map(U=>(U.visible=!b,U));this.layers.update(()=>[...A]),this.visibilityAll.emit(b),this.emitChange()}toggleSingle(b){b.visible=!b.visible,this.layerChange.emit(b),this.layers.update(()=>[...this.layers()]),this.emitChange()}emitChange(){this.visibilityChange.emit(this.layers())}static \u0275fac=function(A){return new(A||D)};static \u0275cmp=l.VBU({type:D,selectors:[["cue-layer-legend"]],inputs:{layers:[1,"layers"]},outputs:{layers:"layersChange",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:4,vars:1,consts:[["direction","column"],["align","center","justify","start",2,"width","100%"],["size","s",3,"checkedChange","checked"],["variant","label",2,"margin-top","4px","opacity","0.6"],["size","s",3,"checkedChange","checked","color"],[2,"cursor","pointer",3,"click"]],template:function(A,U){1&A&&(l.j41(0,"cue-flexcontainer",0),l.nVh(1,P,2,1,"cue-flexcontainer",1),l.Z7z(2,g,3,1,null,null,R),l.k0s()),2&A&&(l.R7$(),l.vxM(U.showCheckAll()?1:-1),l.R7$(),l.Dyx(U.groupedLayers()))},dependencies:[s.n,O.Typography,z.S],encapsulation:2,changeDetection:0})}return D})()},2843(se,Q,u){"use strict";u.d(Q,{M:()=>Wn});var S={};u.r(S),u.d(S,{LAT_MAX:()=>U,LAT_MIN:()=>b,LAT_RENDERED_MAX:()=>B,LAT_RENDERED_MIN:()=>A,LNG_MAX:()=>h,LNG_MIN:()=>X,activeStates:()=>D,classes:()=>s,cursors:()=>l,events:()=>a,geojsonTypes:()=>P,interactions:()=>k,meta:()=>M,modes:()=>p,sources:()=>F,types:()=>R,updateActions:()=>g});var m={};u.r(m),u.d(m,{isActiveFeature:()=>L,isBackspaceKey:()=>he,isDeleteKey:()=>me,isDigit1Key:()=>ne,isDigit2Key:()=>ze,isDigit3Key:()=>xe,isDigitKey:()=>ve,isEnterKey:()=>fe,isEscapeKey:()=>ye,isFeature:()=>Z,isInactiveFeature:()=>w,isOfMetaType:()=>C,isShiftDown:()=>oe,isShiftMousedown:()=>x,isTrue:()=>ct,isVertex:()=>J,noTarget:()=>W});var O={};u.r(O),u.d(O,{CommonSelectors:()=>m,ModeHandler:()=>nt,StringSet:()=>we,constrainFeatureMovement:()=>wt,createMidPoint:()=>nn,createSupplementaryPoints:()=>At,createVertex:()=>Ze,doubleClickZoom:()=>Ie,euclideanDistance:()=>qe,featuresAt:()=>ke,getFeatureAtAndSetCursors:()=>Xe,isClick:()=>et,isEventAtCoordinates:()=>mt,isTap:()=>tt,mapEventToBoundingBox:()=>He,moveFeatures:()=>Nt,sortFeatures:()=>dt,stringSetsAreEqual:()=>pn,theme:()=>Gt,toDenseArray:()=>pe});var z=u(5802);const s={CANVAS:"mapboxgl-canvas",CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},F={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},l={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},R={POLYGON:"polygon",LINE:"line_string",POINT:"point"},P={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},p={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select"},a={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},g={MOVE:"move",CHANGE_PROPERTIES:"change_properties",CHANGE_COORDINATES:"change_coordinates"},M={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},D={ACTIVE:"true",INACTIVE:"false"},k=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],b=-90,A=-85,U=90,B=85,X=-270,h=270;function C(e){return function(t){const n=t.featureTarget;return!(!n||!n.properties)&&n.properties.meta===e}}function x(e){return!(!e.originalEvent||!e.originalEvent.shiftKey)&&0===e.originalEvent.button}function L(e){return!(!e.featureTarget||!e.featureTarget.properties)&&e.featureTarget.properties.active===D.ACTIVE&&e.featureTarget.properties.meta===M.FEATURE}function w(e){return!(!e.featureTarget||!e.featureTarget.properties)&&e.featureTarget.properties.active===D.INACTIVE&&e.featureTarget.properties.meta===M.FEATURE}function W(e){return void 0===e.featureTarget}function Z(e){return!(!e.featureTarget||!e.featureTarget.properties)&&e.featureTarget.properties.meta===M.FEATURE}function J(e){const t=e.featureTarget;return!(!t||!t.properties)&&t.properties.meta===M.VERTEX}function oe(e){return!!e.originalEvent&&!0===e.originalEvent.shiftKey}function ye(e){return"Escape"===e.key||27===e.keyCode}function fe(e){return"Enter"===e.key||13===e.keyCode}function he(e){return"Backspace"===e.key||8===e.keyCode}function me(e){return"Delete"===e.key||46===e.keyCode}function ne(e){return"1"===e.key||49===e.keyCode}function ze(e){return"2"===e.key||50===e.keyCode}function xe(e){return"3"===e.key||51===e.keyCode}function ve(e){const t=e.key||String.fromCharCode(e.keyCode);return t>="0"&&t<="9"}function ct(){return!0}var Ke=u(503);const Ae={Point:0,LineString:1,MultiLineString:1,Polygon:2};function ut(e,t){const n=Ae[e.geometry.type]-Ae[t.geometry.type];return 0===n&&e.geometry.type===P.POLYGON?e.area-t.area:n}const dt=function _t(e){return e.map(t=>(t.geometry.type===P.POLYGON&&(t.area=Ke.geometry({type:P.FEATURE,property:{},geometry:t.geometry})),t)).sort(ut).map(t=>(delete t.area,t))},He=function je(e,t=0){return[[e.point.x-t,e.point.y-t],[e.point.x+t,e.point.y+t]]};function Re(e){if(this._items={},this._nums={},this._length=e?e.length:0,e)for(let t=0,n=e.length;t<n;t++)this.add(e[t]),void 0!==e[t]&&("string"==typeof e[t]?this._items[e[t]]=t:this._nums[e[t]]=t)}Re.prototype.add=function(e){return this.has(e)||(this._length++,"string"==typeof e?this._items[e]=this._length:this._nums[e]=this._length),this},Re.prototype.delete=function(e){return!1===this.has(e)||(this._length--,delete this._items[e],delete this._nums[e]),this},Re.prototype.has=function(e){return!("string"!=typeof e&&"number"!=typeof e||void 0===this._items[e]&&void 0===this._nums[e])},Re.prototype.values=function(){const e=[];return Object.keys(this._items).forEach(t=>{e.push({k:t,v:this._items[t]})}),Object.keys(this._nums).forEach(t=>{e.push({k:JSON.parse(t),v:this._nums[t]})}),e.sort((t,n)=>t.v-n.v).map(t=>t.k)},Re.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};const we=Re,Qe=[M.FEATURE,M.MIDPOINT,M.VERTEX],ke={click:function vt(e,t,n){return ft(e,t,n,n.options.clickBuffer)},touch:function bt(e,t,n){return ft(e,t,n,n.options.touchBuffer)}};function ft(e,t,n,o){if(null===n.map)return[];const r=e?He(e,o):t,i={};n.options.styles&&(i.layers=n.options.styles.map(N=>N.id).filter(N=>null!=n.map.getLayer(N)));const f=n.map.queryRenderedFeatures(r,i).filter(N=>-1!==Qe.indexOf(N.properties.meta)),E=new we,y=[];return f.forEach(N=>{const K=N.properties.id;E.has(K)||(E.add(K),y.push(N))}),dt(y)}function Xe(e,t){const n=ke.click(e,null,t),o={mouse:l.NONE};return n[0]&&(o.mouse=n[0].properties.active===D.ACTIVE?l.MOVE:l.POINTER,o.feature=n[0].properties.meta),-1!==t.events.currentModeName().indexOf("draw")&&(o.mouse=l.ADD),t.ui.queueMapClasses(o),t.ui.updateMapClasses(),n[0]}function qe(e,t){const n=e.x-t.x,o=e.y-t.y;return Math.sqrt(n*n+o*o)}function et(e,t,n={}){const o=null!=n.fineTolerance?n.fineTolerance:4,r=null!=n.grossTolerance?n.grossTolerance:12,i=null!=n.interval?n.interval:500;e.point=e.point||t.point,e.time=e.time||t.time;const f=qe(e.point,t.point);return f<o||f<r&&t.time-e.time<i}function tt(e,t,n={}){const o=null!=n.tolerance?n.tolerance:25,r=null!=n.interval?n.interval:250;return e.point=e.point||t.point,e.time=e.time||t.time,qe(e.point,t.point)<o&&t.time-e.time<r}const nt=function(e,t){const n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},o={on(i,f,E){if(void 0===n[i])throw new Error(`Invalid event type: ${i}`);n[i].push({selector:f,fn:E})},render(i){t.store.featureChanged(i)}},r=function(i,f){const E=n[i];let y=E.length;for(;y--;){const N=E[y];if(N.selector(f)){N.fn.call(o,f)||t.store.render(),t.ui.updateMapClasses();break}}};return e.start.call(o),{render:e.render,stop(){e.stop&&e.stop()},trash(){e.trash&&(e.trash(),t.store.render())},combineFeatures(){e.combineFeatures&&e.combineFeatures()},uncombineFeatures(){e.uncombineFeatures&&e.uncombineFeatures()},drag(i){r("drag",i)},click(i){r("click",i)},mousemove(i){r("mousemove",i)},mousedown(i){r("mousedown",i)},mouseup(i){r("mouseup",i)},mouseout(i){r("mouseout",i)},keydown(i){r("keydown",i)},keyup(i){r("keyup",i)},touchstart(i){r("touchstart",i)},touchmove(i){r("touchmove",i)},touchend(i){r("touchend",i)},tap(i){r("tap",i)}}},I=((e,t=21)=>(n=t)=>{let o="",r=0|n;for(;r--;)o+=e[Math.random()*e.length|0];return o})("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",32);function c(){return I()}const d=function(e,t){this.ctx=e,this.properties=t.properties||{},this.coordinates=t.geometry.coordinates,this.id=t.id||c(),this.type=t.geometry.type};d.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},d.prototype.incomingCoords=function(e){this.setCoordinates(e)},d.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},d.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},d.prototype.setProperty=function(e,t){this.properties[e]=t},d.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:P.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},d.prototype.internal=function(e){const t={id:this.id,meta:M.FEATURE,"meta:type":this.type,active:D.INACTIVE,mode:e};if(this.ctx.options.userProperties)for(const n in this.properties)t[`user_${n}`]=this.properties[n];return{type:P.FEATURE,properties:t,geometry:{coordinates:this.getCoordinates(),type:this.type}}};const v=d,V=function(e,t){v.call(this,e,t)};(V.prototype=Object.create(v.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},V.prototype.updateCoordinate=function(e,t,n){this.coordinates=3===arguments.length?[t,n]:[e,t],this.changed()},V.prototype.getCoordinate=function(){return this.getCoordinates()};const Y=V,q=function(e,t){v.call(this,e,t)};(q.prototype=Object.create(v.prototype)).isValid=function(){return this.coordinates.length>1},q.prototype.addCoordinate=function(e,t,n){this.changed();const o=parseInt(e,10);this.coordinates.splice(o,0,[t,n])},q.prototype.getCoordinate=function(e){const t=parseInt(e,10);return JSON.parse(JSON.stringify(this.coordinates[t]))},q.prototype.removeCoordinate=function(e){this.changed(),this.coordinates.splice(parseInt(e,10),1)},q.prototype.updateCoordinate=function(e,t,n){const o=parseInt(e,10);this.coordinates[o]=[t,n],this.changed()};const le=q,ge=function(e,t){v.call(this,e,t),this.coordinates=this.coordinates.map(n=>n.slice(0,-1))};(ge.prototype=Object.create(v.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every(e=>e.length>2)},ge.prototype.incomingCoords=function(e){this.coordinates=e.map(t=>t.slice(0,-1)),this.changed()},ge.prototype.setCoordinates=function(e){this.coordinates=e,this.changed()},ge.prototype.addCoordinate=function(e,t,n){this.changed();const o=e.split(".").map(i=>parseInt(i,10));this.coordinates[o[0]].splice(o[1],0,[t,n])},ge.prototype.removeCoordinate=function(e){this.changed();const t=e.split(".").map(o=>parseInt(o,10)),n=this.coordinates[t[0]];n&&(n.splice(t[1],1),n.length<3&&this.coordinates.splice(t[0],1))},ge.prototype.getCoordinate=function(e){const t=e.split(".").map(o=>parseInt(o,10));return JSON.parse(JSON.stringify(this.coordinates[t[0]][t[1]]))},ge.prototype.getCoordinates=function(){return this.coordinates.map(e=>e.concat([e[0]]))},ge.prototype.updateCoordinate=function(e,t,n){this.changed();const o=e.split("."),r=parseInt(o[0],10),i=parseInt(o[1],10);void 0===this.coordinates[r]&&(this.coordinates[r]=[]),this.coordinates[r][i]=[t,n]};const ae=ge,de={MultiPoint:Y,MultiLineString:le,MultiPolygon:ae},_e=(e,t,n,o,r)=>{const i=n.split("."),f=parseInt(i[0],10),E=i[1]?i.slice(1).join("."):null;return e[f][t](E,o,r)},Ee=function(e,t){if(v.call(this,e,t),delete this.coordinates,this.model=de[t.geometry.type],void 0===this.model)throw new TypeError(`${t.geometry.type} is not a valid type`);this.features=this._coordinatesToFeatures(t.geometry.coordinates)};(Ee.prototype=Object.create(v.prototype))._coordinatesToFeatures=function(e){const t=this.model.bind(this);return e.map(n=>new t(this.ctx,{id:c(),type:P.FEATURE,properties:{},geometry:{coordinates:n,type:this.type.replace("Multi","")}}))},Ee.prototype.isValid=function(){return this.features.every(e=>e.isValid())},Ee.prototype.setCoordinates=function(e){this.features=this._coordinatesToFeatures(e),this.changed()},Ee.prototype.getCoordinate=function(e){return _e(this.features,"getCoordinate",e)},Ee.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map(e=>e.type===P.POLYGON?e.getCoordinates():e.coordinates)))},Ee.prototype.updateCoordinate=function(e,t,n){_e(this.features,"updateCoordinate",e,t,n),this.changed()},Ee.prototype.addCoordinate=function(e,t,n){_e(this.features,"addCoordinate",e,t,n),this.changed()},Ee.prototype.removeCoordinate=function(e){_e(this.features,"removeCoordinate",e),this.changed()},Ee.prototype.getFeatures=function(){return this.features};const Ne=Ee;function H(e){this.map=e.map,this.drawConfig=JSON.parse(JSON.stringify(e.options||{})),this._ctx=e}H.prototype.setSelected=function(e){return this._ctx.store.setSelected(e)},H.prototype.setSelectedCoordinates=function(e){this._ctx.store.setSelectedCoordinates(e),e.reduce((t,n)=>(void 0===t[n.feature_id]&&(t[n.feature_id]=!0,this._ctx.store.get(n.feature_id).changed()),t),{})},H.prototype.getSelected=function(){return this._ctx.store.getSelected()},H.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},H.prototype.isSelected=function(e){return this._ctx.store.isSelected(e)},H.prototype.getFeature=function(e){return this._ctx.store.get(e)},H.prototype.select=function(e){return this._ctx.store.select(e)},H.prototype.deselect=function(e){return this._ctx.store.deselect(e)},H.prototype.deleteFeature=function(e,t={}){return this._ctx.store.delete(e,t)},H.prototype.addFeature=function(e,t={}){return this._ctx.store.add(e,t)},H.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},H.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},H.prototype.setActionableState=function(e={}){return this._ctx.events.actionable({trash:e.trash||!1,combineFeatures:e.combineFeatures||!1,uncombineFeatures:e.uncombineFeatures||!1})},H.prototype.changeMode=function(e,t={},n={}){return this._ctx.events.changeMode(e,t,n)},H.prototype.fire=function(e,t){return this._ctx.events.fire(e,t)},H.prototype.updateUIClasses=function(e){return this._ctx.ui.queueMapClasses(e)},H.prototype.activateUIButton=function(e){return this._ctx.ui.setActiveButton(e)},H.prototype.featuresAt=function(e,t,n="click"){if("click"!==n&&"touch"!==n)throw new Error("invalid buffer type");return ke[n](e,t,this._ctx)},H.prototype.newFeature=function(e){const t=e.geometry.type;return t===P.POINT?new Y(this._ctx,e):t===P.LINE_STRING?new le(this._ctx,e):t===P.POLYGON?new ae(this._ctx,e):new Ne(this._ctx,e)},H.prototype.isInstanceOf=function(e,t){if(e===P.POINT)return t instanceof Y;if(e===P.LINE_STRING)return t instanceof le;if(e===P.POLYGON)return t instanceof ae;if("MultiFeature"===e)return t instanceof Ne;throw new Error(`Unknown feature class: ${e}`)},H.prototype.doRender=function(e){return this._ctx.store.featureChanged(e)};const ee=H;H.prototype.onSetup=function(){},H.prototype.onDrag=function(){},H.prototype.onClick=function(){},H.prototype.onMouseMove=function(){},H.prototype.onMouseDown=function(){},H.prototype.onMouseUp=function(){},H.prototype.onMouseOut=function(){},H.prototype.onKeyUp=function(){},H.prototype.onKeyDown=function(){},H.prototype.onTouchStart=function(){},H.prototype.onTouchMove=function(){},H.prototype.onTouchEnd=function(){},H.prototype.onTap=function(){},H.prototype.onStop=function(){},H.prototype.onTrash=function(){},H.prototype.onCombineFeature=function(){},H.prototype.onUncombineFeature=function(){},H.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};const re={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},be=Object.keys(re);const pe=function Me(e){return[].concat(e).filter(t=>void 0!==t)};function ot(){const e=this;if(!e.ctx.map||void 0===e.ctx.map.getSource(F.HOT))return y();const n=e.ctx.events.currentModeName();e.ctx.ui.queueMapClasses({mode:n});let o=[],r=[];e.isDirty?r=e.getAllIds():(o=e.getChangedIds().filter(N=>void 0!==e.get(N)),r=e.sources.hot.filter(N=>N.properties.id&&-1===o.indexOf(N.properties.id)&&void 0!==e.get(N.properties.id)).map(N=>N.properties.id)),e.sources.hot=[];const i=e.sources.cold.length;e.sources.cold=e.isDirty?[]:e.sources.cold.filter(N=>-1===o.indexOf(N.properties.id||N.properties.parent));const f=i!==e.sources.cold.length||r.length>0;function E(N,K){const T=e.get(N).internal(n);e.ctx.events.currentModeRender(T,G=>{G.properties.mode=n,e.sources[K].push(G)})}function y(){e.isDirty=!1,e.clearChangedIds()}o.forEach(N=>E(N,"hot")),r.forEach(N=>E(N,"cold")),f&&e.ctx.map.getSource(F.COLD).setData({type:P.FEATURE_COLLECTION,features:e.sources.cold}),e.ctx.map.getSource(F.HOT).setData({type:P.FEATURE_COLLECTION,features:e.sources.hot}),y()}function ie(e){let t;this._features={},this._featureIds=new we,this._selectedFeatureIds=new we,this._selectedCoordinates=[],this._changedFeatureIds=new we,this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=e,this.sources={hot:[],cold:[]},this.render=()=>{t||(t=requestAnimationFrame(()=>{t=null,ot.call(this),this._emitSelectionChange&&(this.ctx.events.fire(a.SELECTION_CHANGE,{features:this.getSelected().map(n=>n.toGeoJSON()),points:this.getSelectedCoordinates().map(n=>({type:P.FEATURE,properties:{},geometry:{type:P.POINT,coordinates:n.coordinates}}))}),this._emitSelectionChange=!1),this.ctx.events.fire(a.RENDER,{})}))},this.isDirty=!1}function rt(e,t={}){const n=e._selectedCoordinates.filter(o=>e._selectedFeatureIds.has(o.feature_id));e._selectedCoordinates.length!==n.length&&!t.silent&&(e._emitSelectionChange=!0),e._selectedCoordinates=n}ie.prototype.createRenderBatch=function(){const e=this.render;let t=0;return this.render=function(){t++},()=>{this.render=e,t>0&&this.render()}},ie.prototype.setDirty=function(){return this.isDirty=!0,this},ie.prototype.featureCreated=function(e,t={}){if(this._changedFeatureIds.add(e),!0!==(null!=t.silent?t.silent:this.ctx.options.suppressAPIEvents)){const o=this.get(e);this.ctx.events.fire(a.CREATE,{features:[o.toGeoJSON()]})}return this},ie.prototype.featureChanged=function(e,t={}){return this._changedFeatureIds.add(e),!0!==(null!=t.silent?t.silent:this.ctx.options.suppressAPIEvents)&&this.ctx.events.fire(a.UPDATE,{action:t.action?t.action:g.CHANGE_COORDINATES,features:[this.get(e).toGeoJSON()]}),this},ie.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},ie.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},ie.prototype.getAllIds=function(){return this._featureIds.values()},ie.prototype.add=function(e,t={}){return this._features[e.id]=e,this._featureIds.add(e.id),this.featureCreated(e.id,{silent:t.silent}),this},ie.prototype.delete=function(e,t={}){const n=[];return pe(e).forEach(o=>{this._featureIds.has(o)&&(this._featureIds.delete(o),this._selectedFeatureIds.delete(o),t.silent||-1===n.indexOf(this._features[o])&&n.push(this._features[o].toGeoJSON()),delete this._features[o],this.isDirty=!0)}),n.length&&this.ctx.events.fire(a.DELETE,{features:n}),rt(this,t),this},ie.prototype.get=function(e){return this._features[e]},ie.prototype.getAll=function(){return Object.keys(this._features).map(e=>this._features[e])},ie.prototype.select=function(e,t={}){return pe(e).forEach(n=>{this._selectedFeatureIds.has(n)||(this._selectedFeatureIds.add(n),this._changedFeatureIds.add(n),t.silent||(this._emitSelectionChange=!0))}),this},ie.prototype.deselect=function(e,t={}){return pe(e).forEach(n=>{this._selectedFeatureIds.has(n)&&(this._selectedFeatureIds.delete(n),this._changedFeatureIds.add(n),t.silent||(this._emitSelectionChange=!0))}),rt(this,t),this},ie.prototype.clearSelected=function(e={}){return this.deselect(this._selectedFeatureIds.values(),{silent:e.silent}),this},ie.prototype.setSelected=function(e,t={}){return e=pe(e),this.deselect(this._selectedFeatureIds.values().filter(n=>-1===e.indexOf(n)),{silent:t.silent}),this.select(e.filter(n=>!this._selectedFeatureIds.has(n)),{silent:t.silent}),this},ie.prototype.setSelectedCoordinates=function(e){return this._selectedCoordinates=e,this._emitSelectionChange=!0,this},ie.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},ie.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},ie.prototype.getSelected=function(){return this.getSelectedIds().map(e=>this.get(e))},ie.prototype.getSelectedCoordinates=function(){return this._selectedCoordinates.map(t=>({coordinates:this.get(t.feature_id).getCoordinate(t.coord_path)}))},ie.prototype.isSelected=function(e){return this._selectedFeatureIds.has(e)},ie.prototype.setFeatureProperty=function(e,t,n,o={}){this.get(e).setProperty(t,n),this.featureChanged(e,{silent:o.silent,action:g.CHANGE_PROPERTIES})},ie.prototype.storeMapConfig=function(){k.forEach(e=>{this.ctx.map[e]&&(this._mapInitialConfig[e]=this.ctx.map[e].isEnabled())})},ie.prototype.restoreMapConfig=function(){Object.keys(this._mapInitialConfig).forEach(e=>{this._mapInitialConfig[e]?this.ctx.map[e].enable():this.ctx.map[e].disable()})},ie.prototype.getInitialConfigValue=function(e){return void 0===this._mapInitialConfig[e]||this._mapInitialConfig[e]};const it=["mode","feature","mouse"];function kt(e){let t=null,n=null;const o={onRemove(){return e.map.off("load",o.connect),clearInterval(n),o.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.boxZoomInitial&&e.map.boxZoom.enable(),e.map=null,e.container=null,e.store=null,t&&t.parentNode&&t.parentNode.removeChild(t),t=null,this},connect(){e.map.off("load",o.connect),clearInterval(n),o.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd(r){if(e.map=r,e.events=function Be(e){const t=Object.keys(e.options.modes).reduce((T,G)=>(T[G]=function Se(e){const t=Object.keys(e);return function(n,o={}){let r={};const i=t.reduce((E,y)=>(E[y]=e[y],E),new ee(n));return{start(){r=i.onSetup(o),be.forEach(E=>{const y=re[E];let N=()=>!1;e[y]&&(N=()=>!0),this.on(E,N,function f(E){return y=>i[E](r,y)}(y))})},stop(){i.onStop(r)},trash(){i.onTrash(r)},combineFeatures(){i.onCombineFeatures(r)},uncombineFeatures(){i.onUncombineFeatures(r)},render(E,y){i.toDisplayFeatures(r,E,y)}}}}(e.options.modes[G]),T),{});let n={},o={};const r={};let i=null,f=null;r.drag=function(T,G){G({point:T.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:l.DRAG}),f.drag(T)):T.originalEvent.stopPropagation()},r.mousedrag=function(T){r.drag(T,G=>!et(n,G))},r.touchdrag=function(T){r.drag(T,G=>!tt(o,G))},r.mousemove=function(T){if(1===(void 0!==T.originalEvent.buttons?T.originalEvent.buttons:T.originalEvent.which))return r.mousedrag(T);const $=Xe(T,e);T.featureTarget=$,f.mousemove(T)},r.mousedown=function(T){n={time:(new Date).getTime(),point:T.point};const G=Xe(T,e);T.featureTarget=G,f.mousedown(T)},r.mouseup=function(T){const G=Xe(T,e);T.featureTarget=G,et(n,{point:T.point,time:(new Date).getTime()})?f.click(T):f.mouseup(T)},r.mouseout=function(T){f.mouseout(T)},r.touchstart=function(T){if(!e.options.touchEnabled)return;o={time:(new Date).getTime(),point:T.point};const G=ke.touch(T,null,e)[0];T.featureTarget=G,f.touchstart(T)},r.touchmove=function(T){if(e.options.touchEnabled)return f.touchmove(T),r.touchdrag(T)},r.touchend=function(T){if(T.originalEvent.preventDefault(),!e.options.touchEnabled)return;const G=ke.touch(T,null,e)[0];T.featureTarget=G,tt(o,{time:(new Date).getTime(),point:T.point})?f.tap(T):f.touchend(T)};const E=T=>{const G=he(T),$=me(T),te=ve(T);return!(G||$||te)};function y(T,G,$={}){f.stop();const te=t[T];if(void 0===te)throw new Error(`${T} is not valid`);i=T;const Ce=te(e,G);f=nt(Ce,e),$.silent||e.map.fire(a.MODE_CHANGE,{mode:T}),e.store.setDirty(),e.store.render()}r.keydown=function(T){(T.srcElement||T.target).classList.contains(s.CANVAS)&&((he(T)||me(T))&&e.options.controls.trash?(T.preventDefault(),f.trash()):E(T)?f.keydown(T):ne(T)&&e.options.controls.point?y(p.DRAW_POINT):ze(T)&&e.options.controls.line_string?y(p.DRAW_LINE_STRING):xe(T)&&e.options.controls.polygon&&y(p.DRAW_POLYGON))},r.keyup=function(T){E(T)&&f.keyup(T)},r.zoomend=function(){e.store.changeZoom()},r.data=function(T){if("style"===T.dataType){const{setup:G,map:$,options:te,store:Ce}=e;te.styles.some(Ve=>$.getLayer(Ve.id))||(G.addLayers(),Ce.setDirty(),Ce.render())}};const N={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start(){i=e.options.defaultMode,f=nt(t[i](e),e)},changeMode:y,actionable:function K(T){let G=!1;Object.keys(T).forEach($=>{if(void 0===N[$])throw new Error("Invalid action type");N[$]!==T[$]&&(G=!0),N[$]=T[$]}),G&&e.map.fire(a.ACTIONABLE,{actions:N})},currentModeName:()=>i,currentModeRender:(T,G)=>f.render(T,G),fire(T,G){e.map&&e.map.fire(T,G)},addEventListeners(){e.map.on("mousemove",r.mousemove),e.map.on("mousedown",r.mousedown),e.map.on("mouseup",r.mouseup),e.map.on("data",r.data),e.map.on("touchmove",r.touchmove),e.map.on("touchstart",r.touchstart),e.map.on("touchend",r.touchend),e.container.addEventListener("mouseout",r.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",r.keydown),e.container.addEventListener("keyup",r.keyup))},removeEventListeners(){e.map.off("mousemove",r.mousemove),e.map.off("mousedown",r.mousedown),e.map.off("mouseup",r.mouseup),e.map.off("data",r.data),e.map.off("touchmove",r.touchmove),e.map.off("touchstart",r.touchstart),e.map.off("touchend",r.touchend),e.container.removeEventListener("mouseout",r.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",r.keydown),e.container.removeEventListener("keyup",r.keyup))},trash(T){f.trash(T)},combineFeatures(){f.combineFeatures()},uncombineFeatures(){f.uncombineFeatures()},getMode:()=>i}}(e),e.ui=function It(e){const t={};let n=null,o={mode:null,feature:null,mouse:null},r={mode:null,feature:null,mouse:null};function f(G){r=Object.assign(r,G)}function E(){if(!e.container)return;const G=[],$=[];it.forEach(te=>{r[te]!==o[te]&&(G.push(`${te}-${o[te]}`),null!==r[te]&&$.push(`${te}-${r[te]}`))}),G.length>0&&e.container.classList.remove(...G),$.length>0&&e.container.classList.add(...$),o=Object.assign(o,r)}function y(G,$={}){const te=document.createElement("button");return te.className=`${s.CONTROL_BUTTON} ${$.className}`,te.setAttribute("title",$.title),$.container.appendChild(te),te.addEventListener("click",Ce=>{if(Ce.preventDefault(),Ce.stopPropagation(),Ce.target===n)return N(),void $.onDeactivate();K(G),$.onActivate()},!0),te}function N(){n&&(n.classList.remove(s.ACTIVE_BUTTON),n=null)}function K(G){N();const $=t[G];$&&$&&"trash"!==G&&($.classList.add(s.ACTIVE_BUTTON),n=$)}return{setActiveButton:K,queueMapClasses:f,updateMapClasses:E,clearMapClasses:function i(){f({mode:null,feature:null,mouse:null}),E()},addButtons:function j(){const G=e.options.controls,$=document.createElement("div");return $.className=`${s.CONTROL_GROUP} ${s.CONTROL_BASE}`,G&&(G[R.POINT]&&(t[R.POINT]=y(R.POINT,{container:$,className:s.CONTROL_BUTTON_POINT,title:"Marker tool "+(e.options.keybindings?"(1)":""),onActivate:()=>e.events.changeMode(p.DRAW_POINT),onDeactivate:()=>e.events.trash()})),G[R.LINE]&&(t[R.LINE]=y(R.LINE,{container:$,className:s.CONTROL_BUTTON_LINE,title:"LineString tool "+(e.options.keybindings?"(2)":""),onActivate:()=>e.events.changeMode(p.DRAW_LINE_STRING),onDeactivate:()=>e.events.trash()})),G[R.POLYGON]&&(t[R.POLYGON]=y(R.POLYGON,{container:$,className:s.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(e.options.keybindings?"(3)":""),onActivate:()=>e.events.changeMode(p.DRAW_POLYGON),onDeactivate:()=>e.events.trash()})),G.trash&&(t.trash=y("trash",{container:$,className:s.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:()=>{e.events.trash()}})),G.combine_features&&(t.combine_features=y("combineFeatures",{container:$,className:s.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:()=>{e.events.combineFeatures()}})),G.uncombine_features&&(t.uncombine_features=y("uncombineFeatures",{container:$,className:s.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:()=>{e.events.uncombineFeatures()}}))),$},removeButtons:function T(){Object.keys(t).forEach(G=>{const $=t[G];$.parentNode&&$.parentNode.removeChild($),delete t[G]})}}}(e),e.container=r.getContainer(),e.store=new ie(e),t=e.ui.addButtons(),e.options.boxSelect){e.boxZoomInitial=r.boxZoom.isEnabled(),r.boxZoom.disable();const i=r.dragPan.isEnabled();r.dragPan.disable(),r.dragPan.enable(),i||r.dragPan.disable()}return r.loaded()?o.connect():(r.on("load",o.connect),n=setInterval(()=>{r.loaded()&&o.connect()},16)),e.events.start(),t},addLayers(){e.map.addSource(F.COLD,{data:{type:P.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.map.addSource(F.HOT,{data:{type:P.FEATURE_COLLECTION,features:[]},type:"geojson"}),e.options.styles.forEach(r=>{e.map.addLayer(r)}),e.store.setDirty(!0),e.store.render()},removeLayers(){e.options.styles.forEach(r=>{e.map.getLayer(r.id)&&e.map.removeLayer(r.id)}),e.map.getSource(F.COLD)&&e.map.removeSource(F.COLD),e.map.getSource(F.HOT)&&e.map.removeSource(F.HOT)}};return e.setup=o,o}const st="#3bb2d0",at="#fbb03b",Gt=[{id:"gl-draw-polygon-fill",type:"fill",filter:["all",["==","$type","Polygon"]],paint:{"fill-color":["case",["==",["get","active"],"true"],at,st],"fill-opacity":.1}},{id:"gl-draw-lines",type:"line",filter:["any",["==","$type","LineString"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["case",["==",["get","active"],"true"],at,st],"line-dasharray":["case",["==",["get","active"],"true"],[.2,2],[2,0]],"line-width":2}},{id:"gl-draw-point-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":"#fff"}},{id:"gl-draw-point-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","feature"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":["case",["==",["get","active"],"true"],at,st]}},{id:"gl-draw-vertex-outer",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],7,5],"circle-color":"#fff"}},{id:"gl-draw-vertex-inner",type:"circle",filter:["all",["==","$type","Point"],["==","meta","vertex"],["!=","mode","simple_select"]],paint:{"circle-radius":["case",["==",["get","active"],"true"],5,3],"circle-color":at}},{id:"gl-draw-midpoint",type:"circle",filter:["all",["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":at}}];function Ge(e,t){this.x=e,this.y=t}Ge.prototype={clone(){return new Ge(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){const t=e.x-this.x,n=e.y-this.y;return t*t+n*n},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){const n=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=n,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){const e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){const t=Math.cos(e),n=Math.sin(e),r=n*this.x+t*this.y;return this.x=t*this.x-n*this.y,this.y=r,this},_rotateAround(e,t){const n=Math.cos(e),o=Math.sin(e),i=t.y+o*(this.x-t.x)+n*(this.y-t.y);return this.x=t.x+n*(this.x-t.x)-o*(this.y-t.y),this.y=i,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Ge},Ge.convert=function(e){if(e instanceof Ge)return e;if(Array.isArray(e))return new Ge(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new Ge(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};const Ot=function mn(e,t){const n=t.getBoundingClientRect();return new Ge(e.clientX-n.left-(t.clientLeft||0),e.clientY-n.top-(t.clientTop||0))};function Ze(e,t,n,o){return{type:P.FEATURE,properties:{meta:M.VERTEX,parent:e,coord_path:n,active:o?D.ACTIVE:D.INACTIVE},geometry:{type:P.POINT,coordinates:t}}}function lt(e,t,n){if(null!==e)for(var o,r,i,f,E,y,N,T,K=0,j=0,G=e.type,$="FeatureCollection"===G,te="Feature"===G,Ce=$?e.features.length:1,Te=0;Te<Ce;Te++){E=(T=!!(N=$?e.features[Te].geometry:te?e.geometry:e)&&"GeometryCollection"===N.type)?N.geometries.length:1;for(var Ve=0;Ve<E;Ve++){var Pe=0,We=0;if(null!==(f=T?N.geometries[Ve]:N)){y=f.coordinates;var Ue=f.type;switch(K=!n||"Polygon"!==Ue&&"MultiPolygon"!==Ue?0:1,Ue){case null:break;case"Point":if(!1===t(y,j,Te,Pe,We))return!1;j++,Pe++;break;case"LineString":case"MultiPoint":for(o=0;o<y.length;o++){if(!1===t(y[o],j,Te,Pe,We))return!1;j++,"MultiPoint"===Ue&&Pe++}"LineString"===Ue&&Pe++;break;case"Polygon":case"MultiLineString":for(o=0;o<y.length;o++){for(r=0;r<y[o].length-K;r++){if(!1===t(y[o][r],j,Te,Pe,We))return!1;j++}"MultiLineString"===Ue&&Pe++,"Polygon"===Ue&&We++}"Polygon"===Ue&&Pe++;break;case"MultiPolygon":for(o=0;o<y.length;o++){for(We=0,r=0;r<y[o].length;r++){for(i=0;i<y[o][r].length-K;i++){if(!1===t(y[o][r][i],j,Te,Pe,We))return!1;j++}We++}Pe++}break;case"GeometryCollection":for(o=0;o<f.geometries.length;o++)if(!1===lt(f.geometries[o],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Jt(e){const t={type:"Feature"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"properties":case"geometry":return;default:t[n]=e[n]}}),t.properties=Yt(e.properties),t.geometry=null==e.geometry?null:xt(e.geometry),t}function Yt(e){const t={};return e&&Object.keys(e).forEach(n=>{const o=e[n];t[n]="object"==typeof o?null===o?null:Array.isArray(o)?o.map(r=>r):Yt(o):o}),t}function xt(e){const t={type:e.type};return e.bbox&&(t.bbox=e.bbox),"GeometryCollection"===e.type?(t.geometries=e.geometries.map(n=>xt(n)),t):(t.coordinates=jt(e.coordinates),t)}function jt(e){const t=e;return"object"!=typeof t[0]?t.slice():t.map(n=>jt(n))}function Qt(e,t={}){return qt(e,"mercator",t)}function qt(e,t,n={}){var o=(n=n||{}).mutate;if(!e)throw new Error("geojson is required");return Array.isArray(e)&&function ht(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}(e[0])?e="mercator"===t?en(e):tn(e):(!0!==o&&(e=function Pn(e){if(!e)throw new Error("geojson is required");switch(e.type){case"Feature":return Jt(e);case"FeatureCollection":return function Sn(e){const t={type:"FeatureCollection"};return Object.keys(e).forEach(n=>{switch(n){case"type":case"features":return;default:t[n]=e[n]}}),t.features=e.features.map(n=>Jt(n)),t}(e);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return xt(e);default:throw new Error("unknown GeoJSON type")}}(e)),lt(e,function(r){var i="mercator"===t?en(r):tn(r);r[0]=i[0],r[1]=i[1]})),e}function en(e){var t=Math.PI/180,n=6378137,o=20037508.342789244,r=Math.abs(e[0])<=180?e[0]:e[0]-360*function On(e){return e<0?-1:e>0?1:0}(e[0]),i=[n*r*t,n*Math.log(Math.tan(.25*Math.PI+.5*e[1]*t))];return i[0]>o&&(i[0]=o),i[0]<-o&&(i[0]=-o),i[1]>o&&(i[1]=o),i[1]<-o&&(i[1]=-o),i}function tn(e){var t=180/Math.PI,n=6378137;return[e[0]*t/n,(.5*Math.PI-2*Math.atan(Math.exp(-e[1]/n)))*t]}function nn(e,t,n){const o=t.geometry.coordinates,r=n.geometry.coordinates;if(o[1]>B||o[1]<A||r[1]>B||r[1]<A)return null;const i=Qt(o),f=Qt(r),E=j=>Number(j.toFixed(8)),y=(j,T)=>(j+T)/2,N=function In(e,t={}){return qt(e,"wgs84",t)}([y(i[0],f[0]),y(i[1],f[1])]),K=[E(N[0]),E(N[1])];return{type:P.FEATURE,properties:{meta:M.MIDPOINT,parent:e,lng:K[0],lat:K[1],coord_path:n.properties.coord_path},geometry:{type:P.POINT,coordinates:K}}}Math;const At=function on(e,t={},n=null){const{type:o,coordinates:r}=e.geometry,i=e.properties&&e.properties.id;let f=[];function E(K,j){let T="",G=null;K.forEach(($,te)=>{const Ce=null!=j?`${j}.${te}`:String(te),Te=Ze(i,$,Ce,y(Ce));if(t.midpoints&&G){const Pe=nn(i,G,Te);Pe&&f.push(Pe)}G=Te;const Ve=JSON.stringify($);T!==Ve&&f.push(Te),0===te&&(T=Ve)})}function y(K){return!!t.selectedPaths&&-1!==t.selectedPaths.indexOf(K)}return o===P.POINT?f.push(Ze(i,r,n,y(n))):o===P.POLYGON?r.forEach((K,j)=>{E(K,null!==n?`${n}.${j}`:String(j))}):o===P.LINE_STRING?E(r,n):0===o.indexOf(P.MULTI_PREFIX)&&function N(){const K=o.replace(P.MULTI_PREFIX,"");r.forEach((j,T)=>{f=f.concat(on({type:P.FEATURE,properties:e.properties,geometry:{type:K,coordinates:j}},t,T))})}(),f},Ie={enable(e){setTimeout(()=>{!e.map||!e.map.doubleClickZoom||!e._ctx||!e._ctx.store||!e._ctx.store.getInitialConfigValue||e._ctx.store.getInitialConfigValue("doubleClickZoom")&&e.map.doubleClickZoom.enable()},0)},disable(e){setTimeout(()=>{!e.map||!e.map.doubleClickZoom||e.map.doubleClickZoom.disable()},0)}},{LAT_MIN:pt,LAT_MAX:gt,LAT_RENDERED_MIN:rn,LAT_RENDERED_MAX:sn,LNG_MIN:an,LNG_MAX:ln}=S;function wt(e,t){let n=pt,o=gt,r=pt,i=gt,f=ln,E=an;e.forEach(N=>{const K=function Dn(e){const n=[e.geometry.coordinates].flat({Point:0,LineString:1,Polygon:2,MultiPoint:1,MultiLineString:2,MultiPolygon:3}[e.geometry.type]),o=n.map(E=>E[0]),r=n.map(E=>E[1]),i=E=>Math.min.apply(null,E),f=E=>Math.max.apply(null,E);return[i(o),i(r),f(o),f(r)]}(N),j=K[1],T=K[3],G=K[0],$=K[2];j>n&&(n=j),T<o&&(o=T),T>r&&(r=T),j<i&&(i=j),G<f&&(f=G),$>E&&(E=$)});const y=t;return n+y.lat>sn&&(y.lat=sn-n),r+y.lat>gt&&(y.lat=gt-r),o+y.lat<rn&&(y.lat=rn-o),i+y.lat<pt&&(y.lat=pt-i),f+y.lng<=an&&(y.lng+=360*Math.ceil(Math.abs(y.lng)/360)),E+y.lng>=ln&&(y.lng-=360*Math.ceil(Math.abs(y.lng)/360)),y}function Nt(e,t){const n=wt(e.map(o=>o.toGeoJSON()),t);e.forEach(o=>{const r=o.getCoordinates(),i=N=>{const K={lng:N[0]+n.lng,lat:N[1]+n.lat};return[K.lng,K.lat]},f=N=>N.map(K=>i(K));let y;o.type===P.POINT?y=i(r):o.type===P.LINE_STRING||o.type===P.MULTI_POINT?y=r.map(i):o.type===P.POLYGON||o.type===P.MULTI_LINE_STRING?y=r.map(f):o.type===P.MULTI_POLYGON&&(y=r.map(N=>N.map(K=>f(K)))),o.incomingCoords(y)})}const ce={onSetup:function(e){const t={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initialDragPanState:this.map.dragPan.isEnabled(),initiallySelectedFeatureIds:e.featureIds||[]};return this.setSelected(t.initiallySelectedFeatureIds.filter(n=>void 0!==this.getFeature(n))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),t},fireUpdate:function(){this.fire(a.UPDATE,{action:g.MOVE,features:this.getSelected().map(e=>e.toGeoJSON())})},fireActionable:function(){const e=this.getSelected(),t=e.filter(i=>this.isInstanceOf("MultiFeature",i));let n=!1;if(e.length>1){n=!0;const i=e[0].type.replace("Multi","");e.forEach(f=>{f.type.replace("Multi","")!==i&&(n=!1)})}this.setActionableState({combineFeatures:n,uncombineFeatures:t.length>0,trash:e.length>0})},getUniqueIds:function(e){return e.length?e.map(n=>n.properties.id).filter(n=>void 0!==n).reduce((n,o)=>(n.add(o),n),new we).values():[]},stopExtendedInteractions:function(e){e.boxSelectElement&&(e.boxSelectElement.parentNode&&e.boxSelectElement.parentNode.removeChild(e.boxSelectElement),e.boxSelectElement=null),(e.canDragMove||e.canBoxSelect)&&!0===e.initialDragPanState&&this.map.dragPan.enable(),e.boxSelecting=!1,e.canBoxSelect=!1,e.dragMoving=!1,e.canDragMove=!1},onStop:function(){Ie.enable(this)},onMouseMove:function(e,t){return Z(t)&&e.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(e),!0},onMouseOut:function(e){return!e.dragMoving||this.fireUpdate()}};ce.onTap=ce.onClick=function(e,t){return W(t)?this.clickAnywhere(e,t):C(M.VERTEX)(t)?this.clickOnVertex(e,t):Z(t)?this.clickOnFeature(e,t):void 0},ce.clickAnywhere=function(e){const t=this.getSelectedIds();t.length&&(this.clearSelectedFeatures(),t.forEach(n=>this.doRender(n))),Ie.enable(this),this.stopExtendedInteractions(e)},ce.clickOnVertex=function(e,t){this.changeMode(p.DIRECT_SELECT,{featureId:t.featureTarget.properties.parent,coordPath:t.featureTarget.properties.coord_path,startPos:t.lngLat}),this.updateUIClasses({mouse:l.MOVE})},ce.startOnActiveFeature=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),this.doRender(t.featureTarget.properties.id),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},ce.clickOnFeature=function(e,t){Ie.disable(this),this.stopExtendedInteractions(e);const n=oe(t),o=this.getSelectedIds(),r=t.featureTarget.properties.id,i=this.isSelected(r);if(!n&&i&&this.getFeature(r).type!==P.POINT)return this.changeMode(p.DIRECT_SELECT,{featureId:r});i&&n?(this.deselect(r),this.updateUIClasses({mouse:l.POINTER}),1===o.length&&Ie.enable(this)):!i&&n?(this.select(r),this.updateUIClasses({mouse:l.MOVE})):!i&&!n&&(o.forEach(f=>this.doRender(f)),this.setSelected(r),this.updateUIClasses({mouse:l.MOVE})),this.doRender(r)},ce.onMouseDown=function(e,t){return e.initialDragPanState=this.map.dragPan.isEnabled(),L(t)?this.startOnActiveFeature(e,t):this.drawConfig.boxSelect&&x(t)?this.startBoxSelect(e,t):void 0},ce.startBoxSelect=function(e,t){this.stopExtendedInteractions(e),this.map.dragPan.disable(),e.boxSelectStartLocation=Ot(t.originalEvent,this.map.getContainer()),e.canBoxSelect=!0},ce.onTouchStart=function(e,t){if(L(t))return this.startOnActiveFeature(e,t)},ce.onDrag=function(e,t){return e.canDragMove?this.dragMove(e,t):this.drawConfig.boxSelect&&e.canBoxSelect?this.whileBoxSelect(e,t):void 0},ce.whileBoxSelect=function(e,t){e.boxSelecting=!0,this.updateUIClasses({mouse:l.ADD}),e.boxSelectElement||(e.boxSelectElement=document.createElement("div"),e.boxSelectElement.classList.add(s.BOX_SELECT),this.map.getContainer().appendChild(e.boxSelectElement));const n=Ot(t.originalEvent,this.map.getContainer()),o=Math.min(e.boxSelectStartLocation.x,n.x),r=Math.max(e.boxSelectStartLocation.x,n.x),i=Math.min(e.boxSelectStartLocation.y,n.y),f=Math.max(e.boxSelectStartLocation.y,n.y),E=`translate(${o}px, ${i}px)`;e.boxSelectElement.style.transform=E,e.boxSelectElement.style.WebkitTransform=E,e.boxSelectElement.style.width=r-o+"px",e.boxSelectElement.style.height=f-i+"px"},ce.dragMove=function(e,t){e.dragMoving=!0,t.originalEvent.stopPropagation();const n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};Nt(this.getSelected(),n),e.dragMoveLocation=t.lngLat},ce.onTouchEnd=ce.onMouseUp=function(e,t){if(e.dragMoving)this.fireUpdate();else if(e.boxSelecting){const n=[e.boxSelectStartLocation,Ot(t.originalEvent,this.map.getContainer())],o=this.featuresAt(null,n,"click"),r=this.getUniqueIds(o).filter(i=>!this.isSelected(i));r.length&&(this.select(r),r.forEach(i=>this.doRender(i)),this.updateUIClasses({mouse:l.MOVE}))}this.stopExtendedInteractions(e)},ce.toDisplayFeatures=function(e,t,n){t.properties.active=this.isSelected(t.properties.id)?D.ACTIVE:D.INACTIVE,n(t),this.fireActionable(),t.properties.active===D.ACTIVE&&t.geometry.type!==P.POINT&&At(t).forEach(n)},ce.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},ce.onCombineFeatures=function(){const e=this.getSelected();if(0===e.length||e.length<2)return;const t=[],n=[],o=e[0].type.replace("Multi","");for(let r=0;r<e.length;r++){const i=e[r];if(i.type.replace("Multi","")!==o)return;i.type.includes("Multi")?i.getCoordinates().forEach(f=>{t.push(f)}):t.push(i.getCoordinates()),n.push(i.toGeoJSON())}if(n.length>1){const r=this.newFeature({type:P.FEATURE,properties:n[0].properties,geometry:{type:`Multi${o}`,coordinates:t}});this.addFeature(r),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([r.id]),this.fire(a.COMBINE_FEATURES,{createdFeatures:[r.toGeoJSON()],deletedFeatures:n})}this.fireActionable()},ce.onUncombineFeatures=function(){const e=this.getSelected();if(0===e.length)return;const t=[],n=[];for(let o=0;o<e.length;o++){const r=e[o];this.isInstanceOf("MultiFeature",r)&&(r.getFeatures().forEach(i=>{this.addFeature(i),i.properties=r.properties,t.push(i.toGeoJSON()),this.select([i.id])}),this.deleteFeature(r.id,{silent:!0}),n.push(r.toGeoJSON()))}t.length>1&&this.fire(a.UNCOMBINE_FEATURES,{createdFeatures:t,deletedFeatures:n}),this.fireActionable()};const Fn=ce,cn=C(M.VERTEX),un=C(M.MIDPOINT),ue={fireUpdate:function(){this.fire(a.UPDATE,{action:g.CHANGE_COORDINATES,features:this.getSelected().map(e=>e.toGeoJSON())})},fireActionable:function(e){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:e.selectedCoordPaths.length>0})},startDragging:function(e,t){null==e.initialDragPanState&&(e.initialDragPanState=this.map.dragPan.isEnabled()),this.map.dragPan.disable(),e.canDragMove=!0,e.dragMoveLocation=t.lngLat},stopDragging:function(e){e.canDragMove&&!0===e.initialDragPanState&&this.map.dragPan.enable(),e.initialDragPanState=null,e.dragMoving=!1,e.canDragMove=!1,e.dragMoveLocation=null},onVertex:function(e,t){this.startDragging(e,t);const n=t.featureTarget.properties,o=e.selectedCoordPaths.indexOf(n.coord_path);oe(t)||-1!==o?oe(t)&&-1===o&&e.selectedCoordPaths.push(n.coord_path):e.selectedCoordPaths=[n.coord_path];const r=this.pathsToCoordinates(e.featureId,e.selectedCoordPaths);this.setSelectedCoordinates(r)},onMidpoint:function(e,t){this.startDragging(e,t);const n=t.featureTarget.properties;e.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),e.selectedCoordPaths=[n.coord_path]},pathsToCoordinates:function(e,t){return t.map(n=>({feature_id:e,coord_path:n}))},onFeature:function(e,t){0===e.selectedCoordPaths.length?this.startDragging(e,t):this.stopDragging(e)},dragFeature:function(e,t,n){Nt(this.getSelected(),n),e.dragMoveLocation=t.lngLat},dragVertex:function(e,t,n){const o=e.selectedCoordPaths.map(f=>e.feature.getCoordinate(f)),i=wt(o.map(f=>({type:P.FEATURE,properties:{},geometry:{type:P.POINT,coordinates:f}})),n);for(let f=0;f<o.length;f++){const E=o[f];e.feature.updateCoordinate(e.selectedCoordPaths[f],E[0]+i.lng,E[1]+i.lat)}},clickNoTarget:function(){this.changeMode(p.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(p.SIMPLE_SELECT)},clickActiveFeature:function(e){e.selectedCoordPaths=[],this.clearSelectedCoordinates(),e.feature.changed()},onSetup:function(e){const t=e.featureId,n=this.getFeature(t);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===P.POINT)throw new TypeError("direct_select mode doesn't handle point features");const o={featureId:t,feature:n,dragMoveLocation:e.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:e.coordPath?[e.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(t,o.selectedCoordPaths)),this.setSelected(t),Ie.disable(this),this.setActionableState({trash:!0}),o},onStop:function(){Ie.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(e,t,n){e.featureId===t.properties.id?(t.properties.active=D.ACTIVE,n(t),At(t,{map:this.map,midpoints:!0,selectedPaths:e.selectedCoordPaths}).forEach(n)):(t.properties.active=D.INACTIVE,n(t)),this.fireActionable(e)},onTrash:function(e){e.selectedCoordPaths.sort((t,n)=>n.localeCompare(t,"en",{numeric:!0})).forEach(t=>e.feature.removeCoordinate(t)),this.fireUpdate(),e.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(e),!1===e.feature.isValid()&&(this.deleteFeature([e.featureId]),this.changeMode(p.SIMPLE_SELECT,{}))},onMouseMove:function(e,t){const n=L(t),o=cn(t),r=un(t),i=0===e.selectedCoordPaths.length;return this.updateUIClasses(n&&i||o&&!i?{mouse:l.MOVE}:{mouse:l.NONE}),(o||n||r)&&e.dragMoving&&this.fireUpdate(),this.stopDragging(e),!0},onMouseOut:function(e){return e.dragMoving&&this.fireUpdate(),!0}};ue.onTouchStart=ue.onMouseDown=function(e,t){return cn(t)?this.onVertex(e,t):L(t)?this.onFeature(e,t):un(t)?this.onMidpoint(e,t):void 0},ue.onDrag=function(e,t){if(!0!==e.canDragMove)return;e.dragMoving=!0,t.originalEvent.stopPropagation();const n={lng:t.lngLat.lng-e.dragMoveLocation.lng,lat:t.lngLat.lat-e.dragMoveLocation.lat};e.selectedCoordPaths.length>0?this.dragVertex(e,t,n):this.dragFeature(e,t,n),e.dragMoveLocation=t.lngLat},ue.onClick=function(e,t){return W(t)?this.clickNoTarget(e,t):L(t)?this.clickActiveFeature(e,t):w(t)?this.clickInactive(e,t):void this.stopDragging(e)},ue.onTap=function(e,t){return W(t)?this.clickNoTarget(e,t):L(t)?this.clickActiveFeature(e,t):w(t)?this.clickInactive(e,t):void 0},ue.onTouchEnd=ue.onMouseUp=function(e){e.dragMoving&&this.fireUpdate(),this.stopDragging(e)};const xn=ue,Fe={onSetup:function(){const e=this.newFeature({type:P.FEATURE,properties:{},geometry:{type:P.POINT,coordinates:[]}});return this.addFeature(e),this.clearSelectedFeatures(),this.updateUIClasses({mouse:l.ADD}),this.activateUIButton(R.POINT),this.setActionableState({trash:!0}),{point:e}},stopDrawingAndRemove:function(e){this.deleteFeature([e.point.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT)}};Fe.onTap=Fe.onClick=function(e,t){this.updateUIClasses({mouse:l.MOVE}),e.point.updateCoordinate("",t.lngLat.lng,t.lngLat.lat),this.fire(a.CREATE,{features:[e.point.toGeoJSON()]}),this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.point.id]})},Fe.onStop=function(e){this.activateUIButton(),e.point.getCoordinate().length||this.deleteFeature([e.point.id],{silent:!0})},Fe.toDisplayFeatures=function(e,t,n){const o=t.properties.id===e.point.id;if(t.properties.active=o?D.ACTIVE:D.INACTIVE,!o)return n(t)},Fe.onTrash=Fe.stopDrawingAndRemove,Fe.onKeyUp=function(e,t){if(ye(t)||fe(t))return this.stopDrawingAndRemove(e,t)};const An=Fe,mt=function wn(e,t){return!!e.lngLat&&e.lngLat.lng===t[0]&&e.lngLat.lat===t[1]},Oe={onSetup:function(){const e=this.newFeature({type:P.FEATURE,properties:{},geometry:{type:P.POLYGON,coordinates:[[]]}});return this.addFeature(e),this.clearSelectedFeatures(),Ie.disable(this),this.updateUIClasses({mouse:l.ADD}),this.activateUIButton(R.POLYGON),this.setActionableState({trash:!0}),{polygon:e,currentVertexPosition:0}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&mt(t,e.polygon.coordinates[0][e.currentVertexPosition-1]))return this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.polygon.id]});this.updateUIClasses({mouse:l.ADD}),e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat),e.currentVertexPosition++,e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},onMouseMove:function(e,t){e.polygon.updateCoordinate(`0.${e.currentVertexPosition}`,t.lngLat.lng,t.lngLat.lat),J(t)&&this.updateUIClasses({mouse:l.POINTER})}};Oe.onTap=Oe.onClick=function(e,t){return J(t)?this.clickOnVertex(e,t):this.clickAnywhere(e,t)},Oe.onKeyUp=function(e,t){ye(t)?(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT)):fe(t)&&this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.polygon.id]})},Oe.onStop=function(e){this.updateUIClasses({mouse:l.NONE}),Ie.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.polygon.id)&&(e.polygon.removeCoordinate(`0.${e.currentVertexPosition}`),e.polygon.isValid()?this.fire(a.CREATE,{features:[e.polygon.toGeoJSON()]}):(this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT,{},{silent:!0})))},Oe.toDisplayFeatures=function(e,t,n){const o=t.properties.id===e.polygon.id;if(t.properties.active=o?D.ACTIVE:D.INACTIVE,!o)return n(t);if(0===t.geometry.coordinates.length)return;const r=t.geometry.coordinates[0].length;if(!(r<3)){if(t.properties.meta=M.FEATURE,n(Ze(e.polygon.id,t.geometry.coordinates[0][0],"0.0",!1)),r>3){const i=t.geometry.coordinates[0].length-3;n(Ze(e.polygon.id,t.geometry.coordinates[0][i],`0.${i}`,!1))}if(r<=4&&(n({type:P.FEATURE,properties:t.properties,geometry:{coordinates:[[t.geometry.coordinates[0][0][0],t.geometry.coordinates[0][0][1]],[t.geometry.coordinates[0][1][0],t.geometry.coordinates[0][1][1]]],type:P.LINE_STRING}}),3===r))return;return n(t)}},Oe.onTrash=function(e){this.deleteFeature([e.polygon.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT)};const Nn=Oe,De={onSetup:function(e){const t=(e=e||{}).featureId;let n,o,r="forward";if(t){if(n=this.getFeature(t),!n)throw new Error("Could not find a feature with the provided featureId");let i=e.from;if(i&&"Feature"===i.type&&i.geometry&&"Point"===i.geometry.type&&(i=i.geometry),i&&"Point"===i.type&&i.coordinates&&2===i.coordinates.length&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");const f=n.coordinates.length-1;if(n.coordinates[f][0]===i[0]&&n.coordinates[f][1]===i[1])o=f+1,n.addCoordinate(o,...n.coordinates[f]);else{if(n.coordinates[0][0]!==i[0]||n.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");r="backwards",o=0,n.addCoordinate(o,...n.coordinates[0])}}else n=this.newFeature({type:P.FEATURE,properties:{},geometry:{type:P.LINE_STRING,coordinates:[]}}),o=0,this.addFeature(n);return this.clearSelectedFeatures(),Ie.disable(this),this.updateUIClasses({mouse:l.ADD}),this.activateUIButton(R.LINE),this.setActionableState({trash:!0}),{line:n,currentVertexPosition:o,direction:r}},clickAnywhere:function(e,t){if(e.currentVertexPosition>0&&mt(t,e.line.coordinates[e.currentVertexPosition-1])||"backwards"===e.direction&&mt(t,e.line.coordinates[e.currentVertexPosition+1]))return this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.line.id]});this.updateUIClasses({mouse:l.ADD}),e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),"forward"===e.direction?(e.currentVertexPosition++,e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat)):e.line.addCoordinate(0,t.lngLat.lng,t.lngLat.lat)},clickOnVertex:function(e){return this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.line.id]})},onMouseMove:function(e,t){e.line.updateCoordinate(e.currentVertexPosition,t.lngLat.lng,t.lngLat.lat),J(t)&&this.updateUIClasses({mouse:l.POINTER})}};De.onTap=De.onClick=function(e,t){if(J(t))return this.clickOnVertex(e,t);this.clickAnywhere(e,t)},De.onKeyUp=function(e,t){fe(t)?this.changeMode(p.SIMPLE_SELECT,{featureIds:[e.line.id]}):ye(t)&&(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT))},De.onStop=function(e){Ie.enable(this),this.activateUIButton(),void 0!==this.getFeature(e.line.id)&&(e.line.removeCoordinate(`${e.currentVertexPosition}`),e.line.isValid()?this.fire(a.CREATE,{features:[e.line.toGeoJSON()]}):(this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT,{},{silent:!0})))},De.onTrash=function(e){this.deleteFeature([e.line.id],{silent:!0}),this.changeMode(p.SIMPLE_SELECT)},De.toDisplayFeatures=function(e,t,n){const o=t.properties.id===e.line.id;if(t.properties.active=o?D.ACTIVE:D.INACTIVE,!o)return n(t);t.geometry.coordinates.length<2||(t.properties.meta=M.FEATURE,n(Ze(e.line.id,t.geometry.coordinates["forward"===e.direction?t.geometry.coordinates.length-2:1],""+("forward"===e.direction?t.geometry.coordinates.length-2:1),!1)),n(t))};const dn={simple_select:Fn,direct_select:xn,draw_point:An,draw_polygon:Nn,draw_line_string:De},Rn={defaultMode:p.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:Gt,modes:dn,controls:{},userProperties:!1,suppressAPIEvents:!0},kn={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},Bn={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function fn(e,t){return e.map(n=>n.source?n:Object.assign({},n,{id:`${n.id}.${t}`,source:"hot"===t?F.HOT:F.COLD}))}var hn=u(362),Vn=u(5341);function pn(e,t){return e.length===t.length&&JSON.stringify(e.map(n=>n).sort())===JSON.stringify(t.map(n=>n).sort())}const Un={Polygon:ae,LineString:le,Point:Y,MultiPolygon:Ne,MultiLineString:Ne,MultiPoint:Ne};function yt(e){!function(e,t){e=function Gn(e={}){let t=Object.assign({},e);return e.controls||(t.controls={}),t.controls=Object.assign({},!1===e.displayControlsDefault?Bn:kn,e.controls),t=Object.assign({},Rn,t),t.styles=fn(t.styles,"cold").concat(fn(t.styles,"hot")),t}(e);const n={options:e};t=function zn(e,t){t.modes=p;const n=void 0===e.options.suppressAPIEvents||!!e.options.suppressAPIEvents;return t.getFeatureIdsAt=function(o){return ke.click({point:o},null,e).map(i=>i.properties.id)},t.getSelectedIds=function(){return e.store.getSelectedIds()},t.getSelected=function(){return{type:P.FEATURE_COLLECTION,features:e.store.getSelectedIds().map(o=>e.store.get(o)).map(o=>o.toGeoJSON())}},t.getSelectedPoints=function(){return{type:P.FEATURE_COLLECTION,features:e.store.getSelectedCoordinates().map(o=>({type:P.FEATURE,properties:{},geometry:{type:P.POINT,coordinates:o.coordinates}}))}},t.set=function(o){if(void 0===o.type||o.type!==P.FEATURE_COLLECTION||!Array.isArray(o.features))throw new Error("Invalid FeatureCollection");const r=e.store.createRenderBatch();let i=e.store.getAllIds().slice();const f=t.add(o),E=new we(f);return i=i.filter(y=>!E.has(y)),i.length&&t.delete(i),r(),f},t.add=function(o){const i=JSON.parse(JSON.stringify(Vn(o))).features.map(f=>{if(f.id=f.id||c(),null===f.geometry)throw new Error("Invalid geometry: null");if(void 0===e.store.get(f.id)||e.store.get(f.id).type!==f.geometry.type){const E=Un[f.geometry.type];if(void 0===E)throw new Error(`Invalid geometry type: ${f.geometry.type}.`);const y=new E(e,f);e.store.add(y,{silent:n})}else{const E=e.store.get(f.id),y=E.properties;E.properties=f.properties,hn(y,f.properties)||e.store.featureChanged(E.id,{silent:n}),hn(E.getCoordinates(),f.geometry.coordinates)||E.incomingCoords(f.geometry.coordinates)}return f.id});return e.store.render(),i},t.get=function(o){const r=e.store.get(o);if(r)return r.toGeoJSON()},t.getAll=function(){return{type:P.FEATURE_COLLECTION,features:e.store.getAll().map(o=>o.toGeoJSON())}},t.delete=function(o){return e.store.delete(o,{silent:n}),t.getMode()!==p.DIRECT_SELECT||e.store.getSelectedIds().length?e.store.render():e.events.changeMode(p.SIMPLE_SELECT,void 0,{silent:n}),t},t.deleteAll=function(){return e.store.delete(e.store.getAllIds(),{silent:n}),t.getMode()===p.DIRECT_SELECT?e.events.changeMode(p.SIMPLE_SELECT,void 0,{silent:n}):e.store.render(),t},t.changeMode=function(o,r={}){return o===p.SIMPLE_SELECT&&t.getMode()===p.SIMPLE_SELECT?(pn(r.featureIds||[],e.store.getSelectedIds())||(e.store.setSelected(r.featureIds,{silent:n}),e.store.render()),t):(o===p.DIRECT_SELECT&&t.getMode()===p.DIRECT_SELECT&&r.featureId===e.store.getSelectedIds()[0]||e.events.changeMode(o,r,{silent:n}),t)},t.getMode=function(){return e.events.getMode()},t.trash=function(){return e.events.trash({silent:n}),t},t.combineFeatures=function(){return e.events.combineFeatures({silent:n}),t},t.uncombineFeatures=function(){return e.events.uncombineFeatures({silent:n}),t},t.setFeatureProperty=function(o,r,i){return e.store.setFeatureProperty(o,r,i,{silent:n}),t},t}(n,t),n.api=t;const o=kt(n);t.onAdd=o.onAdd,t.onRemove=o.onRemove,t.types=R,t.options=e}(e,this)}yt.modes=dn,yt.constants=S,yt.lib=O;const gn=yt;let Wn=(()=>{class e{_draw;_map;_drawMode=(0,z.vPA)(!1);_settingDrawMode=!1;_eventListeners=[];_clearAfterFinish=!0;drawEvent=(0,z.vPA)(void 0);destroy(){this._cleanup()}initializeWithMap(n){this._map=n,this._initDrawControl(n)}setDrawMode(n,o){if(this._draw&&this._map&&!this._settingDrawMode){if(this._clearAfterFinish=o,this._settingDrawMode=!0,this._drawMode.set(n),n){this._draw.deleteAll(),this._draw.changeMode("draw_polygon");const r={type:"polygon",status:"started",coordinates:[],bbox:{minLng:0,minLat:0,maxLng:0,maxLat:0}};this.drawEvent.update(()=>r)}else this._draw.changeMode("simple_select"),this._draw.deleteAll();this._settingDrawMode=!1}}setClearAfterFinish(n){this._clearAfterFinish=n}getClearAfterFinish(){return this._clearAfterFinish}getDrawMode(){return this._drawMode()}clearDrawings(){this._draw&&this._draw.deleteAll()}getDrawInstance(){return this._draw}_initDrawControl(n){this._draw=new gn({displayControlsDefault:!1,modes:{...gn.modes}}),n.addControl(this._draw,"top-left");const o=document.querySelector(".mapbox-gl-draw_ctrl-draw-btn")?.parentElement;o&&(o.style.display="none");const r=E=>{const y=E.features[0];if("Polygon"===y.geometry.type){const N=y.geometry.coordinates[0],j={type:"polygon",status:"ended",coordinates:N,bbox:this._calculateBBox(N)};this.drawEvent.update(()=>j),this._drawMode.set(!1),this._clearAfterFinish&&this._draw?.deleteAll()}},i=E=>{const y=E.features[0];if("Polygon"===y.geometry.type){const N=y.geometry.coordinates[0],j={type:"polygon",status:"in-progress",coordinates:N,bbox:this._calculateBBox(N)};this.drawEvent.update(()=>j)}},f=()=>{if(this._drawMode()){const E=this._draw?.getAll();if(E?.features?.length){const y=E.features[0];if("Polygon"===y.geometry.type){const N=y.geometry.coordinates[0];if(N.length>2){const j={type:"polygon",status:"in-progress",coordinates:N,bbox:this._calculateBBox(N)};this.drawEvent.update(()=>j)}}}}};n.on("draw.create",r),n.on("draw.update",i),n.on("mousemove",f),this._eventListeners.push({event:"draw.create",handler:r}),this._eventListeners.push({event:"draw.update",handler:i}),this._eventListeners.push({event:"mousemove",handler:f})}_cleanup(){this._map&&(this._eventListeners.forEach(({event:n,handler:o})=>{this._map?.off(n,o)}),this._eventListeners=[],this._draw&&this._map._controls?.includes(this._draw)&&this._map.removeControl(this._draw)),this._draw=void 0,this._map=void 0,this.drawEvent.set(void 0)}_calculateBBox(n){return n.reduce((o,r)=>({minLng:Math.min(o.minLng,r[0]),minLat:Math.min(o.minLat,r[1]),maxLng:Math.max(o.maxLng,r[0]),maxLat:Math.max(o.maxLat,r[1])}),{minLng:1/0,minLat:1/0,maxLng:-1/0,maxLat:-1/0})}static \u0275fac=function(o){return new(o||e)};static \u0275prov=z.jDH({token:e,factory:e.\u0275fac})}return e})()},6986(se,Q,u){"use strict";u.d(Q,{A4:()=>S,Jc:()=>l,Ln:()=>O,dx:()=>s,g8:()=>m,j5:()=>z,n7:()=>F});const S=12;function m(p,a,g){return{id:p,source:a,type:"circle",maxzoom:S,filter:["==",["get","_isCentroid"],!0],paint:{"circle-radius":6,"circle-color":["coalesce",["get","_color"],g],"circle-stroke-width":2,"circle-stroke-color":"white","circle-opacity":.8}}}function O(p,a,g,M){return function P(p,a,g,M,D){const k={id:p,source:M},b=D||g;switch(a){case"Point":case"MultiPoint":return[{...k,id:`${p}-clusters`,type:"circle",filter:["has","point_count"],paint:{"circle-color":b,"circle-radius":["step",["get","point_count"],15,100,20,750,25],"circle-stroke-width":2,"circle-stroke-color":"white","circle-opacity":.8}},{...k,id:`${p}-cluster-count`,type:"symbol",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["Poppins Medium","Arial Unicode MS Bold"],"text-size":12,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#ffffff","text-halo-color":"rgba(0, 0, 0, 0.3)","text-halo-width":1}},{...k,id:`${p}-unclustered`,type:"circle",filter:["!",["has","point_count"]],paint:{"circle-radius":6,"circle-color":["coalesce",["get","_color"],g],"circle-stroke-width":2,"circle-stroke-color":"white","circle-opacity":.8}}];case"LineString":case"MultiLineString":return{...k,type:"line",paint:{"line-color":["coalesce",["get","_color"],g],"line-width":3,"line-opacity":.8},layout:{"line-join":"round","line-cap":"round"}};case"Polygon":case"MultiPolygon":return[{id:`${p}-fill`,source:M,type:"fill",paint:{"fill-color":["coalesce",["get","_color"],g],"fill-opacity":.3}},{id:`${p}-stroke`,source:M,type:"line",paint:{"line-color":["coalesce",["get","_color"],g],"line-width":2,"line-opacity":.8},layout:{"line-join":"round","line-cap":"round"}},{id:`${p}-labels`,source:M,type:"symbol",layout:{"text-field":["coalesce",["get","label"],""],"text-font":["Poppins Medium","Arial Unicode MS Bold"],"text-size":13,"text-anchor":"center","text-allow-overlap":!1},paint:{"text-color":"#333333","text-halo-color":"rgba(255, 255, 255, 0.9)","text-halo-width":2}}];default:return console.warn(`Unsupported geometry type: ${a}`),null}}(p,a,g,M,g)}function z(p){return"Polygon"===p||"MultiPolygon"===p}function s(p){return"LineString"===p||"MultiLineString"===p}function F(p,a){return a&&("Point"===p||"MultiPoint"===p)}function l(p,a){return F(p,a)?{cluster:!0,clusterMaxZoom:14,clusterRadius:50,clusterMinPoints:2}:{cluster:!1}}},3646(se,Q,u){"use strict";u.d(Q,{B:()=>U});var S=u(467),m=u(5802),O=u(2271),z=u(4412),s=u(1413),F=u(2306),l=u(140);function b(B){let X=1/0,h=1/0,C=-1/0,x=-1/0;const L=B.features,w=Z=>{Z.length>=2&&(X=Math.min(X,Z[0]),h=Math.min(h,Z[1]),C=Math.max(C,Z[0]),x=Math.max(x,Z[1]))},W=(Z,J)=>{if(0===J)w(Z);else if(Array.isArray(Z))for(const oe of Z)W(oe,J-1)};for(const Z of L){const J=Z.geometry;switch(J.type){case"Point":W(J.coordinates,0);break;case"LineString":case"MultiPoint":W(J.coordinates,1);break;case"Polygon":case"MultiLineString":W(J.coordinates,2);break;case"MultiPolygon":W(J.coordinates,3);break;case"GeometryCollection":for(const oe of J.geometries){const he=b(new l.o([{type:"Feature",geometry:oe,properties:null}]));he&&(w([he[0],he[1]]),w([he[2],he[3]]))}}}return X===1/0?null:[X,h,C,x]}var A=u(6986);let U=(()=>{class B{_layers$=new z.t([]);_map;_sources={};_sourceLayers={};_sourceIds=[];_attachedListeners=[];_hoveredFeature=(0,m.vPA)(void 0);_layerGroups={};_layerClickable={};_pointLayerIds=new Set;_lineLayerIds=new Set;_processedClickEvents=new WeakSet;_clearHoverTimeout;_hoverSequence=0;layers=this._layers$.asObservable();layersSignal=(0,O.EW)(()=>this._layers$.getValue());clickedFeature=new s.B;hoveredFeature=new s.B;initializeWithMap(h){this._map=h,h.on("mousemove",C=>{const x=h.getCanvas();if(!x)return;const L=Object.keys(this._layerClickable).filter(W=>this._layerClickable[W]&&h.getLayer(W)),w=h.queryRenderedFeatures(C.point,{layers:L});x.style.cursor=w.length>0?"pointer":""})}getLayers(){return this._layers$.getValue()}setLayers(h){this._layers$.next([...h])}addLayer(h){const C=this._layers$.getValue(),x=C.findIndex(L=>L.id===h.id);x>=0?C[x]={...h}:C.push({...h}),this._layers$.next([...C])}removeLayer(h){const x=this._layers$.getValue().filter(L=>L.id!==h);this._layers$.next(x),this._deleteSourceIfExists(h.toString()),delete this._sources[h.toString()],delete this._sourceLayers[h.toString()],delete this._layerClickable[h.toString()],this._pointLayerIds.delete(h.toString()),this._lineLayerIds.delete(h.toString()),this._sourceIds=this._sourceIds.filter(L=>L!==h.toString())}toggleVisibility(h){const C=h.toString();if(this._layerGroups[C])return void this.toggleLayerGroupVisibility(C);const L=this._layers$.getValue().map(w=>{if(w.id===h){const W={...w,visible:!w.visible};return this._updateLayerVisibility(h.toString(),W.visible),W}return w});this._layers$.next(L)}setLayerVisibility(h,C){const x=h.toString();if(this._layerGroups[x]){if(this._map){const Z=C?"visible":"none";this._layerGroups[x].forEach(J=>{this._map.setLayoutProperty(J,"visibility",Z)})}}else this._updateLayerVisibility(x,C);const w=this._layers$.getValue().map(W=>W.id===h?{...W,visible:C}:W);this._layers$.next(w)}loadGeoJSONLayerGroup(h,C,x){var L=this;return(0,S.A)(function*(w,W,Z,J={}){const{cluster:oe=!1,zoomToFit:ye=!0,visible:fe=!0,label:he=w,color:me=L._extractColorFromLayer(Z[0])}=J;if(!L._map)return void console.warn("Map not initialized in LayerService");const ne=w;yield L._addSource(w,{type:"geojson",data:W,...(0,A.Jc)("Point",oe)});const ze=[];for(const ve of Z){ze.push(ve.id),L._layerClickable[ve.id]=!0,L._sourceLayers[ne]||(L._sourceLayers[ne]={layer:ve,clickable:!0});const Ke=ve.type;if("circle"===Ke||"symbol"===Ke)L._pointLayerIds.add(ve.id),L._map.addLayer(ve);else if("line"===Ke){L._lineLayerIds.add(ve.id);const Ae=L._getBeforePointLayerId();L._map.addLayer(ve,Ae)}else{const Ae=L._getBeforeLineLayerId()??L._getBeforePointLayerId();L._map.addLayer(ve,Ae)}L._map&&L._map.setLayoutProperty(ve.id,"visibility",fe?"visible":"none")}for(const ve of Z)L._setLayerEvents(ne,ve);L._layerGroups[w]=ze;const xe=new F.ux(he,w);xe.collection=W,xe.color=me,xe.visible=fe,L.addLayer(xe),ye&&L.fitLayerBounds(w)}).apply(this,arguments)}toggleLayerGroupVisibility(h){const C=this._layerGroups[h];if(!C)return;const x=this.getLayer(h);if(!x)return;const L=!x.visible;if(this._map){const w=L?"visible":"none";C.forEach(W=>{this._map.setLayoutProperty(W,"visibility",w)})}this.updateLayer(h,{visible:L})}removeLayerGroup(h){const C=this._layerGroups[h];C&&(this._map&&(C.forEach(x=>{this._map.removeLayer(x),this._attachedListeners=this._attachedListeners.filter(L=>L!==h),delete this._layerClickable[x],this._pointLayerIds.delete(x),this._lineLayerIds.delete(x)}),this._deleteSourceIfExists(h)),delete this._sources[h],delete this._sourceLayers[h],this._sourceIds=this._sourceIds.filter(x=>x!==h),delete this._layerGroups[h],this.removeLayer(h))}loadGeoJSONLayer(h,C,x){var L=this;return(0,S.A)(function*(w,W,Z,J={}){const{cluster:oe=!0,zoomToFit:ye=!0,visible:fe=!0,label:he=w,color:me=L._extractColorFromLayer(Z)}=J;if(!L._map)return void console.warn("Map not initialized in LayerService");yield L._addSource(w,{type:"geojson",data:W,...(0,A.Jc)("Point",oe)},Z);const ne=new F.ux(he,w);ne.collection=W,ne.color=me,ne.visible=fe,L.addLayer(ne),L._updateLayerVisibility(w,fe),ye&&L.fitLayerBounds(w)}).apply(this,arguments)}_addSource(h,C,x){var L=this;return(0,S.A)(function*(w,W,Z,J=!0){L._map&&(L._sources[w]=W,L._deleteSourceIfExists(w),L._sourceIds.push(w),L._map.getSource(w)&&L._map.removeSource(w),L._map.addSource(w,W),Z&&L._addSourceLayer(w,Z,J))}).apply(this,arguments)}_getBeforePointLayerId(){if(!this._map||0===this._pointLayerIds.size)return;const h=this._map.getStyle()?.layers??[];for(const C of h)if(this._pointLayerIds.has(C.id))return C.id}_getBeforeLineLayerId(){if(!this._map||0===this._lineLayerIds.size)return;const h=this._map.getStyle()?.layers??[];for(const C of h)if(this._lineLayerIds.has(C.id))return C.id}_addSourceLayer(h,C,x=!0){if(!this._map)return;this._layerClickable[C.id]=x,this._sourceLayers[h]||(this._sourceLayers[h]={layer:C,clickable:x});const L=C.type;if("circle"===L||"symbol"===L)this._pointLayerIds.add(C.id),this._map.addLayer(C);else if("line"===L){this._lineLayerIds.add(C.id);const w=this._getBeforePointLayerId();this._map.addLayer(C,w)}else{const w=this._getBeforeLineLayerId()??this._getBeforePointLayerId();this._map.addLayer(C,w)}x&&this._setLayerEvents(h,C)}_updateLayerVisibility(h,C){if(!this._map)return;const x=this._sourceLayers[h];x&&this._map.setLayoutProperty(x.layer.id,"visibility",C?"visible":"none")}getLayer(h){return this._layers$.getValue().find(C=>C.id===h)}updateLayer(h,C){const L=this._layers$.getValue().map(w=>{if(w.id===h){const W={...w,...C};return void 0!==C.visible&&this._updateLayerVisibility(h.toString(),C.visible),W}return w});this._layers$.next(L)}toggleAllLayers(){const h=this._layers$.getValue(),x=!h.some(w=>w.visible),L=h.map(w=>(this._updateLayerVisibility(w.id.toString(),x),{...w,visible:x}));this._layers$.next(L)}getVisibleLayersCount(){return this._layers$.getValue().filter(h=>h.visible).length}getTotalLayersCount(){return this._layers$.getValue().length}hasLayer(h){return this._layers$.getValue().some(C=>C.id===h)}fitGeoJSONBounds(h,C=50,x=!0,L=19){this._fitGeoJSONBounds(h,C,x,L)}fitLayerBounds(h,C=50){const x=this._layers$.getValue().find(L=>L.id===h);!x||!x.collection||!this._map||("features"in x.collection?this._fitGeoJSONBounds(x.collection,C):console.warn("Layer collection is not a FeatureCollection, cannot fit bounds."))}fitAllVisibleLayers(h=50){const C=this._layers$.getValue().filter(W=>W.visible&&W.collection);if(0===C.length||!this._map)return;const x=C.flatMap(W=>{const Z=W.collection;return Z&&"features"in Z&&Array.isArray(Z.features)?Z.features:[]}),L=new l.o(x),w=b(L);w&&(L.bbox=w),this._fitGeoJSONBounds(L,h)}clearAllLayers(){if(this._map){for(const[h,C]of Object.entries(this._layerGroups))C.forEach(x=>{this._map.getLayer(x)&&this._map.removeLayer(x)}),this._map.getSource(h)&&this._map.removeSource(h);for(const h of this._sourceIds)this._layerGroups[h]||this._deleteSourceIfExists(h)}this._sourceIds=[],this._sourceLayers={},this._sources={},this._attachedListeners=[],this._layerGroups={},this._layerClickable={},this._layers$.next([])}reapplyLayers(){this._map&&(Object.keys(this._sources).forEach(h=>{this._deleteSourceIfExists(h),this._map.addSource(h,this._sources[h]);const C=this._sourceLayers[h];if(C){this._map.addLayer(C.layer);const x=this._layers$.getValue().find(L=>L.id===h);x&&this._updateLayerVisibility(h,x.visible)}}),this._reattachAllLayerEvents())}_extractColorFromLayer(h){if("paint"in h&&"object"==typeof h.paint){const C=h.paint;return C["circle-color"]||C["fill-color"]||C["line-color"]||""}return""}_fitGeoJSONBounds(h,C=50,x=!0,L=19){if(!this._map)return void console.warn("Map not initialized when trying to fit bounds");if(!h.features||0===h.features.length)return void console.warn("No features to fit bounds to");let w=h.bbox;if(!w){const W=b(h);if(!W)return void console.warn("Failed to calculate bbox for GeoJSON");h.bbox=W,w=W}if(w&&4===w.length)try{this._map.fitBounds([[w[0],w[1]],[w[2],w[3]]],{padding:C,maxZoom:L,animate:x})}catch(W){console.error("Error fitting bounds:",W)}}_deleteSourceIfExists(h){if(!this._map||!this._map.getSource(h))return;const x=this._layerGroups[h];if(x)x.forEach(L=>{this._map.getLayer(L)&&this._map.removeLayer(L)});else{const L=Object.values(this._sourceLayers).find(w=>"source"in w.layer&&w.layer.source===h);L&&this._map.getLayer(L.layer.id)&&(this._map.removeLayer(L.layer.id),this._attachedListeners=this._attachedListeners.filter(w=>w!==L.layer.id))}this._map.removeSource(h)}_setLayerEvents(h,C){if(!this._map)return;const x=C.id.endsWith("-fill"),L=C.id.endsWith("-stroke"),w=x?C.id.replace("-fill",""):L?C.id.replace("-stroke",""):C.id;if(x||L){const J=`${w}-stroke`;this._layerClickable[`${w}-fill`]=!0,this._layerClickable[J]=!0}if(!this._layerClickable[C.id])return;const W=[];if(x||L){const Z=`${w}-fill`,J=`${w}-stroke`;this._map.getLayer(Z)&&W.push(Z),this._map.getLayer(J)&&W.push(J)}else W.push(C.id);W.forEach(Z=>{this._attachedListeners.includes(Z)||(this._map.on("click",Z,J=>{if(!J.features||this._processedClickEvents.has(J.originalEvent))return;const oe=J.features[0],ye=oe.properties;if(ye&&!ye.cluster){const fe=this.getLayer(h)||this.getLayer(w)||this.getLayer(Z);if(fe){const he={...oe,geometry:oe.geometry};if(fe.collection&&"features"in fe.collection){const me=fe.collection.features.find(ne=>ne.geometry.type===oe.geometry?.type&&JSON.stringify(ne.properties)===JSON.stringify(oe.properties));me&&me.id&&(he.id=me.id)}this._processedClickEvents.add(J.originalEvent),this.clickedFeature.next({feature:he,event:J.originalEvent,layer:fe,lngLat:J.lngLat})}}}),this._map.on("mouseenter",Z,J=>{if(this._hoverSequence++,this._clearHoverTimeout&&(clearTimeout(this._clearHoverTimeout),this._clearHoverTimeout=void 0),!J.features)return;const oe=J.features[0],ye=oe.properties,fe={...oe,geometry:oe.geometry};if(ye&&!ye.cluster){const he=this.getLayer(h)||this.getLayer(w)||this.getLayer(Z);if(he){if(he.collection&&"features"in he.collection){const me=he.collection.features.find(ne=>ne.geometry.type===oe.geometry?.type&&JSON.stringify(ne.properties)===JSON.stringify(oe.properties));me&&me.id&&(fe.id=me.id)}this.hoveredFeature.next({feature:fe,event:J.originalEvent,layer:he,lngLat:J.lngLat})}this._hoveredFeature.set(fe)}}),this._map.on("mouseleave",Z,()=>{const J=this._hoverSequence;this._clearHoverTimeout=window.setTimeout(()=>{this._hoverSequence===J&&(this._hoveredFeature.set(void 0),this.hoveredFeature.next(void 0)),this._clearHoverTimeout=void 0},50)}),this._map.on("click",Z,J=>{if(!J.features)return;const oe=J.features[0].properties;if(oe&&oe.cluster){const ye=this._map?.getZoom();ye&&this._map?.flyTo({center:J.lngLat,zoom:ye+1})}}),this._attachedListeners.push(Z))})}_reattachAllLayerEvents(){this._attachedListeners=[],Object.keys(this._sourceLayers).forEach(h=>{const C=this._sourceLayers[h];C&&this._setLayerEvents(h,C.layer)})}static \u0275fac=function(C){return new(C||B)};static \u0275prov=m.jDH({token:B,factory:B.\u0275fac})}return B})()},8017(se,Q,u){"use strict";u.d(Q,{T:()=>St});var S=u(467),m=u(5802),O=u(7705),z=u(2271),s=u(5547),F=u(9769),l=u(5970),R=u(6170),P=u(5949),p=u(2843),a=u(3646),g=u(9079),M=u(1413),D=u(2306),k=u(7089),b=u(9352),A=u(5381),U=u(5187),B=u(5971),X=u(3319);function h(_,I){if(1&_){const c=s.RV6();s.j41(0,"cue-button",5),s.nI1(1,"transloco"),s.bIt("click",function(){m.eBV(c);const v=s.XpG(2);return m.Njj(v.handleZoomFit())}),s.nrm(2,"cue-button-icon",9),s.k0s()}2&_&&s.Y8G("cueTooltip",s.bMT(1,1,"components.map.tooltipZoomFit"))}function C(_,I){if(1&_){const c=s.RV6();s.j41(0,"cue-flexcontainer",3)(1,"cue-button",5),s.nI1(2,"transloco"),s.bIt("click",function(){m.eBV(c);const v=s.XpG();return m.Njj(v.handleZoomOut())}),s.nrm(3,"cue-button-icon",6),s.k0s(),s.j41(4,"cue-button",5),s.nI1(5,"transloco"),s.bIt("click",function(){m.eBV(c);const v=s.XpG();return m.Njj(v.handleZoomIn())}),s.nrm(6,"cue-button-icon",7),s.k0s(),s.nVh(7,h,3,3,"cue-button",8),s.k0s()}if(2&_){const c=s.XpG();s.R7$(),s.Y8G("cueTooltip",s.bMT(2,3,"components.map.tooltipZoomOut")),s.R7$(3),s.Y8G("cueTooltip",s.bMT(5,5,"components.map.tooltipZoomIn")),s.R7$(3),s.vxM(c.displayZoomFit()?7:-1)}}function x(_,I){if(1&_){const c=s.RV6();s.j41(0,"cue-button",10),s.nI1(1,"transloco"),s.nI1(2,"transloco"),s.mxI("selectedChange",function(v){m.eBV(c);const V=s.XpG();return s.DH7(V.layersVisible,v)||(V.layersVisible=v),m.Njj(v)}),s.nrm(3,"cue-button-icon",11),s.k0s()}if(2&_){const c=s.XpG();s.AVh("border-left",c.options().displayZoom&&c.displayLayerToggle()),s.Y8G("cueTooltip",c.layersVisible()?s.bMT(1,6,"components.map.tooltipHideLayers"):s.bMT(2,8,"components.map.tooltipShowLayers"))("toggleButton",!0),s.R50("selected",c.layersVisible),s.R7$(3),s.Y8G("icon",c.layersVisible()?"layers-clear":"layers")}}function L(_,I){if(1&_){const c=s.RV6();s.j41(0,"cue-button",10),s.nI1(1,"transloco"),s.nI1(2,"transloco"),s.mxI("selectedChange",function(v){m.eBV(c);const V=s.XpG();return s.DH7(V.geoFenceDrawEnabled,v)||(V.geoFenceDrawEnabled=v),m.Njj(v)}),s.nrm(3,"cue-button-icon",12),s.k0s()}if(2&_){const c=s.XpG();s.AVh("border-left",c.options().displayGeofenceDraw),s.Y8G("cueTooltip",c.geoFenceDrawEnabled()?s.bMT(1,5,"components.map.tooltipEndDrawGeofence"):s.bMT(2,7,"components.map.tooltipDrawGeofence"))("toggleButton",!0),s.R50("selected",c.geoFenceDrawEnabled)}}let w=(()=>{class _{_service=(0,m.WQX)(P.u);layerService=(0,m.WQX)(a.B);mapLayers=(0,g.ot)(this.layerService.layers);options=(0,O.hFB)(new D.AA);zoom=(0,O.geq)(1);rotate=(0,O.CGW)();geoFenceDrawEnabled=(0,O.geq)(!1);layersVisible=(0,O.geq)(!1);hasLayers=(0,z.EW)(()=>void 0!==this.mapLayers()&&this.mapLayers().length>0);displayLayerToggle=(0,z.EW)(()=>this.options().displayLayerToggle&&this.hasLayers());displayZoomFit=(0,z.EW)(()=>this.options().displayZoom&&this.hasLayers());selectMenuPositions=(0,z.EW)(()=>"top"===this.options().position?"bottomleft":"topleft");handleZoomIn(){this._service.zoomIn()}handleZoomOut(){this._service.zoomOut()}handleZoomFit(){this._service.fitGeoJSONBBOX(void 0,.01)}static \u0275fac=function(d){return new(d||_)};static \u0275cmp=s.VBU({type:_,selectors:[["cue-map-toolbar"]],inputs:{options:[1,"options"],zoom:[1,"zoom"],geoFenceDrawEnabled:[1,"geoFenceDrawEnabled"],layersVisible:[1,"layersVisible"]},outputs:{zoom:"zoomChange",rotate:"rotate",geoFenceDrawEnabled:"geoFenceDrawEnabledChange",layersVisible:"layersVisibleChange"},decls:6,vars:4,consts:[["justify","center",1,"container"],[1,"toolbar",3,"padded"],["align","center"],["align","center","gap","s"],["size","xs","variant","ghost",3,"border-left","cueTooltip","toggleButton","selected"],["size","xs","variant","tertiary",3,"click","cueTooltip"],["icon","zoom-out"],["icon","zoom-in"],["size","xs","variant","tertiary",3,"cueTooltip"],["icon","zoom-fit"],["size","xs","variant","ghost",3,"selectedChange","cueTooltip","toggleButton","selected"],[3,"icon"],["icon","polygon"]],template:function(d,v){1&d&&(s.j41(0,"cue-flexcontainer",0)(1,"cue-card",1)(2,"cue-flexcontainer",2),s.nVh(3,C,8,7,"cue-flexcontainer",3),s.nVh(4,x,4,10,"cue-button",4),s.nVh(5,L,4,9,"cue-button",4),s.k0s()()()),2&d&&(s.R7$(),s.Y8G("padded",!1),s.R7$(2),s.vxM(v.options().displayZoom?3:-1),s.R7$(),s.vxM(v.displayLayerToggle()?4:-1),s.R7$(),s.vxM(v.options().displayGeofenceDraw?5:-1))},dependencies:[A.n,U.Z,B.$,X.a,k.d,b.Kj],styles:[".container[_ngcontent-%COMP%]{width:100%;pointer-events:none}.toolbar[_ngcontent-%COMP%]{pointer-events:all;padding:5px 10px}.border-left[_ngcontent-%COMP%]{border-left:1px solid;padding-left:12px}"],changeDetection:0})}return _})();var W=u(7023),Z=u(1024),J=u(9421);function oe(_,I){if(1&_&&s.nrm(0,"cue-key-val",1),2&_){const c=I.$implicit;s.Y8G("key",c.key)("val",c.val)}}let ye=(()=>{class _{props=(0,O.hFB)(null);keyVals=(0,z.EW)(()=>{const c=this.props();return c?Object.entries(c).map(([d,v])=>({key:d,val:String(v)})):[]});static \u0275fac=function(d){return new(d||_)};static \u0275cmp=s.VBU({type:_,selectors:[["cue-props-panel"]],inputs:{props:[1,"props"]},decls:4,vars:0,consts:[[2,"height","100%","overflow-y","auto"],[3,"key","val"]],template:function(d,v){1&d&&(s.j41(0,"cue-flexcontainer",0)(1,"cue-key-val-list"),s.Z7z(2,oe,1,2,"cue-key-val",1,s.Vm6),s.k0s()()),2&d&&(s.R7$(2),s.Dyx(v.keyVals()))},dependencies:[Z.p,J.F,A.n],encapsulation:2,changeDetection:0})}return _})();var fe=u(7517);let he=(()=>{class _{layerService=(0,m.WQX)(a.B);mapLayers=(0,g.ot)(this.layerService.layers);layerDefs=(0,z.EW)(()=>{const c=this.mapLayers();return c?c.map(d=>({label:d.label,color:d.color??"#000000",visible:d.visible,category:d.category})):[]});updateSingle(c){const d=this.mapLayers()?.find(v=>v.label===c.label);d&&this.layerService.toggleVisibility(d.id)}updateAll(c){const d=this.mapLayers();if(d)for(const v of d)v.visible===c&&this.layerService.toggleVisibility(v.id)}static \u0275fac=function(d){return new(d||_)};static \u0275cmp=s.VBU({type:_,selectors:[["cue-layer-panel"]],decls:1,vars:1,consts:[[3,"layerChange","visibilityAll","layers"]],template:function(d,v){1&d&&(s.j41(0,"cue-layer-legend",0),s.bIt("layerChange",function(Y){return v.updateSingle(Y)})("visibilityAll",function(Y){return v.updateAll(Y)}),s.k0s()),2&d&&s.Y8G("layers",v.layerDefs())},dependencies:[F.MD,fe.P],encapsulation:2})}return _})();var me=u(140),ne=u(6986);function ve(_){const I=_.flatMap(c=>{const d=function xe(_){switch(_.type){case"Point":return[_.coordinates[0],_.coordinates[1]];case"MultiPoint":{if(!_.coordinates.length)return null;const I=_.coordinates.reduce((c,d)=>[c[0]+d[0],c[1]+d[1]],[0,0]);return[I[0]/_.coordinates.length,I[1]/_.coordinates.length]}case"LineString":{if(!_.coordinates.length)return null;const I=Math.floor(_.coordinates.length/2);return[_.coordinates[I][0],_.coordinates[I][1]]}case"MultiLineString":{if(!_.coordinates.length||!_.coordinates[0].length)return null;const I=_.coordinates[0],c=Math.floor(I.length/2);return[I[c][0],I[c][1]]}case"Polygon":{if(!_.coordinates.length||!_.coordinates[0].length)return null;const I=_.coordinates[0],c=I.reduce((d,v)=>[d[0]+v[0],d[1]+v[1]],[0,0]);return[c[0]/I.length,c[1]/I.length]}case"MultiPolygon":{if(!_.coordinates.length||!_.coordinates[0]?.length||!_.coordinates[0][0]?.length)return null;const I=_.coordinates[0][0],c=I.reduce((d,v)=>[d[0]+v[0],d[1]+v[1]],[0,0]);return[c[0]/I.length,c[1]/I.length]}default:return null}}(c.geometry);return d?[{type:"Feature",id:c.id,geometry:{type:"Point",coordinates:d},properties:{...c.properties??{},_isCentroid:!0}}]:[]});return[..._,...I]}const ut=["rgba(255, 0, 0, 0.5)","rgba(0, 0, 255, 0.5)","rgba(0, 255, 0, 0.5)","rgba(255, 165, 0, 0.5)","rgba(128, 0, 128, 0.5)","rgba(255, 192, 203, 0.5)","rgba(255, 255, 0, 0.5)"];function _t(_){const I=_.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d\.]+))?\)/);if(I)return{r:parseInt(I[1]),g:parseInt(I[2]),b:parseInt(I[3]),a:I[4]?parseFloat(I[4]):1};const c=_.match(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/);if(c){const d=c[1];return{r:parseInt(3===d.length?d[0]+d[0]:d.slice(0,2),16),g:parseInt(3===d.length?d[1]+d[1]:d.slice(2,4),16),b:parseInt(3===d.length?d[2]+d[2]:d.slice(4,6),16),a:1}}return{r:0,g:0,b:0,a:1}}function je(_){if(0===_.length)return ut[0];if(1===_.length)return _[0].color;const I=_.map(ae=>({...ae,totalWeight:ae.featureCount*ae.weight})).sort((ae,de)=>de.totalWeight-ae.totalWeight),c=I.reduce((ae,de)=>ae+de.totalWeight,0),d=I[0];if(d.totalWeight/c>.6)return d.color;const v=I.slice(0,Math.min(3,I.length)),V=v.reduce((ae,de)=>ae+de.totalWeight,0);let Y=0,q=0,le=0,ge=0;for(const ae of v){const de=_t(ae.color),_e=ae.totalWeight/V;Y+=de.r*_e,q+=de.g*_e,le+=de.b*_e,ge+=de.a*_e}return function dt(_,I,c,d=1){return d<1?`rgba(${Math.round(_)}, ${Math.round(I)}, ${Math.round(c)}, ${d})`:`rgb(${Math.round(_)}, ${Math.round(I)}, ${Math.round(c)})`}(Y,q,le,ge)}function He(_,I,c,d){if(!d||"Point"!==c&&"MultiPoint"!==c)return[{color:I,weight:1,featureCount:_.length}];const v=_.length;if(v<10)return[{color:I,weight:1,featureCount:v}];let V=0,Y=0,q=0;v>=750?(V=Math.floor(.1*v),Y=Math.floor(.3*v),q=v-V-Y):v>=100?(Y=Math.floor(.4*v),q=v-Y):(q=Math.floor(.8*v),Y=v-q);const le=[];return q>0&&le.push({color:I,weight:1,featureCount:q}),Y>0&&le.push({color:"#f28cb1",weight:2,featureCount:Y}),V>0&&le.push({color:"#e2f552",weight:3,featureCount:V}),le}function Qe(_,I,c,d,v,V){const Y=Array.isArray(d)?d:[d];(0,ne.j5)(v)?_.layerService.loadGeoJSONLayerGroup(I,c,Y,{cluster:!1,zoomToFit:V.zoomToFit,visible:V.visible,label:V.label,color:V.color}):Y.length>1||("Point"===v||"MultiPoint"===v)&&Array.isArray(Y)&&Y.length>1?_.layerService.loadGeoJSONLayerGroup(I,c,Y,{cluster:(0,ne.n7)(v,V.cluster),zoomToFit:V.zoomToFit,visible:V.visible,label:V.label,color:V.color}):_.loadGeoJSON(I,c,Y[0],(0,ne.n7)(v,V.cluster),V.zoomToFit)}var vt=u(6756),bt=u(356),ft=u(6279);const Xe=["map"],qe=_=>({position:"bottomleft",hoveredFeature:_}),Et=(_,I)=>I.label;function Mt(_,I){if(1&_){const c=s.RV6();s.j41(0,"cue-menu-item",6),s.bIt("click",function(v){const V=m.eBV(c).$implicit;return m.Njj(V.action(v))}),s.EFF(1),s.k0s()}if(2&_){const c=I.$implicit;s.R7$(),s.JRh(c.label)}}function Ct(_,I){if(1&_&&(s.j41(0,"cue-menu-wrap"),s.Z7z(1,Mt,2,1,"cue-menu-item",null,Et),s.k0s()),2&_){const c=s.XpG();s.R7$(),s.Dyx(c.contextMenuItems())}}function et(_,I){if(1&_&&(s.j41(0,"span"),s.EFF(1),s.k0s()),2&_){const c=s.XpG();s.R7$(),s.JRh(c.mapService.error())}}function Lt(_,I){if(1&_){const c=s.RV6();s.j41(0,"cue-map-toolbar",8),s.mxI("zoomChange",function(v){m.eBV(c);const V=s.XpG(2);return s.DH7(V.zoom,v)||(V.zoom=v),m.Njj(v)})("layersVisibleChange",function(v){m.eBV(c);const V=s.XpG(2);return s.DH7(V.layerPanelVisible,v)||(V.layerPanelVisible=v),m.Njj(v)})("geoFenceDrawEnabledChange",function(v){m.eBV(c);const V=s.XpG(2);return s.DH7(V.geoFenceDrawEnabled,v)||(V.geoFenceDrawEnabled=v),m.Njj(v)}),s.k0s()}if(2&_){const c=s.XpG(),d=s.XpG();s.Aen(d.toolbarStyle()),s.Y8G("options",c),s.R50("zoom",d.zoom)("layersVisible",d.layerPanelVisible)("geoFenceDrawEnabled",d.geoFenceDrawEnabled)}}function Tt(_,I){1&_&&s.nVh(0,Lt,1,6,"cue-map-toolbar",7),2&_&&s.vxM(I.hidden?-1:0)}function tt(_,I){1&_&&(s.j41(0,"cue-card",4),s.nrm(1,"cue-layer-panel"),s.k0s())}function Rt(_,I){1&_&&(s.j41(0,"cue-card",5),s.nrm(1,"cue-props-panel",9),s.k0s()),2&_&&(s.R7$(),s.Y8G("props",I))}function nt(_,I){if(1&_&&(s.j41(0,"div",11),s.EFF(1),s.k0s()),2&_){const c=I,d=s.XpG();s.xc7("left",c.x,"px")("top",c.y,"px"),s.R7$(),s.SpI(" ",d," ")}}function Pt(_,I){if(1&_&&s.nVh(0,nt,2,5,"div",10),2&_){let c;const d=s.XpG();s.vxM((c=d.hoveredTooltipPosition())?0:-1,c)}}let St=(()=>{class _{mapService=(0,m.WQX)(P.u);drawService=(0,m.WQX)(p.M);settings=(0,O.hFB)(new D.yY);center=(0,O.hFB)([8.5,47.4]);layerPanelVisible=(0,O.geq)(!1);zoom=(0,O.geq)(2);instruction=(0,O.geq)("Hello");layers=(0,O.hFB)([]);zoomToFit=(0,O.hFB)(!0);zoomToFitEachLayer=(0,O.hFB)(!1);splitLayersByGeometryType=(0,O.hFB)(!0);maxClickZoom=(0,O.hFB)(1/0);borderRadius=(0,O.hFB)("0");geoFenceDrawEnabled=(0,O.geq)(!1);contextMenuItemsBefore=(0,O.hFB)([]);contextMenuItemsAfter=(0,O.hFB)([]);immidiateDrawMode=(0,O.hFB)(void 0);hoverTooltipFn=(0,O.hFB)(null);mapReady=(0,O.CGW)();clickedMap=(0,O.CGW)();pannedMap=(0,O.CGW)();panningMap=(0,O.CGW)();zoomedMap=(0,O.CGW)();clickedFeature=(0,O.CGW)();hoveredFeature=(0,O.CGW)();drawEvent=(0,O.CGW)();layersSaturated=(0,z.EW)(()=>this.layers().map((c,d)=>{const v={...c};return v.color||(v.color=vt.BK[d]),v}));toolbarOptions=(0,z.EW)(()=>this.settings().toolbar);featureBeingHovered=(0,m.vPA)(void 0);lastClickedFeatureEvent=(0,m.vPA)(void 0);lastHoveredFeatureEvent=(0,m.vPA)(void 0);shownProperties=(0,m.vPA)(null);hoveredTooltipLabel=(0,z.EW)(()=>{const c=this.hoverTooltipFn();if(!c)return null;const d=this.lastHoveredFeatureEvent();return d?c(d.feature.properties??{})??null:null});hoveredTooltipPosition=(0,z.EW)(()=>{if(!this.hoveredTooltipLabel())return null;const c=this.lastHoveredFeatureEvent();if(!c)return null;const d=this.mapService.map;if(!d)return null;const v=d.project([c.lngLat.lng,c.lngLat.lat]);return{x:v.x,y:v.y}});_featureClickedThisTick=!1;_previousLayersHash=(0,m.vPA)("");_userHasInteracted=(0,m.vPA)(!1);toolbarStyle=(0,z.EW)(()=>{const c=this.toolbarOptions();return{position:"absolute",left:c.margin,right:c.margin,["top"===c.position?"top":"bottom"]:c.margin,"z-index":"10",display:"flex","justify-content":"center"}});contextMenuEnabled=(0,z.EW)(()=>{const c=this.contextMenuItems().length>0,d=this.featureBeingHovered(),v=this.lastClickedFeatureEvent();return c&&(void 0!==d||void 0!==v)});contextMenuItems=(0,z.EW)(()=>{const c=this.lastHoveredFeatureEvent(),d=this.lastClickedFeatureEvent(),V=(c?.feature||d?.feature)?.properties||null,Y=V?Object.fromEntries(Object.entries(V).filter(([_e])=>!_e.startsWith("_"))):null,q=c?.lngLat||d?.lngLat||null,ge=[...this.contextMenuItemsBefore()||[]],ae=this.settings().contextMenu;Y&&Object.keys(Y).length>0&&ae.showProperties&&ge.push({label:"Show properties",action:()=>{this.shownProperties.update(()=>Y)}}),q&&ae.showFlyTo&&ge.push({label:"Fly to feature",action:()=>{this.mapService.flyTo([q.lng,q.lat],this.zoom())}});const de=this.contextMenuItemsAfter()||[];return[...ge,...de]});_mapContainer;_destroy$=new M.B;constructor(){this._subscribeToServiceOutputs(),this._setupEffects(),(0,s.mal)(()=>{this._destroy$.closed||this._tryInitializeMap()})}ngOnDestroy(){this._destroy$.next(),this._destroy$.complete(),this.drawService.destroy(),this.mapService.destroy()}_subscribeToServiceOutputs(){this.mapService.mapReady.pipe((0,g.pQ)()).subscribe(()=>this.mapReady.emit()),this.mapService.clickedMap.pipe((0,g.pQ)()).subscribe(c=>{this._featureClickedThisTick||(this.lastClickedFeatureEvent.update(()=>{}),this.lastHoveredFeatureEvent.update(()=>{}),this.featureBeingHovered.update(()=>{}),this.clickedMap.emit(c),this.shownProperties.update(()=>null))}),this.mapService.pannedMap.pipe((0,g.pQ)()).subscribe(c=>{this._userHasInteracted.set(!0),this.pannedMap.emit(c)}),this.mapService.panningMap.pipe((0,g.pQ)()).subscribe(c=>this.panningMap.emit(c)),this.mapService.zoomedMap.pipe((0,g.pQ)()).subscribe(c=>{this._userHasInteracted.set(!0),this.zoomedMap.emit(this.mapService.getZoom()??this.zoom())}),this.mapService.clickedFeature.pipe((0,g.pQ)()).subscribe(c=>{this._featureClickedThisTick=!0,queueMicrotask(()=>{this._featureClickedThisTick=!1}),this.lastClickedFeatureEvent.update(()=>c),this.clickedFeature.emit(c);const d=c.feature?.geometry?.type,v="Point"===d||"MultiPoint"===d,V=this.mapService.getZoom()??0,Y=this.contextMenuItems().length>0;v&&!Y&&V<this.maxClickZoom()&&this.mapService.zoomToCoordinate(c.lngLat)}),this.mapService.hoveredFeature.pipe((0,g.pQ)()).subscribe(c=>{this.featureBeingHovered.update(()=>c?.feature),this.lastHoveredFeatureEvent.update(()=>c),this.hoveredFeature.emit(c)})}_setupEffects(){var c=this;(0,m.QZP)(()=>{"polygon"===this.immidiateDrawMode()&&(this.geoFenceDrawEnabled.set(!0),setTimeout(()=>{this.drawService.setDrawMode(!0,this.settings().toolbar.clearGeofenceAfterDraw)},500))}),(0,m.QZP)(()=>this.mapService.flyTo(this.center(),this.zoom())),(0,m.QZP)(()=>{const v=this.settings()?.mapboxToken;v&&"string"==typeof v&&""!==v.trim()&&!this.mapService.isMapReady()&&this._tryInitializeMap()}),(0,m.QZP)(()=>{const d=this.geoFenceDrawEnabled();this.drawService.setDrawMode(d,this.settings().toolbar.clearGeofenceAfterDraw)}),(0,m.QZP)(()=>{const d=this.drawService.drawEvent();void 0!==d&&this.drawEvent.emit(d)}),(0,m.QZP)((0,S.A)(function*(){const d=c.layersSaturated();if(!d||0===d.length)return;const v=c._createLayersHash(d);if(v===c._previousLayersHash())return;c._previousLayersHash.set(v),yield c.mapService.waitForMapReady(),c.mapService.clearLayers();const Y=c.zoomToFitEachLayer();d.forEach((q,le)=>{!function ke(_,I,c,d,v,V,Y){const q=I.collection,le=I.color??ut[c];let ge;ge="geometries"in q?function Re(_){const I=_.geometries.map((d,v)=>({type:"Feature",geometry:d,properties:{},id:_.id?`${_.id}_${v}`:void 0})),c=new me.o(I);return c.id=_.id,c.bbox=_.bbox,c}(q):q;const ae=function we(_){const I=[];return _.forEach(c=>{c.geometry&&"GeometryCollection"===c.geometry.type?c.geometry.geometries.forEach((d,v)=>{I.push({type:"Feature",geometry:d,properties:c.properties||{},id:c.id?`${c.id}_${v}`:void 0})}):I.push(c)}),I}(ge.features),de=new me.o(ae);de.id=ge.id,de.bbox=ge.bbox;let _e=le;if(!V){const H=I.id.toString(),ee=ae[0]?.geometry?.type||"Point";_e=je(He(ae,le,ee,d));let be=Y(H,ee,_e,H),Se=de;const Be="Point"!==ee&&"MultiPoint"!==ee,Me=(0,ne.j5)(ee),pe=(0,ne.dx)(ee);if(d&&Be&&!Me&&!pe&&be){const ot=Array.isArray(be)?be:[be],ie=ve(ae);Se=new me.o(ie),Se.id=de.id,Se.bbox=de.bbox,be=[(0,ne.g8)(`${H}-centroid`,H,_e),...ot.map(it=>({...it,minzoom:ne.A4}))]}return void(be&&Qe(_,H,Se,be,ee,{cluster:d,zoomToFit:v,visible:!0,label:I.label||I.id.toString(),color:_e}))}if(V){const H=new Set(ae.map(re=>re.geometry.type)),ee=[];return H.forEach(re=>{const be=`${I.id.toString()}-${re}`,Se=ae.filter(pe=>pe.geometry.type===re),Be=He(Se,le,re,d);ee.push(...Be);let Me=Y(be,re,le,be);if(Me){let pe=new me.o(Se);pe.id=de.id,pe.bbox=de.bbox;const ot="Point"!==re&&"MultiPoint"!==re,ie=(0,ne.j5)(re),rt=(0,ne.dx)(re);if(d&&ot&&!ie&&!rt){const it=Array.isArray(Me)?Me:[Me],It=ve(Se);pe=new me.o(It),pe.id=de.id,pe.bbox=de.bbox,Me=[(0,ne.g8)(`${be}-centroid`,be,le),...it.map(st=>({...st,minzoom:ne.A4}))]}Qe(_,be,pe,Me,re,{cluster:d,zoomToFit:v,visible:!0,label:H.size>1?`${I.label||I.id} (${re})`:`${I.label||I.id}`,color:le})}}),void(ee.length>0&&(_e=je(ee),_.layerService.getLayer(I.id.toString())&&_.layerService.updateLayer(I.id.toString(),{color:_e})))}const Ee=new Map;ae.forEach(H=>{const ee=H.geometry.type;let re;re="Point"===ee||"MultiPoint"===ee?"Point":"LineString"===ee||"MultiLineString"===ee?"LineString":"Polygon"===ee||"MultiPolygon"===ee?"Polygon":ee,Ee.has(re)||Ee.set(re,[]),Ee.get(re).push(ee)});const Ne=[];Ee.forEach((H,ee)=>{const re=`${I.id.toString()}-${ee}`,be=ae.filter(Me=>{const pe=Me.geometry.type;return"Point"===ee?"Point"===pe||"MultiPoint"===pe:"LineString"===ee?"LineString"===pe||"MultiLineString"===pe:"Polygon"===ee?"Polygon"===pe||"MultiPolygon"===pe:pe===ee}),Se=He(be,le,ee,d);Ne.push(...Se);const Be=Y(re,ee,le,re);if(Be){const Me=new me.o(be);Me.id=de.id,Me.bbox=de.bbox,Qe(_,re,Me,Be,ee,{cluster:d,zoomToFit:v,visible:!0,label:Ee.size>1?`${I.label||I.id} (${ee})`:`${I.label||I.id}`,color:le})}}),Ne.length>0&&(_e=je(Ne),_.layerService.getLayer(I.id.toString())&&_.layerService.updateLayer(I.id.toString(),{color:_e}))}(c.mapService,q,le,q.cluster,Y&&q.zoomToFit,c.splitLayersByGeometryType(),ne.Ln)}),c.zoomToFit()&&!Y&&!c._userHasInteracted()&&c.mapService.fitGeoJSONBBOX()}))}_tryInitializeMap(){if(this._destroy$.closed)return;const d=this.settings()?.mapboxToken,v=d&&"string"==typeof d&&""!==d.trim(),V=this._mapContainer,Y=!this.mapService.isMapReady();v&&V&&Y&&(this._userHasInteracted.set(!1),this.mapService.init(this._mapContainer.nativeElement,d,this.center(),this.zoom(),this.borderRadius()))}_createLayersHash(c){return c.map(d=>{const v=d.collection;let V=0;return v&&"FeatureCollection"===v.type&&"features"in v&&(V=Array.isArray(v.features)?v.features.length:0),`${d.id}|${d.label}|${d.visible}|${V}`}).join("::")}static \u0275fac=function(d){return new(d||_)};static \u0275cmp=s.VBU({type:_,selectors:[["cue-map"]],viewQuery:function(d,v){if(1&d&&s.GBs(Xe,5),2&d){let V;s.mGM(V=s.lsd())&&(v._mapContainer=V.first)}},hostAttrs:["data-component","cue-map-main"],inputs:{settings:[1,"settings"],center:[1,"center"],layerPanelVisible:[1,"layerPanelVisible"],zoom:[1,"zoom"],instruction:[1,"instruction"],layers:[1,"layers"],zoomToFit:[1,"zoomToFit"],zoomToFitEachLayer:[1,"zoomToFitEachLayer"],splitLayersByGeometryType:[1,"splitLayersByGeometryType"],maxClickZoom:[1,"maxClickZoom"],borderRadius:[1,"borderRadius"],geoFenceDrawEnabled:[1,"geoFenceDrawEnabled"],contextMenuItemsBefore:[1,"contextMenuItemsBefore"],contextMenuItemsAfter:[1,"contextMenuItemsAfter"],immidiateDrawMode:[1,"immidiateDrawMode"],hoverTooltipFn:[1,"hoverTooltipFn"]},outputs:{layerPanelVisible:"layerPanelVisibleChange",zoom:"zoomChange",instruction:"instructionChange",geoFenceDrawEnabled:"geoFenceDrawEnabledChange",mapReady:"mapReady",clickedMap:"clickedMap",pannedMap:"pannedMap",panningMap:"panningMap",zoomedMap:"zoomedMap",clickedFeature:"clickedFeature",hoveredFeature:"hoveredFeature",drawEvent:"drawEvent"},features:[s.Jv_([P.u,p.M,a.B])],decls:10,vars:10,consts:[["hoveringFeature",""],["map",""],["direction","row",1,"container"],["id","map","cueResized","","cueDarkMode","","trigger","leftclick",3,"darkModeChange","resized","cueContextMenu","contextMenuData","cueContextEnabled"],[1,"layer-panel"],[1,"props-panel"],[3,"click"],[3,"options","style","zoom","layersVisible","geoFenceDrawEnabled"],[3,"zoomChange","layersVisibleChange","geoFenceDrawEnabledChange","options","zoom","layersVisible","geoFenceDrawEnabled"],[3,"props"],[1,"hover-tooltip",3,"left","top"],[1,"hover-tooltip"]],template:function(d,v){if(1&d&&(s.DNE(0,Ct,3,0,"ng-template",null,0,s.C5r),s.j41(2,"cue-flexcontainer",2)(3,"div",3,1),s.bIt("darkModeChange",function(Y){return v.mapService.setDarkMode(Y)})("resized",function(){return v.mapService.onParentResize()}),s.k0s(),s.nVh(5,et,2,1,"span"),s.nVh(6,Tt,1,1),s.nVh(7,tt,2,0,"cue-card",4),s.nVh(8,Rt,2,1,"cue-card",5),s.nVh(9,Pt,1,1),s.k0s()),2&d){let V,Y,q;const le=s.sdS(1);s.R7$(3),s.Y8G("cueContextMenu",le)("contextMenuData",s.eq3(8,qe,v.lastHoveredFeatureEvent()))("cueContextEnabled",v.contextMenuEnabled()),s.R7$(2),s.vxM(v.mapService.error()?5:-1),s.R7$(),s.vxM((V=v.toolbarOptions())?6:-1,V),s.R7$(),s.vxM(v.layerPanelVisible()?7:-1),s.R7$(),s.vxM((Y=v.shownProperties())?8:-1,Y),s.R7$(),s.vxM((q=v.hoveredTooltipLabel())?9:-1,q)}},dependencies:[F.MD,l.C,R.R,w,W.Q,bt.M,ft.D,A.n,ye,he,U.Z],styles:["#map[_ngcontent-%COMP%]{flex:1;min-height:0;border-radius:inherit;overflow:hidden}[_nghost-%COMP%]{display:flex;flex-direction:column;position:relative;width:100%;height:100%;min-height:400px;min-width:200px;flex:1 1 auto;align-self:stretch;box-sizing:border-box;overflow:hidden;border-radius:var(--cue-card-border-radius, inherit)}.mapboxgl-canvas-container[_ngcontent-%COMP%], .mapboxgl-canvas[_ngcontent-%COMP%]{border-radius:inherit!important}.mapboxgl-map[_ngcontent-%COMP%]{border-radius:inherit!important;overflow:hidden!important}.container[_ngcontent-%COMP%]{position:relative;width:100%;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}.props-panel[_ngcontent-%COMP%]{position:absolute;top:8px;right:8px;bottom:8px;z-index:10}.layer-panel[_ngcontent-%COMP%]{position:absolute;top:10px;left:10px;z-index:10}cue-map-toolbar[_ngcontent-%COMP%]{position:absolute;left:0;right:0;bottom:0;z-index:10;display:flex;justify-content:center}.hover-tooltip[_ngcontent-%COMP%]{position:absolute;background:var(--cue-menu-background-color);color:var(--cue-menu-foreground-color);box-shadow:var(--cue-menu-box-shadow);border:1px solid var(--cue-menu-border-color);padding:3px 8px;border-radius:4px;font-family:var(--cue-font-family);font-size:.75rem;line-height:1.4;pointer-events:none;white-space:nowrap;z-index:20;transform:translate(-50%,calc(-100% - 8px))}"]})}return _})()},5949(se,Q,u){"use strict";u.d(Q,{u:()=>R});var S=u(467),m=u(5802),O=u(2271),z=u(1413),s=u(3646),F=u(2843),l=u(9079);let R=(()=>{class P{_map;_mapContainer;_isInitializing=!1;_mapReadyPromiseResolve;_mapReady=new Promise(a=>{this._mapReadyPromiseResolve=a});_emittedReady=!1;_firstThemeReceived=!1;_hoveredFeature=(0,m.vPA)(void 0);_layerService=(0,m.WQX)(s.B);_drawService=(0,m.WQX)(F.M);mapboxToken=(0,m.vPA)("");center=(0,m.vPA)([8.5,47.4]);zoom=(0,m.vPA)(2);borderRadius=(0,m.vPA)("0");mapReady=new z.B;clickedMap=new z.B;pannedMap=new z.B;panningMap=new z.B;zoomedMap=new z.B;error=(0,m.vPA)("");get clickedFeature(){return this._layerService.clickedFeature}get hoveredFeature(){return this._layerService.hoveredFeature}get layers(){return this._layerService.layers}get layersSignal(){return this._layerService.layersSignal}get layerService(){return this._layerService}get drawService(){return this._drawService}get drawEvent(){return this._drawService.drawEvent}_darkMode=(0,m.vPA)(this._getSystemColorPreference());_styleId=(0,O.EW)(()=>this._darkMode()?"madsholten/clwjh4xeu00q601pnczm07jq6":"madsholten/clwjh6ug900q701pn6eor8p51");get map(){return this._map}constructor(){this._layerService.hoveredFeature.pipe((0,l.pQ)()).subscribe(a=>{this._hoveredFeature.set(a?.feature)}),(0,m.QZP)(()=>{this._styleId(),this._firstThemeReceived?void 0!==this._map&&this._updateStyle().catch(a=>{console.error("Failed to update map style:",a)}):this._firstThemeReceived=!0})}destroy(){if(this._layerService?.clearAllLayers(),this._drawService?.destroy(),this._map)try{this._map.remove()}catch(a){console.warn("Error removing map:",a)}this._map=void 0,this._mapContainer&&(this._mapContainer.innerHTML="",this._mapContainer=void 0),this._isInitializing=!1,this._emittedReady=!1,this._mapReady=new Promise(a=>{this._mapReadyPromiseResolve=a})}isMapReady(){return void 0!==this._map&&this._emittedReady&&!this._isInitializing}waitForMapReady(){var a=this;return(0,S.A)(function*(){return a._mapReady})()}init(a,g,M,D,k){var b=this;return(0,S.A)(function*(){if(g&&""!==g.trim())if(b._map||b._isInitializing)console.warn("MapService: Map is already initialized or currently initializing");else{b._isInitializing=!0,b.mapboxToken.set(g),b.center.set(M),b.zoom.set(D),b.borderRadius.set(k),b._mapContainer=a,b._mapContainer&&(b._mapContainer.innerHTML="");try{yield b._loadMapboxCSS();const A=yield u.e(247).then(u.t.bind(u,1247,23)),U=A.default||A;if(!U||"function"!=typeof U.Map)throw new Error("Mapbox GL JS not properly loaded");U.accessToken=b.mapboxToken(),b._map=new U.Map({container:a,style:b._getMapStyleURL(),center:b.center(),zoom:b.zoom()}),b._applyBorderRadius(a),b._initEventListeners(b._map)}catch(A){console.error("Failed to load mapbox-gl:",A),b.error.set("Failed to load map library. Please ensure mapbox-gl is installed.")}finally{b._isInitializing=!1}}else console.warn("MapService: Cannot initialize map without valid mapbox token")})()}loadGeoJSON(a,g,M){var D=this;return(0,S.A)(function*(k,b,A,U=!0,B=!0){return yield D._mapReady,D._layerService.loadGeoJSONLayer(k,b,A,{cluster:U,zoomToFit:B,visible:!0,label:k})}).apply(this,arguments)}fitGeoJSONBBOX(a){var g=this;return(0,S.A)(function*(M,D=50,k=!0,b=19){yield g._mapReady,M?g._layerService.fitGeoJSONBounds(M,D,k,b):g._layerService.fitAllVisibleLayers(D)}).apply(this,arguments)}jumpTo(a,g){this._map?.jumpTo({center:a,zoom:g??this.zoom()})}setDarkMode(a){this._darkMode.set(a)}zoomToCoordinate(a){const g=this._map?.getZoom();if(!g)return;const M=g+1;this._map?.flyTo({center:a,zoom:M})}getZoom(){return this._map?.getZoom()}flyTo(a,g,M){this._map?.flyTo({center:a,zoom:g??this.zoom(),essential:!0,padding:M})}zoomIn(){if(!this._map)return;const a=this._map.getZoom();this._map.flyTo({zoom:a+1})}zoomOut(){if(!this._map)return;const a=this._map.getZoom();this._map.flyTo({zoom:a-1})}clearLayers(){this._layerService.clearAllLayers()}getImage(){const a=this._map?.getCanvas();if(void 0!==a)return a.toDataURL("image/png")}onParentResize(){this._map?.resize()}_loadMapboxCSS(){return(0,S.A)(function*(){return new Promise((a,g)=>{if(document.querySelector('link[href*="mapbox-gl.css"]'))return void a();const M=document.createElement("link");M.rel="stylesheet",M.href="https://api.mapbox.com/mapbox-gl-js/v3.3.0/mapbox-gl.css",M.onload=()=>a(),M.onerror=()=>{const D=document.createElement("link");D.rel="stylesheet",D.href="node_modules/mapbox-gl/dist/mapbox-gl.css",D.onload=()=>a(),D.onerror=()=>g(new Error("Failed to load Mapbox CSS")),document.head.appendChild(D)},document.head.appendChild(M)})})()}_applyBorderRadius(a){const g=this.borderRadius();let M=g;if("0"===g){const k=a.closest("cue-map")?.parentElement;k&&(M=getComputedStyle(k).borderRadius||"0")}"0"!==M&&(a.style.borderRadius=M,a.style.overflow="hidden",setTimeout(()=>{const D=a.querySelector(".mapboxgl-canvas"),k=a.querySelector(".mapboxgl-canvas-container"),b=a.querySelector(".mapboxgl-map");D&&(D.style.borderRadius=M),k&&(k.style.borderRadius=M),b&&(b.style.borderRadius=M)},100))}_initEventListeners(a){a.on("click",g=>{void 0===this._hoveredFeature()&&this.clickedMap.next(g)}),a.on("drag",g=>{void 0===this._hoveredFeature()&&this.panningMap.next(g)}),a.on("dragend",g=>{void 0===this._hoveredFeature()&&this.pannedMap.next(g)}),a.on("zoomend",g=>{this.zoomedMap.next(g)}),a.on("load",()=>{this._emittedReady||(this._layerService.initializeWithMap(a),this._drawService.initializeWithMap(a),this._mapReadyPromiseResolve(),this.mapReady.next(),this._emittedReady=!0)}),a.on("error",g=>{this.error.set(g.error.message)})}_getMapStyleURL(){return`mapbox://styles/${this._styleId()}`}_updateStyle(){var a=this;return(0,S.A)(function*(){if(void 0===a._map)return;const g=a._map.getZoom(),M=a._map.getCenter();void 0!==a._mapContainer&&(yield a.init(a._mapContainer,a.mapboxToken(),M,g,a.borderRadius()),setTimeout(()=>{a._layerService.reapplyLayers(),a._map?.flyTo({center:M,zoom:g})},500))})()}_getSystemColorPreference(){return typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches}static \u0275fac=function(g){return new(g||P)};static \u0275prov=m.jDH({token:P,factory:P.\u0275fac})}return P})()},2306(se,Q,u){"use strict";u.d(Q,{AA:()=>z,ux:()=>s,yY:()=>O});var S=u(140),m=u(8402);class O{mapboxToken;contextMenu={showProperties:!0,showFlyTo:!0};toolbar=new z}class z{hidden=!1;position="bottom";margin="20px";displayZoom=!0;displayGeofenceDraw=!1;displayLayerToggle=!0;clearGeofenceAfterDraw=!0}class s{label;id;collection=new S.o;color;visible=!0;cluster=!0;zoomToFit=!0;category;constructor(l,R=(0,m.A)()){this.label=l,this.id=R}}},8334(se,Q,u){"use strict";u.d(Q,{o:()=>z});var S=u(7705),m=u(5547);const O=["*"];let z=(()=>{class s{label=S.hFB.required();active=(0,S.geq)(!1);static \u0275fac=function(R){return new(R||s)};static \u0275cmp=m.VBU({type:s,selectors:[["cue-tab"]],hostVars:1,hostBindings:function(R,P){2&R&&m.Avn("hidden",!P.active())},inputs:{label:[1,"label"],active:[1,"active"]},outputs:{active:"activeChange"},ngContentSelectors:O,decls:1,vars:0,template:function(R,P){1&R&&(m.NAR(),m.SdG(0))},styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;flex:1;min-height:0}[hidden][_nghost-%COMP%]{display:none!important}"]})}return s})()},6455(se,Q,u){"use strict";u.d(Q,{t:()=>D});var S=u(7705),m=u(5802),O=u(2271),z=u(8334),s=u(5187),F=u(9769),l=u(5547);const R=["*"],P=(k,b)=>b.label();function p(k,b){if(1&k&&(l.j41(0,"cue-card",1),l.eu8(1,2),l.k0s()),2&k){const A=l.XpG(),U=l.sdS(3);l.Y8G("variant",A._cardVariant())("padded",!1),l.R7$(),l.Y8G("ngTemplateOutlet",U)}}function a(k,b){if(1&k&&l.eu8(0,2),2&k){l.XpG();const A=l.sdS(3);l.Y8G("ngTemplateOutlet",A)}}function g(k,b){if(1&k){const A=l.RV6();l.j41(0,"button",6),l.bIt("click",function(){const B=m.eBV(A).$index,X=l.XpG(2);return m.Njj(X.setActive(B))}),l.EFF(1),l.k0s()}if(2&k){const A=b.$implicit,U=b.$index,B=l.XpG(2);l.AVh("active",B.activeIndex()===U),l.R7$(),l.SpI(" ",A.label()," ")}}function M(k,b){if(1&k&&(l.j41(0,"div",3),l.Z7z(1,g,2,3,"button",4,P),l.k0s(),l.j41(3,"div",5),l.SdG(4),l.k0s()),2&k){const A=l.XpG();l.R7$(),l.Dyx(A.tabs())}}let D=(()=>{class k{tabs=(0,S.tEk)(z.o);activeIndex=(0,m.vPA)(0);variant=(0,S.hFB)("none");_cardVariant=(0,O.EW)(()=>"none"===this.variant()?"default":this.variant());constructor(){(0,m.QZP)(()=>{const A=this.tabs(),U=this.activeIndex();A.forEach((B,X)=>B.active.set(X===U))})}setActive(A){this.activeIndex.set(A)}static \u0275fac=function(U){return new(U||k)};static \u0275cmp=l.VBU({type:k,selectors:[["cue-tabs"]],contentQueries:function(U,B,X){1&U&&l.C6U(X,B.tabs,z.o,4),2&U&&l.NyB()},inputs:{variant:[1,"variant"]},ngContentSelectors:R,decls:4,vars:1,consts:[["inner",""],[2,"height","100%","width","100%","display","flex","flex-direction","column","overflow","hidden",3,"variant","padded"],[3,"ngTemplateOutlet"],[1,"tabs-header"],[1,"tab-button",3,"active"],[1,"tabs-content"],[1,"tab-button",3,"click"]],template:function(U,B){1&U&&(l.NAR(),l.nVh(0,p,2,3,"cue-card",1)(1,a,1,1,"ng-container",2),l.DNE(2,M,5,0,"ng-template",null,0,l.C5r)),2&U&&l.vxM("none"!==B.variant()?0:1)},dependencies:[s.Z,F.T3],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;box-sizing:border-box;border-radius:var(--cue-card-border-radius);border:1px solid var(--cue-card-border-color);background-color:var(--cue-default);color:var(--cue-defaultContrast);overflow:hidden}.tabs-header[_ngcontent-%COMP%]{display:flex;border-bottom:1px solid var(--cue-card-border-color);background-color:var(--background-color, var(--cue-default))}.tab-button[_ngcontent-%COMP%]{padding:10px 16px;background:none;border:none;border-bottom:2px solid transparent;cursor:pointer;color:inherit;font-family:var(--cue-font-family);font-size:var(--cue-font-s-size);line-height:var(--cue-font-s-line-height);opacity:.6;transition:opacity .15s,border-bottom-color .15s}.tab-button[_ngcontent-%COMP%]:hover{opacity:.9}.tab-button.active[_ngcontent-%COMP%]{border-bottom-color:currentColor;opacity:1;font-weight:500}.tabs-content[_ngcontent-%COMP%]{padding:var(--cue-card-padding-y) var(--cue-card-padding-x);flex:1;min-height:0;box-sizing:border-box;display:flex;flex-direction:column}"]})}return k})()},6170(se,Q,u){"use strict";u.d(Q,{R:()=>s});var S=u(7705),m=u(5802),O=u(2271),z=u(5547);let s=(()=>{class F{destroyRef=(0,m.WQX)(m.abz);_isDarkMode=(0,m.vPA)(this.hasDarkClass());isDarkMode=(0,O.EW)(()=>this._isDarkMode());darkModeChange=(0,S.CGW)();constructor(){const R=new MutationObserver(P=>{P.forEach(p=>{if("attributes"===p.type&&"class"===p.attributeName){const a=this.hasDarkClass();a!==this._isDarkMode()&&this._isDarkMode.set(a)}})});R.observe(document.body,{attributes:!0,attributeFilter:["class"]}),this.destroyRef.onDestroy(()=>R.disconnect()),(0,m.QZP)(()=>{this.darkModeChange.emit(this._isDarkMode()),document.documentElement.style.colorScheme=this._isDarkMode()?"dark":"light"})}hasDarkClass(){return document.body.classList.contains("dark")}toggleDarkMode(){document.body.classList.toggle("dark")}static \u0275fac=function(P){return new(P||F)};static \u0275dir=z.FsC({type:F,selectors:[["","cueDarkMode",""]],outputs:{darkModeChange:"darkModeChange"},exportAs:["darkModeDetector"]})}return F})()},7335(se,Q,u){"use strict";u.d(Q,{e:()=>R});var S=u(7705),m=u(5802),O=u(5547),z=u(8359),s=u(6939),F=u(63),l=u(4853);let R=(()=>{class P{_targetEl=(0,m.WQX)(O.aKT);_overlay=(0,m.WQX)(F.hJ);_overlayRef;_isOverlayHovered=!1;_subscriptions;display=(0,S.hFB)("on-hover");menuItems=S.hFB.required();menuEnabled=(0,S.hFB)(!0);onMouseEnter(){if("on-hover"===this.display()){if(!this.menuItems().length)return void this.removeOverlayMenu();this.appendOverlayMenu()}}onMouseLeave(){this._checkShouldRemoveOverlay()}appendOverlayMenu(){if(!this.menuItems().length||this._overlayRef)return;const a=this._overlay.create({positionStrategy:this._overlay.position().flexibleConnectedTo(this._targetEl).withPositions([{originX:"end",originY:"center",overlayX:"start",overlayY:"center",offsetX:2,offsetY:0}])});this._overlayRef=a;const g=window.getComputedStyle(this._targetEl.nativeElement).color;a.overlayElement.style.color=g;const M=new s.A8(l.H),D=a.attach(M);D.instance.items=this.menuItems,this._subscriptions&&this._subscriptions.unsubscribe(),this._subscriptions=new z.yU,this._subscriptions.add(D.instance.mouseEnter.subscribe(()=>{this._isOverlayHovered=!0})),this._subscriptions.add(D.instance.mouseLeave.subscribe(()=>{this._isOverlayHovered=!1,this._checkShouldRemoveOverlay()}))}removeOverlayMenu(){this._overlayRef&&(this._subscriptions&&(this._subscriptions.unsubscribe(),this._subscriptions=void 0),this._overlayRef.detach(),this._overlayRef.dispose(),this._overlayRef=void 0)}_checkShouldRemoveOverlay(){setTimeout(()=>{this._isOverlayHovered||this.removeOverlayMenu()},300)}static \u0275fac=function(g){return new(g||P)};static \u0275dir=O.FsC({type:P,selectors:[["","cueEntityMenu",""]],hostBindings:function(g,M){1&g&&O.bIt("mouseenter",function(){return M.onMouseEnter()})("mouseleave",function(){return M.onMouseLeave()})},inputs:{display:[1,"display"],menuItems:[1,"menuItems"],menuEnabled:[1,"menuEnabled"]}})}return P})()},140(se,Q,u){"use strict";u.d(Q,{o:()=>S});class S{type="FeatureCollection";features=[];bbox;id;constructor(O=[]){this.features=O}addFeature(O){this.features.push(O)}removeFeature(O){return this.features.splice(O,1)[0]}getFeatureCount(){return this.features.length}clear(){this.features=[]}}},58(se,Q,u){"use strict";function S(a){let g=0,M=-1,D=-1;for(let k=0;k<a.length;k++)if("("===a[k])g++,1===g&&(M=k+1);else if(")"===a[k]&&(g--,0===g)){D=k;break}return-1!==M&&-1!==D?a.substring(M,D):null}u.d(Q,{S:()=>P,n:()=>p});class m{x;y;z;constructor(g,M,D){this.x=g,this.y=M,this.z=D}}class O{points;constructor(g){this.points=g}}class z{lines;constructor(g){this.lines=g}}function P(a){if(a){if((a=a.trim().toUpperCase()).startsWith("POINT"))return function F(a){a=a.trim().toUpperCase();const M=S(a)?.split(" ")??[];return a.includes("POINT Z")?new m(parseFloat(M[0]),parseFloat(M[1]),parseFloat(M[2])):new m(parseFloat(M[0]),parseFloat(M[1]))}(a);if(a.startsWith("LINESTRING"))return function s(a){const g=S(a=a.trim().toUpperCase()),M=[];return g?.split(",").map(D=>D.trim().split(" ").map(k=>parseFloat(k))).map(D=>{M.push(new m(D[0],D[1],D[2]))}),new O(M)}(a);if(a.startsWith("POLYGON"))return function l(a){const g=S(a=a.trim().toUpperCase());if(!g)return new z([]);const M=g.match(/\(([^)]+)\)/g);if(!M)return new z([]);const D=M.map(k=>{const b=S(k);return b?b.split(",").map(A=>{const U=A.trim().split(" ");return U.length>=3?new m(parseFloat(U[0]),parseFloat(U[1]),parseFloat(U[2])):new m(parseFloat(U[0]),parseFloat(U[1]))}):[]});return new z(D)}(a)}}function p(a){if(a instanceof m)return{type:"Point",coordinates:void 0!==a.z?[a.x,a.y,a.z]:[a.x,a.y]};if(a instanceof O)return{type:"LineString",coordinates:a.points.map(g=>void 0!==g.z?[g.x,g.y,g.z]:[g.x,g.y])};if(a instanceof z)return{type:"Polygon",coordinates:a.lines.map(g=>g.map(M=>void 0!==M.z?[M.x,M.y,M.z]:[M.x,M.y]))};throw new Error("Unknown WKT type")}},362(se){"use strict";se.exports=function Q(u,S){if(u===S)return!0;if(u&&S&&"object"==typeof u&&"object"==typeof S){if(u.constructor!==S.constructor)return!1;var m,O,z;if(Array.isArray(u)){if((m=u.length)!=S.length)return!1;for(O=m;0!==O--;)if(!Q(u[O],S[O]))return!1;return!0}if(u.constructor===RegExp)return u.source===S.source&&u.flags===S.flags;if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===S.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===S.toString();if((m=(z=Object.keys(u)).length)!==Object.keys(S).length)return!1;for(O=m;0!==O--;)if(!Object.prototype.hasOwnProperty.call(S,z[O]))return!1;for(O=m;0!==O--;){var s=z[O];if(!Q(u[s],S[s]))return!1}return!0}return u!=u&&S!=S}},5332(se,Q,u){"use strict";u.d(Q,{k:()=>z});for(var m=[],O=0;O<256;++O)m.push((O+256).toString(16).slice(1));function z(l,R=0){return(m[l[R+0]]+m[l[R+1]]+m[l[R+2]]+m[l[R+3]]+"-"+m[l[R+4]]+m[l[R+5]]+"-"+m[l[R+6]]+m[l[R+7]]+"-"+m[l[R+8]]+m[l[R+9]]+"-"+m[l[R+10]]+m[l[R+11]]+m[l[R+12]]+m[l[R+13]]+m[l[R+14]]+m[l[R+15]]).toLowerCase()}},8402(se,Q,u){"use strict";u.d(Q,{A:()=>R});const m={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var O,z=new Uint8Array(16);function s(){if(!O&&!(O=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return O(z)}var F=u(5332);const R=function l(P,p,a){if(m.randomUUID&&!p&&!P)return m.randomUUID();var g=(P=P||{}).random||(P.rng||s)();if(g[6]=15&g[6]|64,g[8]=63&g[8]|128,p){a=a||0;for(var M=0;M<16;++M)p[a+M]=g[M];return p}return(0,F.k)(g)}},6119(se){se.exports.RADIUS=6378137,se.exports.FLATTENING=1/298.257223563,se.exports.POLAR_RADIUS=6356752.3142}}]);
|
package/953.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[953],{5448(L,B,h){"use strict";h.d(B,{L:()=>D});var g=h(7705),S=h(2245),u=h(5547);const k=["*"];let D=(()=>{class l{fontSize=(0,g.hFB)("m");italic=(0,g.hFB)(!1);noWrap=(0,g.hFB)(!0);static \u0275fac=function(v){return new(v||l)};static \u0275cmp=u.VBU({type:l,selectors:[["cue-button-label"]],inputs:{fontSize:[1,"fontSize"],italic:[1,"italic"],noWrap:[1,"noWrap"]},ngContentSelectors:k,decls:3,vars:3,consts:[[3,"size","italic","noWrap"]],template:function(v,f){1&v&&(u.NAR(),u.j41(0,"div")(1,"cue-typography",0),u.SdG(2),u.k0s()()),2&v&&(u.R7$(),u.Y8G("size",f.fontSize())("italic",f.italic())("noWrap",f.noWrap()))},dependencies:[S.Typography],styles:["div[_ngcontent-%COMP%]{transform:translateY(.05em)}"]})}return l})()},9695(L,B,h){"use strict";h.d(B,{d:()=>l});var g=h(7705),S=h(29),u=h(5547);function k(e,s){if(1&e&&u.nrm(0,"cue-svg-icon",2),2&e){const v=u.XpG();u.Y8G("name",v.iconChecked())}}function D(e,s){if(1&e&&u.nrm(0,"cue-svg-icon",2),2&e){const v=u.XpG();u.Y8G("name",v.icon())}}let l=(()=>{class e{size=(0,g.hFB)("m");icon=(0,g.hFB)(void 0);iconChecked=(0,g.hFB)(void 0);disabled=(0,g.hFB)(!1);checked=(0,g.geq)(!1);toggleChange=(0,g.CGW)();toggle(){this.checked.set(!this.checked()),this.toggleChange.emit(this.checked())}static \u0275fac=function(f){return new(f||e)};static \u0275cmp=u.VBU({type:e,selectors:[["cue-input-switch"]],hostVars:5,hostBindings:function(f,M){2&f&&(u.BMQ("size",M.size()),u.AVh("checked",M.checked())("disabled",M.disabled()))},inputs:{size:[1,"size"],icon:[1,"icon"],iconChecked:[1,"iconChecked"],disabled:[1,"disabled"],checked:[1,"checked"]},outputs:{checked:"checkedChange",toggleChange:"toggleChange"},decls:4,vars:3,consts:[["type","checkbox",3,"click","checked","disabled"],[1,"indicator"],[3,"name"]],template:function(f,M){1&f&&(u.j41(0,"input",0),u.bIt("click",function(){return M.toggle()}),u.k0s(),u.j41(1,"div",1),u.nVh(2,k,1,1,"cue-svg-icon",2)(3,D,1,1,"cue-svg-icon",2),u.k0s()),2&f&&(u.Y8G("checked",M.checked())("disabled",M.disabled()),u.R7$(2),u.vxM(M.checked()&&M.iconChecked()?2:M.icon()?3:-1))},dependencies:[S.A],styles:["[_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-width: calc(var(--cue-input-switch-height) * 1.7);--cue-input-switch-inset: 2px;--cue-input-switch-indicator-width: calc( var(--cue-input-switch-height) - (2 * var(--cue-input-switch-inset)) );--cue-input-switch-icon-width: calc( var(--cue-input-switch-indicator-width) - (2 * var(--cue-input-switch-inset)) );display:block;flex-shrink:0;position:relative;height:var(--cue-input-switch-height);width:var(--cue-input-switch-width);border-radius:var(--cue-input-switch-height);--cue-icon-width: var(--cue-input-switch-icon-width);background:var(--cue-input-switch-background);transition:background-color .4s ease}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 12px;--cue-input-switch-inset: 1px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 14px;--cue-input-switch-inset: 1px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 18px;--cue-input-switch-inset: 2px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 22px;--cue-input-switch-inset: 3px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 28px;--cue-input-switch-inset: 3px}@container cue-container (width < 20em){[_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=xs][_nghost-%COMP%]{--cue-input-switch-height: 10px}[size=s][_nghost-%COMP%]{--cue-input-switch-height: 12px}[size=m][_nghost-%COMP%]{--cue-input-switch-height: 16px}[size=l][_nghost-%COMP%]{--cue-input-switch-height: 18px}[size=xl][_nghost-%COMP%]{--cue-input-switch-height: 20px}}.checked[_nghost-%COMP%]{background:var(--cue-input-switch-checked-background)}.disabled[_nghost-%COMP%]{background:var(--cue-input-switch-disabled-background);cursor:default}[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{pointer-events:none;position:absolute;left:var(--cue-input-switch-inset);top:var(--cue-input-switch-inset);width:var(--cue-input-switch-indicator-width);aspect-ratio:1;border-radius:50%;display:flex;align-items:center;justify-content:center;background-color:var(--cue-input-switch-indicator-background);color:var(--cue-input-switch-indicator-foreground);transition:left .4s ease,background-color .4s ease,color .4s ease}.checked[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{left:calc(var(--cue-input-switch-width) - var(--cue-input-switch-inset) - var( --cue-input-switch-indicator-width ));background:var(--cue-input-switch-checked-indicator-background);color:var(--cue-input-switch-checked-indicator-foreground)}.disabled[_nghost-%COMP%] .indicator[_ngcontent-%COMP%]{background:var(--cue-input-switch-disabled-indicator-background);color:var(--cue-input-switch-disabled-indicator-foreground)}input[_ngcontent-%COMP%]{all:unset;position:absolute;inset:0;cursor:pointer;border-radius:var(--cue-input-switch-height)}input[_ngcontent-%COMP%]:focus-visible:not(:disabled) + .indicator[_ngcontent-%COMP%]{outline:1px solid var(--cue-input-switch-focus-color);outline-offset:2px}"]})}return e})()},5745(L,B,h){"use strict";h.d(B,{a:()=>K});var g=h(7705),S=h(5802),u=h(5187),k=h(5381),D=h(29),l=h(2245),e=h(5547);const s=["dialog"],v=["*"];function f($,j){if(1&$&&(e.j41(0,"cue-typography",4),e.EFF(1),e.k0s()),2&$){const _=e.XpG(2);e.R7$(),e.JRh(_.label())}}function M($,j){if(1&$){const _=e.RV6();e.j41(0,"cue-svg-icon",7),e.bIt("click",function(){S.eBV(_);const P=e.XpG(2);return S.Njj(P.onClose())}),e.k0s()}}function U($,j){if(1&$&&(e.j41(0,"cue-flexcontainer",3),e.bIt("click",function(y){return y.stopPropagation()}),e.nVh(1,f,2,1,"cue-typography",4),e.j41(2,"cue-card",5),e.bIt("click",function(y){return y.stopPropagation()}),e.nVh(3,M,1,0,"cue-svg-icon",6),e.j41(4,"cue-flexcontainer"),e.SdG(5),e.k0s()()()),2&$){const _=e.XpG();e.R7$(),e.vxM(_.label()?1:-1),e.R7$(),e.Aen(_.minWidth()?"position: relative; min-width: min("+_.minWidth()+", 80vw)":"position: relative"),e.R7$(),e.vxM(_.displayCloseBtn()?3:-1),e.R7$(),e.Aen("width: 100%; margin-top: "+(_.displayCloseBtn()?"16px":"0"))}}let K=(()=>{class ${visible=(0,g.geq)(!0);closeOnBackgroundClick=(0,g.hFB)(!0);displayCloseBtn=(0,g.hFB)(!0);label=(0,g.hFB)("");minWidth=(0,g.hFB)();close=(0,g.CGW)();dialogRef=g.ebz.required("dialog");constructor(){(0,S.QZP)(()=>{const _=this.dialogRef().nativeElement;this.visible()?_.open||_.showModal():_.open&&_.close()})}onBackdropClick(){this.closeOnBackgroundClick()&&this.onClose()}onClose(){this.visible.set(!1),this.close.emit()}static \u0275fac=function(y){return new(y||$)};static \u0275cmp=e.VBU({type:$,selectors:[["cue-modal"]],viewQuery:function(y,P){1&y&&e.wEZ(P.dialogRef,s,5),2&y&&e.NyB()},inputs:{visible:[1,"visible"],closeOnBackgroundClick:[1,"closeOnBackgroundClick"],displayCloseBtn:[1,"displayCloseBtn"],label:[1,"label"],minWidth:[1,"minWidth"]},outputs:{visible:"visibleChange",close:"close"},ngContentSelectors:v,decls:3,vars:1,consts:[["dialog",""],[1,"modal-dialog",3,"cancel","click"],["direction","column","gap","s","align","center",2,"max-width","80vw"],["direction","column","gap","s","align","center",2,"max-width","80vw",3,"click"],["weight","medium"],[3,"click"],["name","close",1,"close-btn"],["name","close",1,"close-btn",3,"click"]],template:function(y,P){1&y&&(e.NAR(),e.j41(0,"dialog",1,0),e.bIt("cancel",function(){return P.onClose()})("click",function(){return P.onBackdropClick()}),e.nVh(2,U,6,6,"cue-flexcontainer",2),e.k0s()),2&y&&(e.R7$(2),e.vxM(P.visible()?2:-1))},dependencies:[u.Z,k.n,D.A,l.Typography],styles:[".close-btn[_ngcontent-%COMP%]{position:absolute;right:8px;top:8px;cursor:pointer}.modal-dialog[_ngcontent-%COMP%]{padding:0;border:none;background:transparent;overflow:visible;margin:auto;outline:none}.modal-dialog[_ngcontent-%COMP%]::backdrop{background-color:var(--cue-modal-overlay-color, rgba(0, 0, 0, .5))}"]})}return $})()},2065(L,B,h){"use strict";function u(l,e,s="text/plain"){return function g(l,e="data.zip"){const s=document.createElement("a"),v=URL.createObjectURL(l);s.href=v,s.download=e,document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(v)}(new Blob([l],{type:s}),e)}function k(l,e){const s=document.createElement("a");s.style.display="hidden",s.setAttribute("href",window.URL.createObjectURL(l)),s.setAttribute("download",e),document.body.appendChild(s),s.click(),s.remove()}h.d(B,{KE:()=>k,YN:()=>u})},7374(L){L.exports=function(){"use strict";var h=6e4,g=36e5,S="millisecond",u="second",k="minute",D="hour",l="day",e="week",s="month",v="quarter",f="year",M="date",U="Invalid Date",K=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,$=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,j={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(o){var i=["th","st","nd","rd"],t=o%100;return"["+o+(i[(t-20)%10]||i[t]||i[0])+"]"}},_=function(o,i,t){var c=String(o);return!c||c.length>=i?o:""+Array(i+1-c.length).join(t)+o},y={s:_,z:function(o){var i=-o.utcOffset(),t=Math.abs(i),c=Math.floor(t/60),n=t%60;return(i<=0?"+":"-")+_(c,2,"0")+":"+_(n,2,"0")},m:function o(i,t){if(i.date()<t.date())return-o(t,i);var c=12*(t.year()-i.year())+(t.month()-i.month()),n=i.clone().add(c,s),r=t-n<0,a=i.clone().add(c+(r?-1:1),s);return+(-(c+(t-n)/(r?n-a:a-n))||0)},a:function(o){return o<0?Math.ceil(o)||0:Math.floor(o)},p:function(o){return{M:s,y:f,w:e,d:l,D:M,h:D,m:k,s:u,ms:S,Q:v}[o]||String(o||"").toLowerCase().replace(/s$/,"")},u:function(o){return void 0===o}},P="en",E={};E[P]=j;var G="$isDayjsObject",V=function(o){return o instanceof F||!(!o||!o[G])},N=function o(i,t,c){var n;if(!i)return P;if("string"==typeof i){var r=i.toLowerCase();E[r]&&(n=r),t&&(E[r]=t,n=r);var a=i.split("-");if(!n&&a.length>1)return o(a[0])}else{var p=i.name;E[p]=i,n=p}return!c&&n&&(P=n),n||!c&&P},w=function(o,i){if(V(o))return o.clone();var t="object"==typeof i?i:{};return t.date=o,t.args=arguments,new F(t)},d=y;d.l=N,d.i=V,d.w=function(o,i){return w(o,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var F=function(){function o(t){this.$L=N(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[G]=!0}var i=o.prototype;return i.parse=function(t){this.$d=function(c){var n=c.date,r=c.utc;if(null===n)return new Date(NaN);if(d.u(n))return new Date;if(n instanceof Date)return new Date(n);if("string"==typeof n&&!/Z$/i.test(n)){var a=n.match(K);if(a){var p=a[2]-1||0,m=(a[7]||"0").substring(0,3);return r?new Date(Date.UTC(a[1],p,a[3]||1,a[4]||0,a[5]||0,a[6]||0,m)):new Date(a[1],p,a[3]||1,a[4]||0,a[5]||0,a[6]||0,m)}}return new Date(n)}(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return d},i.isValid=function(){return this.$d.toString()!==U},i.isSame=function(t,c){var n=w(t);return this.startOf(c)<=n&&n<=this.endOf(c)},i.isAfter=function(t,c){return w(t)<this.startOf(c)},i.isBefore=function(t,c){return this.endOf(c)<w(t)},i.$g=function(t,c,n){return d.u(t)?this[c]:this.set(n,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,c){var n=this,r=!!d.u(c)||c,a=d.p(t),p=function(R,O){var T=d.w(n.$u?Date.UTC(n.$y,O,R):new Date(n.$y,O,R),n);return r?T:T.endOf(l)},m=function(R,O){return d.w(n.toDate()[R].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(O)),n)},b=this.$W,C=this.$M,x=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case f:return r?p(1,0):p(31,11);case s:return r?p(1,C):p(0,C+1);case e:var W=this.$locale().weekStart||0,z=(b<W?b+7:b)-W;return p(r?x-z:x+(6-z),C);case l:case M:return m(A+"Hours",0);case D:return m(A+"Minutes",1);case k:return m(A+"Seconds",2);case u:return m(A+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,c){var n,r=d.p(t),a="set"+(this.$u?"UTC":""),p=(n={},n[l]=a+"Date",n[M]=a+"Date",n[s]=a+"Month",n[f]=a+"FullYear",n[D]=a+"Hours",n[k]=a+"Minutes",n[u]=a+"Seconds",n[S]=a+"Milliseconds",n)[r],m=r===l?this.$D+(c-this.$W):c;if(r===s||r===f){var b=this.clone().set(M,1);b.$d[p](m),b.init(),this.$d=b.set(M,Math.min(this.$D,b.daysInMonth())).$d}else p&&this.$d[p](m);return this.init(),this},i.set=function(t,c){return this.clone().$set(t,c)},i.get=function(t){return this[d.p(t)]()},i.add=function(t,c){var n,r=this;t=Number(t);var a=d.p(c),p=function(C){var x=w(r);return d.w(x.date(x.date()+Math.round(C*t)),r)};if(a===s)return this.set(s,this.$M+t);if(a===f)return this.set(f,this.$y+t);if(a===l)return p(1);if(a===e)return p(7);var m=(n={},n[k]=h,n[D]=g,n[u]=1e3,n)[a]||1,b=this.$d.getTime()+t*m;return d.w(b,this)},i.subtract=function(t,c){return this.add(-1*t,c)},i.format=function(t){var c=this,n=this.$locale();if(!this.isValid())return n.invalidDate||U;var r=t||"YYYY-MM-DDTHH:mm:ssZ",a=d.z(this),p=this.$H,m=this.$m,b=this.$M,C=n.weekdays,x=n.months,W=function(O,T,I,Y){return O&&(O[T]||O(c,r))||I[T].slice(0,Y)},z=function(O){return d.s(p%12||12,O,"0")},R=n.meridiem||function(O,T,I){var Y=O<12?"AM":"PM";return I?Y.toLowerCase():Y};return r.replace($,function(O,T){return T||function(I){switch(I){case"YY":return String(c.$y).slice(-2);case"YYYY":return d.s(c.$y,4,"0");case"M":return b+1;case"MM":return d.s(b+1,2,"0");case"MMM":return W(n.monthsShort,b,x,3);case"MMMM":return W(x,b);case"D":return c.$D;case"DD":return d.s(c.$D,2,"0");case"d":return String(c.$W);case"dd":return W(n.weekdaysMin,c.$W,C,2);case"ddd":return W(n.weekdaysShort,c.$W,C,3);case"dddd":return C[c.$W];case"H":return String(p);case"HH":return d.s(p,2,"0");case"h":return z(1);case"hh":return z(2);case"a":return R(p,m,!0);case"A":return R(p,m,!1);case"m":return String(m);case"mm":return d.s(m,2,"0");case"s":return String(c.$s);case"ss":return d.s(c.$s,2,"0");case"SSS":return d.s(c.$ms,3,"0");case"Z":return a}return null}(O)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,c,n){var r,a=this,p=d.p(c),m=w(t),b=(m.utcOffset()-this.utcOffset())*h,C=this-m,x=function(){return d.m(a,m)};switch(p){case f:r=x()/12;break;case s:r=x();break;case v:r=x()/3;break;case e:r=(C-b)/6048e5;break;case l:r=(C-b)/864e5;break;case D:r=C/g;break;case k:r=C/h;break;case u:r=C/1e3;break;default:r=C}return n?r:d.a(r)},i.daysInMonth=function(){return this.endOf(s).$D},i.$locale=function(){return E[this.$L]},i.locale=function(t,c){if(!t)return this.$L;var n=this.clone(),r=N(t,c,!0);return r&&(n.$L=r),n},i.clone=function(){return d.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},o}(),H=F.prototype;return w.prototype=H,[["$ms",S],["$s",u],["$m",k],["$H",D],["$W",l],["$M",s],["$y",f],["$D",M]].forEach(function(o){H[o[1]]=function(i){return this.$g(i,o[0],o[1])}}),w.extend=function(o,i){return o.$i||(o(i,F,w),o.$i=!0),w},w.locale=N,w.isDayjs=V,w.unix=function(o){return w(1e3*o)},w.en=E[P],w.Ls=E,w.p={},w}()}}]);
|
package/README.md
CHANGED
|
@@ -12,6 +12,7 @@ Drop them into any HTML page — no build step required.
|
|
|
12
12
|
| `<cue-document-list>` | Lazy document list that fetches metadata from the Cue SDK |
|
|
13
13
|
| `<cue-entity-list>` | Lazy entity list that fetches entity data from the Cue SDK |
|
|
14
14
|
| `<cue-entity-viewer>` | Full entity detail view — info, relationships, documents, and optional map |
|
|
15
|
+
| `<cue-project-list>` | Lists all projects the authenticated user is a member of, with an optional map |
|
|
15
16
|
| `<cue-id-builder>` | Interactive IFC/SPARQL ID builder |
|
|
16
17
|
| `<cue-block-project-documents>` | Project documents content block with charts and statistics |
|
|
17
18
|
|
|
@@ -332,9 +333,69 @@ document.getElementById('viewer-host').appendChild(viewer);
|
|
|
332
333
|
|
|
333
334
|
---
|
|
334
335
|
|
|
335
|
-
##
|
|
336
|
+
## `<cue-project-list>`
|
|
336
337
|
|
|
337
|
-
|
|
338
|
+
Fetches all projects the authenticated user is a member of via `cue.projects.listProjects()` and renders them in a sortable, selectable ag-grid table. Projects that carry a `location` (WKT string) automatically show a **Map** tab alongside the **List** tab. Clicking a row emits the project's UUID.
|
|
339
|
+
|
|
340
|
+
| Property | Type | Required | Description |
|
|
341
|
+
| ------------- | ----------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
342
|
+
| `sdkState` | `{ cue: Cue }` | ✅ | Must include an authenticated `Cue` instance. Projects are fetched via `cue.projects.listProjects()`. |
|
|
343
|
+
| `mapboxToken` | `string` | ❌ | Mapbox access token. When provided, projects that have a `location` value are shown on an interactive map tab. |
|
|
344
|
+
| `variant` | `'none' \| 'default' \| 'primary' \| 'secondary' \| 'accent' \| 'fade'` | ❌ | Card styling variant. `'none'` (default) renders with no card border/background. Other values apply the named card style. |
|
|
345
|
+
|
|
346
|
+
> **Mapbox token** — the map tab only appears when at least one project has a `location` field **and** a `mapboxToken` is supplied. Without a token the component always shows the list-only view. Obtain a token from [mapbox.com](https://www.mapbox.com/).
|
|
347
|
+
|
|
348
|
+
The component emits one event:
|
|
349
|
+
|
|
350
|
+
| Event | Payload | Description |
|
|
351
|
+
| ----------------- | -------- | -------------------------------------------------------- |
|
|
352
|
+
| `projectSelected` | `string` | UUID of the project the user clicked in the list or map. |
|
|
353
|
+
|
|
354
|
+
```js
|
|
355
|
+
await customElements.whenDefined('cue-project-list');
|
|
356
|
+
|
|
357
|
+
const list = document.createElement('cue-project-list');
|
|
358
|
+
|
|
359
|
+
// sdkState must be set as a JS property — not an HTML attribute
|
|
360
|
+
list.sdkState = { cue };
|
|
361
|
+
|
|
362
|
+
// Optional: show projects on a map when they have a location
|
|
363
|
+
list.mapboxToken = 'pk.eyJ1…';
|
|
364
|
+
|
|
365
|
+
// Optional: apply a card style ('none' | 'default' | 'primary' | 'secondary' | 'accent' | 'fade')
|
|
366
|
+
list.variant = 'primary';
|
|
367
|
+
|
|
368
|
+
list.addEventListener('projectSelected', (e) => {
|
|
369
|
+
console.log('Selected project UUID:', e.detail);
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
document.getElementById('list-host').appendChild(list);
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Static placement is also supported — `sdkState` must still be set via JavaScript:
|
|
376
|
+
|
|
377
|
+
```html
|
|
378
|
+
<cue-project-list id="projects" variant="primary"></cue-project-list>
|
|
379
|
+
|
|
380
|
+
<script type="module">
|
|
381
|
+
import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
|
|
382
|
+
|
|
383
|
+
const cue = new Cue();
|
|
384
|
+
await cue.auth.signIn('google');
|
|
385
|
+
|
|
386
|
+
const list = document.getElementById('projects');
|
|
387
|
+
list.sdkState = { cue };
|
|
388
|
+
list.addEventListener('projectSelected', (e) => console.log(e.detail));
|
|
389
|
+
</script>
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
> **Loader** — add `cue-project-list` to `data-components` if you create it dynamically; otherwise it is detected automatically. See [CDN quickstart](#cdn-quickstart).
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
## `<cue-entity-viewer>`
|
|
397
|
+
|
|
398
|
+
The `cue-document-viewer`, `cue-document-list`, `cue-entity-list`, `cue-entity-viewer`, and `cue-project-list` components require an authenticated [`Cue`](https://www.npmjs.com/package/@qaecy/cue-sdk) instance. The SDK handles authentication and all data fetching — the components never make direct network calls.
|
|
338
399
|
|
|
339
400
|
```js
|
|
340
401
|
import { Cue } from 'https://cdn.jsdelivr.net/npm/@qaecy/cue-sdk/dist/index.esm.js';
|
package/common.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[76],{2014(b,m,a){a.d(m,{z:()=>u});var s=a(7705),h=a(2271),n=a(5547);const l=["*"];let u=(()=>{class t{justify=(0,s.hFB)("start");size=(0,s.hFB)("l");widthStyle=(0,h.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(e){return new(e||t)};static \u0275cmp=n.VBU({type:t,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:l,decls:2,vars:4,template:function(e,o){1&e&&(n.NAR(),n.rj2(0,"div"),n.SdG(1),n.eux()),2&e&&n.xc7("justify-content",o.justify())("min-width",o.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return t})()},6034(b,m,a){a.d(m,{y:()=>f});var s=a(7705),h=a(7598),n=a(9769),l=a(5187),u=a(2271),t=a(5547);const v=["*"];let _=(()=>{class c{style=(0,s.hFB)("");gap=(0,s.hFB)("m");columns=(0,s.hFB)(1);getStyles=(0,u.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(y){return new(y||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(y,g){2&y&&t.Aen(g.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:v,decls:1,vars:0,template:function(y,g){1&y&&(t.NAR(),t.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return c})();var e=a(2245),o=a(5381),i=a(29);const r=["*"];function p(c,C){if(1&c&&(t.j41(0,"cue-typography",2),t.EFF(1),t.k0s()),2&c){const M=t.XpG();t.R7$(),t.SpI(" ",M.label()," ")}}let f=(()=>{class c{label=(0,s.hFB)("");variant=(0,s.hFB)("default");shadow=(0,s.hFB)(!1);padded=(0,s.hFB)(!0);showCloseBtn=(0,s.hFB)(!0);position=(0,s.hFB)("top-left");clickedClose=(0,s.CGW)();margin=(0,s.hFB)("0.5rem");close(M){M.stopPropagation(),M.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(y){return new(y||c)};static \u0275cmp=t.VBU({type:c,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:r,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(y,g){1&y&&(t.NAR(),t.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),t.nVh(4,p,2,1,"cue-typography",2),t.nrm(5,"span",3),t.j41(6,"cue-svg-icon",4),t.bIt("click",function(D){return g.close(D)}),t.k0s()(),t.SdG(7),t.k0s()()()),2&y&&(t.xc7("top","top-left"===g.position()||"top-right"===g.position()?g.margin():"null")("bottom","bottom-left"===g.position()||"bottom-right"===g.position()?g.margin():"null")("left","top-left"===g.position()||"bottom-left"===g.position()?g.margin():"null")("right","top-right"===g.position()||"bottom-right"===g.position()?g.margin():"null"),t.Y8G("variant",g.variant())("shadow",g.shadow())("padded",g.padded()),t.R7$(3),t.xc7("padding",g.padded()?"0":"10px"),t.R7$(),t.vxM(g.label()&&"undefined"!==g.label()?4:-1))},dependencies:[n.MD,l.Z,_,e.Typography,o.n,i.A,h.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content}"]})}return c})()},9134(b,m,a){a.d(m,{v:()=>u});var s=a(7705),h=a(6034),n=a(7517),l=a(5547);let u=(()=>{class t{title=(0,s.hFB)("Legend");layers=(0,s.hFB)([]);position=(0,s.hFB)("top-left");close=(0,s.CGW)();visibilityChange=(0,s.CGW)();layerChange=(0,s.CGW)();visibilityAll=(0,s.CGW)();static \u0275fac=function(e){return new(e||t)};static \u0275cmp=l.VBU({type:t,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(e,o){1&e&&(l.j41(0,"cue-draggable-card",0),l.bIt("clickedClose",function(){return o.close.emit()}),l.j41(1,"div",1)(2,"cue-layer-legend",2),l.bIt("visibilityAll",function(r){return o.visibilityAll.emit(r)})("layerChange",function(r){return o.layerChange.emit(r)})("visibilityChange",function(r){return o.visibilityChange.emit(r)}),l.k0s()()()),2&e&&(l.Y8G("label",o.title())("padded",!1)("position",o.position()),l.R7$(2),l.Y8G("layers",o.layers()))},dependencies:[h.y,n.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return t})()},4613(b,m,a){a.d(m,{Logo:()=>t});var s=a(7705),h=a(5802),n=a(5547),l=a(2271),u=a(6170);let t=(()=>{class v{size=(0,s.hFB)("m");sizeMap={xs:"40px",s:"80px",m:"160px",l:"222px"};active=(0,s.hFB)(!0,{transform:s.L39});continuous=(0,s.hFB)(!1,{transform:s.L39});mode=(0,s.hFB)("default");isDarkMode=(0,s.geq)(!1);handleDarkModeChange(e){this.isDarkMode.set(e),-1===this.raf&&this.animate()}colorA=(0,l.EW)(()=>this.isDarkMode()?[221,246,18]:[18,28,43]);colorB=[0,202,204];paths=[];raf=-1;appearTime=0;disappearTime=0;tip=0;toe=0;mix=[0,0,0];norm=0;animate=e=>{if(void 0!==e){const o=5e-4*(e-this.appearTime);"glow"===this.mode()?this.tip=o%1:(this.tip=Math.min(1,o),this.active()||(this.toe=Math.min(1,6e-4*(e-this.disappearTime))))}if("glow"===this.mode()){const o=.06666666666666667,i=this.rgbToSvg(this.colorA());return this.paths.forEach((r,p)=>{this.norm=1/this.paths.length*p;let d=this.tip-this.norm;if(d<-(1-o)&&(d+=1),d>=0&&d<o){const f=1-d/o;r.setAttribute("stroke",this.rgbToSvg(this.colorB)),r.setAttribute("stroke-opacity",f.toFixed(3))}else r.setAttribute("stroke",i),r.setAttribute("stroke-opacity","0.005")}),void(this.raf=requestAnimationFrame(this.animate))}if(this.paths.forEach((o,i)=>{this.norm=1/this.paths.length*i,this.mix=this.mixRgb(this.colorA(),this.colorB,Math.max(0,Math.min(1,15*(this.tip-this.norm)))),o.setAttribute("stroke",this.tip*this.paths.length>i&&(this.active()||this.toe*this.paths.length<i)?this.rgbToSvg(this.mix):"transparent")}),this.tip>=1&&(this.active()||this.toe>=1))return this.continuous()?void setTimeout(()=>{this.appearTime=performance.now(),this.tip=0,this.toe=0,this.raf=requestAnimationFrame(this.animate)},500):void(this.raf=-1);this.raf=requestAnimationFrame(this.animate)};activate(){this.appearTime=performance.now(),this.animate(this.appearTime)}deactivate(){this.disappearTime=performance.now(),-1===this.raf&&this.animate(this.disappearTime)}mixChannel(e,o,i){return parseInt((e*i+o*(1-i)).toFixed())}mixRgb(e,o,i){return[this.mixChannel(e[0],o[0],i),this.mixChannel(e[1],o[1],i),this.mixChannel(e[2],o[2],i)]}rgbToSvg(e){return`rgb(${e[0]},${e[1]},${e[2]})`}constructor(){(0,h.QZP)(()=>{"glow"===this.mode()||this.active()?this.activate():this.deactivate()}),(0,h.QZP)(()=>{this.isDarkMode(),this.animate()});const e=(0,h.WQX)(n.aKT);(0,n.mal)({read:()=>{if(this.paths.length)return;const o=e.nativeElement.querySelector("svg"),i=e.nativeElement.querySelector("#original-path");if(!i)return;const r=i.getTotalLength(),d=[];for(let f=0;f<400;f++){const c=i.getPointAtLength(r/400*f);d.push({x:parseFloat(c.x.toFixed(2)),y:parseFloat(c.y.toFixed(2))})}d.push(i.getPointAtLength(r)),d.reverse(),d.forEach((f,c)=>{if(0===c||1===c)return;const C=document.createElementNS("http://www.w3.org/2000/svg","path");C.setAttribute("d",`M${d[c-2].x},${d[c-2].y}L${d[c-1].x},${d[c-1].y}L${f.x},${f.y}`),C.setAttribute("fill","none"),C.setAttribute("stroke","transparent"),C.setAttribute("stroke-width",i?.getAttribute("stroke-width")||"1"),C.setAttribute("stroke-miterlimit",i?.getAttribute("stroke-miterlimit")||"1"),o.appendChild(C),this.paths.push(C)})}})}ngOnDestroy(){this.paths=[],cancelAnimationFrame(this.raf),this.raf=-1}static \u0275fac=function(o){return new(o||v)};static \u0275cmp=n.VBU({type:v,selectors:[["cue-logo"]],hostVars:2,hostBindings:function(o,i){2&o&&n.xc7("width",i.sizeMap[i.size()])},inputs:{size:[1,"size"],active:[1,"active"],continuous:[1,"continuous"],mode:[1,"mode"],isDarkMode:[1,"isDarkMode"]},outputs:{isDarkMode:"isDarkModeChange"},decls:2,vars:0,consts:[["cueDarkMode","","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 221.545 86.191","width","222","height","86","overflow","visible",3,"darkModeChange"],["id","original-path","fill","none","stroke","transparent","stroke-miterlimit","10","stroke-width","12","d","M216.046 56.638s-10.561 24.201-36.192 22.991c-25.631-1.21-22.771-24.751-20.351-37.622 2.42-12.871 10.451-20.351 16.831-18.041 6.283 2.275 8.03 9.68 2.09 21.891-5.94 12.211-21.341 37.567-35.862 33.992-12.413-3.056-13.281-23.162-13.281-23.162V29.762v26.925c0 14.471-12.47 23.212-24.672 23.212s-24.672-8.301-24.672-23.212V29.829l-.006.105v13.031c0 20.416-16.55 36.966-36.966 36.966S6 63.381 6 42.966 22.55 6 42.966 6c6.91 0 13.377 1.896 18.91 5.196"]],template:function(o,i){1&o&&(h.qSk(),n.j41(0,"svg",0),n.bIt("darkModeChange",function(p){return i.handleDarkModeChange(p)}),n.nrm(1,"path",1),n.k0s())},dependencies:[u.R],styles:["[_nghost-%COMP%]{display:block}svg[_ngcontent-%COMP%]{flex:1;display:block;width:100%;height:auto}"]})}return v})()},7851(b,m,a){a.d(m,{k:()=>_});var s=a(7705),h=a(5802),n=a(5547),l=a(4613),u=a(2245);function t(e,o){if(1&e&&(n.j41(0,"cue-typography",1),n.EFF(1),n.k0s()),2&e){const i=n.XpG();n.R7$(),n.JRh(i.message)}}let v=(()=>{class e{message="";static \u0275fac=function(r){return new(r||e)};static \u0275cmp=n.VBU({type:e,selectors:[["cue-logo-loader-overlay"]],decls:2,vars:1,consts:[["size","m","mode","glow"],["size","s",1,"message"]],template:function(r,p){1&r&&(n.nrm(0,"cue-logo",0),n.nVh(1,t,2,1,"cue-typography",1)),2&r&&(n.R7$(),n.vxM(p.message?1:-1))},dependencies:[l.Logo,u.Typography],styles:["[_nghost-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;z-index:1000}.message[_ngcontent-%COMP%]{color:var(--color-text-secondary)}"],changeDetection:0})}return e})(),_=(()=>{class e{cueLogoLoader=(0,s.hFB)(!1);cueLogoLoaderMessage=(0,s.hFB)("");el=(0,h.WQX)(n.aKT);appRef=(0,h.WQX)(n.o8S);envInjector=(0,h.WQX)(h.uvJ);renderer=(0,h.WQX)(n.sFG);overlayRef;constructor(){(0,h.QZP)(()=>{const i=this.cueLogoLoader(),r=this.cueLogoLoaderMessage();i?(this.overlayRef||this.createOverlay(),this.overlayRef&&(this.overlayRef.instance.message=r,this.overlayRef.changeDetectorRef.markForCheck())):this.destroyOverlay()})}createOverlay(){this.overlayRef=(0,s.a0P)(v,{environmentInjector:this.envInjector}),this.appRef.attachView(this.overlayRef.hostView),this.renderer.appendChild(this.el.nativeElement,this.overlayRef.hostView.rootNodes[0])}destroyOverlay(){this.overlayRef&&(this.appRef.detachView(this.overlayRef.hostView),this.overlayRef.destroy(),this.overlayRef=void 0)}ngOnDestroy(){this.destroyOverlay()}static \u0275fac=function(r){return new(r||e)};static \u0275dir=n.FsC({type:e,selectors:[["","cueLogoLoader",""]],hostVars:2,hostBindings:function(r,p){2&r&&n.xc7("position","relative")},inputs:{cueLogoLoader:[1,"cueLogoLoader"],cueLogoLoaderMessage:[1,"cueLogoLoaderMessage"]}})}return e})()},7106(b,m,a){function s(h,n){this.v=h,this.k=n}a.d(m,{A:()=>s})},600(b,m,a){a.d(m,{A:()=>h});var s=a(7106);function h(l){return function(){return new n(l.apply(this,arguments))}}function n(l){var u,t;function v(e,o){try{var i=l[e](o),r=i.value,p=r instanceof s.A;Promise.resolve(p?r.v:r).then(function(d){if(p){var f="return"===e?"return":"next";if(!r.k||d.done)return v(f,d);d=l[f](d).value}_(i.done?"return":"normal",d)},function(d){v("throw",d)})}catch(d){_("throw",d)}}function _(e,o){switch(e){case"return":u.resolve({value:o,done:!0});break;case"throw":u.reject(o);break;default:u.resolve({value:o,done:!1})}(u=u.next)?v(u.key,u.arg):t=null}this._invoke=function(e,o){return new Promise(function(i,r){var p={key:e,arg:o,resolve:i,reject:r,next:null};t?t=t.next=p:(u=t=p,v(e,o))})},"function"!=typeof l.return&&(this.return=void 0)}n.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},n.prototype.next=function(l){return this._invoke("next",l)},n.prototype.throw=function(l){return this._invoke("throw",l)},n.prototype.return=function(l){return this._invoke("return",l)}}}]);
|
|
1
|
+
"use strict";(self.webpackChunkcue_ui=self.webpackChunkcue_ui||[]).push([[76],{2014(b,f,s){s.d(f,{z:()=>m});var a=s(7705),u=s(2271),i=s(5547);const d=["*"];let m=(()=>{class o{justify=(0,a.hFB)("start");size=(0,a.hFB)("l");widthStyle=(0,u.EW)(()=>`var(--cue-button-label-padding-${this.size()}-x)`);static \u0275fac=function(e){return new(e||o)};static \u0275cmp=i.VBU({type:o,selectors:[["cue-button-padder"]],inputs:{justify:[1,"justify"],size:[1,"size"]},ngContentSelectors:d,decls:2,vars:4,template:function(e,n){1&e&&(i.NAR(),i.rj2(0,"div"),i.SdG(1),i.eux()),2&e&&i.xc7("justify-content",n.justify())("min-width",n.widthStyle())},styles:["div[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1px}"]})}return o})()},6034(b,f,s){s.d(f,{y:()=>h});var a=s(7705),u=s(7598),i=s(9769),d=s(5187),m=s(2271),o=s(5547);const v=["*"];let _=(()=>{class c{style=(0,a.hFB)("");gap=(0,a.hFB)("m");columns=(0,a.hFB)(1);getStyles=(0,m.EW)(()=>`\n grid-template-columns: repeat(${this.columns()}, minmax(0, 1fr));\n gap: var(--cue-grid-gap-${this.gap()});\n ${this.style()}\n `);static \u0275fac=function(y){return new(y||c)};static \u0275cmp=o.VBU({type:c,selectors:[["cue-grid"]],hostVars:2,hostBindings:function(y,p){2&y&&o.Aen(p.getStyles())},inputs:{style:[1,"style"],gap:[1,"gap"],columns:[1,"columns"]},ngContentSelectors:v,decls:1,vars:0,template:function(y,p){1&y&&(o.NAR(),o.SdG(0))},styles:["[_nghost-%COMP%]{display:grid}"]})}return c})();var e=s(2245),n=s(5381),t=s(29);const r=["*"];function g(c,D){if(1&c&&(o.j41(0,"cue-typography",2),o.EFF(1),o.k0s()),2&c){const M=o.XpG();o.R7$(),o.SpI(" ",M.label()," ")}}let h=(()=>{class c{label=(0,a.hFB)("");variant=(0,a.hFB)("default");shadow=(0,a.hFB)(!1);padded=(0,a.hFB)(!0);showCloseBtn=(0,a.hFB)(!0);position=(0,a.hFB)("top-left");clickedClose=(0,a.CGW)();margin=(0,a.hFB)("0.5rem");close(M){M.stopPropagation(),M.stopImmediatePropagation(),this.clickedClose.emit()}static \u0275fac=function(y){return new(y||c)};static \u0275cmp=o.VBU({type:c,selectors:[["cue-draggable-card"]],inputs:{label:[1,"label"],variant:[1,"variant"],shadow:[1,"shadow"],padded:[1,"padded"],showCloseBtn:[1,"showCloseBtn"],position:[1,"position"],margin:[1,"margin"]},outputs:{clickedClose:"clickedClose"},ngContentSelectors:r,decls:8,vars:14,consts:[["cdkDrag","",1,"panel",3,"variant","shadow","padded"],["justify","end"],["size","l"],[2,"width","100%"],["name","close",2,"cursor","pointer",3,"click"]],template:function(y,p){1&y&&(o.NAR(),o.j41(0,"cue-card",0)(1,"cue-typography")(2,"cue-grid")(3,"cue-flexcontainer",1),o.nVh(4,g,2,1,"cue-typography",2),o.nrm(5,"span",3),o.j41(6,"cue-svg-icon",4),o.bIt("click",function(C){return p.close(C)}),o.k0s()(),o.SdG(7),o.k0s()()()),2&y&&(o.xc7("top","top-left"===p.position()||"top-right"===p.position()?p.margin():"null")("bottom","bottom-left"===p.position()||"bottom-right"===p.position()?p.margin():"null")("left","top-left"===p.position()||"bottom-left"===p.position()?p.margin():"null")("right","top-right"===p.position()||"bottom-right"===p.position()?p.margin():"null"),o.Y8G("variant",p.variant())("shadow",p.shadow())("padded",p.padded()),o.R7$(3),o.xc7("padding",p.padded()?"0":"10px"),o.R7$(),o.vxM(p.label()&&"undefined"!==p.label()?4:-1))},dependencies:[i.MD,d.Z,_,e.Typography,n.n,t.A,u.T1],styles:[".panel[_ngcontent-%COMP%]{position:absolute;width:fit-content}"]})}return c})()},9134(b,f,s){s.d(f,{v:()=>m});var a=s(7705),u=s(6034),i=s(7517),d=s(5547);let m=(()=>{class o{title=(0,a.hFB)("Legend");layers=(0,a.hFB)([]);position=(0,a.hFB)("top-left");close=(0,a.CGW)();visibilityChange=(0,a.CGW)();layerChange=(0,a.CGW)();visibilityAll=(0,a.CGW)();static \u0275fac=function(e){return new(e||o)};static \u0275cmp=d.VBU({type:o,selectors:[["cue-color-legend-panel"]],inputs:{title:[1,"title"],layers:[1,"layers"],position:[1,"position"]},outputs:{close:"close",visibilityChange:"visibilityChange",layerChange:"layerChange",visibilityAll:"visibilityAll"},decls:3,vars:4,consts:[[3,"clickedClose","label","padded","position"],[1,"content"],[3,"visibilityAll","layerChange","visibilityChange","layers"]],template:function(e,n){1&e&&(d.j41(0,"cue-draggable-card",0),d.bIt("clickedClose",function(){return n.close.emit()}),d.j41(1,"div",1)(2,"cue-layer-legend",2),d.bIt("visibilityAll",function(r){return n.visibilityAll.emit(r)})("layerChange",function(r){return n.layerChange.emit(r)})("visibilityChange",function(r){return n.visibilityChange.emit(r)}),d.k0s()()()),2&e&&(d.Y8G("label",n.title())("padded",!1)("position",n.position()),d.R7$(2),d.Y8G("layers",n.layers()))},dependencies:[u.y,i.P],styles:[".content[_ngcontent-%COMP%]{padding-left:10px;padding-right:10px;margin-bottom:30px;font-size:.8em;max-height:200px;max-width:180px;overflow:auto}"]})}return o})()},4613(b,f,s){s.d(f,{Logo:()=>o});var a=s(7705),u=s(5802),i=s(5547),d=s(2271),m=s(6170);let o=(()=>{class v{size=(0,a.hFB)("m");sizeMap={xs:"40px",s:"80px",m:"160px",l:"222px"};active=(0,a.hFB)(!0,{transform:a.L39});continuous=(0,a.hFB)(!1,{transform:a.L39});mode=(0,a.hFB)("default");isDarkMode=(0,a.geq)(!1);handleDarkModeChange(e){this.isDarkMode.set(e),-1===this.raf&&this.animate()}colorA=(0,d.EW)(()=>this.isDarkMode()?[221,246,18]:[18,28,43]);colorB=[0,202,204];paths=[];raf=-1;appearTime=0;disappearTime=0;tip=0;toe=0;mix=[0,0,0];norm=0;animate=e=>{if(void 0!==e){const n=5e-4*(e-this.appearTime);"glow"===this.mode()?this.tip=n%1:(this.tip=Math.min(1,n),this.active()||(this.toe=Math.min(1,6e-4*(e-this.disappearTime))))}if("glow"===this.mode()){const n=.06666666666666667,t=this.rgbToSvg(this.colorA());return this.paths.forEach((r,g)=>{this.norm=1/this.paths.length*g;let l=this.tip-this.norm;if(l<-(1-n)&&(l+=1),l>=0&&l<n){const h=1-l/n;r.setAttribute("stroke",this.rgbToSvg(this.colorB)),r.setAttribute("stroke-opacity",h.toFixed(3))}else r.setAttribute("stroke",t),r.setAttribute("stroke-opacity","0.005")}),void(this.raf=requestAnimationFrame(this.animate))}if(this.paths.forEach((n,t)=>{this.norm=1/this.paths.length*t,this.mix=this.mixRgb(this.colorA(),this.colorB,Math.max(0,Math.min(1,15*(this.tip-this.norm)))),n.setAttribute("stroke",this.tip*this.paths.length>t&&(this.active()||this.toe*this.paths.length<t)?this.rgbToSvg(this.mix):"transparent")}),this.tip>=1&&(this.active()||this.toe>=1))return this.continuous()?void setTimeout(()=>{this.appearTime=performance.now(),this.tip=0,this.toe=0,this.raf=requestAnimationFrame(this.animate)},500):void(this.raf=-1);this.raf=requestAnimationFrame(this.animate)};activate(){this.appearTime=performance.now(),this.animate(this.appearTime)}deactivate(){this.disappearTime=performance.now(),-1===this.raf&&this.animate(this.disappearTime)}mixChannel(e,n,t){return parseInt((e*t+n*(1-t)).toFixed())}mixRgb(e,n,t){return[this.mixChannel(e[0],n[0],t),this.mixChannel(e[1],n[1],t),this.mixChannel(e[2],n[2],t)]}rgbToSvg(e){return`rgb(${e[0]},${e[1]},${e[2]})`}constructor(){(0,u.QZP)(()=>{"glow"===this.mode()||this.active()?this.activate():this.deactivate()}),(0,u.QZP)(()=>{this.isDarkMode(),this.animate()});const e=(0,u.WQX)(i.aKT);(0,i.mal)({read:()=>{if(this.paths.length)return;const n=e.nativeElement.querySelector("svg"),t=e.nativeElement.querySelector("#original-path");if(!t)return;const r=t.getTotalLength(),l=[];for(let h=0;h<400;h++){const c=t.getPointAtLength(r/400*h);l.push({x:parseFloat(c.x.toFixed(2)),y:parseFloat(c.y.toFixed(2))})}l.push(t.getPointAtLength(r)),l.reverse(),l.forEach((h,c)=>{if(0===c||1===c)return;const D=document.createElementNS("http://www.w3.org/2000/svg","path");D.setAttribute("d",`M${l[c-2].x},${l[c-2].y}L${l[c-1].x},${l[c-1].y}L${h.x},${h.y}`),D.setAttribute("fill","none"),D.setAttribute("stroke","transparent"),D.setAttribute("stroke-width",t?.getAttribute("stroke-width")||"1"),D.setAttribute("stroke-miterlimit",t?.getAttribute("stroke-miterlimit")||"1"),n.appendChild(D),this.paths.push(D)})}})}ngOnDestroy(){this.paths=[],cancelAnimationFrame(this.raf),this.raf=-1}static \u0275fac=function(n){return new(n||v)};static \u0275cmp=i.VBU({type:v,selectors:[["cue-logo"]],hostVars:2,hostBindings:function(n,t){2&n&&i.xc7("width",t.sizeMap[t.size()])},inputs:{size:[1,"size"],active:[1,"active"],continuous:[1,"continuous"],mode:[1,"mode"],isDarkMode:[1,"isDarkMode"]},outputs:{isDarkMode:"isDarkModeChange"},decls:2,vars:0,consts:[["cueDarkMode","","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 221.545 86.191","width","222","height","86","overflow","visible",3,"darkModeChange"],["id","original-path","fill","none","stroke","transparent","stroke-miterlimit","10","stroke-width","12","d","M216.046 56.638s-10.561 24.201-36.192 22.991c-25.631-1.21-22.771-24.751-20.351-37.622 2.42-12.871 10.451-20.351 16.831-18.041 6.283 2.275 8.03 9.68 2.09 21.891-5.94 12.211-21.341 37.567-35.862 33.992-12.413-3.056-13.281-23.162-13.281-23.162V29.762v26.925c0 14.471-12.47 23.212-24.672 23.212s-24.672-8.301-24.672-23.212V29.829l-.006.105v13.031c0 20.416-16.55 36.966-36.966 36.966S6 63.381 6 42.966 22.55 6 42.966 6c6.91 0 13.377 1.896 18.91 5.196"]],template:function(n,t){1&n&&(u.qSk(),i.j41(0,"svg",0),i.bIt("darkModeChange",function(g){return t.handleDarkModeChange(g)}),i.nrm(1,"path",1),i.k0s())},dependencies:[m.R],styles:["[_nghost-%COMP%]{display:block}svg[_ngcontent-%COMP%]{flex:1;display:block;width:100%;height:auto}"]})}return v})()},6103(b,f,s){s.d(f,{N:()=>d});var a=s(2306),u=s(140),i=s(58);function d({entityData:m,availableEntityRelationships:o}){const v=g=>o.find(l=>l.iri===g)?.label??g.split("#").pop()??g,_=[],e={};for(const[g,l]of Object.entries(m)){for(const h of l.directMapGeometries??[])_.push({iri:g,wkt:h.wkt});for(const h of l.indirectMapGeometries??[]){e[h.rel]||(e[h.rel]=[]);for(const c of h.geometries)e[h.rel].push({iri:h.entityUUID,wkt:c.wkt})}}const n=(g,l,h)=>{if(!l.length)return null;const c=new a.ux(g,g);return c.category=h,c.collection=new u.o(l.flatMap(({iri:D,wkt:M})=>{const y=(0,i.S)(M);return y?[{type:"Feature",geometry:(0,i.n)(y),properties:{iri:D}}]:[]})),c},t=[],r=n("direct",_,"Direct");r&&t.push(r);for(const[g,l]of Object.entries(e)){const h=v(g),c=n(h,l,h);c&&t.push(c)}return t}},7851(b,f,s){s.d(f,{k:()=>_});var a=s(7705),u=s(5802),i=s(5547),d=s(4613),m=s(2245);function o(e,n){if(1&e&&(i.j41(0,"cue-typography",1),i.EFF(1),i.k0s()),2&e){const t=i.XpG();i.R7$(),i.JRh(t.message)}}let v=(()=>{class e{message="";static \u0275fac=function(r){return new(r||e)};static \u0275cmp=i.VBU({type:e,selectors:[["cue-logo-loader-overlay"]],decls:2,vars:1,consts:[["size","m","mode","glow"],["size","s",1,"message"]],template:function(r,g){1&r&&(i.nrm(0,"cue-logo",0),i.nVh(1,o,2,1,"cue-typography",1)),2&r&&(i.R7$(),i.vxM(g.message?1:-1))},dependencies:[d.Logo,m.Typography],styles:["[_nghost-%COMP%]{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;z-index:1000}.message[_ngcontent-%COMP%]{color:var(--color-text-secondary)}"],changeDetection:0})}return e})(),_=(()=>{class e{cueLogoLoader=(0,a.hFB)(!1);cueLogoLoaderMessage=(0,a.hFB)("");el=(0,u.WQX)(i.aKT);appRef=(0,u.WQX)(i.o8S);envInjector=(0,u.WQX)(u.uvJ);renderer=(0,u.WQX)(i.sFG);overlayRef;constructor(){(0,u.QZP)(()=>{const t=this.cueLogoLoader(),r=this.cueLogoLoaderMessage();t?(this.overlayRef||this.createOverlay(),this.overlayRef&&(this.overlayRef.instance.message=r,this.overlayRef.changeDetectorRef.markForCheck())):this.destroyOverlay()})}createOverlay(){this.overlayRef=(0,a.a0P)(v,{environmentInjector:this.envInjector}),this.appRef.attachView(this.overlayRef.hostView),this.renderer.appendChild(this.el.nativeElement,this.overlayRef.hostView.rootNodes[0])}destroyOverlay(){this.overlayRef&&(this.appRef.detachView(this.overlayRef.hostView),this.overlayRef.destroy(),this.overlayRef=void 0)}ngOnDestroy(){this.destroyOverlay()}static \u0275fac=function(r){return new(r||e)};static \u0275dir=i.FsC({type:e,selectors:[["","cueLogoLoader",""]],hostVars:2,hostBindings:function(r,g){2&r&&i.xc7("position","relative")},inputs:{cueLogoLoader:[1,"cueLogoLoader"],cueLogoLoaderMessage:[1,"cueLogoLoaderMessage"]}})}return e})()},7106(b,f,s){function a(u,i){this.v=u,this.k=i}s.d(f,{A:()=>a})},600(b,f,s){s.d(f,{A:()=>u});var a=s(7106);function u(d){return function(){return new i(d.apply(this,arguments))}}function i(d){var m,o;function v(e,n){try{var t=d[e](n),r=t.value,g=r instanceof a.A;Promise.resolve(g?r.v:r).then(function(l){if(g){var h="return"===e?"return":"next";if(!r.k||l.done)return v(h,l);l=d[h](l).value}_(t.done?"return":"normal",l)},function(l){v("throw",l)})}catch(l){_("throw",l)}}function _(e,n){switch(e){case"return":m.resolve({value:n,done:!0});break;case"throw":m.reject(n);break;default:m.resolve({value:n,done:!1})}(m=m.next)?v(m.key,m.arg):o=null}this._invoke=function(e,n){return new Promise(function(t,r){var g={key:e,arg:n,resolve:t,reject:r,next:null};o?o=o.next=g:(m=o=g,v(e,n))})},"function"!=typeof d.return&&(this.return=void 0)}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(d){return this._invoke("next",d)},i.prototype.throw=function(d){return this._invoke("throw",d)},i.prototype.return=function(d){return this._invoke("return",d)}}}]);
|