riskscape-plugins 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/riskscape-map.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--rs-primary-color: #2563eb;--rs-secondary-color: #f8fafc;--rs-text-color: #1f2937;--rs-muted-color: #6b7280;--rs-border-color: #e5e7eb;--rs-error-color: #dc2626;--rs-success-color: #16a34a;--rs-hover-bg: #f9fafb;--rs-selected-bg: #eff6ff;--rs-selected-border-color: #dbeafe;--rs-font-family: inherit;--rs-font-size-base: .875rem;--rs-font-size-small: .75rem;--rs-font-weight-normal: 400;--rs-font-weight-medium: 500;--rs-font-weight-semibold: 600;--rs-line-height-base: 1.5;--rs-border-radius: 8px;--rs-border-radius-small: 4px;--rs-shadow-light: 0 4px 10px rgba(0, 0, 0, .1);--rs-shadow-medium: 0 10px 25px rgba(0, 0, 0, .15);--rs-z-index-dropdown: 10000;--rs-transition-fast: .15s ease;--rs-transition-medium: .2s ease}:root{--rs-unit-selector-primary-color: var(--rs-primary-color);--rs-unit-selector-text-color: var(--rs-text-color);--rs-unit-selector-text-muted: var(--rs-muted-color);--rs-unit-selector-border-color: var(--rs-border-color);--rs-unit-selector-bg-color: #ffffff;--rs-unit-selector-bg-selected: var(--rs-selected-bg);--rs-unit-selector-bg-hover: var(--rs-hover-bg);--rs-unit-selector-shadow: var(--rs-shadow-medium)}.rs-unit-selector-input:focus{border-color:var(--rs-unit-selector-primary-color)}.rs-unit-selector-container{background:var(--rs-unit-selector-bg-color);box-shadow:var(--rs-unit-selector-shadow)}.rs-unit-selector-header,.rs-unit-selector-input{border-color:var(--rs-unit-selector-border-color)}.rs-unit-selector-item--selected{background-color:var(--rs-unit-selector-bg-selected)}.rs-unit-selector-item:hover{background-color:var(--rs-unit-selector-bg-hover)}.rs-unit-selector-unit-number{color:var(--rs-unit-selector-text-color)}.rs-unit-selector-no-results{color:var(--rs-unit-selector-text-muted)}@-webkit-keyframes leaflet-gestures-fadein{0%{opacity:0}to{opacity:1}}@keyframes leaflet-gestures-fadein{0%{opacity:0}to{opacity:1}}.leaflet-container:after{-webkit-animation:leaflet-gestures-fadein .8s backwards;animation:leaflet-gestures-fadein .8s backwards;color:#fff;font-family:Roboto,Arial,sans-serif;font-size:22px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:15px;position:absolute;top:0;left:0;right:0;bottom:0;background:#00000080;z-index:461;pointer-events:none}.leaflet-gesture-handling-touch-warning:after,.leaflet-gesture-handling-scroll-warning:after{-webkit-animation:leaflet-gestures-fadein .8s forwards;animation:leaflet-gestures-fadein .8s forwards}.leaflet-gesture-handling-touch-warning:after{content:attr(data-gesture-handling-touch-content)}.leaflet-gesture-handling-scroll-warning:after{content:attr(data-gesture-handling-scroll-content)}.rs-map-container{z-index:1;width:100%;height:100%;position:relative}.rs-map-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;z-index:1000;cursor:wait;display:flex;justify-content:center;align-items:center}
|
|
1
|
+
.leaflet-pane,.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-tile-container,.leaflet-pane>svg,.leaflet-pane>canvas,.leaflet-zoom-box,.leaflet-image-layer,.leaflet-layer{position:absolute;left:0;top:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:transparent}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon,.leaflet-marker-shadow{display:block}.leaflet-container .leaflet-overlay-pane svg{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img,.leaflet-container .leaflet-shadow-pane img,.leaflet-container .leaflet-tile-pane img,.leaflet-container img.leaflet-image-layer,.leaflet-container .leaflet-tile{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom{-ms-touch-action:none;touch-action:none}.leaflet-container{-webkit-tap-highlight-color:transparent}.leaflet-container a{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{width:0;height:0;-moz-box-sizing:border-box;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg{-moz-user-select:none}.leaflet-pane{z-index:400}.leaflet-tile-pane{z-index:200}.leaflet-overlay-pane{z-index:400}.leaflet-shadow-pane{z-index:500}.leaflet-marker-pane{z-index:600}.leaflet-tooltip-pane{z-index:650}.leaflet-popup-pane{z-index:700}.leaflet-map-pane canvas{z-index:100}.leaflet-map-pane svg{z-index:200}.leaflet-vml-shape{width:1px;height:1px}.lvml{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top,.leaflet-bottom{position:absolute;z-index:1000;pointer-events:none}.leaflet-top{top:0}.leaflet-right{right:0}.leaflet-bottom{bottom:0}.leaflet-left{left:0}.leaflet-control{float:left;clear:both}.leaflet-right .leaflet-control{float:right}.leaflet-top .leaflet-control{margin-top:10px}.leaflet-bottom .leaflet-control{margin-bottom:10px}.leaflet-left .leaflet-control{margin-left:10px}.leaflet-right .leaflet-control{margin-right:10px}.leaflet-fade-anim .leaflet-popup{opacity:0;-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0}svg.leaflet-zoom-animated{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile,.leaflet-pan-anim .leaflet-tile{-webkit-transition:none;-moz-transition:none;transition:none}.leaflet-zoom-anim .leaflet-zoom-hide{visibility:hidden}.leaflet-interactive{cursor:pointer}.leaflet-grab{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair,.leaflet-crosshair .leaflet-interactive{cursor:crosshair}.leaflet-popup-pane,.leaflet-control{cursor:auto}.leaflet-dragging .leaflet-grab,.leaflet-dragging .leaflet-grab .leaflet-interactive,.leaflet-dragging .leaflet-marker-draggable{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon,.leaflet-marker-shadow,.leaflet-image-layer,.leaflet-pane>svg path,.leaflet-tile-container{pointer-events:none}.leaflet-marker-icon.leaflet-interactive,.leaflet-image-layer.leaflet-interactive,.leaflet-pane>svg path.leaflet-interactive,svg.leaflet-image-layer.leaflet-interactive path{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container{background:#ddd;outline-offset:1px}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{border:2px dotted #38f;background:#ffffff80}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a,.leaflet-control-layers-toggle{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a:hover,.leaflet-bar a:focus{background-color:#f4f4f4}.leaflet-bar a:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list,.leaflet-control-layers-expanded .leaflet-control-layers-toggle{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list{display:block;position:relative}.leaflet-control-layers-expanded{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a{text-decoration:none}.leaflet-control-attribution a:hover,.leaflet-control-attribution a:focus{text-decoration:underline}.leaflet-attribution-flag{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;-moz-box-sizing:border-box;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution,.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{box-shadow:none}.leaflet-touch .leaflet-control-layers,.leaflet-touch .leaflet-bar{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button:hover,.leaflet-container a.leaflet-popup-close-button:focus{color:#585858}.leaflet-popup-scrolled{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom,.leaflet-oldie .leaflet-control-layers,.leaflet-oldie .leaflet-popup-content-wrapper,.leaflet-oldie .leaflet-popup-tip{border:1px solid #999}.leaflet-div-icon{background:#fff;border:1px solid #666}.leaflet-tooltip{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top:before,.leaflet-tooltip-bottom:before,.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{left:50%;margin-left:-6px}.leaflet-tooltip-top:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{top:50%;margin-top:-6px}.leaflet-tooltip-left:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}:root{--rs-primary-color: #2563eb;--rs-secondary-color: #f8fafc;--rs-text-color: #1f2937;--rs-muted-color: #6b7280;--rs-border-color: #e5e7eb;--rs-error-color: #dc2626;--rs-success-color: #16a34a;--rs-hover-bg: #f9fafb;--rs-selected-bg: #eff6ff;--rs-selected-border-color: #dbeafe;--rs-font-family: inherit;--rs-font-size-base: .875rem;--rs-font-size-small: .75rem;--rs-font-weight-normal: 400;--rs-font-weight-medium: 500;--rs-font-weight-semibold: 600;--rs-line-height-base: 1.5;--rs-border-radius: 8px;--rs-border-radius-small: 4px;--rs-shadow-light: 0 4px 10px rgba(0, 0, 0, .1);--rs-shadow-medium: 0 10px 25px rgba(0, 0, 0, .15);--rs-z-index-dropdown: 10000;--rs-transition-fast: .15s ease;--rs-transition-medium: .2s ease}:root{--rs-unit-selector-primary-color: var(--rs-primary-color);--rs-unit-selector-text-color: var(--rs-text-color);--rs-unit-selector-text-muted: var(--rs-muted-color);--rs-unit-selector-border-color: var(--rs-border-color);--rs-unit-selector-bg-color: #ffffff;--rs-unit-selector-bg-selected: var(--rs-selected-bg);--rs-unit-selector-bg-hover: var(--rs-hover-bg);--rs-unit-selector-shadow: var(--rs-shadow-medium)}.rs-unit-selector-container{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:320px;max-height:400px;background:var(--rs-unit-selector-bg-color);box-shadow:var(--rs-unit-selector-shadow);border-radius:var(--rs-border-radius);border:1px solid var(--rs-unit-selector-border-color);z-index:var(--rs-z-index-dropdown);overflow:hidden}.rs-unit-selector-header{display:flex;justify-content:space-between;align-items:center;padding:1rem;border-bottom:1px solid var(--rs-unit-selector-border-color);background:var(--rs-secondary-color)}.rs-unit-selector-title{font-weight:var(--rs-font-weight-semibold);color:var(--rs-unit-selector-text-color);font-size:var(--rs-font-size-base)}.rs-unit-selector-cancel{background:none;border:none;color:var(--rs-unit-selector-text-muted);cursor:pointer;padding:.25rem;border-radius:var(--rs-border-radius-small);transition:color var(--rs-transition-fast)}.rs-unit-selector-cancel:hover{color:var(--rs-unit-selector-text-color)}.rs-unit-selector-input{width:100%;padding:.75rem 1rem;border:none;border-bottom:1px solid var(--rs-unit-selector-border-color);font-size:var(--rs-font-size-base);line-height:var(--rs-line-height-base);outline:none;background:var(--rs-unit-selector-bg-color)}.rs-unit-selector-input:focus{border-color:var(--rs-unit-selector-primary-color)}.rs-unit-selector-dropdown{max-height:250px;overflow-y:auto}.rs-unit-selector-list{list-style:none;margin:0;padding:0}.rs-unit-selector-item{display:block;padding:.75rem 1rem;cursor:pointer;border-bottom:1px solid var(--rs-border-color);transition:background-color var(--rs-transition-fast)}.rs-unit-selector-item:last-child{border-bottom:none}.rs-unit-selector-item:hover{background-color:var(--rs-unit-selector-bg-hover)}.rs-unit-selector-item--selected{background-color:var(--rs-unit-selector-bg-selected);border-color:var(--rs-selected-border-color)}.rs-unit-selector-unit-number{color:var(--rs-unit-selector-text-color);font-weight:var(--rs-font-weight-medium);font-size:var(--rs-font-size-base)}.rs-unit-selector-no-results{padding:2rem 1rem;text-align:center;color:var(--rs-unit-selector-text-muted);font-size:var(--rs-font-size-base)}@-webkit-keyframes leaflet-gestures-fadein{0%{opacity:0}to{opacity:1}}@keyframes leaflet-gestures-fadein{0%{opacity:0}to{opacity:1}}.leaflet-container:after{-webkit-animation:leaflet-gestures-fadein .8s backwards;animation:leaflet-gestures-fadein .8s backwards;color:#fff;font-family:Roboto,Arial,sans-serif;font-size:22px;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:15px;position:absolute;top:0;left:0;right:0;bottom:0;background:#00000080;z-index:461;pointer-events:none}.leaflet-gesture-handling-touch-warning:after,.leaflet-gesture-handling-scroll-warning:after{-webkit-animation:leaflet-gestures-fadein .8s forwards;animation:leaflet-gestures-fadein .8s forwards}.leaflet-gesture-handling-touch-warning:after{content:attr(data-gesture-handling-touch-content)}.leaflet-gesture-handling-scroll-warning:after{content:attr(data-gesture-handling-scroll-content)}.rs-map-container{z-index:1;width:100%;height:100%;position:relative}.rs-map-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;z-index:1000;cursor:wait;display:flex;justify-content:center;align-items:center}
|
package/dist/riskscape-map.es.js
CHANGED
|
@@ -306,7 +306,7 @@ class Ut {
|
|
|
306
306
|
f(this, U);
|
|
307
307
|
f(this, D, 0);
|
|
308
308
|
f(this, R, 0);
|
|
309
|
-
c(this, $, e), c(this, j, t), c(this, W, i), this.fetchAddress = this.fetchAddress.bind(this), this.fetchPropertyIdentification = this.fetchPropertyIdentification.bind(this), this.fetchProperty = this.fetchProperty.bind(this), this.fetchPropertyUnits = this.fetchPropertyUnits.bind(this), this.fetchFeature = this.fetchFeature.bind(this), this.fetchSchemeUnits = this.fetchSchemeUnits.bind(this), this.geocode = this.geocode.bind(this), console.debug("RiskscapeApi initialized with version:", "1.1.
|
|
309
|
+
c(this, $, e), c(this, j, t), c(this, W, i), this.fetchAddress = this.fetchAddress.bind(this), this.fetchPropertyIdentification = this.fetchPropertyIdentification.bind(this), this.fetchProperty = this.fetchProperty.bind(this), this.fetchPropertyUnits = this.fetchPropertyUnits.bind(this), this.fetchFeature = this.fetchFeature.bind(this), this.fetchSchemeUnits = this.fetchSchemeUnits.bind(this), this.geocode = this.geocode.bind(this), console.debug("RiskscapeApi initialized with version:", "1.1.2");
|
|
310
310
|
}
|
|
311
311
|
// =============================================================================
|
|
312
312
|
// ADDRESS API METHODS
|
|
@@ -489,7 +489,7 @@ vt = function(e) {
|
|
|
489
489
|
headers: {
|
|
490
490
|
accept: "application/json",
|
|
491
491
|
"x-api-key": a(this, $),
|
|
492
|
-
"x-riskscape-plugins-version": "1.1.
|
|
492
|
+
"x-riskscape-plugins-version": "1.1.2",
|
|
493
493
|
...i.headers
|
|
494
494
|
},
|
|
495
495
|
signal: i.signal || (AbortSignal.timeout ? AbortSignal.timeout(a(this, W)) : void 0)
|
|
@@ -1037,14 +1037,16 @@ const Z = class Z extends L.Map {
|
|
|
1037
1037
|
* @param {L.LeafletMouseEvent} e - Click event
|
|
1038
1038
|
*/
|
|
1039
1039
|
w(this, "_handleMapClick", async (t) => {
|
|
1040
|
-
if (this.
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1040
|
+
if (!this._unitSelector.isVisible()) {
|
|
1041
|
+
if (this.getZoom() <= 15) {
|
|
1042
|
+
console.debug("Zoom level too low for feature identification");
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
try {
|
|
1046
|
+
await l(this, g, F).call(this, "property_scheme", t.latlng);
|
|
1047
|
+
} catch (i) {
|
|
1048
|
+
console.error("Failed to identify feature on map click:", i);
|
|
1049
|
+
}
|
|
1048
1050
|
}
|
|
1049
1051
|
});
|
|
1050
1052
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<li class="rs-unit-selector-item" data-index="${i}" role="option">
|
|
10
10
|
<span class="rs-unit-selector-unit-number">${t.unit_number}</span>
|
|
11
11
|
</li>
|
|
12
|
-
`).join(""),l(this,h,q).call(this)},q=function(){const e=s(this,k).querySelectorAll(".rs-unit-selector-item");if(e.forEach((t,i)=>{t.classList.toggle("rs-unit-selector-item--selected",i===s(this,M))}),s(this,M)>=0){const t=e[s(this,M)];t&&t.scrollIntoView({block:"nearest"})}},tt=function(){s(this,I)||(c(this,I,!0),s(this,E).style.display="block",s(this,m).setAttribute("aria-expanded","true"))},V=function(){s(this,I)&&(c(this,I,!1),s(this,E)&&(s(this,E).style.display="none"),s(this,m)&&s(this,m).setAttribute("aria-expanded","false"))},lt=function(e){s(this,m).value=e.unit_number,l(this,h,V).call(this),this.hide(),s(this,P)&&s(this,P).call(this,e)},ht=function(){this.hide(),s(this,F)&&s(this,F).call(this)};class et{constructor({apiKey:e,baseUrl:t,timeout:i=8e3}){_(this,x);_(this,W);_(this,K);_(this,B,8e3);_(this,T);_(this,N,0);_(this,H,0);c(this,W,e),c(this,K,t),c(this,B,i),this.fetchAddress=this.fetchAddress.bind(this),this.fetchPropertyIdentification=this.fetchPropertyIdentification.bind(this),this.fetchProperty=this.fetchProperty.bind(this),this.fetchPropertyUnits=this.fetchPropertyUnits.bind(this),this.fetchFeature=this.fetchFeature.bind(this),this.fetchSchemeUnits=this.fetchSchemeUnits.bind(this),this.geocode=this.geocode.bind(this),console.debug("RiskscapeApi initialized with version:","1.1.0")}async fetchAddress(e){return l(this,x,D).call(this,"GET","/addressing/v2/address",{params:{address_id:e}})}async geocode(e,t={},i={}){const r={q:e,...t};return l(this,x,D).call(this,"GET","/addressing/v2/autocomplete",{params:r,signal:i.signal||this.getAbortSignal(),...i})}async fetchProperty(e,t){return l(this,x,D).call(this,"GET","/properties/v1/property",{params:{property_key:e,unit_number:t}})}async fetchPropertyIdentification(e,t){return this.fetchProperty(e,t)}async fetchPropertyUnits(e){return l(this,x,D).call(this,"GET","/properties/v1/unit-numbers",{params:{property_key:e}})}async fetchFeature(e,t){return l(this,x,D).call(this,"GET","/features/v1/feature",{params:{type:e,...t}})}async fetchSchemeUnits(e){return l(this,x,D).call(this,"GET","/schemes/v1/units",{params:{scheme_id:e}})}cancel(){s(this,T)&&(s(this,T).abort(),c(this,T,null))}createAbortController(){c(this,T,new AbortController)}getAbortSignal(){return s(this,T)||this.createAbortController(),s(this,T).signal}getConsecutiveErrors(){return s(this,N)}getConsecutiveCancels(){return s(this,H)}resetCounters(){c(this,N,0),c(this,H,0)}}W=new WeakMap,K=new WeakMap,B=new WeakMap,T=new WeakMap,N=new WeakMap,H=new WeakMap,x=new WeakSet,Lt=function(e){var i,r,n;if(e.name==="AbortError")throw ot(this,H)._++,new Error("Request cancelled");ot(this,N)._++;const t=new CustomEvent("riskscape-api:error",{detail:{message:e.message,response:(i=e.response)==null?void 0:i.data,status:(r=e.response)==null?void 0:r.status}});throw document.dispatchEvent(t),e.response?e.response.status===401?new Error("Unauthorized"):new Error(((n=e.response.data)==null?void 0:n.message)||"Unknown error"):navigator.onLine?e:new Error("Network error: No internet connection")},D=async function(e,t,i={}){try{const r=new URL(t,s(this,K));i.params&&Object.entries(i.params).forEach(([o,u])=>{u!=null&&r.searchParams.append(o,u)});const n=await fetch(r,{method:e.toUpperCase(),headers:{accept:"application/json","x-api-key":s(this,W),"x-riskscape-plugins-version":"1.1.0",...i.headers},signal:i.signal||(AbortSignal.timeout?AbortSignal.timeout(s(this,B)):void 0)});if(!n.ok){const o=new Error(`HTTP ${n.status}`);throw o.response={status:n.status,data:await n.json().catch(()=>({}))},o}return await n.json()}catch(r){return l(this,x,Lt).call(this,r)}finally{i.signal===this.getAbortSignal()&&c(this,T,null)}};var $={exports:{}},Ut=$.exports,ut;function xt(){return ut||(ut=1,function(a,e){(function(t,i){i(e)})(Ut,function(t){var i={ar:{touch:"استخدم إصبعين لتحريك الخريطة",scroll:"استخدم ctrl + scroll لتصغير/تكبير الخريطة",scrollMac:"يمكنك استخدام ⌘ + التمرير لتكبير/تصغير الخريطة"},bg:{touch:"Използвайте два пръста, за да преместите картата",scroll:"Задръжте бутона Ctrl натиснат, докато превъртате, за да промените мащаба на картата",scrollMac:"Задръжте бутона ⌘ натиснат, докато превъртате, за да промените мащаба на картата"},bn:{touch:"মানচিত্রটিকে সরাতে দুটি আঙ্গুল ব্যবহার করুন",scroll:"ম্যাপ জুম করতে ctrl + scroll ব্যবহার করুন",scrollMac:"ম্যাপে জুম করতে ⌘ বোতাম টিপে স্ক্রল করুন"},ca:{touch:"Fes servir dos dits per moure el mapa",scroll:"Prem la tecla Control mentre et desplaces per apropar i allunyar el mapa",scrollMac:"Prem la tecla ⌘ mentre et desplaces per apropar i allunyar el mapa"},cs:{touch:"K posunutí mapy použijte dva prsty",scroll:"Velikost zobrazení mapy změňte podržením klávesy Ctrl a posouváním kolečka myši",scrollMac:"Velikost zobrazení mapy změníte podržením klávesy ⌘ a posunutím kolečka myši / touchpadu"},da:{touch:"Brug to fingre til at flytte kortet",scroll:"Brug ctrl + rullefunktionen til at zoome ind og ud på kortet",scrollMac:"Brug ⌘ + rullefunktionen til at zoome ind og ud på kortet"},de:{touch:"Verschieben der Karte mit zwei Fingern",scroll:"Verwende Strg+Scrollen zum Zoomen der Karte",scrollMac:"⌘"},el:{touch:"Χρησιμοποιήστε δύο δάχτυλα για μετακίνηση στον χάρτη",scroll:"Χρησιμοποιήστε το πλήκτρο Ctrl και κύλιση, για να μεγεθύνετε τον χάρτη",scrollMac:"Χρησιμοποιήστε το πλήκτρο ⌘ + κύλιση για εστίαση στον χάρτη"},en:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-AU":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-GB":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},es:{touch:"Para mover el mapa, utiliza dos dedos",scroll:"Mantén pulsada la tecla Ctrl mientras te desplazas para acercar o alejar el mapa",scrollMac:"Mantén pulsada la tecla ⌘ mientras te desplazas para acercar o alejar el mapa"},eu:{touch:"Erabili bi hatz mapa mugitzeko",scroll:"Mapan zooma aplikatzeko, sakatu Ktrl eta egin gora edo behera",scrollMac:"Eduki sakatuta ⌘ eta egin gora eta behera mapa handitu eta txikitzeko"},fa:{touch:"برای حرکت دادن نقشه از دو انگشت استفاده کنید.",scroll:"برای بزرگنمایی نقشه از ctrl + scroll استفاده کنید",scrollMac:"برای بزرگنمایی نقشه، از ⌘ + پیمایش استفاده کنید."},fi:{touch:"Siirrä karttaa kahdella sormella.",scroll:"Zoomaa karttaa painamalla Ctrl-painiketta ja vierittämällä.",scrollMac:"Zoomaa karttaa pitämällä painike ⌘ painettuna ja vierittämällä."},fil:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},fr:{touch:"Utilisez deux doigts pour déplacer la carte",scroll:"Vous pouvez zoomer sur la carte à l'aide de CTRL+Molette de défilement",scrollMac:"Vous pouvez zoomer sur la carte à l'aide de ⌘+Molette de défilement"},gl:{touch:"Utiliza dous dedos para mover o mapa",scroll:"Preme Ctrl mentres te desprazas para ampliar o mapa",scrollMac:"Preme ⌘ e desprázate para ampliar o mapa"},gu:{touch:"નકશો ખસેડવા બે આંગળીઓનો ઉપયોગ કરો",scroll:"નકશાને ઝૂમ કરવા માટે ctrl + સ્ક્રોલનો ઉપયોગ કરો",scrollMac:"નકશાને ઝૂમ કરવા ⌘ + સ્ક્રોલનો ઉપયોગ કરો"},hi:{touch:"मैप एक जगह से दूसरी जगह ले जाने के लिए दो उंगलियों का इस्तेमाल करें",scroll:"मैप को ज़ूम करने के लिए ctrl + स्क्रोल का उपयोग करें",scrollMac:"मैप को ज़ूम करने के लिए ⌘ + स्क्रोल का उपयोग करें"},hr:{touch:"Pomičite kartu pomoću dva prsta",scroll:"Upotrijebite Ctrl i klizač miša da biste zumirali kartu",scrollMac:"Upotrijebite gumb ⌘ dok se pomičete za zumiranje karte"},hu:{touch:"Két ujjal mozgassa a térképet",scroll:"A térkép a ctrl + görgetés használatával nagyítható",scrollMac:"A térkép a ⌘ + görgetés használatával nagyítható"},id:{touch:"Gunakan dua jari untuk menggerakkan peta",scroll:"Gunakan ctrl + scroll untuk memperbesar atau memperkecil peta",scrollMac:"Gunakan ⌘ + scroll untuk memperbesar atau memperkecil peta"},it:{touch:"Utilizza due dita per spostare la mappa",scroll:"Utilizza CTRL + scorrimento per eseguire lo zoom della mappa",scrollMac:"Utilizza ⌘ + scorrimento per eseguire lo zoom della mappa"},iw:{touch:"הזז את המפה באמצעות שתי אצבעות",scroll:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ctrl וגלילה",scrollMac:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ⌘ וגלילה"},ja:{touch:"地図を移動させるには指 2 本で操作します",scroll:"地図をズームするには、Ctrl キーを押しながらスクロールしてください",scrollMac:"地図をズームするには、⌘ キーを押しながらスクロールしてください"},kn:{touch:"Use two fingers to move the map",scroll:"Use Ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},ko:{touch:"지도를 움직이려면 두 손가락을 사용하세요.",scroll:"지도를 확대/축소하려면 Ctrl을 누른 채 스크롤하세요.",scrollMac:"지도를 확대하려면 ⌘ + 스크롤 사용"},lt:{touch:"Perkelkite žemėlapį dviem pirštais",scroll:"Slinkite nuspaudę klavišą „Ctrl“, kad pakeistumėte žemėlapio mastelį",scrollMac:"Paspauskite klavišą ⌘ ir slinkite, kad priartintumėte žemėlapį"},lv:{touch:"Lai pārvietotu karti, bīdiet to ar diviem pirkstiem",scroll:"Kartes tālummaiņai izmantojiet ctrl + ritināšanu",scrollMac:"Lai veiktu kartes tālummaiņu, izmantojiet ⌘ + ritināšanu"},ml:{touch:"മാപ്പ് നീക്കാൻ രണ്ട് വിരലുകൾ ഉപയോഗിക്കുക",scroll:"കൺട്രോൾ + സ്ക്രോൾ ഉപയോഗിച്ച് മാപ്പ് സൂം ചെയ്യുക",scrollMac:"⌘ + സ്ക്രോൾ ഉപയോഗിച്ച് മാപ്പ് സൂം ചെയ്യുക"},mr:{touch:"नकाशा हलविण्यासाठी दोन बोटे वापरा",scroll:"नकाशा झूम करण्यासाठी ctrl + scroll वापरा",scrollMac:"नकाशावर झूम करण्यासाठी ⌘ + स्क्रोल वापरा"},nl:{touch:"Gebruik twee vingers om de kaart te verplaatsen",scroll:"Gebruik Ctrl + scrollen om in- en uit te zoomen op de kaart",scrollMac:"Gebruik ⌘ + scrollen om in en uit te zoomen op de kaart"},no:{touch:"Bruk to fingre for å flytte kartet",scroll:"Hold ctrl-tasten inne og rull for å zoome på kartet",scrollMac:"Hold inne ⌘-tasten og rull for å zoome på kartet"},pl:{touch:"Przesuń mapę dwoma palcami",scroll:"Naciśnij CTRL i przewiń, by przybliżyć mapę",scrollMac:"Naciśnij ⌘ i przewiń, by przybliżyć mapę"},pt:{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-BR":{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-PT":{touch:"Utilize dois dedos para mover o mapa",scroll:"Utilizar ctrl + deslocar para aumentar/diminuir zoom do mapa",scrollMac:"Utilize ⌘ + deslocar para aumentar/diminuir o zoom do mapa"},ro:{touch:"Folosiți două degete pentru a deplasa harta",scroll:"Apăsați tasta ctrl și derulați simultan pentru a mări harta",scrollMac:"Folosiți ⌘ și derulați pentru a mări/micșora harta"},ru:{touch:"Чтобы переместить карту, проведите по ней двумя пальцами",scroll:"Чтобы изменить масштаб, прокручивайте карту, удерживая клавишу Ctrl.",scrollMac:"Чтобы изменить масштаб, нажмите ⌘ + прокрутка"},sk:{touch:"Mapu môžete posunúť dvoma prstami",scroll:"Ak chcete priblížiť mapu, stlačte kláves ctrl a posúvajte",scrollMac:"Ak chcete priblížiť mapu, stlačte kláves ⌘ a posúvajte kolieskom myši"},sl:{touch:"Premaknite zemljevid z dvema prstoma",scroll:"Zemljevid povečate tako, da držite tipko Ctrl in vrtite kolesce na miški",scrollMac:"Uporabite ⌘ + funkcijo pomika, da povečate ali pomanjšate zemljevid"},sr:{touch:"Мапу померајте помоћу два прста",scroll:"Притисните ctrl тастер док померате да бисте зумирали мапу",scrollMac:"Притисните тастер ⌘ док померате да бисте зумирали мапу"},sv:{touch:"Använd två fingrar för att flytta kartan",scroll:"Använd ctrl + rulla för att zooma kartan",scrollMac:"Använd ⌘ + rulla för att zooma på kartan"},ta:{touch:"மேப்பை நகர்த்த இரண்டு விரல்களைப் பயன்படுத்தவும்",scroll:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ctrl பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்",scrollMac:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ⌘ பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்"},te:{touch:"మ్యాప్ని తరలించడం కోసం రెండు వేళ్లను ఉపయోగించండి",scroll:"మ్యాప్ని జూమ్ చేయడానికి ctrl బటన్ను నొక్కి ఉంచి, స్క్రోల్ చేయండి",scrollMac:"మ్యాప్ జూమ్ చేయాలంటే ⌘ + స్క్రోల్ ఉపయోగించండి"},th:{touch:"ใช้ 2 นิ้วเพื่อเลื่อนแผนที่",scroll:"กด Ctrl ค้างไว้ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่",scrollMac:"กด ⌘ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่"},tl:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},tr:{touch:"Haritada gezinmek için iki parmağınızı kullanın",scroll:"Haritayı yakınlaştırmak için ctrl + kaydırma kombinasyonunu kullanın",scrollMac:"Haritayı yakınlaştırmak için ⌘ tuşuna basıp ekranı kaydırın"},uk:{touch:"Переміщуйте карту двома пальцями",scroll:"Щоб змінювати масштаб карти, прокручуйте коліщатко миші, утримуючи клавішу Ctrl",scrollMac:"Щоб змінити масштаб карти, використовуйте ⌘ + прокручування"},vi:{touch:"Sử dụng hai ngón tay để di chuyển bản đồ",scroll:"Sử dụng ctrl + cuộn để thu phóng bản đồ",scrollMac:"Sử dụng ⌘ + cuộn để thu phóng bản đồ"},"zh-CN":{touch:"使用双指移动地图",scroll:"按住 Ctrl 并滚动鼠标滚轮才可缩放地图",scrollMac:"按住 ⌘ 并滚动鼠标滚轮才可缩放地图"},"zh-TW":{touch:"同時以兩指移動地圖",scroll:"按住 ctrl 鍵加上捲動滑鼠可以縮放地圖",scrollMac:"按 ⌘ 加上滾動捲軸可以縮放地圖"}};L.Map.mergeOptions({gestureHandlingOptions:{text:{},duration:1e3}});var r=!1,n=L.Handler.extend({addHooks:function(){this._handleTouch=this._handleTouch.bind(this),this._setupPluginOptions(),this._setLanguageContent(),this._disableInteractions(),this._map._container.addEventListener("touchstart",this._handleTouch),this._map._container.addEventListener("touchmove",this._handleTouch),this._map._container.addEventListener("touchend",this._handleTouch),this._map._container.addEventListener("touchcancel",this._handleTouch),this._map._container.addEventListener("click",this._handleTouch),L.DomEvent.on(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.on(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.on(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.on(this._map,"movestart",this._handleDragging,this),L.DomEvent.on(this._map,"move",this._handleDragging,this),L.DomEvent.on(this._map,"moveend",this._handleDragging,this)},removeHooks:function(){this._enableInteractions(),this._map._container.removeEventListener("touchstart",this._handleTouch),this._map._container.removeEventListener("touchmove",this._handleTouch),this._map._container.removeEventListener("touchend",this._handleTouch),this._map._container.removeEventListener("touchcancel",this._handleTouch),this._map._container.removeEventListener("click",this._handleTouch),L.DomEvent.off(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.off(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.off(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.off(this._map,"movestart",this._handleDragging,this),L.DomEvent.off(this._map,"move",this._handleDragging,this),L.DomEvent.off(this._map,"moveend",this._handleDragging,this)},_handleDragging:function(o){o.type=="movestart"||o.type=="move"?r=!0:o.type=="moveend"&&(r=!1)},_disableInteractions:function(){this._map.dragging.disable(),this._map.scrollWheelZoom.disable(),this._map.tap&&this._map.tap.disable()},_enableInteractions:function(){this._map.dragging.enable(),this._map.scrollWheelZoom.enable(),this._map.tap&&this._map.tap.enable()},_setupPluginOptions:function(){this._map.options.gestureHandlingText&&(this._map.options.gestureHandlingOptions.text=this._map.options.gestureHandlingText)},_setLanguageContent:function(){var o;if(this._map.options.gestureHandlingOptions&&this._map.options.gestureHandlingOptions.text&&this._map.options.gestureHandlingOptions.text.touch&&this._map.options.gestureHandlingOptions.text.scroll&&this._map.options.gestureHandlingOptions.text.scrollMac)o=this._map.options.gestureHandlingOptions.text;else{var u=this._getUserLanguage();u||(u="en"),i[u]&&(o=i[u]),o||u.indexOf("-")===-1||(u=u.split("-")[0],o=i[u]),o||(o=i[u="en"])}var C=!1;0<=navigator.platform.toUpperCase().indexOf("MAC")&&(C=!0);var Z=o.scroll;C&&(Z=o.scrollMac),this._map._container.setAttribute("data-gesture-handling-touch-content",o.touch),this._map._container.setAttribute("data-gesture-handling-scroll-content",Z)},_getUserLanguage:function(){return navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage},_handleTouch:function(o){for(var u=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],C=!1,Z=0;Z<u.length;Z++)L.DomUtil.hasClass(o.target,u[Z])&&(C=!0);C?L.DomUtil.hasClass(o.target,"leaflet-interactive")&&o.type==="touchmove"&&o.touches.length===1?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning"):o.type==="touchmove"||o.type==="touchstart"?o.touches.length===1?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):(o.preventDefault(),this._enableInteractions(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")},_isScrolling:!1,_handleScroll:function(o){o.metaKey||o.ctrlKey?(o.preventDefault(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.enable()):(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.disable(),clearTimeout(this._isScrolling),this._isScrolling=setTimeout(function(){for(var u=document.getElementsByClassName("leaflet-gesture-handling-scroll-warning"),C=0;C<u.length;C++)L.DomUtil.removeClass(u[C],"leaflet-gesture-handling-scroll-warning")},this._map.options.gestureHandlingOptions.duration))},_handleMouseOver:function(o){this._enableInteractions()},_handleMouseOut:function(o){r||this._disableInteractions()}});L.Map.addInitHook("addHandler","gestureHandling",n),t.GestureHandling=n,t.default=n,Object.defineProperty(t,"__esModule",{value:!0})})}($,$.exports)),$.exports}xt();const f=Symbol("newer"),w=Symbol("older");class It{constructor(e,t){typeof e!="number"&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[f]&&(e===this.oldest&&(this.oldest=e[f]),e[f][w]=e[w]),e[w]&&(e[w][f]=e[f]),e[f]=void 0,e[w]=this.newest,this.newest&&(this.newest[f]=e),this.newest=e)}assign(e){let t,i=this.limit||Number.MAX_VALUE;this._keymap.clear();let r=e[Symbol.iterator]();for(let n=r.next();!n.done;n=r.next()){let o=new dt(n.value[0],n.value[1]);if(this._keymap.set(o.key,o),t?(t[f]=o,o[w]=t):this.oldest=o,t=o,i--==0)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}set(e,t){var i=this._keymap.get(e);return i?(i.value=t,this._markEntryAsUsed(i),this):(this._keymap.set(e,i=new dt(e,t)),this.newest?(this.newest[f]=i,i[w]=this.newest):this.oldest=i,this.newest=i,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[f]?(this.oldest=this.oldest[f],this.oldest[w]=void 0):(this.oldest=void 0,this.newest=void 0),e[f]=e[w]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[f]&&t[w]?(t[w][f]=t[f],t[f][w]=t[w]):t[f]?(t[f][w]=void 0,this.oldest=t[f]):t[w]?(t[w][f]=void 0,this.newest=t[w]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new st(this.oldest)}values(){return new at(this.oldest)}entries(){return this}[Symbol.iterator](){return new it(this.oldest)}forEach(e,t){typeof t!="object"&&(t=this);let i=this.oldest;for(;i;)e.call(t,i.value,i.key,this),i=i[f]}toJSON(){for(var e=new Array(this.size),t=0,i=this.oldest;i;)e[t++]={key:i.key,value:i.value},i=i[f];return e}toString(){for(var e="",t=this.oldest;t;)e+=String(t.key)+":"+t.value,t=t[f],t&&(e+=" < ");return e}}function dt(a,e){this.key=a,this.value=e,this[f]=void 0,this[w]=void 0}function it(a){this.entry=a}it.prototype[Symbol.iterator]=function(){return this},it.prototype.next=function(){let a=this.entry;return a?(this.entry=a[f],{done:!1,value:[a.key,a.value]}):{done:!0,value:void 0}};function st(a){this.entry=a}st.prototype[Symbol.iterator]=function(){return this},st.prototype.next=function(){let a=this.entry;return a?(this.entry=a[f],{done:!1,value:a.key}):{done:!0,value:void 0}};function at(a){this.entry=a}at.prototype[Symbol.iterator]=function(){return this},at.prototype.next=function(){let a=this.entry;return a?(this.entry=a[f],{done:!1,value:a.value}):{done:!0,value:void 0}};function Tt(a,e){let t=0,i=null;i=setInterval(function(){if(t>=20)throw clearInterval(i),new Error("window.google not found after 10 seconds");window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(i),a.call(e)),++t},500)}L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:"roadmap",maxNativeZoom:21},initialize:function(a){L.GridLayer.prototype.initialize.call(this,a),this._tileCallbacks={},this._lru=new It(100),this._imagesPerTile=this.options.type==="hybrid"?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(a){L.GridLayer.prototype.onAdd.call(this,a),this._initMutantContainer(),this._logoContainer&&a._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&a._controlCorners.bottomright.appendChild(this._attributionContainer),Tt(()=>{this._map&&(this._initMutant(),google.maps.event.addListenerOnce(this._mutant,"idle",()=>{this._map&&(this._checkZoomLevels(),this._mutantIsReady=!0)}))})},onRemove:function(a){L.GridLayer.prototype.onRemove.call(this,a),this._observer.disconnect(),a._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,"idle")},addGoogleLayer:function(a,e){return this._subLayers||(this._subLayers={}),this.whenReady(()=>{var t=google.maps[a],i=new t(e);i.setMap(this._mutant),this._subLayers[a]=i}),this},removeGoogleLayer:function(a){return this.whenReady(()=>{var e=this._subLayers&&this._subLayers[a];e&&(e.setMap(null),delete this._subLayers[a])}),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create("div","leaflet-google-mutant leaflet-top leaflet-left"),this._mutantContainer.id="_MutantContainer_"+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents="none",this._mutantContainer.style.visibility="hidden",L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);const a=this._mutantContainer.style;this._map.options.zoomSnap<1?(a.width="180%",a.height="180%"):(a.width="100%",a.height="100%"),a.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var a={center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:"transparent"};this.options.mapId!=null&&(a.mapId=this.options.mapId);var e=new google.maps.Map(this._mutantContainer,a);this._mutant=e,this._update(),this.fire("spawned",{mapObject:e}),this._waitControls(),this.once("controls_ready",this._setupAttribution)}},_attachObserver:function(e){this._observer||(this._observer=new MutationObserver(this._onMutations.bind(this))),this._observer.observe(e,{childList:!0,subtree:!0}),Array.prototype.forEach.call(e.querySelectorAll("img"),this._boundOnMutatedImage)},_waitControls:function(){const a=setInterval(()=>{const e=this._mutant.__gm.layoutManager;if(!e)return;clearInterval(a);let t;Object.keys(e).forEach(function(i){const r=e[i];r.get&&r.get(1)instanceof Node&&(t=r)}),this.fire("controls_ready",{positions:t})},50)},_setupAttribution:function(a){if(!this._map)return;const e=google.maps.ControlPosition,t=this._attributionContainer=a.positions.get(e.BOTTOM_RIGHT);L.DomUtil.addClass(t,"leaflet-control leaflet-control-attribution"),L.DomEvent.disableClickPropagation(t),t.style.height="14px",this._map._controlCorners.bottomright.appendChild(t),this._logoContainer=a.positions.get(e.BOTTOM_LEFT),this._logoContainer.style.pointerEvents="auto",this._map._controlCorners.bottomleft.appendChild(this._logoContainer)},_onMutations:function(e){for(var t=0;t<e.length;++t)for(var i=e[t],r=0;r<i.addedNodes.length;++r){var n=i.addedNodes[r];n instanceof HTMLImageElement?this._onMutatedImage(n):n instanceof HTMLElement&&Array.prototype.forEach.call(n.querySelectorAll("img"),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function(e){let t,i=e.src.match(this._roadRegexp),r=0;if(i?(t={z:i[1],x:i[2],y:i[3]},this._imagesPerTile>1&&(e.style.zIndex=1,r=1)):(i=e.src.match(this._satRegexp),i&&(t={x:i[1],y:i[2],z:i[3]}),r=0),t){var n=this._tileCoordsToKey(t);e.style.position="absolute";var o=n+"/"+r;this._lru.set(o,e),o in this._tileCallbacks&&this._tileCallbacks[o]&&(this._tileCallbacks[o].forEach(u=>u(e)),delete this._tileCallbacks[o])}},createTile:function(a,e){const t=this._tileCoordsToKey(a),i=L.DomUtil.create("div");i.style.textAlign="left",i.dataset.pending=this._imagesPerTile,e=e.bind(this,null,i);for(var r=0;r<this._imagesPerTile;++r){const n=t+"/"+r,o=this._lru.get(n);o?(i.appendChild(this._clone(o)),--i.dataset.pending):(this._tileCallbacks[n]=this._tileCallbacks[n]||[],this._tileCallbacks[n].push((function(u){return(function(C){u.appendChild(this._clone(C)),--u.dataset.pending,parseInt(u.dataset.pending)||e()}).bind(this)}).bind(this)(i)))}return parseInt(i.dataset.pending)||L.Util.requestAnimFrame(e),i},_clone:function(a){const e=a.cloneNode(!0);return e.style.visibility="visible",e},_checkZoomLevels:function(){const a=this._map.getZoom(),e=this._mutant.getZoom();!a||!e||(e!==a||e>this.options.maxNativeZoom)&&this._setMaxNativeZoom(e)},_setMaxNativeZoom:function(a){a!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=a,this._resetView())},_update:function(a){if(this._mutant){a=a||this._map.getCenter();const e=new google.maps.LatLng(a.lat,a.lng),t=Math.round(this._map.getZoom()),i=this._mutant.getZoom();this._mutant.setCenter(e),t!==i&&(this._mutant.setZoom(t),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,a)},whenReady:function(a,e){return this._mutant?a.call(e||this,{target:this}):this.on("spawned",a,e),this}}),L.gridLayer.googleMutant=function(a){return new L.GridLayer.GoogleMutant(a)};const pt=a=>`/maps/v1/${a}/{z}/{x}/{y}`,J=a=>`/tiles/v1/${a}`,Ot={default:[{name:"base",type:"RiskscapeTileLayer",layerUrl:pt("default"),layerOptions:{pane:"tilePane",zIndex:4,maxZoom:20,tileSize:512,zoomOffset:-1,crossOrigin:!0}},{name:"wmsDefault",type:"RiskscapeWmsLayer",layerUrl:J("default"),layerOptions:{pane:"tilePane",zIndex:2,minZoom:12,maxZoom:20,tileSize:512,zoomOffset:-1}},{name:"wmsDefaultLabels",type:"RiskscapeWmsLayer",layerUrl:J("default-labels"),layerOptions:{pane:"overlayPane",zIndex:10,minZoom:13,maxZoom:20,tileSize:512,zoomOffset:-1}}],hybrid:[{name:"googleSatellite",type:"GoogleMutant",layerOptions:{type:"satellite"}},{name:"base",type:"RiskscapeTileLayer",layerUrl:pt("hybrid"),layerOptions:{pane:"tilePane",zIndex:4,maxZoom:20,tileSize:512,zoomOffset:-1,crossOrigin:!0}},{name:"wmsHybrid",type:"RiskscapeWmsLayer",layerUrl:J("hybrid"),layerOptions:{pane:"tilePane",zIndex:1,minZoom:13,maxZoom:20,tileSize:512,zoomOffset:-1}},{name:"wmsHybridLabels",type:"RiskscapeWmsLayer",layerUrl:J("hybrid-labels"),layerOptions:{pane:"overlayPane",minZoom:13,maxZoom:20,tileSize:512,zoomOffset:-1}}]};function Zt(a){return Ot[a]}function At(a){return{lat:a.lat.toFixed(6),lon:a.lng.toFixed(6)}}function Pt(a){const e=At(a);return`${e.lat},${e.lon}`}function Ft(a){return new Promise((e,t)=>{if(window.google&&window.google.maps){e(window.google.maps);return}const i=document.createElement("script");i.src=`https://maps.googleapis.com/maps/api/js?key=${a}&callback=initGoogleMaps`,i.async=!0,i.defer=!0,window.initGoogleMaps=function(){e(window.google.maps),delete window.initGoogleMaps},i.onerror=function(){t(new Error("Failed to load Google Maps API"))},document.head.appendChild(i)})}const R=class R extends L.Map{constructor(t){R._validateConfig(t);const{apiKey:i,googleKey:r,style:n,el:o,mapOptions:u,pluginOptions:C}=R._processConfig(t);super(o,u);_(this,v);z(this,"_api");z(this,"_search");z(this,"_searchMarker");z(this,"_unitSelector");z(this,"_loading",!1);z(this,"_locationFeature");z(this,"pluginOptions");z(this,"styleLayers");z(this,"featureLayer");z(this,"feature");z(this,"_originalInteractionStates");z(this,"_handleMapClick",async t=>{if(this.getZoom()<=15){console.debug("Zoom level too low for feature identification");return}try{await l(this,v,j).call(this,"property_scheme",t.latlng)}catch(i){console.error("Failed to identify feature on map click:",i)}});z(this,"_handleSearchSelect",async({candidate:t})=>{this._removeSearchMarker(),this._removeLocationFeature();const{category:i,subcategory:r,position:n,attributes:o}=t,u=[n.lat,n.lon];try{this.pluginOptions.operationMode==="identify"?await this._handleIdentifyModeSearch(t,u):i==="Location"?await this._handleLocationSearch(o):this._setSearchMarker(u)}catch(C){console.error("Failed to handle search selection:",C),this._setSearchMarker(u)}});this._initializePlugin(C,u)}static _validateConfig(t){if(!(t!=null&&t.key))throw new Error("API key is required.");const i=(t==null?void 0:t.style)||"default",r=t==null?void 0:t.googleKey;if(i==="hybrid"&&!r)throw new Error("Google API key is required for hybrid style.")}static _processConfig(t){const i=t.key,r=t.element,n=(t==null?void 0:t.style)||"default",o=t==null?void 0:t.googleKey,u={key:i,googleKey:o,url:(t==null?void 0:t.url)||"https://api.cloud.riskscape.pro",style:n,featureStyle:(t==null?void 0:t.featureStyle)||R._getDefaultFeatureStyle(),locationFeatureStyle:(t==null?void 0:t.locationFeatureStyle)||R._getDefaultLocationFeatureStyle(),operationMode:(t==null?void 0:t.operationMode)||"default"},Z={...R._getDefaultMapOptions(),...t.options};if(Z.maxZoom>20)throw new Error("Max zoom level cannot be greater than 20.");return{apiKey:i,googleKey:o,style:n,el:r,mapOptions:Z,pluginOptions:u}}static _getDefaultFeatureStyle(){return{weight:2,color:"white",fillColor:"#1E88E5",fillOpacity:.3}}static _getDefaultLocationFeatureStyle(){return{weight:3,color:"#1E88E5",fill:!1,dashArray:"15,5"}}static _getDefaultMapOptions(){return{zoom:5,center:[-29.15,25.15],minZoom:5,maxZoom:20,gestureHandling:!0}}_initializePlugin(t,i){this.pluginOptions=t,this._api=new et({apiKey:t.key,baseUrl:t.url}),this._unitSelector=new G({placeholder:"Type to search unit numbers..."}),this.styleLayers={},this._originalInteractionStates=this._captureInteractionStates(i),this._setupRiskscapeMap(),this._bindMethods()}_captureInteractionStates(t){return{dragging:t.dragging!==!1,touchZoom:t.touchZoom!==!1,doubleClickZoom:t.doubleClickZoom!==!1,scrollWheelZoom:t.scrollWheelZoom!==!1,boxZoom:t.boxZoom!==!1,keyboard:t.keyboard!==!1,tap:t.tap!==!1}}_bindMethods(){this.setStyle=this.setStyle.bind(this)}_setupRiskscapeMap(){this._configureControls(),this.setOperationMode(this.pluginOptions.operationMode),this._initializeStyle()}_configureControls(){this.zoomControl&&this.zoomControl.setPosition("bottomright"),this.attributionControl&&this.attributionControl.setPrefix(`
|
|
12
|
+
`).join(""),l(this,h,q).call(this)},q=function(){const e=s(this,k).querySelectorAll(".rs-unit-selector-item");if(e.forEach((t,i)=>{t.classList.toggle("rs-unit-selector-item--selected",i===s(this,M))}),s(this,M)>=0){const t=e[s(this,M)];t&&t.scrollIntoView({block:"nearest"})}},tt=function(){s(this,I)||(c(this,I,!0),s(this,E).style.display="block",s(this,m).setAttribute("aria-expanded","true"))},V=function(){s(this,I)&&(c(this,I,!1),s(this,E)&&(s(this,E).style.display="none"),s(this,m)&&s(this,m).setAttribute("aria-expanded","false"))},lt=function(e){s(this,m).value=e.unit_number,l(this,h,V).call(this),this.hide(),s(this,P)&&s(this,P).call(this,e)},ht=function(){this.hide(),s(this,F)&&s(this,F).call(this)};class et{constructor({apiKey:e,baseUrl:t,timeout:i=8e3}){_(this,x);_(this,W);_(this,K);_(this,B,8e3);_(this,T);_(this,N,0);_(this,H,0);c(this,W,e),c(this,K,t),c(this,B,i),this.fetchAddress=this.fetchAddress.bind(this),this.fetchPropertyIdentification=this.fetchPropertyIdentification.bind(this),this.fetchProperty=this.fetchProperty.bind(this),this.fetchPropertyUnits=this.fetchPropertyUnits.bind(this),this.fetchFeature=this.fetchFeature.bind(this),this.fetchSchemeUnits=this.fetchSchemeUnits.bind(this),this.geocode=this.geocode.bind(this),console.debug("RiskscapeApi initialized with version:","1.1.2")}async fetchAddress(e){return l(this,x,D).call(this,"GET","/addressing/v2/address",{params:{address_id:e}})}async geocode(e,t={},i={}){const r={q:e,...t};return l(this,x,D).call(this,"GET","/addressing/v2/autocomplete",{params:r,signal:i.signal||this.getAbortSignal(),...i})}async fetchProperty(e,t){return l(this,x,D).call(this,"GET","/properties/v1/property",{params:{property_key:e,unit_number:t}})}async fetchPropertyIdentification(e,t){return this.fetchProperty(e,t)}async fetchPropertyUnits(e){return l(this,x,D).call(this,"GET","/properties/v1/unit-numbers",{params:{property_key:e}})}async fetchFeature(e,t){return l(this,x,D).call(this,"GET","/features/v1/feature",{params:{type:e,...t}})}async fetchSchemeUnits(e){return l(this,x,D).call(this,"GET","/schemes/v1/units",{params:{scheme_id:e}})}cancel(){s(this,T)&&(s(this,T).abort(),c(this,T,null))}createAbortController(){c(this,T,new AbortController)}getAbortSignal(){return s(this,T)||this.createAbortController(),s(this,T).signal}getConsecutiveErrors(){return s(this,N)}getConsecutiveCancels(){return s(this,H)}resetCounters(){c(this,N,0),c(this,H,0)}}W=new WeakMap,K=new WeakMap,B=new WeakMap,T=new WeakMap,N=new WeakMap,H=new WeakMap,x=new WeakSet,Lt=function(e){var i,r,n;if(e.name==="AbortError")throw ot(this,H)._++,new Error("Request cancelled");ot(this,N)._++;const t=new CustomEvent("riskscape-api:error",{detail:{message:e.message,response:(i=e.response)==null?void 0:i.data,status:(r=e.response)==null?void 0:r.status}});throw document.dispatchEvent(t),e.response?e.response.status===401?new Error("Unauthorized"):new Error(((n=e.response.data)==null?void 0:n.message)||"Unknown error"):navigator.onLine?e:new Error("Network error: No internet connection")},D=async function(e,t,i={}){try{const r=new URL(t,s(this,K));i.params&&Object.entries(i.params).forEach(([o,u])=>{u!=null&&r.searchParams.append(o,u)});const n=await fetch(r,{method:e.toUpperCase(),headers:{accept:"application/json","x-api-key":s(this,W),"x-riskscape-plugins-version":"1.1.2",...i.headers},signal:i.signal||(AbortSignal.timeout?AbortSignal.timeout(s(this,B)):void 0)});if(!n.ok){const o=new Error(`HTTP ${n.status}`);throw o.response={status:n.status,data:await n.json().catch(()=>({}))},o}return await n.json()}catch(r){return l(this,x,Lt).call(this,r)}finally{i.signal===this.getAbortSignal()&&c(this,T,null)}};var $={exports:{}},Ut=$.exports,ut;function xt(){return ut||(ut=1,function(a,e){(function(t,i){i(e)})(Ut,function(t){var i={ar:{touch:"استخدم إصبعين لتحريك الخريطة",scroll:"استخدم ctrl + scroll لتصغير/تكبير الخريطة",scrollMac:"يمكنك استخدام ⌘ + التمرير لتكبير/تصغير الخريطة"},bg:{touch:"Използвайте два пръста, за да преместите картата",scroll:"Задръжте бутона Ctrl натиснат, докато превъртате, за да промените мащаба на картата",scrollMac:"Задръжте бутона ⌘ натиснат, докато превъртате, за да промените мащаба на картата"},bn:{touch:"মানচিত্রটিকে সরাতে দুটি আঙ্গুল ব্যবহার করুন",scroll:"ম্যাপ জুম করতে ctrl + scroll ব্যবহার করুন",scrollMac:"ম্যাপে জুম করতে ⌘ বোতাম টিপে স্ক্রল করুন"},ca:{touch:"Fes servir dos dits per moure el mapa",scroll:"Prem la tecla Control mentre et desplaces per apropar i allunyar el mapa",scrollMac:"Prem la tecla ⌘ mentre et desplaces per apropar i allunyar el mapa"},cs:{touch:"K posunutí mapy použijte dva prsty",scroll:"Velikost zobrazení mapy změňte podržením klávesy Ctrl a posouváním kolečka myši",scrollMac:"Velikost zobrazení mapy změníte podržením klávesy ⌘ a posunutím kolečka myši / touchpadu"},da:{touch:"Brug to fingre til at flytte kortet",scroll:"Brug ctrl + rullefunktionen til at zoome ind og ud på kortet",scrollMac:"Brug ⌘ + rullefunktionen til at zoome ind og ud på kortet"},de:{touch:"Verschieben der Karte mit zwei Fingern",scroll:"Verwende Strg+Scrollen zum Zoomen der Karte",scrollMac:"⌘"},el:{touch:"Χρησιμοποιήστε δύο δάχτυλα για μετακίνηση στον χάρτη",scroll:"Χρησιμοποιήστε το πλήκτρο Ctrl και κύλιση, για να μεγεθύνετε τον χάρτη",scrollMac:"Χρησιμοποιήστε το πλήκτρο ⌘ + κύλιση για εστίαση στον χάρτη"},en:{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-AU":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},"en-GB":{touch:"Use two fingers to move the map",scroll:"Use ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},es:{touch:"Para mover el mapa, utiliza dos dedos",scroll:"Mantén pulsada la tecla Ctrl mientras te desplazas para acercar o alejar el mapa",scrollMac:"Mantén pulsada la tecla ⌘ mientras te desplazas para acercar o alejar el mapa"},eu:{touch:"Erabili bi hatz mapa mugitzeko",scroll:"Mapan zooma aplikatzeko, sakatu Ktrl eta egin gora edo behera",scrollMac:"Eduki sakatuta ⌘ eta egin gora eta behera mapa handitu eta txikitzeko"},fa:{touch:"برای حرکت دادن نقشه از دو انگشت استفاده کنید.",scroll:"برای بزرگنمایی نقشه از ctrl + scroll استفاده کنید",scrollMac:"برای بزرگنمایی نقشه، از ⌘ + پیمایش استفاده کنید."},fi:{touch:"Siirrä karttaa kahdella sormella.",scroll:"Zoomaa karttaa painamalla Ctrl-painiketta ja vierittämällä.",scrollMac:"Zoomaa karttaa pitämällä painike ⌘ painettuna ja vierittämällä."},fil:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},fr:{touch:"Utilisez deux doigts pour déplacer la carte",scroll:"Vous pouvez zoomer sur la carte à l'aide de CTRL+Molette de défilement",scrollMac:"Vous pouvez zoomer sur la carte à l'aide de ⌘+Molette de défilement"},gl:{touch:"Utiliza dous dedos para mover o mapa",scroll:"Preme Ctrl mentres te desprazas para ampliar o mapa",scrollMac:"Preme ⌘ e desprázate para ampliar o mapa"},gu:{touch:"નકશો ખસેડવા બે આંગળીઓનો ઉપયોગ કરો",scroll:"નકશાને ઝૂમ કરવા માટે ctrl + સ્ક્રોલનો ઉપયોગ કરો",scrollMac:"નકશાને ઝૂમ કરવા ⌘ + સ્ક્રોલનો ઉપયોગ કરો"},hi:{touch:"मैप एक जगह से दूसरी जगह ले जाने के लिए दो उंगलियों का इस्तेमाल करें",scroll:"मैप को ज़ूम करने के लिए ctrl + स्क्रोल का उपयोग करें",scrollMac:"मैप को ज़ूम करने के लिए ⌘ + स्क्रोल का उपयोग करें"},hr:{touch:"Pomičite kartu pomoću dva prsta",scroll:"Upotrijebite Ctrl i klizač miša da biste zumirali kartu",scrollMac:"Upotrijebite gumb ⌘ dok se pomičete za zumiranje karte"},hu:{touch:"Két ujjal mozgassa a térképet",scroll:"A térkép a ctrl + görgetés használatával nagyítható",scrollMac:"A térkép a ⌘ + görgetés használatával nagyítható"},id:{touch:"Gunakan dua jari untuk menggerakkan peta",scroll:"Gunakan ctrl + scroll untuk memperbesar atau memperkecil peta",scrollMac:"Gunakan ⌘ + scroll untuk memperbesar atau memperkecil peta"},it:{touch:"Utilizza due dita per spostare la mappa",scroll:"Utilizza CTRL + scorrimento per eseguire lo zoom della mappa",scrollMac:"Utilizza ⌘ + scorrimento per eseguire lo zoom della mappa"},iw:{touch:"הזז את המפה באמצעות שתי אצבעות",scroll:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ctrl וגלילה",scrollMac:"אפשר לשנות את מרחק התצוגה במפה באמצעות מקש ⌘ וגלילה"},ja:{touch:"地図を移動させるには指 2 本で操作します",scroll:"地図をズームするには、Ctrl キーを押しながらスクロールしてください",scrollMac:"地図をズームするには、⌘ キーを押しながらスクロールしてください"},kn:{touch:"Use two fingers to move the map",scroll:"Use Ctrl + scroll to zoom the map",scrollMac:"Use ⌘ + scroll to zoom the map"},ko:{touch:"지도를 움직이려면 두 손가락을 사용하세요.",scroll:"지도를 확대/축소하려면 Ctrl을 누른 채 스크롤하세요.",scrollMac:"지도를 확대하려면 ⌘ + 스크롤 사용"},lt:{touch:"Perkelkite žemėlapį dviem pirštais",scroll:"Slinkite nuspaudę klavišą „Ctrl“, kad pakeistumėte žemėlapio mastelį",scrollMac:"Paspauskite klavišą ⌘ ir slinkite, kad priartintumėte žemėlapį"},lv:{touch:"Lai pārvietotu karti, bīdiet to ar diviem pirkstiem",scroll:"Kartes tālummaiņai izmantojiet ctrl + ritināšanu",scrollMac:"Lai veiktu kartes tālummaiņu, izmantojiet ⌘ + ritināšanu"},ml:{touch:"മാപ്പ് നീക്കാൻ രണ്ട് വിരലുകൾ ഉപയോഗിക്കുക",scroll:"കൺട്രോൾ + സ്ക്രോൾ ഉപയോഗിച്ച് മാപ്പ് സൂം ചെയ്യുക",scrollMac:"⌘ + സ്ക്രോൾ ഉപയോഗിച്ച് മാപ്പ് സൂം ചെയ്യുക"},mr:{touch:"नकाशा हलविण्यासाठी दोन बोटे वापरा",scroll:"नकाशा झूम करण्यासाठी ctrl + scroll वापरा",scrollMac:"नकाशावर झूम करण्यासाठी ⌘ + स्क्रोल वापरा"},nl:{touch:"Gebruik twee vingers om de kaart te verplaatsen",scroll:"Gebruik Ctrl + scrollen om in- en uit te zoomen op de kaart",scrollMac:"Gebruik ⌘ + scrollen om in en uit te zoomen op de kaart"},no:{touch:"Bruk to fingre for å flytte kartet",scroll:"Hold ctrl-tasten inne og rull for å zoome på kartet",scrollMac:"Hold inne ⌘-tasten og rull for å zoome på kartet"},pl:{touch:"Przesuń mapę dwoma palcami",scroll:"Naciśnij CTRL i przewiń, by przybliżyć mapę",scrollMac:"Naciśnij ⌘ i przewiń, by przybliżyć mapę"},pt:{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-BR":{touch:"Use dois dedos para mover o mapa",scroll:"Pressione Ctrl e role a tela simultaneamente para aplicar zoom no mapa",scrollMac:"Use ⌘ e role a tela simultaneamente para aplicar zoom no mapa"},"pt-PT":{touch:"Utilize dois dedos para mover o mapa",scroll:"Utilizar ctrl + deslocar para aumentar/diminuir zoom do mapa",scrollMac:"Utilize ⌘ + deslocar para aumentar/diminuir o zoom do mapa"},ro:{touch:"Folosiți două degete pentru a deplasa harta",scroll:"Apăsați tasta ctrl și derulați simultan pentru a mări harta",scrollMac:"Folosiți ⌘ și derulați pentru a mări/micșora harta"},ru:{touch:"Чтобы переместить карту, проведите по ней двумя пальцами",scroll:"Чтобы изменить масштаб, прокручивайте карту, удерживая клавишу Ctrl.",scrollMac:"Чтобы изменить масштаб, нажмите ⌘ + прокрутка"},sk:{touch:"Mapu môžete posunúť dvoma prstami",scroll:"Ak chcete priblížiť mapu, stlačte kláves ctrl a posúvajte",scrollMac:"Ak chcete priblížiť mapu, stlačte kláves ⌘ a posúvajte kolieskom myši"},sl:{touch:"Premaknite zemljevid z dvema prstoma",scroll:"Zemljevid povečate tako, da držite tipko Ctrl in vrtite kolesce na miški",scrollMac:"Uporabite ⌘ + funkcijo pomika, da povečate ali pomanjšate zemljevid"},sr:{touch:"Мапу померајте помоћу два прста",scroll:"Притисните ctrl тастер док померате да бисте зумирали мапу",scrollMac:"Притисните тастер ⌘ док померате да бисте зумирали мапу"},sv:{touch:"Använd två fingrar för att flytta kartan",scroll:"Använd ctrl + rulla för att zooma kartan",scrollMac:"Använd ⌘ + rulla för att zooma på kartan"},ta:{touch:"மேப்பை நகர்த்த இரண்டு விரல்களைப் பயன்படுத்தவும்",scroll:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ctrl பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்",scrollMac:"மேப்பை பெரிதாக்கி/சிறிதாக்கிப் பார்க்க, ⌘ பட்டனைப் பிடித்தபடி, மேலே/கீழே ஸ்க்ரால் செய்யவும்"},te:{touch:"మ్యాప్ని తరలించడం కోసం రెండు వేళ్లను ఉపయోగించండి",scroll:"మ్యాప్ని జూమ్ చేయడానికి ctrl బటన్ను నొక్కి ఉంచి, స్క్రోల్ చేయండి",scrollMac:"మ్యాప్ జూమ్ చేయాలంటే ⌘ + స్క్రోల్ ఉపయోగించండి"},th:{touch:"ใช้ 2 นิ้วเพื่อเลื่อนแผนที่",scroll:"กด Ctrl ค้างไว้ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่",scrollMac:"กด ⌘ แล้วเลื่อนหน้าจอเพื่อซูมแผนที่"},tl:{touch:"Gumamit ng dalawang daliri upang iusog ang mapa",scroll:"Gamitin ang ctrl + scroll upang i-zoom ang mapa",scrollMac:"Gamitin ang ⌘ + scroll upang i-zoom ang mapa"},tr:{touch:"Haritada gezinmek için iki parmağınızı kullanın",scroll:"Haritayı yakınlaştırmak için ctrl + kaydırma kombinasyonunu kullanın",scrollMac:"Haritayı yakınlaştırmak için ⌘ tuşuna basıp ekranı kaydırın"},uk:{touch:"Переміщуйте карту двома пальцями",scroll:"Щоб змінювати масштаб карти, прокручуйте коліщатко миші, утримуючи клавішу Ctrl",scrollMac:"Щоб змінити масштаб карти, використовуйте ⌘ + прокручування"},vi:{touch:"Sử dụng hai ngón tay để di chuyển bản đồ",scroll:"Sử dụng ctrl + cuộn để thu phóng bản đồ",scrollMac:"Sử dụng ⌘ + cuộn để thu phóng bản đồ"},"zh-CN":{touch:"使用双指移动地图",scroll:"按住 Ctrl 并滚动鼠标滚轮才可缩放地图",scrollMac:"按住 ⌘ 并滚动鼠标滚轮才可缩放地图"},"zh-TW":{touch:"同時以兩指移動地圖",scroll:"按住 ctrl 鍵加上捲動滑鼠可以縮放地圖",scrollMac:"按 ⌘ 加上滾動捲軸可以縮放地圖"}};L.Map.mergeOptions({gestureHandlingOptions:{text:{},duration:1e3}});var r=!1,n=L.Handler.extend({addHooks:function(){this._handleTouch=this._handleTouch.bind(this),this._setupPluginOptions(),this._setLanguageContent(),this._disableInteractions(),this._map._container.addEventListener("touchstart",this._handleTouch),this._map._container.addEventListener("touchmove",this._handleTouch),this._map._container.addEventListener("touchend",this._handleTouch),this._map._container.addEventListener("touchcancel",this._handleTouch),this._map._container.addEventListener("click",this._handleTouch),L.DomEvent.on(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.on(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.on(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.on(this._map,"movestart",this._handleDragging,this),L.DomEvent.on(this._map,"move",this._handleDragging,this),L.DomEvent.on(this._map,"moveend",this._handleDragging,this)},removeHooks:function(){this._enableInteractions(),this._map._container.removeEventListener("touchstart",this._handleTouch),this._map._container.removeEventListener("touchmove",this._handleTouch),this._map._container.removeEventListener("touchend",this._handleTouch),this._map._container.removeEventListener("touchcancel",this._handleTouch),this._map._container.removeEventListener("click",this._handleTouch),L.DomEvent.off(this._map._container,"wheel",this._handleScroll,this),L.DomEvent.off(this._map,"mouseover",this._handleMouseOver,this),L.DomEvent.off(this._map,"mouseout",this._handleMouseOut,this),L.DomEvent.off(this._map,"movestart",this._handleDragging,this),L.DomEvent.off(this._map,"move",this._handleDragging,this),L.DomEvent.off(this._map,"moveend",this._handleDragging,this)},_handleDragging:function(o){o.type=="movestart"||o.type=="move"?r=!0:o.type=="moveend"&&(r=!1)},_disableInteractions:function(){this._map.dragging.disable(),this._map.scrollWheelZoom.disable(),this._map.tap&&this._map.tap.disable()},_enableInteractions:function(){this._map.dragging.enable(),this._map.scrollWheelZoom.enable(),this._map.tap&&this._map.tap.enable()},_setupPluginOptions:function(){this._map.options.gestureHandlingText&&(this._map.options.gestureHandlingOptions.text=this._map.options.gestureHandlingText)},_setLanguageContent:function(){var o;if(this._map.options.gestureHandlingOptions&&this._map.options.gestureHandlingOptions.text&&this._map.options.gestureHandlingOptions.text.touch&&this._map.options.gestureHandlingOptions.text.scroll&&this._map.options.gestureHandlingOptions.text.scrollMac)o=this._map.options.gestureHandlingOptions.text;else{var u=this._getUserLanguage();u||(u="en"),i[u]&&(o=i[u]),o||u.indexOf("-")===-1||(u=u.split("-")[0],o=i[u]),o||(o=i[u="en"])}var C=!1;0<=navigator.platform.toUpperCase().indexOf("MAC")&&(C=!0);var Z=o.scroll;C&&(Z=o.scrollMac),this._map._container.setAttribute("data-gesture-handling-touch-content",o.touch),this._map._container.setAttribute("data-gesture-handling-scroll-content",Z)},_getUserLanguage:function(){return navigator.languages?navigator.languages[0]:navigator.language||navigator.userLanguage},_handleTouch:function(o){for(var u=["leaflet-control-minimap","leaflet-interactive","leaflet-popup-content","leaflet-popup-content-wrapper","leaflet-popup-close-button","leaflet-control-zoom-in","leaflet-control-zoom-out"],C=!1,Z=0;Z<u.length;Z++)L.DomUtil.hasClass(o.target,u[Z])&&(C=!0);C?L.DomUtil.hasClass(o.target,"leaflet-interactive")&&o.type==="touchmove"&&o.touches.length===1?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning"):o.type==="touchmove"||o.type==="touchstart"?o.touches.length===1?(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-touch-warning"),this._disableInteractions()):(o.preventDefault(),this._enableInteractions(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")):L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-touch-warning")},_isScrolling:!1,_handleScroll:function(o){o.metaKey||o.ctrlKey?(o.preventDefault(),L.DomUtil.removeClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.enable()):(L.DomUtil.addClass(this._map._container,"leaflet-gesture-handling-scroll-warning"),this._map.scrollWheelZoom.disable(),clearTimeout(this._isScrolling),this._isScrolling=setTimeout(function(){for(var u=document.getElementsByClassName("leaflet-gesture-handling-scroll-warning"),C=0;C<u.length;C++)L.DomUtil.removeClass(u[C],"leaflet-gesture-handling-scroll-warning")},this._map.options.gestureHandlingOptions.duration))},_handleMouseOver:function(o){this._enableInteractions()},_handleMouseOut:function(o){r||this._disableInteractions()}});L.Map.addInitHook("addHandler","gestureHandling",n),t.GestureHandling=n,t.default=n,Object.defineProperty(t,"__esModule",{value:!0})})}($,$.exports)),$.exports}xt();const f=Symbol("newer"),w=Symbol("older");class It{constructor(e,t){typeof e!="number"&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[f]&&(e===this.oldest&&(this.oldest=e[f]),e[f][w]=e[w]),e[w]&&(e[w][f]=e[f]),e[f]=void 0,e[w]=this.newest,this.newest&&(this.newest[f]=e),this.newest=e)}assign(e){let t,i=this.limit||Number.MAX_VALUE;this._keymap.clear();let r=e[Symbol.iterator]();for(let n=r.next();!n.done;n=r.next()){let o=new dt(n.value[0],n.value[1]);if(this._keymap.set(o.key,o),t?(t[f]=o,o[w]=t):this.oldest=o,t=o,i--==0)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}set(e,t){var i=this._keymap.get(e);return i?(i.value=t,this._markEntryAsUsed(i),this):(this._keymap.set(e,i=new dt(e,t)),this.newest?(this.newest[f]=i,i[w]=this.newest):this.oldest=i,this.newest=i,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var e=this.oldest;if(e)return this.oldest[f]?(this.oldest=this.oldest[f],this.oldest[w]=void 0):(this.oldest=void 0,this.newest=void 0),e[f]=e[w]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var t=this._keymap.get(e);if(t)return this._keymap.delete(t.key),t[f]&&t[w]?(t[w][f]=t[f],t[f][w]=t[w]):t[f]?(t[f][w]=void 0,this.oldest=t[f]):t[w]?(t[w][f]=void 0,this.newest=t[w]):this.oldest=this.newest=void 0,this.size--,t.value}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new st(this.oldest)}values(){return new at(this.oldest)}entries(){return this}[Symbol.iterator](){return new it(this.oldest)}forEach(e,t){typeof t!="object"&&(t=this);let i=this.oldest;for(;i;)e.call(t,i.value,i.key,this),i=i[f]}toJSON(){for(var e=new Array(this.size),t=0,i=this.oldest;i;)e[t++]={key:i.key,value:i.value},i=i[f];return e}toString(){for(var e="",t=this.oldest;t;)e+=String(t.key)+":"+t.value,t=t[f],t&&(e+=" < ");return e}}function dt(a,e){this.key=a,this.value=e,this[f]=void 0,this[w]=void 0}function it(a){this.entry=a}it.prototype[Symbol.iterator]=function(){return this},it.prototype.next=function(){let a=this.entry;return a?(this.entry=a[f],{done:!1,value:[a.key,a.value]}):{done:!0,value:void 0}};function st(a){this.entry=a}st.prototype[Symbol.iterator]=function(){return this},st.prototype.next=function(){let a=this.entry;return a?(this.entry=a[f],{done:!1,value:a.key}):{done:!0,value:void 0}};function at(a){this.entry=a}at.prototype[Symbol.iterator]=function(){return this},at.prototype.next=function(){let a=this.entry;return a?(this.entry=a[f],{done:!1,value:a.value}):{done:!0,value:void 0}};function Tt(a,e){let t=0,i=null;i=setInterval(function(){if(t>=20)throw clearInterval(i),new Error("window.google not found after 10 seconds");window.google&&window.google.maps&&window.google.maps.Map&&(clearInterval(i),a.call(e)),++t},500)}L.GridLayer.GoogleMutant=L.GridLayer.extend({options:{maxZoom:21,type:"roadmap",maxNativeZoom:21},initialize:function(a){L.GridLayer.prototype.initialize.call(this,a),this._tileCallbacks={},this._lru=new It(100),this._imagesPerTile=this.options.type==="hybrid"?2:1,this._boundOnMutatedImage=this._onMutatedImage.bind(this)},onAdd:function(a){L.GridLayer.prototype.onAdd.call(this,a),this._initMutantContainer(),this._logoContainer&&a._controlCorners.bottomleft.appendChild(this._logoContainer),this._attributionContainer&&a._controlCorners.bottomright.appendChild(this._attributionContainer),Tt(()=>{this._map&&(this._initMutant(),google.maps.event.addListenerOnce(this._mutant,"idle",()=>{this._map&&(this._checkZoomLevels(),this._mutantIsReady=!0)}))})},onRemove:function(a){L.GridLayer.prototype.onRemove.call(this,a),this._observer.disconnect(),a._container.removeChild(this._mutantContainer),this._logoContainer&&L.DomUtil.remove(this._logoContainer),this._attributionContainer&&L.DomUtil.remove(this._attributionContainer),this._mutant&&google.maps.event.clearListeners(this._mutant,"idle")},addGoogleLayer:function(a,e){return this._subLayers||(this._subLayers={}),this.whenReady(()=>{var t=google.maps[a],i=new t(e);i.setMap(this._mutant),this._subLayers[a]=i}),this},removeGoogleLayer:function(a){return this.whenReady(()=>{var e=this._subLayers&&this._subLayers[a];e&&(e.setMap(null),delete this._subLayers[a])}),this},_initMutantContainer:function(){this._mutantContainer||(this._mutantContainer=L.DomUtil.create("div","leaflet-google-mutant leaflet-top leaflet-left"),this._mutantContainer.id="_MutantContainer_"+L.Util.stamp(this._mutantContainer),this._mutantContainer.style.pointerEvents="none",this._mutantContainer.style.visibility="hidden",L.DomEvent.off(this._mutantContainer)),this._map.getContainer().appendChild(this._mutantContainer),this.setOpacity(this.options.opacity);const a=this._mutantContainer.style;this._map.options.zoomSnap<1?(a.width="180%",a.height="180%"):(a.width="100%",a.height="100%"),a.zIndex=-1,this._attachObserver(this._mutantContainer)},_initMutant:function(){if(!this._mutant){var a={center:{lat:0,lng:0},zoom:0,tilt:0,mapTypeId:this.options.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,styles:this.options.styles||[],backgroundColor:"transparent"};this.options.mapId!=null&&(a.mapId=this.options.mapId);var e=new google.maps.Map(this._mutantContainer,a);this._mutant=e,this._update(),this.fire("spawned",{mapObject:e}),this._waitControls(),this.once("controls_ready",this._setupAttribution)}},_attachObserver:function(e){this._observer||(this._observer=new MutationObserver(this._onMutations.bind(this))),this._observer.observe(e,{childList:!0,subtree:!0}),Array.prototype.forEach.call(e.querySelectorAll("img"),this._boundOnMutatedImage)},_waitControls:function(){const a=setInterval(()=>{const e=this._mutant.__gm.layoutManager;if(!e)return;clearInterval(a);let t;Object.keys(e).forEach(function(i){const r=e[i];r.get&&r.get(1)instanceof Node&&(t=r)}),this.fire("controls_ready",{positions:t})},50)},_setupAttribution:function(a){if(!this._map)return;const e=google.maps.ControlPosition,t=this._attributionContainer=a.positions.get(e.BOTTOM_RIGHT);L.DomUtil.addClass(t,"leaflet-control leaflet-control-attribution"),L.DomEvent.disableClickPropagation(t),t.style.height="14px",this._map._controlCorners.bottomright.appendChild(t),this._logoContainer=a.positions.get(e.BOTTOM_LEFT),this._logoContainer.style.pointerEvents="auto",this._map._controlCorners.bottomleft.appendChild(this._logoContainer)},_onMutations:function(e){for(var t=0;t<e.length;++t)for(var i=e[t],r=0;r<i.addedNodes.length;++r){var n=i.addedNodes[r];n instanceof HTMLImageElement?this._onMutatedImage(n):n instanceof HTMLElement&&Array.prototype.forEach.call(n.querySelectorAll("img"),this._boundOnMutatedImage)}},_roadRegexp:/!1i(\d+)!2i(\d+)!3i(\d+|VinaFnapurmBegrtn)!/,_satRegexp:/x=(\d+)&y=(\d+)&z=(\d+|VinaFnapurmBegrtn)/,_onMutatedImage:function(e){let t,i=e.src.match(this._roadRegexp),r=0;if(i?(t={z:i[1],x:i[2],y:i[3]},this._imagesPerTile>1&&(e.style.zIndex=1,r=1)):(i=e.src.match(this._satRegexp),i&&(t={x:i[1],y:i[2],z:i[3]}),r=0),t){var n=this._tileCoordsToKey(t);e.style.position="absolute";var o=n+"/"+r;this._lru.set(o,e),o in this._tileCallbacks&&this._tileCallbacks[o]&&(this._tileCallbacks[o].forEach(u=>u(e)),delete this._tileCallbacks[o])}},createTile:function(a,e){const t=this._tileCoordsToKey(a),i=L.DomUtil.create("div");i.style.textAlign="left",i.dataset.pending=this._imagesPerTile,e=e.bind(this,null,i);for(var r=0;r<this._imagesPerTile;++r){const n=t+"/"+r,o=this._lru.get(n);o?(i.appendChild(this._clone(o)),--i.dataset.pending):(this._tileCallbacks[n]=this._tileCallbacks[n]||[],this._tileCallbacks[n].push((function(u){return(function(C){u.appendChild(this._clone(C)),--u.dataset.pending,parseInt(u.dataset.pending)||e()}).bind(this)}).bind(this)(i)))}return parseInt(i.dataset.pending)||L.Util.requestAnimFrame(e),i},_clone:function(a){const e=a.cloneNode(!0);return e.style.visibility="visible",e},_checkZoomLevels:function(){const a=this._map.getZoom(),e=this._mutant.getZoom();!a||!e||(e!==a||e>this.options.maxNativeZoom)&&this._setMaxNativeZoom(e)},_setMaxNativeZoom:function(a){a!==this.options.maxNativeZoom&&(this.options.maxNativeZoom=a,this._resetView())},_update:function(a){if(this._mutant){a=a||this._map.getCenter();const e=new google.maps.LatLng(a.lat,a.lng),t=Math.round(this._map.getZoom()),i=this._mutant.getZoom();this._mutant.setCenter(e),t!==i&&(this._mutant.setZoom(t),this._mutantIsReady&&this._checkZoomLevels())}L.GridLayer.prototype._update.call(this,a)},whenReady:function(a,e){return this._mutant?a.call(e||this,{target:this}):this.on("spawned",a,e),this}}),L.gridLayer.googleMutant=function(a){return new L.GridLayer.GoogleMutant(a)};const pt=a=>`/maps/v1/${a}/{z}/{x}/{y}`,J=a=>`/tiles/v1/${a}`,Ot={default:[{name:"base",type:"RiskscapeTileLayer",layerUrl:pt("default"),layerOptions:{pane:"tilePane",zIndex:4,maxZoom:20,tileSize:512,zoomOffset:-1,crossOrigin:!0}},{name:"wmsDefault",type:"RiskscapeWmsLayer",layerUrl:J("default"),layerOptions:{pane:"tilePane",zIndex:2,minZoom:12,maxZoom:20,tileSize:512,zoomOffset:-1}},{name:"wmsDefaultLabels",type:"RiskscapeWmsLayer",layerUrl:J("default-labels"),layerOptions:{pane:"overlayPane",zIndex:10,minZoom:13,maxZoom:20,tileSize:512,zoomOffset:-1}}],hybrid:[{name:"googleSatellite",type:"GoogleMutant",layerOptions:{type:"satellite"}},{name:"base",type:"RiskscapeTileLayer",layerUrl:pt("hybrid"),layerOptions:{pane:"tilePane",zIndex:4,maxZoom:20,tileSize:512,zoomOffset:-1,crossOrigin:!0}},{name:"wmsHybrid",type:"RiskscapeWmsLayer",layerUrl:J("hybrid"),layerOptions:{pane:"tilePane",zIndex:1,minZoom:13,maxZoom:20,tileSize:512,zoomOffset:-1}},{name:"wmsHybridLabels",type:"RiskscapeWmsLayer",layerUrl:J("hybrid-labels"),layerOptions:{pane:"overlayPane",minZoom:13,maxZoom:20,tileSize:512,zoomOffset:-1}}]};function Zt(a){return Ot[a]}function At(a){return{lat:a.lat.toFixed(6),lon:a.lng.toFixed(6)}}function Pt(a){const e=At(a);return`${e.lat},${e.lon}`}function Ft(a){return new Promise((e,t)=>{if(window.google&&window.google.maps){e(window.google.maps);return}const i=document.createElement("script");i.src=`https://maps.googleapis.com/maps/api/js?key=${a}&callback=initGoogleMaps`,i.async=!0,i.defer=!0,window.initGoogleMaps=function(){e(window.google.maps),delete window.initGoogleMaps},i.onerror=function(){t(new Error("Failed to load Google Maps API"))},document.head.appendChild(i)})}const R=class R extends L.Map{constructor(t){R._validateConfig(t);const{apiKey:i,googleKey:r,style:n,el:o,mapOptions:u,pluginOptions:C}=R._processConfig(t);super(o,u);_(this,v);z(this,"_api");z(this,"_search");z(this,"_searchMarker");z(this,"_unitSelector");z(this,"_loading",!1);z(this,"_locationFeature");z(this,"pluginOptions");z(this,"styleLayers");z(this,"featureLayer");z(this,"feature");z(this,"_originalInteractionStates");z(this,"_handleMapClick",async t=>{if(!this._unitSelector.isVisible()){if(this.getZoom()<=15){console.debug("Zoom level too low for feature identification");return}try{await l(this,v,j).call(this,"property_scheme",t.latlng)}catch(i){console.error("Failed to identify feature on map click:",i)}}});z(this,"_handleSearchSelect",async({candidate:t})=>{this._removeSearchMarker(),this._removeLocationFeature();const{category:i,subcategory:r,position:n,attributes:o}=t,u=[n.lat,n.lon];try{this.pluginOptions.operationMode==="identify"?await this._handleIdentifyModeSearch(t,u):i==="Location"?await this._handleLocationSearch(o):this._setSearchMarker(u)}catch(C){console.error("Failed to handle search selection:",C),this._setSearchMarker(u)}});this._initializePlugin(C,u)}static _validateConfig(t){if(!(t!=null&&t.key))throw new Error("API key is required.");const i=(t==null?void 0:t.style)||"default",r=t==null?void 0:t.googleKey;if(i==="hybrid"&&!r)throw new Error("Google API key is required for hybrid style.")}static _processConfig(t){const i=t.key,r=t.element,n=(t==null?void 0:t.style)||"default",o=t==null?void 0:t.googleKey,u={key:i,googleKey:o,url:(t==null?void 0:t.url)||"https://api.cloud.riskscape.pro",style:n,featureStyle:(t==null?void 0:t.featureStyle)||R._getDefaultFeatureStyle(),locationFeatureStyle:(t==null?void 0:t.locationFeatureStyle)||R._getDefaultLocationFeatureStyle(),operationMode:(t==null?void 0:t.operationMode)||"default"},Z={...R._getDefaultMapOptions(),...t.options};if(Z.maxZoom>20)throw new Error("Max zoom level cannot be greater than 20.");return{apiKey:i,googleKey:o,style:n,el:r,mapOptions:Z,pluginOptions:u}}static _getDefaultFeatureStyle(){return{weight:2,color:"white",fillColor:"#1E88E5",fillOpacity:.3}}static _getDefaultLocationFeatureStyle(){return{weight:3,color:"#1E88E5",fill:!1,dashArray:"15,5"}}static _getDefaultMapOptions(){return{zoom:5,center:[-29.15,25.15],minZoom:5,maxZoom:20,gestureHandling:!0}}_initializePlugin(t,i){this.pluginOptions=t,this._api=new et({apiKey:t.key,baseUrl:t.url}),this._unitSelector=new G({placeholder:"Type to search unit numbers..."}),this.styleLayers={},this._originalInteractionStates=this._captureInteractionStates(i),this._setupRiskscapeMap(),this._bindMethods()}_captureInteractionStates(t){return{dragging:t.dragging!==!1,touchZoom:t.touchZoom!==!1,doubleClickZoom:t.doubleClickZoom!==!1,scrollWheelZoom:t.scrollWheelZoom!==!1,boxZoom:t.boxZoom!==!1,keyboard:t.keyboard!==!1,tap:t.tap!==!1}}_bindMethods(){this.setStyle=this.setStyle.bind(this)}_setupRiskscapeMap(){this._configureControls(),this.setOperationMode(this.pluginOptions.operationMode),this._initializeStyle()}_configureControls(){this.zoomControl&&this.zoomControl.setPosition("bottomright"),this.attributionControl&&this.attributionControl.setPrefix(`
|
|
13
13
|
<span style="font-size: 0.8em;">Powered by <a href="https://riskscape.pro/powered-by" target="_blank" style="color: #b01d21 !important;">Riskscape</a>
|
|
14
14
|
| © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors</span>
|
|
15
15
|
`)}_initializeStyle(){this.whenReady(()=>{this.setStyle(this.pluginOptions.style)})}_withLatLonParams(t){const i={...t};return i!=null&&i.lng&&(i.latlon=Pt(i),delete i.lat,delete i.lng),i}async _getFeature(t,i){if(this._loading)return console.warn("Feature request already in progress"),null;this._loading=!0;try{const{data:r}=await this._api.fetchFeature(t,this._withLatLonParams(i));return r}catch(r){return console.error(`Failed to fetch ${t} feature:`,r),null}finally{this._loading=!1}}_setLocationFeature(t){if(this._removeLocationFeature(),!!t)try{this._locationFeature=L.geoJSON(t,{style:this.pluginOptions.locationFeatureStyle}).addTo(this),this.fitBounds(this._locationFeature.getBounds())}catch(i){console.error("Failed to set location feature:",i)}}_removeLocationFeature(){this._locationFeature&&(this._locationFeature.remove(),this._locationFeature=null)}_setSearchMarker(t){try{this._searchMarker=L.marker(t).addTo(this);const i=this.getZoom(),r=i>=17?i:17;this.setView(t,r)}catch(i){console.error("Failed to set search marker:",i)}}_removeSearchMarker(){this._searchMarker&&(this._searchMarker.remove(),this._searchMarker=null)}async _handleIdentifyModeSearch(t,i){const{category:r,subcategory:n,attributes:o}=t;r==="StreetAddress"?await this._handleStreetAddressSearch(n,o,t,i):r==="Scheme"&&n!=="Commercial"?await l(this,v,j).call(this,"scheme",{id:o.scheme_id}):this._setSearchMarker(i)}async _handleStreetAddressSearch(t,i,r,n){switch(t){case"StreetNumberScheme":await l(this,v,j).call(this,"scheme",{id:i.scheme_id});break;case"SchemeUnit":await l(this,v,j).call(this,"scheme",{id:i.scheme_id},{unit_number:r.attributes.unit_number,property_key:r.attributes.property_key});break;default:i.property_key?await l(this,v,j).call(this,"property",{id:i.property_key}):this._setSearchMarker(n)}}async _handleLocationSearch(t){const i=await this._getFeature("location",{id:t.location_id});i&&this._setLocationFeature(i)}async _handleSectionalUnits(t){try{const i=await l(this,v,Ct).call(this,t);if(!i||i.length===0){console.warn("No units found for sectional feature");return}this._unitSelector.show(i,this.getContainer(),this,{onSelect:r=>{this._firePropertyIdentified({unit_number:r.unit_number,property_key:r.property_key,address_id:t.address_id})},onCancel:()=>{console.debug("Unit selection cancelled by user")}})}catch(i){console.error("Failed to handle sectional units:",i)}}_firePropertyIdentified(t){this.fire("property:identified",{property:{unit_number:t.unit_number||"00000",property_key:t.property_key,address_id:t.address_id}})}bindSearch(t,i){if(!t)throw new Error("Search instance is required");this._search=t,this._search.bindToMap(),this._search.on("select",this._handleSearchSelect.bind(this))}async setStyle(t){const i=Zt(t);if(!i)throw new Error(`Style "${t}" is not valid. Use 'default' or 'hybrid'.`);if(t==="hybrid"&&!this.pluginOptions.googleKey)throw new Error("Google API key is required for hybrid style.");try{t==="hybrid"&&await Ft(this.pluginOptions.googleKey),this._clearStyleLayers(),await this._addStyleLayers(i),this.pluginOptions.style=t}catch(r){throw console.error(`Failed to set style to ${t}:`,r),new Error(`Failed to load ${t} style. Check your configuration and internet connection.`)}}_clearStyleLayers(){Object.values(this.styleLayers).forEach(t=>{t&&this.hasLayer(t)&&this.removeLayer(t)}),this.styleLayers={}}async _addStyleLayers(t){for(const i of t)try{const r=this._createLayer(i);r&&(this.styleLayers[i.name]=r,r.addTo(this))}catch(r){console.error(`Error creating layer ${i.name}:`,r)}}_createLayer(t){const{type:i,layerOptions:r,layerUrl:n,name:o}=t;switch(i){case"GoogleMutant":return L.gridLayer.googleMutant({type:r.type,styles:r.styles||[]});case"RiskscapeTileLayer":return L.riskscapeTileLayer(this.pluginOptions.url+n,r,this.pluginOptions.key);case"RiskscapeWmsLayer":return L.riskscapeWmsLayer(this.pluginOptions.url+n,r,this.pluginOptions.key);default:return console.warn(`Unknown layer type: ${i}`),null}}setOperationMode(t){this.off("click"),this.pluginOptions.operationMode=t,t==="identify"&&this.on("click",this._handleMapClick.bind(this))}enableInteraction(){const t=this._originalInteractionStates;t.dragging&&this.dragging.enable(),t.touchZoom&&this.touchZoom.enable(),t.doubleClickZoom&&this.doubleClickZoom.enable(),t.scrollWheelZoom&&this.scrollWheelZoom.enable(),t.boxZoom&&this.boxZoom.enable(),t.keyboard&&this.keyboard.enable(),t.tap&&this.tap&&this.tap.enable()}disableInteraction(){this.dragging.disable(),this.touchZoom.disable(),this.doubleClickZoom.disable(),this.scrollWheelZoom.disable(),this.boxZoom.disable(),this.keyboard.disable(),this.tap&&this.tap.disable()}unbindSearch(){this._search&&(this._search.off("select",this._handleSearchSelect),this._search.unbindFromMap(),this._search=null)}async getAddressById(t){if(!t||typeof t!="string")throw new Error("Address ID must be a non-empty string");if(!this._api)throw new Error("API client not initialized");try{const i=await this._api.fetchAddress(t);if(!(i!=null&&i.data))throw new Error("Invalid response format from address API");return i.data}catch(i){throw console.error("Error fetching address:",i),new Error(`Failed to fetch address: ${i.message}`)}}async getPropertyIdentification(t,i){if(!t||typeof t!="string")throw new Error("Property key must be a non-empty string");if(!i||typeof i!="string")throw new Error("Unit number must be a non-empty string");try{const r=await this._api.fetchPropertyIdentification(t,i);if(!(r!=null&&r.data))throw new Error("Invalid response format from property identification API");return r.data}catch(r){throw console.error("Error fetching property identification:",r),new Error(`Failed to fetch property identification: ${r.message}`)}}destroy(){this.unbindSearch(),this._clearStyleLayers(),this.featureLayer&&(this.featureLayer.remove(),this.featureLayer=null),this.feature=null,this._removeLocationFeature(),this._removeSearchMarker(),this._unitSelector&&(this._unitSelector=null),this.off("click",this._handleMapClick),this._api=null,this.pluginOptions=null,this._originalInteractionStates=null}};v=new WeakSet,Ct=async function(t){if(!(t!=null&&t.type))return console.warn("Feature type not specified"),null;try{switch(t.type){case"scheme":return await l(this,v,zt).call(this,t.scheme_id);case"property":return await l(this,v,Mt).call(this,t.property_key);default:return console.warn(`Unknown feature type: ${t.type}`),null}}catch(i){return console.error(`Failed to get units for ${t.type}:`,i),null}},Mt=async function(t){if(!t)throw new Error("Property key is required");const{data:i}=await this._api.fetchPropertyUnits(t);return i.map(r=>({unit_number:r,property_key:t}))},zt=async function(t){if(!t)throw new Error("Scheme ID is required");const{data:i}=await this._api.fetchSchemeUnits(t);return i},St=function(t,i={}){if(l(this,v,ct).call(this),!t){console.warn("No feature provided to setFeatureLayer");return}try{i!=null&&i.style||(i.style=this.pluginOptions.featureStyle),this.feature=t,this.featureLayer=L.geoJSON(this.feature,i),this.featureLayer.addTo(this)}catch(r){console.error("Failed to set feature layer:",r),l(this,v,ct).call(this)}},ct=function(){this.featureLayer&&(this.featureLayer.remove(),this.featureLayer=null),this.feature=null},Et=function(){if(!this.featureLayer){console.warn("No feature layer to fit bounds to");return}try{this.fitBounds(this.featureLayer.getBounds(),{padding:[50,50],minZoom:12})}catch(t){console.error("Failed to fit feature layer bounds:",t)}},j=async function(t,i,r={}){try{const n=await this._getFeature(t,i);if(!n){console.debug(`No ${t} feature found for given parameters`);return}l(this,v,St).call(this,n),l(this,v,Et).call(this);const o={...(n==null?void 0:n.properties)||{},...r};o!=null&&o.has_sectional_units&&!(o!=null&&o.unit_number)?await this._handleSectionalUnits(o):this._firePropertyIdentified(o)}catch(n){console.error(`Failed to identify ${t} feature:`,n)}};let X=R;typeof window<"u"&&(window.RiskscapeMap=X,window.RiskscapeTileLayer=g,window.RiskscapeWmsLayer=p),d.RiskscapeMap=X,d.RiskscapeTileLayer=g,d.RiskscapeWmsLayer=p,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1028,7 +1028,7 @@ class nn {
|
|
|
1028
1028
|
C(this, W);
|
|
1029
1029
|
C(this, ht, 0);
|
|
1030
1030
|
C(this, ut, 0);
|
|
1031
|
-
w(this, vt, t), w(this, Et, i), w(this, xt, n), this.fetchAddress = this.fetchAddress.bind(this), this.fetchPropertyIdentification = this.fetchPropertyIdentification.bind(this), this.fetchProperty = this.fetchProperty.bind(this), this.fetchPropertyUnits = this.fetchPropertyUnits.bind(this), this.fetchFeature = this.fetchFeature.bind(this), this.fetchSchemeUnits = this.fetchSchemeUnits.bind(this), this.geocode = this.geocode.bind(this), console.debug("RiskscapeApi initialized with version:", "1.1.
|
|
1031
|
+
w(this, vt, t), w(this, Et, i), w(this, xt, n), this.fetchAddress = this.fetchAddress.bind(this), this.fetchPropertyIdentification = this.fetchPropertyIdentification.bind(this), this.fetchProperty = this.fetchProperty.bind(this), this.fetchPropertyUnits = this.fetchPropertyUnits.bind(this), this.fetchFeature = this.fetchFeature.bind(this), this.fetchSchemeUnits = this.fetchSchemeUnits.bind(this), this.geocode = this.geocode.bind(this), console.debug("RiskscapeApi initialized with version:", "1.1.2");
|
|
1032
1032
|
}
|
|
1033
1033
|
// =============================================================================
|
|
1034
1034
|
// ADDRESS API METHODS
|
|
@@ -1211,7 +1211,7 @@ Ce = function(t) {
|
|
|
1211
1211
|
headers: {
|
|
1212
1212
|
accept: "application/json",
|
|
1213
1213
|
"x-api-key": l(this, vt),
|
|
1214
|
-
"x-riskscape-plugins-version": "1.1.
|
|
1214
|
+
"x-riskscape-plugins-version": "1.1.2",
|
|
1215
1215
|
...n.headers
|
|
1216
1216
|
},
|
|
1217
1217
|
signal: n.signal || (AbortSignal.timeout ? AbortSignal.timeout(l(this, xt)) : void 0)
|
|
@@ -1319,7 +1319,7 @@ class sn {
|
|
|
1319
1319
|
// Configuration and data
|
|
1320
1320
|
/** @private {Object} Search filters for API requests */
|
|
1321
1321
|
S(this, "_filters", {
|
|
1322
|
-
categories:
|
|
1322
|
+
// categories: 'StreetAddress,Scheme'
|
|
1323
1323
|
});
|
|
1324
1324
|
/** @private {Array} Current search results */
|
|
1325
1325
|
C(this, L, []);
|
|
@@ -1431,7 +1431,7 @@ class sn {
|
|
|
1431
1431
|
setFilters(t) {
|
|
1432
1432
|
if (t && typeof t != "object")
|
|
1433
1433
|
throw new Error("Filters must be an object");
|
|
1434
|
-
return this._filters =
|
|
1434
|
+
return this._filters = t, this;
|
|
1435
1435
|
}
|
|
1436
1436
|
/**
|
|
1437
1437
|
* Resets the search component to its initial state
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(w,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(w=typeof globalThis<"u"?globalThis:w||self,b(w.RiskscapeSearch={}))})(this,function(w){"use strict";var sn=Object.defineProperty;var Le=w=>{throw TypeError(w)};var rn=(w,b,C)=>b in w?sn(w,b,{enumerable:!0,configurable:!0,writable:!0,value:C}):w[b]=C;var D=(w,b,C)=>rn(w,typeof b!="symbol"?b+"":b,C),te=(w,b,C)=>b.has(w)||Le("Cannot "+C);var l=(w,b,C)=>(te(w,b,"read from private field"),C?C.call(w):b.get(w)),T=(w,b,C)=>b.has(w)?Le("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(w):b.set(w,C),y=(w,b,C,ht)=>(te(w,b,"write to private field"),ht?ht.call(w,C):b.set(w,C),C),c=(w,b,C)=>(te(w,b,"access private method"),C);var Rt=(w,b,C,ht)=>({set _(Lt){y(w,b,Lt,C)},get _(){return l(w,b,ht)}});var vt,xt,Et,q,pt,mt,W,Oe,lt,P,R,B,F,O,G,Z,rt,gt,k,N,r,Ne,De,Pe,ke,Ie,Me,Fe,He,Ue,We,Be,$e,Ve,je,tt,ct,K,ze,qe,Ge,Bt,$t,St,Ke,Ye,Xe,Qe,Ze,Je,ti,ei,ii,ni,si,ee,Vt,ie,ri,ne,Tt,oi;function b(e){return/^[A-Z0-9]{8}[0-9]{13}$/.test(e)}function C(e){return/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?((180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?))$/.test(e)}function ht(e,t){let i;return function(...s){const o=()=>{clearTimeout(i),e.apply(this,s)};clearTimeout(i),i=setTimeout(o,t)}}function Lt(e){return e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").toLowerCase().replace(/\b\w/g,t=>t.toUpperCase()):""}function se(e,t){return!e||!t?!1:e.toLowerCase().startsWith(t.toLowerCase())}const jt={DEFAULT_MIN_CHARS:5,DEFAULT_MAX_RESULTS:10},re={MISSING_ELEMENT:'Configuration error: "element" id is required',ELEMENT_NOT_FOUND:e=>`Element with id "${e}" not found`,API_KEY_REQUIRED:"API Key is required",UNAUTHORIZED:"Authentication error. Please check your API key.",NETWORK_ERROR:"Network error. Please check your connection and try again.",GENERIC_ERROR:"An error occurred while searching. Please try again.",NO_RESULTS:e=>"No results found. Try a different search term."};function ai(e){return{all:e=e||new Map,on:function(t,i){var n=e.get(t);n?n.push(i):e.set(t,[i])},off:function(t,i){var n=e.get(t);n&&(i?n.splice(n.indexOf(i)>>>0,1):e.set(t,[]))},emit:function(t,i){var n=e.get(t);n&&n.slice().map(function(s){s(i)}),(n=e.get("*"))&&n.slice().map(function(s){s(t,i)})}}}const Ot=Math.min,et=Math.max,Nt=Math.round,Dt=Math.floor,V=e=>({x:e,y:e}),li={left:"right",right:"left",bottom:"top",top:"bottom"},ci={start:"end",end:"start"};function oe(e,t,i){return et(e,Ot(t,i))}function Pt(e,t){return typeof e=="function"?e(t):e}function it(e){return e.split("-")[0]}function kt(e){return e.split("-")[1]}function ae(e){return e==="x"?"y":"x"}function le(e){return e==="y"?"height":"width"}const hi=new Set(["top","bottom"]);function Y(e){return hi.has(it(e))?"y":"x"}function ce(e){return ae(Y(e))}function ui(e,t,i){i===void 0&&(i=!1);const n=kt(e),s=ce(e),o=le(s);let a=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=It(a)),[a,It(a)]}function di(e){const t=It(e);return[zt(e),t,zt(t)]}function zt(e){return e.replace(/start|end/g,t=>ci[t])}const he=["left","right"],ue=["right","left"],fi=["top","bottom"],pi=["bottom","top"];function mi(e,t,i){switch(e){case"top":case"bottom":return i?t?ue:he:t?he:ue;case"left":case"right":return t?fi:pi;default:return[]}}function gi(e,t,i,n){const s=kt(e);let o=mi(it(e),i==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(zt)))),o}function It(e){return e.replace(/left|right|bottom|top/g,t=>li[t])}function wi(e){return{top:0,right:0,bottom:0,left:0,...e}}function yi(e){return typeof e!="number"?wi(e):{top:e,right:e,bottom:e,left:e}}function Mt(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function de(e,t,i){let{reference:n,floating:s}=e;const o=Y(t),a=ce(t),h=le(a),u=it(t),d=o==="y",m=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,g=n[h]/2-s[h]/2;let p;switch(u){case"top":p={x:m,y:n.y-s.height};break;case"bottom":p={x:m,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-s.width,y:f};break;default:p={x:n.x,y:n.y}}switch(kt(t)){case"start":p[a]-=g*(i&&d?-1:1);break;case"end":p[a]+=g*(i&&d?-1:1);break}return p}const bi=async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=i,h=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:f}=de(d,n,u),g=n,p={},_=0;for(let x=0;x<h.length;x++){const{name:E,fn:v}=h[x],{x:A,y:S,data:I,reset:L}=await v({x:m,y:f,initialPlacement:n,placement:g,strategy:s,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});m=A??m,f=S??f,p={...p,[E]:{...p[E],...I}},L&&_<=50&&(_++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(d=L.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):L.rects),{x:m,y:f}=de(d,g,u)),x=-1)}return{x:m,y:f,placement:g,strategy:s,middlewareData:p}};async function fe(e,t){var i;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:h,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Pt(t,e),_=yi(p),E=h[g?f==="floating"?"reference":"floating":f],v=Mt(await o.getClippingRect({element:(i=await(o.isElement==null?void 0:o.isElement(E)))==null||i?E:E.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(h.floating)),boundary:d,rootBoundary:m,strategy:u})),A=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(h.floating)),I=await(o.isElement==null?void 0:o.isElement(S))?await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1}:{x:1,y:1},L=Mt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:S,strategy:u}):A);return{top:(v.top-L.top+_.top)/I.y,bottom:(L.bottom-v.bottom+_.bottom)/I.y,left:(v.left-L.left+_.left)/I.x,right:(L.right-v.right+_.right)/I.x}}const _i=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:h,platform:u,elements:d}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:x=!0,...E}=Pt(e,t);if((i=o.arrow)!=null&&i.alignmentOffset)return{};const v=it(s),A=Y(h),S=it(h)===h,I=await(u.isRTL==null?void 0:u.isRTL(d.floating)),L=g||(S||!x?[It(h)]:di(h)),At=_!=="none";!g&&At&&L.push(...gi(h,x,_,I));const wt=[h,...L],Zt=await fe(t,E),Wt=[];let yt=((n=o.flip)==null?void 0:n.overflows)||[];if(m&&Wt.push(Zt[v]),f){const ot=ui(s,a,I);Wt.push(Zt[ot[0]],Zt[ot[1]])}if(yt=[...yt,{placement:s,overflows:Wt}],!Wt.every(ot=>ot<=0)){var Re,Se;const ot=(((Re=o.flip)==null?void 0:Re.index)||0)+1,Jt=wt[ot];if(Jt&&(!(f==="alignment"?A!==Y(Jt):!1)||yt.every($=>$.overflows[0]>0&&Y($.placement)===A)))return{data:{index:ot,overflows:yt},reset:{placement:Jt}};let Ct=(Se=yt.filter(at=>at.overflows[0]<=0).sort((at,$)=>at.overflows[1]-$.overflows[1])[0])==null?void 0:Se.placement;if(!Ct)switch(p){case"bestFit":{var Te;const at=(Te=yt.filter($=>{if(At){const J=Y($.placement);return J===A||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,nn)=>J+nn,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:Te[0];at&&(Ct=at);break}case"initialPlacement":Ct=h;break}if(s!==Ct)return{reset:{placement:Ct}}}return{}}}},vi=new Set(["left","top"]);async function xi(e,t){const{placement:i,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=it(i),h=kt(i),u=Y(i)==="y",d=vi.has(a)?-1:1,m=o&&u?-1:1,f=Pt(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:_}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return h&&typeof _=="number"&&(p=h==="end"?_*-1:_),u?{x:p*m,y:g*d}:{x:g*d,y:p*m}}const Ei=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:a,middlewareData:h}=t,u=await xi(t,e);return a===((i=h.offset)==null?void 0:i.placement)&&(n=h.arrow)!=null&&n.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},Ai=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:h={fn:E=>{let{x:v,y:A}=E;return{x:v,y:A}}},...u}=Pt(e,t),d={x:i,y:n},m=await fe(t,u),f=Y(it(s)),g=ae(f);let p=d[g],_=d[f];if(o){const E=g==="y"?"top":"left",v=g==="y"?"bottom":"right",A=p+m[E],S=p-m[v];p=oe(A,p,S)}if(a){const E=f==="y"?"top":"left",v=f==="y"?"bottom":"right",A=_+m[E],S=_-m[v];_=oe(A,_,S)}const x=h.fn({...t,[g]:p,[f]:_});return{...x,data:{x:x.x-i,y:x.y-n,enabled:{[g]:o,[f]:a}}}}}};function Ft(){return typeof window<"u"}function ut(e){return pe(e)?(e.nodeName||"").toLowerCase():"#document"}function M(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function j(e){var t;return(t=(pe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pe(e){return Ft()?e instanceof Node||e instanceof M(e).Node:!1}function H(e){return Ft()?e instanceof Element||e instanceof M(e).Element:!1}function z(e){return Ft()?e instanceof HTMLElement||e instanceof M(e).HTMLElement:!1}function me(e){return!Ft()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof M(e).ShadowRoot}const Ci=new Set(["inline","contents"]);function bt(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!Ci.has(s)}const Ri=new Set(["table","td","th"]);function Si(e){return Ri.has(ut(e))}const Ti=[":popover-open",":modal"];function Ht(e){return Ti.some(t=>{try{return e.matches(t)}catch{return!1}})}const Li=["transform","translate","scale","rotate","perspective"],Oi=["transform","translate","scale","rotate","perspective","filter"],Ni=["paint","layout","strict","content"];function qt(e){const t=Gt(),i=H(e)?U(e):e;return Li.some(n=>i[n]?i[n]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||Oi.some(n=>(i.willChange||"").includes(n))||Ni.some(n=>(i.contain||"").includes(n))}function Di(e){let t=X(e);for(;z(t)&&!dt(t);){if(qt(t))return t;if(Ht(t))return null;t=X(t)}return null}function Gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Pi=new Set(["html","body","#document"]);function dt(e){return Pi.has(ut(e))}function U(e){return M(e).getComputedStyle(e)}function Ut(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function X(e){if(ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||j(e);return me(t)?t.host:t}function ge(e){const t=X(e);return dt(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&bt(t)?t:ge(t)}function _t(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const s=ge(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=M(s);if(o){const h=Kt(a);return t.concat(a,a.visualViewport||[],bt(s)?s:[],h&&i?_t(h):[])}return t.concat(s,_t(s,[],i))}function Kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function we(e){const t=U(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=z(e),o=s?e.offsetWidth:i,a=s?e.offsetHeight:n,h=Nt(i)!==o||Nt(n)!==a;return h&&(i=o,n=a),{width:i,height:n,$:h}}function Yt(e){return H(e)?e:e.contextElement}function ft(e){const t=Yt(e);if(!z(t))return V(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=we(t);let a=(o?Nt(i.width):i.width)/n,h=(o?Nt(i.height):i.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!h||!Number.isFinite(h))&&(h=1),{x:a,y:h}}const ki=V(0);function ye(e){const t=M(e);return!Gt()||!t.visualViewport?ki:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ii(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==M(e)?!1:t}function nt(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),o=Yt(e);let a=V(1);t&&(n?H(n)&&(a=ft(n)):a=ft(e));const h=Ii(o,i,n)?ye(o):V(0);let u=(s.left+h.x)/a.x,d=(s.top+h.y)/a.y,m=s.width/a.x,f=s.height/a.y;if(o){const g=M(o),p=n&&H(n)?M(n):n;let _=g,x=Kt(_);for(;x&&n&&p!==_;){const E=ft(x),v=x.getBoundingClientRect(),A=U(x),S=v.left+(x.clientLeft+parseFloat(A.paddingLeft))*E.x,I=v.top+(x.clientTop+parseFloat(A.paddingTop))*E.y;u*=E.x,d*=E.y,m*=E.x,f*=E.y,u+=S,d+=I,_=M(x),x=Kt(_)}}return Mt({width:m,height:f,x:u,y:d})}function Xt(e,t){const i=Ut(e).scrollLeft;return t?t.left+i:nt(j(e)).left+i}function be(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(i?0:Xt(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function Mi(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=j(n),h=t?Ht(t.floating):!1;if(n===a||h&&o)return i;let u={scrollLeft:0,scrollTop:0},d=V(1);const m=V(0),f=z(n);if((f||!f&&!o)&&((ut(n)!=="body"||bt(a))&&(u=Ut(n)),z(n))){const p=nt(n);d=ft(n),m.x=p.x+n.clientLeft,m.y=p.y+n.clientTop}const g=a&&!f&&!o?be(a,u,!0):V(0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-u.scrollLeft*d.x+m.x+g.x,y:i.y*d.y-u.scrollTop*d.y+m.y+g.y}}function Fi(e){return Array.from(e.getClientRects())}function Hi(e){const t=j(e),i=Ut(e),n=e.ownerDocument.body,s=et(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=et(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-i.scrollLeft+Xt(e);const h=-i.scrollTop;return U(n).direction==="rtl"&&(a+=et(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:h}}function Ui(e,t){const i=M(e),n=j(e),s=i.visualViewport;let o=n.clientWidth,a=n.clientHeight,h=0,u=0;if(s){o=s.width,a=s.height;const d=Gt();(!d||d&&t==="fixed")&&(h=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:h,y:u}}const Wi=new Set(["absolute","fixed"]);function Bi(e,t){const i=nt(e,!0,t==="fixed"),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=z(e)?ft(e):V(1),a=e.clientWidth*o.x,h=e.clientHeight*o.y,u=s*o.x,d=n*o.y;return{width:a,height:h,x:u,y:d}}function _e(e,t,i){let n;if(t==="viewport")n=Ui(e,i);else if(t==="document")n=Hi(j(e));else if(H(t))n=Bi(t,i);else{const s=ye(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Mt(n)}function ve(e,t){const i=X(e);return i===t||!H(i)||dt(i)?!1:U(i).position==="fixed"||ve(i,t)}function $i(e,t){const i=t.get(e);if(i)return i;let n=_t(e,[],!1).filter(h=>H(h)&&ut(h)!=="body"),s=null;const o=U(e).position==="fixed";let a=o?X(e):e;for(;H(a)&&!dt(a);){const h=U(a),u=qt(a);!u&&h.position==="fixed"&&(s=null),(o?!u&&!s:!u&&h.position==="static"&&!!s&&Wi.has(s.position)||bt(a)&&!u&&ve(e,a))?n=n.filter(m=>m!==a):s=h,a=X(a)}return t.set(e,n),n}function Vi(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const a=[...i==="clippingAncestors"?Ht(t)?[]:$i(t,this._c):[].concat(i),n],h=a[0],u=a.reduce((d,m)=>{const f=_e(t,m,s);return d.top=et(f.top,d.top),d.right=Ot(f.right,d.right),d.bottom=Ot(f.bottom,d.bottom),d.left=et(f.left,d.left),d},_e(t,h,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ji(e){const{width:t,height:i}=we(e);return{width:t,height:i}}function zi(e,t,i){const n=z(t),s=j(t),o=i==="fixed",a=nt(e,!0,o,t);let h={scrollLeft:0,scrollTop:0};const u=V(0);function d(){u.x=Xt(s)}if(n||!n&&!o)if((ut(t)!=="body"||bt(s))&&(h=Ut(t)),n){const p=nt(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else s&&d();o&&!n&&s&&d();const m=s&&!n&&!o?be(s,h):V(0),f=a.left+h.scrollLeft-u.x-m.x,g=a.top+h.scrollTop-u.y-m.y;return{x:f,y:g,width:a.width,height:a.height}}function Qt(e){return U(e).position==="static"}function xe(e,t){if(!z(e)||U(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return j(e)===i&&(i=i.ownerDocument.body),i}function Ee(e,t){const i=M(e);if(Ht(e))return i;if(!z(e)){let s=X(e);for(;s&&!dt(s);){if(H(s)&&!Qt(s))return s;s=X(s)}return i}let n=xe(e,t);for(;n&&Si(n)&&Qt(n);)n=xe(n,t);return n&&dt(n)&&Qt(n)&&!qt(n)?i:n||Di(e)||i}const qi=async function(e){const t=this.getOffsetParent||Ee,i=this.getDimensions,n=await i(e.floating);return{reference:zi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Gi(e){return U(e).direction==="rtl"}const Ki={convertOffsetParentRelativeRectToViewportRelativeRect:Mi,getDocumentElement:j,getClippingRect:Vi,getOffsetParent:Ee,getElementRects:qi,getClientRects:Fi,getDimensions:ji,getScale:ft,isElement:H,isRTL:Gi};function Ae(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yi(e,t){let i=null,n;const s=j(e);function o(){var h;clearTimeout(n),(h=i)==null||h.disconnect(),i=null}function a(h,u){h===void 0&&(h=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:m,top:f,width:g,height:p}=d;if(h||t(),!g||!p)return;const _=Dt(f),x=Dt(s.clientWidth-(m+g)),E=Dt(s.clientHeight-(f+p)),v=Dt(m),S={rootMargin:-_+"px "+-x+"px "+-E+"px "+-v+"px",threshold:et(0,Ot(1,u))||1};let I=!0;function L(At){const wt=At[0].intersectionRatio;if(wt!==u){if(!I)return a();wt?a(!1,wt):n=setTimeout(()=>{a(!1,1e-7)},1e3)}wt===1&&!Ae(d,e.getBoundingClientRect())&&a(),I=!1}try{i=new IntersectionObserver(L,{...S,root:s.ownerDocument})}catch{i=new IntersectionObserver(L,S)}i.observe(e)}return a(!0),o}function Xi(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=Yt(e),m=s||o?[...d?_t(d):[],..._t(t)]:[];m.forEach(v=>{s&&v.addEventListener("scroll",i,{passive:!0}),o&&v.addEventListener("resize",i)});const f=d&&h?Yi(d,i):null;let g=-1,p=null;a&&(p=new ResizeObserver(v=>{let[A]=v;A&&A.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),i()}),d&&!u&&p.observe(d),p.observe(t));let _,x=u?nt(e):null;u&&E();function E(){const v=nt(e);x&&!Ae(x,v)&&i(),x=v,_=requestAnimationFrame(E)}return i(),()=>{var v;m.forEach(A=>{s&&A.removeEventListener("scroll",i),o&&A.removeEventListener("resize",i)}),f==null||f(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(_)}}const Qi=Ei,Zi=Ai,Ji=_i,tn=(e,t,i)=>{const n=new Map,s={platform:Ki,...i},o={...s.platform,_c:n};return bi(e,t,{...s,platform:o})};class en{constructor({apiKey:t,baseUrl:i,timeout:n=8e3}){T(this,W);T(this,vt);T(this,xt);T(this,Et,8e3);T(this,q);T(this,pt,0);T(this,mt,0);y(this,vt,t),y(this,xt,i),y(this,Et,n),this.fetchAddress=this.fetchAddress.bind(this),this.fetchPropertyIdentification=this.fetchPropertyIdentification.bind(this),this.fetchProperty=this.fetchProperty.bind(this),this.fetchPropertyUnits=this.fetchPropertyUnits.bind(this),this.fetchFeature=this.fetchFeature.bind(this),this.fetchSchemeUnits=this.fetchSchemeUnits.bind(this),this.geocode=this.geocode.bind(this),console.debug("RiskscapeApi initialized with version:","1.1.0")}async fetchAddress(t){return c(this,W,lt).call(this,"GET","/addressing/v2/address",{params:{address_id:t}})}async geocode(t,i={},n={}){const s={q:t,...i};return c(this,W,lt).call(this,"GET","/addressing/v2/autocomplete",{params:s,signal:n.signal||this.getAbortSignal(),...n})}async fetchProperty(t,i){return c(this,W,lt).call(this,"GET","/properties/v1/property",{params:{property_key:t,unit_number:i}})}async fetchPropertyIdentification(t,i){return this.fetchProperty(t,i)}async fetchPropertyUnits(t){return c(this,W,lt).call(this,"GET","/properties/v1/unit-numbers",{params:{property_key:t}})}async fetchFeature(t,i){return c(this,W,lt).call(this,"GET","/features/v1/feature",{params:{type:t,...i}})}async fetchSchemeUnits(t){return c(this,W,lt).call(this,"GET","/schemes/v1/units",{params:{scheme_id:t}})}cancel(){l(this,q)&&(l(this,q).abort(),y(this,q,null))}createAbortController(){y(this,q,new AbortController)}getAbortSignal(){return l(this,q)||this.createAbortController(),l(this,q).signal}getConsecutiveErrors(){return l(this,pt)}getConsecutiveCancels(){return l(this,mt)}resetCounters(){y(this,pt,0),y(this,mt,0)}}vt=new WeakMap,xt=new WeakMap,Et=new WeakMap,q=new WeakMap,pt=new WeakMap,mt=new WeakMap,W=new WeakSet,Oe=function(t){var n,s,o;if(t.name==="AbortError")throw Rt(this,mt)._++,new Error("Request cancelled");Rt(this,pt)._++;const i=new CustomEvent("riskscape-api:error",{detail:{message:t.message,response:(n=t.response)==null?void 0:n.data,status:(s=t.response)==null?void 0:s.status}});throw document.dispatchEvent(i),t.response?t.response.status===401?new Error("Unauthorized"):new Error(((o=t.response.data)==null?void 0:o.message)||"Unknown error"):navigator.onLine?t:new Error("Network error: No internet connection")},lt=async function(t,i,n={}){try{const s=new URL(i,l(this,xt));n.params&&Object.entries(n.params).forEach(([a,h])=>{h!=null&&s.searchParams.append(a,h)});const o=await fetch(s,{method:t.toUpperCase(),headers:{accept:"application/json","x-api-key":l(this,vt),"x-riskscape-plugins-version":"1.1.0",...n.headers},signal:n.signal||(AbortSignal.timeout?AbortSignal.timeout(l(this,Et)):void 0)});if(!o.ok){const a=new Error(`HTTP ${o.status}`);throw a.response={status:o.status,data:await o.json().catch(()=>({}))},a}return await o.json()}catch(s){return c(this,W,Oe).call(this,s)}finally{n.signal===this.getAbortSignal()&&y(this,q,null)}};const st={MENU:"rs-search-menu",RESULTS:"rs-search-results",LOADING:"rs-search-loading",LOADING_SPINNER:"rs-search-loading__spinner",LOADING_TEXT:"rs-search-loading__text",POWERED_BY:"rs-search-powered-by",CONTAINER:"rs-search-container"},Q={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ENTER:"Enter",ESCAPE:"Escape"};class Ce{constructor(t){T(this,r);D(this,"_api");T(this,P);D(this,"_input");D(this,"_events");D(this,"_dropdown");D(this,"_dropdownContainer");T(this,R);T(this,B);T(this,F);T(this,O,-1);D(this,"_dropdownCleanup",null);T(this,G,null);T(this,Z,null);T(this,rt,"");T(this,gt,!1);T(this,k,!1);D(this,"_boundToMap",!1);D(this,"_filters",{categories:"StreetAddress,Scheme"});T(this,N,[]);D(this,"_handleChange");D(this,"_boundHandleBlur");D(this,"_boundHandleFocus");D(this,"_boundHandleKeydown");D(this,"_boundHandlePaste");D(this,"_boundHandleItemClick");try{c(this,r,Ne).call(this,t),c(this,r,De).call(this,t),c(this,r,Pe).call(this,t.element),this._api=new en({apiKey:l(this,P).key,baseUrl:l(this,P).url}),this._events=ai(),c(this,r,ke).call(this),c(this,r,Ie).call(this),c(this,r,Me).call(this)}catch(i){throw console.error("Failed to initialize RiskscapeSearch:",i),new Error(`RiskscapeSearch initialization failed: ${i.message}`)}}on(t,i){if(typeof t!="string")throw new Error("Event name must be a string");if(typeof i!="function")throw new Error("Callback must be a function");return this._events.on(t,i),this}off(t,i){if(typeof t!="string")throw new Error("Event name must be a string");if(typeof i!="function")throw new Error("Callback must be a function");return this._events.off(t,i),this}setFilters(t){if(t&&typeof t!="object")throw new Error("Filters must be an object");return this._filters={...this._filters,...t},this}reset(){return this._input.value="",c(this,r,Bt).call(this),c(this,r,K).call(this),c(this,r,$t).call(this),this}bindToMap(){return this.setFilters({}),this._boundToMap=!0,this}unbindFromMap(){return this._boundToMap=!1,this}destroy(){return this._events.all.clear(),this._input&&(this._input.removeEventListener("input",this._handleChange),this._input.removeEventListener("blur",this._boundHandleBlur),this._input.removeEventListener("focus",this._boundHandleFocus),this._input.removeEventListener("keydown",this._boundHandleKeydown),this._input.removeEventListener("paste",this._boundHandlePaste)),this._dropdown&&this._dropdown.removeEventListener("click",this._boundHandleItemClick),this._dropdownCleanup&&(this._dropdownCleanup(),this._dropdownCleanup=null),this._dropdownContainer&&this._dropdownContainer.remove(),this._api=null,this._input=null,this._dropdown=null,this._dropdownContainer=null,this._boundToMap=!1,this}}P=new WeakMap,R=new WeakMap,B=new WeakMap,F=new WeakMap,O=new WeakMap,G=new WeakMap,Z=new WeakMap,rt=new WeakMap,gt=new WeakMap,k=new WeakMap,N=new WeakMap,r=new WeakSet,Ne=function(t){if(!t)throw new Error("Configuration object is required");if(!t.element)throw new Error(re.MISSING_ELEMENT);if(!t.key)throw new Error("API key is required for RiskscapeSearch");if(typeof t.element!="string"&&!(t.element instanceof HTMLElement))throw new Error("Element must be a string selector, element ID, or HTMLElement");if(typeof t.key!="string")throw new Error("API key must be a string");if(t.maxResults!==void 0&&(!Number.isInteger(t.maxResults)||t.maxResults<1))throw new Error("maxResults must be a positive integer");if(t.debounceDelay!==void 0&&(!Number.isInteger(t.debounceDelay)||t.debounceDelay<0))throw new Error("debounceDelay must be a non-negative integer")},De=function(t){y(this,P,{url:"https://api.cloud.riskscape.pro",key:t.key,showCategory:!1,showPoweredBy:!0,placeholder:"Search for an address...",maxResults:jt.DEFAULT_MAX_RESULTS,debounceDelay:300,minChars:jt.DEFAULT_MIN_CHARS,noResultsText:"No results found",loadingText:"Loading...",errorText:"Error occurred while searching",...t}),l(this,P).minChars=jt.DEFAULT_MIN_CHARS},Pe=function(t){if(typeof t=="string")t.startsWith("#")||t.startsWith(".")?this._input=document.querySelector(t):this._input=document.getElementById(t);else if(t instanceof HTMLElement)this._input=t;else throw new Error("Element must be a string selector, element ID, or HTMLElement");if(!this._input)throw new Error(re.ELEMENT_NOT_FOUND(t));if(this._input.tagName!=="INPUT")throw new Error("Element must be an input element");Object.assign(this._input,{autocomplete:"off",placeholder:l(this,P).placeholder}),this._input.setAttribute("role","combobox"),this._input.setAttribute("aria-autocomplete","list"),this._input.setAttribute("aria-expanded","false"),this._input.setAttribute("aria-haspopup","listbox")},ke=function(){this._handleChange=ht(c(this,r,Qe).bind(this),l(this,P).debounceDelay),this._boundHandleBlur=c(this,r,Ze).bind(this),this._boundHandleFocus=c(this,r,Je).bind(this),this._boundHandleKeydown=c(this,r,ei).bind(this),this._boundHandlePaste=c(this,r,ti).bind(this),this._boundHandleItemClick=c(this,r,ri).bind(this)},Ie=function(){c(this,r,Fe).call(this)},Me=function(){this._input.addEventListener("input",this._handleChange),this._input.addEventListener("blur",this._boundHandleBlur),this._input.addEventListener("focus",this._boundHandleFocus),this._input.addEventListener("keydown",this._boundHandleKeydown),this._input.addEventListener("paste",this._boundHandlePaste)},Fe=function(){c(this,r,He).call(this),c(this,r,Ue).call(this),c(this,r,We).call(this),c(this,r,Be).call(this),c(this,r,$e).call(this),c(this,r,Ve).call(this),c(this,r,je).call(this)},He=function(){this._dropdownContainer=c(this,r,tt).call(this,"div",st.CONTAINER)},Ue=function(){this._dropdown=c(this,r,tt).call(this,"nav",st.MENU,{role:"listbox"}),this._dropdown.addEventListener("click",this._boundHandleItemClick),this._dropdownContainer.appendChild(this._dropdown)},We=function(){y(this,R,c(this,r,tt).call(this,"ul",st.RESULTS)),this._dropdown.appendChild(l(this,R))},Be=function(){l(this,P).showPoweredBy&&(y(this,F,c(this,r,tt).call(this,"div",st.POWERED_BY,{style:{display:"none"}})),l(this,F).innerHTML='powered by <a href="https://riskscape.pro/powered-by" target="_blank">Riskscape</a>',this._dropdownContainer.appendChild(l(this,F)))},$e=function(){y(this,B,c(this,r,tt).call(this,"div",st.LOADING,{"aria-label":"Loading search results",role:"status",style:{display:"none"}}));const t=c(this,r,tt).call(this,"div",st.LOADING_SPINNER),i=c(this,r,tt).call(this,"div",st.LOADING_TEXT);i.textContent="Searching...",l(this,B).appendChild(t),l(this,B).appendChild(i),this._dropdownContainer.appendChild(l(this,B))},Ve=function(){document.body.appendChild(this._dropdownContainer)},je=function(){this._dropdownCleanup=Xi(this._input,this._dropdownContainer,()=>{tn(this._input,this._dropdownContainer,{placement:"bottom-start",middleware:[Qi(5),Ji(),Zi()]}).then(({x:t,y:i})=>{const n=this._input.offsetWidth,a=Math.max(400,Math.min(700,n)),h=a>=400;this._dropdownContainer.classList.toggle("rs-search-container--wide",h),Object.assign(this._dropdownContainer.style,{top:`${i}px`,left:`${t}px`,width:`${a}px`})})})},tt=function(t,i,n={}){const s=document.createElement(t);return s.className=i,Object.entries(n).forEach(([o,a])=>{o==="style"&&typeof a=="object"?Object.assign(s.style,a):s.setAttribute(o,a)}),s},ct=function(){this._dropdown&&(l(this,Z)&&y(this,O,l(this,G)),y(this,k,!0),this._dropdown.style.display="block",l(this,F)&&(l(this,F).style.display="block"),this._input&&this._input.setAttribute("aria-expanded","true"))},K=function(){if(!this._dropdown){y(this,k,!1);return}setTimeout(()=>{y(this,O,-1),y(this,k,!1),this._dropdown&&(this._dropdown.style.display="none"),l(this,F)&&(l(this,F).style.display="none"),this._input&&this._input.setAttribute("aria-expanded","false")},200)},ze=function(){y(this,O,-1),c(this,r,$t).call(this),c(this,r,St).call(this),l(this,R).innerHTML="",this._dropdown.setAttribute("aria-expanded","true"),this._input.setAttribute("aria-controls","rs-search-results-list"),l(this,R).id="rs-search-results-list";const t=document.createDocumentFragment();if(l(this,N).forEach((i,n)=>{const s=c(this,r,qe).call(this,i,n);t.appendChild(s)}),!l(this,N).length){const i=document.createElement("li");i.classList.add("rs-search-results__message"),i.innerHTML="<div>Search returned no results.</div>",t.appendChild(i)}l(this,R).appendChild(t),c(this,r,ct).call(this)},qe=function(t,i){const n=document.createElement("li");n.dataset.index=i.toString(),n.classList.add("rs-search-results__item"),n.setAttribute("role","option"),n.setAttribute("aria-selected","false"),n.setAttribute("id",`rs-search-result-${i}`);const s=t.candidate.split(", "),o=`<span>${s.shift()}</span>, ${s.join(", ")}`;let a="";return l(this,P).showCategory&&(a+=c(this,r,Ge).call(this,t)),a&&(a=`<div class="rs-search-results__meta">${a}</div>`),n.innerHTML=`
|
|
1
|
+
(function(w,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(w=typeof globalThis<"u"?globalThis:w||self,b(w.RiskscapeSearch={}))})(this,function(w){"use strict";var sn=Object.defineProperty;var Le=w=>{throw TypeError(w)};var rn=(w,b,C)=>b in w?sn(w,b,{enumerable:!0,configurable:!0,writable:!0,value:C}):w[b]=C;var D=(w,b,C)=>rn(w,typeof b!="symbol"?b+"":b,C),te=(w,b,C)=>b.has(w)||Le("Cannot "+C);var l=(w,b,C)=>(te(w,b,"read from private field"),C?C.call(w):b.get(w)),S=(w,b,C)=>b.has(w)?Le("Cannot add the same private member more than once"):b instanceof WeakSet?b.add(w):b.set(w,C),y=(w,b,C,ht)=>(te(w,b,"write to private field"),ht?ht.call(w,C):b.set(w,C),C),c=(w,b,C)=>(te(w,b,"access private method"),C);var Rt=(w,b,C,ht)=>({set _(Lt){y(w,b,Lt,C)},get _(){return l(w,b,ht)}});var vt,xt,Et,q,pt,mt,W,Oe,lt,P,R,B,F,O,G,Z,rt,gt,k,N,r,Ne,De,Pe,ke,Ie,Me,Fe,He,Ue,We,Be,$e,Ve,je,tt,ct,K,ze,qe,Ge,Bt,$t,Tt,Ke,Ye,Xe,Qe,Ze,Je,ti,ei,ii,ni,si,ee,Vt,ie,ri,ne,St,oi;function b(e){return/^[A-Z0-9]{8}[0-9]{13}$/.test(e)}function C(e){return/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?),\s*[-+]?((180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?))$/.test(e)}function ht(e,t){let i;return function(...s){const o=()=>{clearTimeout(i),e.apply(this,s)};clearTimeout(i),i=setTimeout(o,t)}}function Lt(e){return e?e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").toLowerCase().replace(/\b\w/g,t=>t.toUpperCase()):""}function se(e,t){return!e||!t?!1:e.toLowerCase().startsWith(t.toLowerCase())}const jt={DEFAULT_MIN_CHARS:5,DEFAULT_MAX_RESULTS:10},re={MISSING_ELEMENT:'Configuration error: "element" id is required',ELEMENT_NOT_FOUND:e=>`Element with id "${e}" not found`,API_KEY_REQUIRED:"API Key is required",UNAUTHORIZED:"Authentication error. Please check your API key.",NETWORK_ERROR:"Network error. Please check your connection and try again.",GENERIC_ERROR:"An error occurred while searching. Please try again.",NO_RESULTS:e=>"No results found. Try a different search term."};function ai(e){return{all:e=e||new Map,on:function(t,i){var n=e.get(t);n?n.push(i):e.set(t,[i])},off:function(t,i){var n=e.get(t);n&&(i?n.splice(n.indexOf(i)>>>0,1):e.set(t,[]))},emit:function(t,i){var n=e.get(t);n&&n.slice().map(function(s){s(i)}),(n=e.get("*"))&&n.slice().map(function(s){s(t,i)})}}}const Ot=Math.min,et=Math.max,Nt=Math.round,Dt=Math.floor,V=e=>({x:e,y:e}),li={left:"right",right:"left",bottom:"top",top:"bottom"},ci={start:"end",end:"start"};function oe(e,t,i){return et(e,Ot(t,i))}function Pt(e,t){return typeof e=="function"?e(t):e}function it(e){return e.split("-")[0]}function kt(e){return e.split("-")[1]}function ae(e){return e==="x"?"y":"x"}function le(e){return e==="y"?"height":"width"}const hi=new Set(["top","bottom"]);function Y(e){return hi.has(it(e))?"y":"x"}function ce(e){return ae(Y(e))}function ui(e,t,i){i===void 0&&(i=!1);const n=kt(e),s=ce(e),o=le(s);let a=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=It(a)),[a,It(a)]}function di(e){const t=It(e);return[zt(e),t,zt(t)]}function zt(e){return e.replace(/start|end/g,t=>ci[t])}const he=["left","right"],ue=["right","left"],fi=["top","bottom"],pi=["bottom","top"];function mi(e,t,i){switch(e){case"top":case"bottom":return i?t?ue:he:t?he:ue;case"left":case"right":return t?fi:pi;default:return[]}}function gi(e,t,i,n){const s=kt(e);let o=mi(it(e),i==="start",n);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(zt)))),o}function It(e){return e.replace(/left|right|bottom|top/g,t=>li[t])}function wi(e){return{top:0,right:0,bottom:0,left:0,...e}}function yi(e){return typeof e!="number"?wi(e):{top:e,right:e,bottom:e,left:e}}function Mt(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function de(e,t,i){let{reference:n,floating:s}=e;const o=Y(t),a=ce(t),h=le(a),u=it(t),d=o==="y",m=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,g=n[h]/2-s[h]/2;let p;switch(u){case"top":p={x:m,y:n.y-s.height};break;case"bottom":p={x:m,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:f};break;case"left":p={x:n.x-s.width,y:f};break;default:p={x:n.x,y:n.y}}switch(kt(t)){case"start":p[a]-=g*(i&&d?-1:1);break;case"end":p[a]+=g*(i&&d?-1:1);break}return p}const bi=async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:a}=i,h=o.filter(Boolean),u=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:m,y:f}=de(d,n,u),g=n,p={},_=0;for(let x=0;x<h.length;x++){const{name:E,fn:v}=h[x],{x:A,y:T,data:I,reset:L}=await v({x:m,y:f,initialPlacement:n,placement:g,strategy:s,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});m=A??m,f=T??f,p={...p,[E]:{...p[E],...I}},L&&_<=50&&(_++,typeof L=="object"&&(L.placement&&(g=L.placement),L.rects&&(d=L.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:s}):L.rects),{x:m,y:f}=de(d,g,u)),x=-1)}return{x:m,y:f,placement:g,strategy:s,middlewareData:p}};async function fe(e,t){var i;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:a,elements:h,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Pt(t,e),_=yi(p),E=h[g?f==="floating"?"reference":"floating":f],v=Mt(await o.getClippingRect({element:(i=await(o.isElement==null?void 0:o.isElement(E)))==null||i?E:E.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(h.floating)),boundary:d,rootBoundary:m,strategy:u})),A=f==="floating"?{x:n,y:s,width:a.floating.width,height:a.floating.height}:a.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(h.floating)),I=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},L=Mt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:A,offsetParent:T,strategy:u}):A);return{top:(v.top-L.top+_.top)/I.y,bottom:(L.bottom-v.bottom+_.bottom)/I.y,left:(v.left-L.left+_.left)/I.x,right:(L.right-v.right+_.right)/I.x}}const _i=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:s,middlewareData:o,rects:a,initialPlacement:h,platform:u,elements:d}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:_="none",flipAlignment:x=!0,...E}=Pt(e,t);if((i=o.arrow)!=null&&i.alignmentOffset)return{};const v=it(s),A=Y(h),T=it(h)===h,I=await(u.isRTL==null?void 0:u.isRTL(d.floating)),L=g||(T||!x?[It(h)]:di(h)),At=_!=="none";!g&&At&&L.push(...gi(h,x,_,I));const wt=[h,...L],Zt=await fe(t,E),Wt=[];let yt=((n=o.flip)==null?void 0:n.overflows)||[];if(m&&Wt.push(Zt[v]),f){const ot=ui(s,a,I);Wt.push(Zt[ot[0]],Zt[ot[1]])}if(yt=[...yt,{placement:s,overflows:Wt}],!Wt.every(ot=>ot<=0)){var Re,Te;const ot=(((Re=o.flip)==null?void 0:Re.index)||0)+1,Jt=wt[ot];if(Jt&&(!(f==="alignment"?A!==Y(Jt):!1)||yt.every($=>$.overflows[0]>0&&Y($.placement)===A)))return{data:{index:ot,overflows:yt},reset:{placement:Jt}};let Ct=(Te=yt.filter(at=>at.overflows[0]<=0).sort((at,$)=>at.overflows[1]-$.overflows[1])[0])==null?void 0:Te.placement;if(!Ct)switch(p){case"bestFit":{var Se;const at=(Se=yt.filter($=>{if(At){const J=Y($.placement);return J===A||J==="y"}return!0}).map($=>[$.placement,$.overflows.filter(J=>J>0).reduce((J,nn)=>J+nn,0)]).sort(($,J)=>$[1]-J[1])[0])==null?void 0:Se[0];at&&(Ct=at);break}case"initialPlacement":Ct=h;break}if(s!==Ct)return{reset:{placement:Ct}}}return{}}}},vi=new Set(["left","top"]);async function xi(e,t){const{placement:i,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),a=it(i),h=kt(i),u=Y(i)==="y",d=vi.has(a)?-1:1,m=o&&u?-1:1,f=Pt(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:_}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return h&&typeof _=="number"&&(p=h==="end"?_*-1:_),u?{x:p*m,y:g*d}:{x:g*d,y:p*m}}const Ei=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:a,middlewareData:h}=t,u=await xi(t,e);return a===((i=h.offset)==null?void 0:i.placement)&&(n=h.arrow)!=null&&n.alignmentOffset?{}:{x:s+u.x,y:o+u.y,data:{...u,placement:a}}}}},Ai=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:h={fn:E=>{let{x:v,y:A}=E;return{x:v,y:A}}},...u}=Pt(e,t),d={x:i,y:n},m=await fe(t,u),f=Y(it(s)),g=ae(f);let p=d[g],_=d[f];if(o){const E=g==="y"?"top":"left",v=g==="y"?"bottom":"right",A=p+m[E],T=p-m[v];p=oe(A,p,T)}if(a){const E=f==="y"?"top":"left",v=f==="y"?"bottom":"right",A=_+m[E],T=_-m[v];_=oe(A,_,T)}const x=h.fn({...t,[g]:p,[f]:_});return{...x,data:{x:x.x-i,y:x.y-n,enabled:{[g]:o,[f]:a}}}}}};function Ft(){return typeof window<"u"}function ut(e){return pe(e)?(e.nodeName||"").toLowerCase():"#document"}function M(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function j(e){var t;return(t=(pe(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pe(e){return Ft()?e instanceof Node||e instanceof M(e).Node:!1}function H(e){return Ft()?e instanceof Element||e instanceof M(e).Element:!1}function z(e){return Ft()?e instanceof HTMLElement||e instanceof M(e).HTMLElement:!1}function me(e){return!Ft()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof M(e).ShadowRoot}const Ci=new Set(["inline","contents"]);function bt(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!Ci.has(s)}const Ri=new Set(["table","td","th"]);function Ti(e){return Ri.has(ut(e))}const Si=[":popover-open",":modal"];function Ht(e){return Si.some(t=>{try{return e.matches(t)}catch{return!1}})}const Li=["transform","translate","scale","rotate","perspective"],Oi=["transform","translate","scale","rotate","perspective","filter"],Ni=["paint","layout","strict","content"];function qt(e){const t=Gt(),i=H(e)?U(e):e;return Li.some(n=>i[n]?i[n]!=="none":!1)||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||Oi.some(n=>(i.willChange||"").includes(n))||Ni.some(n=>(i.contain||"").includes(n))}function Di(e){let t=X(e);for(;z(t)&&!dt(t);){if(qt(t))return t;if(Ht(t))return null;t=X(t)}return null}function Gt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Pi=new Set(["html","body","#document"]);function dt(e){return Pi.has(ut(e))}function U(e){return M(e).getComputedStyle(e)}function Ut(e){return H(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function X(e){if(ut(e)==="html")return e;const t=e.assignedSlot||e.parentNode||me(e)&&e.host||j(e);return me(t)?t.host:t}function ge(e){const t=X(e);return dt(t)?e.ownerDocument?e.ownerDocument.body:e.body:z(t)&&bt(t)?t:ge(t)}function _t(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const s=ge(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),a=M(s);if(o){const h=Kt(a);return t.concat(a,a.visualViewport||[],bt(s)?s:[],h&&i?_t(h):[])}return t.concat(s,_t(s,[],i))}function Kt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function we(e){const t=U(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=z(e),o=s?e.offsetWidth:i,a=s?e.offsetHeight:n,h=Nt(i)!==o||Nt(n)!==a;return h&&(i=o,n=a),{width:i,height:n,$:h}}function Yt(e){return H(e)?e:e.contextElement}function ft(e){const t=Yt(e);if(!z(t))return V(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=we(t);let a=(o?Nt(i.width):i.width)/n,h=(o?Nt(i.height):i.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!h||!Number.isFinite(h))&&(h=1),{x:a,y:h}}const ki=V(0);function ye(e){const t=M(e);return!Gt()||!t.visualViewport?ki:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ii(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==M(e)?!1:t}function nt(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),o=Yt(e);let a=V(1);t&&(n?H(n)&&(a=ft(n)):a=ft(e));const h=Ii(o,i,n)?ye(o):V(0);let u=(s.left+h.x)/a.x,d=(s.top+h.y)/a.y,m=s.width/a.x,f=s.height/a.y;if(o){const g=M(o),p=n&&H(n)?M(n):n;let _=g,x=Kt(_);for(;x&&n&&p!==_;){const E=ft(x),v=x.getBoundingClientRect(),A=U(x),T=v.left+(x.clientLeft+parseFloat(A.paddingLeft))*E.x,I=v.top+(x.clientTop+parseFloat(A.paddingTop))*E.y;u*=E.x,d*=E.y,m*=E.x,f*=E.y,u+=T,d+=I,_=M(x),x=Kt(_)}}return Mt({width:m,height:f,x:u,y:d})}function Xt(e,t){const i=Ut(e).scrollLeft;return t?t.left+i:nt(j(e)).left+i}function be(e,t,i){i===void 0&&(i=!1);const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-(i?0:Xt(e,n)),o=n.top+t.scrollTop;return{x:s,y:o}}function Mi(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o=s==="fixed",a=j(n),h=t?Ht(t.floating):!1;if(n===a||h&&o)return i;let u={scrollLeft:0,scrollTop:0},d=V(1);const m=V(0),f=z(n);if((f||!f&&!o)&&((ut(n)!=="body"||bt(a))&&(u=Ut(n)),z(n))){const p=nt(n);d=ft(n),m.x=p.x+n.clientLeft,m.y=p.y+n.clientTop}const g=a&&!f&&!o?be(a,u,!0):V(0);return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-u.scrollLeft*d.x+m.x+g.x,y:i.y*d.y-u.scrollTop*d.y+m.y+g.y}}function Fi(e){return Array.from(e.getClientRects())}function Hi(e){const t=j(e),i=Ut(e),n=e.ownerDocument.body,s=et(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=et(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-i.scrollLeft+Xt(e);const h=-i.scrollTop;return U(n).direction==="rtl"&&(a+=et(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:a,y:h}}function Ui(e,t){const i=M(e),n=j(e),s=i.visualViewport;let o=n.clientWidth,a=n.clientHeight,h=0,u=0;if(s){o=s.width,a=s.height;const d=Gt();(!d||d&&t==="fixed")&&(h=s.offsetLeft,u=s.offsetTop)}return{width:o,height:a,x:h,y:u}}const Wi=new Set(["absolute","fixed"]);function Bi(e,t){const i=nt(e,!0,t==="fixed"),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=z(e)?ft(e):V(1),a=e.clientWidth*o.x,h=e.clientHeight*o.y,u=s*o.x,d=n*o.y;return{width:a,height:h,x:u,y:d}}function _e(e,t,i){let n;if(t==="viewport")n=Ui(e,i);else if(t==="document")n=Hi(j(e));else if(H(t))n=Bi(t,i);else{const s=ye(e);n={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Mt(n)}function ve(e,t){const i=X(e);return i===t||!H(i)||dt(i)?!1:U(i).position==="fixed"||ve(i,t)}function $i(e,t){const i=t.get(e);if(i)return i;let n=_t(e,[],!1).filter(h=>H(h)&&ut(h)!=="body"),s=null;const o=U(e).position==="fixed";let a=o?X(e):e;for(;H(a)&&!dt(a);){const h=U(a),u=qt(a);!u&&h.position==="fixed"&&(s=null),(o?!u&&!s:!u&&h.position==="static"&&!!s&&Wi.has(s.position)||bt(a)&&!u&&ve(e,a))?n=n.filter(m=>m!==a):s=h,a=X(a)}return t.set(e,n),n}function Vi(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const a=[...i==="clippingAncestors"?Ht(t)?[]:$i(t,this._c):[].concat(i),n],h=a[0],u=a.reduce((d,m)=>{const f=_e(t,m,s);return d.top=et(f.top,d.top),d.right=Ot(f.right,d.right),d.bottom=Ot(f.bottom,d.bottom),d.left=et(f.left,d.left),d},_e(t,h,s));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function ji(e){const{width:t,height:i}=we(e);return{width:t,height:i}}function zi(e,t,i){const n=z(t),s=j(t),o=i==="fixed",a=nt(e,!0,o,t);let h={scrollLeft:0,scrollTop:0};const u=V(0);function d(){u.x=Xt(s)}if(n||!n&&!o)if((ut(t)!=="body"||bt(s))&&(h=Ut(t)),n){const p=nt(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else s&&d();o&&!n&&s&&d();const m=s&&!n&&!o?be(s,h):V(0),f=a.left+h.scrollLeft-u.x-m.x,g=a.top+h.scrollTop-u.y-m.y;return{x:f,y:g,width:a.width,height:a.height}}function Qt(e){return U(e).position==="static"}function xe(e,t){if(!z(e)||U(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return j(e)===i&&(i=i.ownerDocument.body),i}function Ee(e,t){const i=M(e);if(Ht(e))return i;if(!z(e)){let s=X(e);for(;s&&!dt(s);){if(H(s)&&!Qt(s))return s;s=X(s)}return i}let n=xe(e,t);for(;n&&Ti(n)&&Qt(n);)n=xe(n,t);return n&&dt(n)&&Qt(n)&&!qt(n)?i:n||Di(e)||i}const qi=async function(e){const t=this.getOffsetParent||Ee,i=this.getDimensions,n=await i(e.floating);return{reference:zi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Gi(e){return U(e).direction==="rtl"}const Ki={convertOffsetParentRelativeRectToViewportRelativeRect:Mi,getDocumentElement:j,getClippingRect:Vi,getOffsetParent:Ee,getElementRects:qi,getClientRects:Fi,getDimensions:ji,getScale:ft,isElement:H,isRTL:Gi};function Ae(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yi(e,t){let i=null,n;const s=j(e);function o(){var h;clearTimeout(n),(h=i)==null||h.disconnect(),i=null}function a(h,u){h===void 0&&(h=!1),u===void 0&&(u=1),o();const d=e.getBoundingClientRect(),{left:m,top:f,width:g,height:p}=d;if(h||t(),!g||!p)return;const _=Dt(f),x=Dt(s.clientWidth-(m+g)),E=Dt(s.clientHeight-(f+p)),v=Dt(m),T={rootMargin:-_+"px "+-x+"px "+-E+"px "+-v+"px",threshold:et(0,Ot(1,u))||1};let I=!0;function L(At){const wt=At[0].intersectionRatio;if(wt!==u){if(!I)return a();wt?a(!1,wt):n=setTimeout(()=>{a(!1,1e-7)},1e3)}wt===1&&!Ae(d,e.getBoundingClientRect())&&a(),I=!1}try{i=new IntersectionObserver(L,{...T,root:s.ownerDocument})}catch{i=new IntersectionObserver(L,T)}i.observe(e)}return a(!0),o}function Xi(e,t,i,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:h=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=Yt(e),m=s||o?[...d?_t(d):[],..._t(t)]:[];m.forEach(v=>{s&&v.addEventListener("scroll",i,{passive:!0}),o&&v.addEventListener("resize",i)});const f=d&&h?Yi(d,i):null;let g=-1,p=null;a&&(p=new ResizeObserver(v=>{let[A]=v;A&&A.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=p)==null||T.observe(t)})),i()}),d&&!u&&p.observe(d),p.observe(t));let _,x=u?nt(e):null;u&&E();function E(){const v=nt(e);x&&!Ae(x,v)&&i(),x=v,_=requestAnimationFrame(E)}return i(),()=>{var v;m.forEach(A=>{s&&A.removeEventListener("scroll",i),o&&A.removeEventListener("resize",i)}),f==null||f(),(v=p)==null||v.disconnect(),p=null,u&&cancelAnimationFrame(_)}}const Qi=Ei,Zi=Ai,Ji=_i,tn=(e,t,i)=>{const n=new Map,s={platform:Ki,...i},o={...s.platform,_c:n};return bi(e,t,{...s,platform:o})};class en{constructor({apiKey:t,baseUrl:i,timeout:n=8e3}){S(this,W);S(this,vt);S(this,xt);S(this,Et,8e3);S(this,q);S(this,pt,0);S(this,mt,0);y(this,vt,t),y(this,xt,i),y(this,Et,n),this.fetchAddress=this.fetchAddress.bind(this),this.fetchPropertyIdentification=this.fetchPropertyIdentification.bind(this),this.fetchProperty=this.fetchProperty.bind(this),this.fetchPropertyUnits=this.fetchPropertyUnits.bind(this),this.fetchFeature=this.fetchFeature.bind(this),this.fetchSchemeUnits=this.fetchSchemeUnits.bind(this),this.geocode=this.geocode.bind(this),console.debug("RiskscapeApi initialized with version:","1.1.2")}async fetchAddress(t){return c(this,W,lt).call(this,"GET","/addressing/v2/address",{params:{address_id:t}})}async geocode(t,i={},n={}){const s={q:t,...i};return c(this,W,lt).call(this,"GET","/addressing/v2/autocomplete",{params:s,signal:n.signal||this.getAbortSignal(),...n})}async fetchProperty(t,i){return c(this,W,lt).call(this,"GET","/properties/v1/property",{params:{property_key:t,unit_number:i}})}async fetchPropertyIdentification(t,i){return this.fetchProperty(t,i)}async fetchPropertyUnits(t){return c(this,W,lt).call(this,"GET","/properties/v1/unit-numbers",{params:{property_key:t}})}async fetchFeature(t,i){return c(this,W,lt).call(this,"GET","/features/v1/feature",{params:{type:t,...i}})}async fetchSchemeUnits(t){return c(this,W,lt).call(this,"GET","/schemes/v1/units",{params:{scheme_id:t}})}cancel(){l(this,q)&&(l(this,q).abort(),y(this,q,null))}createAbortController(){y(this,q,new AbortController)}getAbortSignal(){return l(this,q)||this.createAbortController(),l(this,q).signal}getConsecutiveErrors(){return l(this,pt)}getConsecutiveCancels(){return l(this,mt)}resetCounters(){y(this,pt,0),y(this,mt,0)}}vt=new WeakMap,xt=new WeakMap,Et=new WeakMap,q=new WeakMap,pt=new WeakMap,mt=new WeakMap,W=new WeakSet,Oe=function(t){var n,s,o;if(t.name==="AbortError")throw Rt(this,mt)._++,new Error("Request cancelled");Rt(this,pt)._++;const i=new CustomEvent("riskscape-api:error",{detail:{message:t.message,response:(n=t.response)==null?void 0:n.data,status:(s=t.response)==null?void 0:s.status}});throw document.dispatchEvent(i),t.response?t.response.status===401?new Error("Unauthorized"):new Error(((o=t.response.data)==null?void 0:o.message)||"Unknown error"):navigator.onLine?t:new Error("Network error: No internet connection")},lt=async function(t,i,n={}){try{const s=new URL(i,l(this,xt));n.params&&Object.entries(n.params).forEach(([a,h])=>{h!=null&&s.searchParams.append(a,h)});const o=await fetch(s,{method:t.toUpperCase(),headers:{accept:"application/json","x-api-key":l(this,vt),"x-riskscape-plugins-version":"1.1.2",...n.headers},signal:n.signal||(AbortSignal.timeout?AbortSignal.timeout(l(this,Et)):void 0)});if(!o.ok){const a=new Error(`HTTP ${o.status}`);throw a.response={status:o.status,data:await o.json().catch(()=>({}))},a}return await o.json()}catch(s){return c(this,W,Oe).call(this,s)}finally{n.signal===this.getAbortSignal()&&y(this,q,null)}};const st={MENU:"rs-search-menu",RESULTS:"rs-search-results",LOADING:"rs-search-loading",LOADING_SPINNER:"rs-search-loading__spinner",LOADING_TEXT:"rs-search-loading__text",POWERED_BY:"rs-search-powered-by",CONTAINER:"rs-search-container"},Q={ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ENTER:"Enter",ESCAPE:"Escape"};class Ce{constructor(t){S(this,r);D(this,"_api");S(this,P);D(this,"_input");D(this,"_events");D(this,"_dropdown");D(this,"_dropdownContainer");S(this,R);S(this,B);S(this,F);S(this,O,-1);D(this,"_dropdownCleanup",null);S(this,G,null);S(this,Z,null);S(this,rt,"");S(this,gt,!1);S(this,k,!1);D(this,"_boundToMap",!1);D(this,"_filters",{});S(this,N,[]);D(this,"_handleChange");D(this,"_boundHandleBlur");D(this,"_boundHandleFocus");D(this,"_boundHandleKeydown");D(this,"_boundHandlePaste");D(this,"_boundHandleItemClick");try{c(this,r,Ne).call(this,t),c(this,r,De).call(this,t),c(this,r,Pe).call(this,t.element),this._api=new en({apiKey:l(this,P).key,baseUrl:l(this,P).url}),this._events=ai(),c(this,r,ke).call(this),c(this,r,Ie).call(this),c(this,r,Me).call(this)}catch(i){throw console.error("Failed to initialize RiskscapeSearch:",i),new Error(`RiskscapeSearch initialization failed: ${i.message}`)}}on(t,i){if(typeof t!="string")throw new Error("Event name must be a string");if(typeof i!="function")throw new Error("Callback must be a function");return this._events.on(t,i),this}off(t,i){if(typeof t!="string")throw new Error("Event name must be a string");if(typeof i!="function")throw new Error("Callback must be a function");return this._events.off(t,i),this}setFilters(t){if(t&&typeof t!="object")throw new Error("Filters must be an object");return this._filters=t,this}reset(){return this._input.value="",c(this,r,Bt).call(this),c(this,r,K).call(this),c(this,r,$t).call(this),this}bindToMap(){return this.setFilters({}),this._boundToMap=!0,this}unbindFromMap(){return this._boundToMap=!1,this}destroy(){return this._events.all.clear(),this._input&&(this._input.removeEventListener("input",this._handleChange),this._input.removeEventListener("blur",this._boundHandleBlur),this._input.removeEventListener("focus",this._boundHandleFocus),this._input.removeEventListener("keydown",this._boundHandleKeydown),this._input.removeEventListener("paste",this._boundHandlePaste)),this._dropdown&&this._dropdown.removeEventListener("click",this._boundHandleItemClick),this._dropdownCleanup&&(this._dropdownCleanup(),this._dropdownCleanup=null),this._dropdownContainer&&this._dropdownContainer.remove(),this._api=null,this._input=null,this._dropdown=null,this._dropdownContainer=null,this._boundToMap=!1,this}}P=new WeakMap,R=new WeakMap,B=new WeakMap,F=new WeakMap,O=new WeakMap,G=new WeakMap,Z=new WeakMap,rt=new WeakMap,gt=new WeakMap,k=new WeakMap,N=new WeakMap,r=new WeakSet,Ne=function(t){if(!t)throw new Error("Configuration object is required");if(!t.element)throw new Error(re.MISSING_ELEMENT);if(!t.key)throw new Error("API key is required for RiskscapeSearch");if(typeof t.element!="string"&&!(t.element instanceof HTMLElement))throw new Error("Element must be a string selector, element ID, or HTMLElement");if(typeof t.key!="string")throw new Error("API key must be a string");if(t.maxResults!==void 0&&(!Number.isInteger(t.maxResults)||t.maxResults<1))throw new Error("maxResults must be a positive integer");if(t.debounceDelay!==void 0&&(!Number.isInteger(t.debounceDelay)||t.debounceDelay<0))throw new Error("debounceDelay must be a non-negative integer")},De=function(t){y(this,P,{url:"https://api.cloud.riskscape.pro",key:t.key,showCategory:!1,showPoweredBy:!0,placeholder:"Search for an address...",maxResults:jt.DEFAULT_MAX_RESULTS,debounceDelay:300,minChars:jt.DEFAULT_MIN_CHARS,noResultsText:"No results found",loadingText:"Loading...",errorText:"Error occurred while searching",...t}),l(this,P).minChars=jt.DEFAULT_MIN_CHARS},Pe=function(t){if(typeof t=="string")t.startsWith("#")||t.startsWith(".")?this._input=document.querySelector(t):this._input=document.getElementById(t);else if(t instanceof HTMLElement)this._input=t;else throw new Error("Element must be a string selector, element ID, or HTMLElement");if(!this._input)throw new Error(re.ELEMENT_NOT_FOUND(t));if(this._input.tagName!=="INPUT")throw new Error("Element must be an input element");Object.assign(this._input,{autocomplete:"off",placeholder:l(this,P).placeholder}),this._input.setAttribute("role","combobox"),this._input.setAttribute("aria-autocomplete","list"),this._input.setAttribute("aria-expanded","false"),this._input.setAttribute("aria-haspopup","listbox")},ke=function(){this._handleChange=ht(c(this,r,Qe).bind(this),l(this,P).debounceDelay),this._boundHandleBlur=c(this,r,Ze).bind(this),this._boundHandleFocus=c(this,r,Je).bind(this),this._boundHandleKeydown=c(this,r,ei).bind(this),this._boundHandlePaste=c(this,r,ti).bind(this),this._boundHandleItemClick=c(this,r,ri).bind(this)},Ie=function(){c(this,r,Fe).call(this)},Me=function(){this._input.addEventListener("input",this._handleChange),this._input.addEventListener("blur",this._boundHandleBlur),this._input.addEventListener("focus",this._boundHandleFocus),this._input.addEventListener("keydown",this._boundHandleKeydown),this._input.addEventListener("paste",this._boundHandlePaste)},Fe=function(){c(this,r,He).call(this),c(this,r,Ue).call(this),c(this,r,We).call(this),c(this,r,Be).call(this),c(this,r,$e).call(this),c(this,r,Ve).call(this),c(this,r,je).call(this)},He=function(){this._dropdownContainer=c(this,r,tt).call(this,"div",st.CONTAINER)},Ue=function(){this._dropdown=c(this,r,tt).call(this,"nav",st.MENU,{role:"listbox"}),this._dropdown.addEventListener("click",this._boundHandleItemClick),this._dropdownContainer.appendChild(this._dropdown)},We=function(){y(this,R,c(this,r,tt).call(this,"ul",st.RESULTS)),this._dropdown.appendChild(l(this,R))},Be=function(){l(this,P).showPoweredBy&&(y(this,F,c(this,r,tt).call(this,"div",st.POWERED_BY,{style:{display:"none"}})),l(this,F).innerHTML='powered by <a href="https://riskscape.pro/powered-by" target="_blank">Riskscape</a>',this._dropdownContainer.appendChild(l(this,F)))},$e=function(){y(this,B,c(this,r,tt).call(this,"div",st.LOADING,{"aria-label":"Loading search results",role:"status",style:{display:"none"}}));const t=c(this,r,tt).call(this,"div",st.LOADING_SPINNER),i=c(this,r,tt).call(this,"div",st.LOADING_TEXT);i.textContent="Searching...",l(this,B).appendChild(t),l(this,B).appendChild(i),this._dropdownContainer.appendChild(l(this,B))},Ve=function(){document.body.appendChild(this._dropdownContainer)},je=function(){this._dropdownCleanup=Xi(this._input,this._dropdownContainer,()=>{tn(this._input,this._dropdownContainer,{placement:"bottom-start",middleware:[Qi(5),Ji(),Zi()]}).then(({x:t,y:i})=>{const n=this._input.offsetWidth,a=Math.max(400,Math.min(700,n)),h=a>=400;this._dropdownContainer.classList.toggle("rs-search-container--wide",h),Object.assign(this._dropdownContainer.style,{top:`${i}px`,left:`${t}px`,width:`${a}px`})})})},tt=function(t,i,n={}){const s=document.createElement(t);return s.className=i,Object.entries(n).forEach(([o,a])=>{o==="style"&&typeof a=="object"?Object.assign(s.style,a):s.setAttribute(o,a)}),s},ct=function(){this._dropdown&&(l(this,Z)&&y(this,O,l(this,G)),y(this,k,!0),this._dropdown.style.display="block",l(this,F)&&(l(this,F).style.display="block"),this._input&&this._input.setAttribute("aria-expanded","true"))},K=function(){if(!this._dropdown){y(this,k,!1);return}setTimeout(()=>{y(this,O,-1),y(this,k,!1),this._dropdown&&(this._dropdown.style.display="none"),l(this,F)&&(l(this,F).style.display="none"),this._input&&this._input.setAttribute("aria-expanded","false")},200)},ze=function(){y(this,O,-1),c(this,r,$t).call(this),c(this,r,Tt).call(this),l(this,R).innerHTML="",this._dropdown.setAttribute("aria-expanded","true"),this._input.setAttribute("aria-controls","rs-search-results-list"),l(this,R).id="rs-search-results-list";const t=document.createDocumentFragment();if(l(this,N).forEach((i,n)=>{const s=c(this,r,qe).call(this,i,n);t.appendChild(s)}),!l(this,N).length){const i=document.createElement("li");i.classList.add("rs-search-results__message"),i.innerHTML="<div>Search returned no results.</div>",t.appendChild(i)}l(this,R).appendChild(t),c(this,r,ct).call(this)},qe=function(t,i){const n=document.createElement("li");n.dataset.index=i.toString(),n.classList.add("rs-search-results__item"),n.setAttribute("role","option"),n.setAttribute("aria-selected","false"),n.setAttribute("id",`rs-search-result-${i}`);const s=t.candidate.split(", "),o=`<span>${s.shift()}</span>, ${s.join(", ")}`;let a="";return l(this,P).showCategory&&(a+=c(this,r,Ge).call(this,t)),a&&(a=`<div class="rs-search-results__meta">${a}</div>`),n.innerHTML=`
|
|
2
2
|
<div class="rs-search-results__content">
|
|
3
3
|
<div class="rs-search-results__candidate">${o}</div>
|
|
4
4
|
${a}
|
|
5
5
|
</div>
|
|
6
|
-
`,n},Ge=function(t){const i=[Lt(t.category),Lt(t.subcategory)];let n=i[1];return se(i[1],"Street Number")?n="Street Number":se(i[1],"Stand Number")?n="Stand Number":["Residential","Commercial"].includes(i[1])?n=i[1]+" Scheme":i[1]==="Scheme Unit"&&(n="Sectional Scheme Unit"),`<div class="rs-search-results__category">${n}</div>`},Bt=function(){y(this,N,[]),y(this,rt,""),y(this,O,-1),c(this,r,$t).call(this)},$t=function(){y(this,G,null),y(this,Z,null)},
|
|
6
|
+
`,n},Ge=function(t){const i=[Lt(t.category),Lt(t.subcategory)];let n=i[1];return se(i[1],"Street Number")?n="Street Number":se(i[1],"Stand Number")?n="Stand Number":["Residential","Commercial"].includes(i[1])?n=i[1]+" Scheme":i[1]==="Scheme Unit"&&(n="Sectional Scheme Unit"),`<div class="rs-search-results__category">${n}</div>`},Bt=function(){y(this,N,[]),y(this,rt,""),y(this,O,-1),c(this,r,$t).call(this)},$t=function(){y(this,G,null),y(this,Z,null)},Tt=function(){l(this,R).querySelectorAll("li").forEach((t,i)=>{t.classList.toggle("rs-search-results__item--hover",i===l(this,O))})},Ke=function(t){l(this,R).querySelectorAll("li").forEach((i,n)=>{i.classList.toggle("rs-search-results__item--selected",n===t)})},Ye=function(t){return typeof t!="string"?"":t.normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/<[^>]*>/g,"").replace(/[^\w\s,.-]/g,"").trim().slice(0,100)},Xe=function(t){if(!t)return t;const i=["unit","stand"],n=t.toLowerCase().split(/\s+/);for(;n.length>0&&i.includes(n[0]);)n.shift();return n.join(" ").trim()},Qe=async function(t){const i=c(this,r,Ye).call(this,t.target.value),n=c(this,r,Xe).call(this,i);if(n.length<l(this,P).minChars){l(this,k)&&(c(this,r,Bt).call(this),c(this,r,K).call(this));return}if(n!==l(this,rt)){y(this,rt,n),this._api.cancel(),this._api.createAbortController(),c(this,r,ne).call(this,!0),!l(this,k)&&this._dropdown&&c(this,r,ct).call(this),this._events.emit("geocode:before",{query:n});try{const s=await this._api.geocode(n,this._filters),o=s.data||s;y(this,N,o.slice(0,l(this,P).maxResults)),l(this,N).length===0?c(this,r,St).call(this,"No results found. Try a different search term."):c(this,r,ze).call(this),this._events.emit("geocode:after",l(this,N))}catch(s){this._events.emit("error",s),s.message==="Network error: No response received"?c(this,r,St).call(this,"Network error. Please check your connection and try again."):s.message==="Unauthorized"?c(this,r,St).call(this,"Authentication error. Please check your API key."):s.message==="Request cancelled"||(c(this,r,St).call(this,"An error occurred while searching. Please try again."),console.error("Error fetching geocode results:",s))}finally{c(this,r,ne).call(this,!1)}}},Ze=function(){l(this,k)&&c(this,r,K).call(this)},Je=function(){l(this,N).length&&(this._boundToMap&&(this._input.value=l(this,rt)),c(this,r,ct).call(this))},ti=function(t){if(this._boundToMap)return;const i=t.clipboardData.getData("text/plain");if(c(this,r,Bt).call(this),C(i)){t.preventDefault();const[n,s]=i.split(",").map(o=>parseFloat(o).toFixed(6));this._events.emit("paste",{type:"latlon",data:{lat:n,lon:s}}),this._input.value=`${n}, ${s}`,this._input.blur(),c(this,r,K).call(this)}else b(i)&&(t.preventDefault(),this._events.emit("paste",{type:"property_key",data:i}),this._input.value=i,this._input.blur(),c(this,r,K).call(this))},ei=function(t){var o;const{key:i}=t;if(![Q.ARROW_UP,Q.ARROW_DOWN,Q.ENTER,Q.ESCAPE].includes(i))return;t.preventDefault();const s={[Q.ARROW_DOWN]:()=>c(this,r,ii).call(this),[Q.ARROW_UP]:()=>c(this,r,ni).call(this),[Q.ENTER]:()=>c(this,r,si).call(this),[Q.ESCAPE]:()=>c(this,r,K).call(this)};(o=s[i])==null||o.call(s)},ii=function(){if(!l(this,k)&&l(this,N).length){c(this,r,ct).call(this);return}l(this,O)<l(this,N).length-1&&(Rt(this,O)._++,c(this,r,ee).call(this),c(this,r,Tt).call(this))},ni=function(){l(this,k)&&l(this,O)>0&&(Rt(this,O)._--,c(this,r,ee).call(this),c(this,r,Tt).call(this))},si=function(){if(!l(this,k)&&l(this,N).length){c(this,r,ct).call(this);return}if(l(this,O)>=0){c(this,r,Vt).call(this);const t=l(this,R).querySelector(`li[data-index="${l(this,O)}"]`);t==null||t.click()}},ee=function(){const t=l(this,R).querySelector(`li[data-index="${l(this,O)}"]`);t==null||t.scrollIntoView({block:"nearest",behavior:"smooth"})},Vt=function(){this._input&&(this._input.disabled=!0,this._input.setAttribute("aria-disabled","true"))},ie=function(){this._input&&(this._input.disabled=!1,this._input.setAttribute("aria-disabled","false"))},ri=async function(t){if(l(this,gt))return;const i=t.target.closest("li");if(!i||!i.dataset.index||i.classList.contains("rs-search-results__message")||(y(this,O,-1),c(this,r,Tt).call(this),y(this,G,parseInt(i.dataset.index)),l(this,G)<0||l(this,G)>=l(this,N).length))return;c(this,r,Ke).call(this,l(this,G)),c(this,r,K).call(this);const n=l(this,N)[l(this,G)];if(y(this,Z,n),this._boundToMap){c(this,r,Vt).call(this),this._events.emit("select",{candidate:n}),this._input.value=n.candidate,setTimeout(()=>{c(this,r,ie).call(this)},300);return}c(this,r,Vt).call(this);try{const s=await c(this,r,oi).call(this);this._events.emit("select",{candidate:n,address:s}),this._input.value=(s==null?void 0:s.full_address)||n.candidate}catch(s){console.error("Error in handleItemClick:",s),this._events.emit("error",new Error("Failed to process selection"))}finally{c(this,r,ie).call(this),this._input.blur()}},ne=function(t){if(y(this,gt,t),!!l(this,B)){if(t){if(l(this,B).style.display="flex",!l(this,k)&&l(this,R)){if(l(this,R).innerHTML="",l(this,R)){const i=document.createElement("li");i.classList.add("rs-search-results__message"),i.classList.add("rs-search-results__loading-placeholder"),l(this,R).appendChild(i)}this._dropdown&&(this._dropdown.style.display="block",this._dropdown.style.overflowY="hidden"),l(this,F)&&(l(this,F).style.display="block"),y(this,k,!0),this._input.setAttribute("aria-expanded","true")}}else if(l(this,B)&&(l(this,B).style.display="none"),l(this,R)){const i=l(this,R).querySelector(".rs-search-results__loading-placeholder");i&&i.remove(),this._dropdown&&(this._dropdown.style.overflowY="auto"),l(this,N).length===0&&l(this,R).querySelector(".rs-search-results__error")===null&&c(this,r,K).call(this)}this._events.emit("loading",l(this,gt))}},St=function(t){(!t||typeof t!="string")&&(t=l(this,P).errorText||"An error occurred"),l(this,R).innerHTML="";const i=document.createElement("li");i.classList.add("rs-search-results__message","rs-search-results__error"),i.setAttribute("role","alert"),i.setAttribute("aria-live","polite"),i.innerHTML=`<div>${t}</div>`,l(this,R).appendChild(i),c(this,r,ct).call(this),this._events.emit("error",new Error(t))},oi=async function(){var t,i;if(!((i=(t=l(this,Z))==null?void 0:t.attributes)!=null&&i.address_id))return console.warn("No address ID available for selected candidate"),null;try{const n=await this._api.fetchAddress(l(this,Z).attributes.address_id);return n!=null&&n.data?n.data:(console.warn("Invalid response structure from fetchAddress"),null)}catch(n){return console.error("Error fetching candidate address:",n),this._events.emit("error",new Error("Failed to fetch address details")),null}},typeof window<"u"&&(window.RiskscapeSearch=Ce),w.RiskscapeSearch=Ce,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|