@qratilabs/qrati-connect 2.25.0 → 2.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/element/1dmOpMwn2.js +1 -0
  2. package/element/1eQ9Ef0M2.js +9 -0
  3. package/element/B0sEsGHn.js +8 -0
  4. package/element/B9ImRAum.js +1 -0
  5. package/element/{DGbyGc8b.js → BKENYwOQ.js} +1 -1
  6. package/element/BLeZg2Bz.js +1 -0
  7. package/element/BNaRcekR2.js +1 -0
  8. package/element/{qQ9Xx6H32.js → BdkTKcG52.js} +8 -8
  9. package/element/BmsDSHUi.js +4 -0
  10. package/element/Bo39kG4k2.js +1 -0
  11. package/element/{CsfDBJh72.js → BqiJLitq2.js} +2 -2
  12. package/element/BspExsK7.js +8 -0
  13. package/element/Bspyv2wJ2.js +24 -0
  14. package/element/BwwxqSTC2.js +1 -0
  15. package/element/C4DSwLWc.js +5 -0
  16. package/element/C6MqLLDX.js +3 -0
  17. package/element/C6YE4WUG2.js +5 -0
  18. package/element/{CgUphJWo.js → C7zv6hcG.js} +1 -1
  19. package/element/{C12iSy3L.js → C8meSsHD.js} +1 -1
  20. package/element/CBLQRRGX2.js +3 -0
  21. package/element/CBM5QMn8.js +1 -0
  22. package/element/CKQOToSD.js +41 -0
  23. package/element/CUBxHQ8u.js +1 -0
  24. package/element/CeHBrY_i.js +1 -0
  25. package/element/CfTdZB8y.js +4 -0
  26. package/element/CgxypkdG.js +3 -0
  27. package/element/{iuooW4mt.js → Cl0CwL5p.js} +8 -8
  28. package/element/{mQzpzQ_t.js → CpYO5bBq.js} +1 -1
  29. package/element/CtxIOzTC2.js +1 -0
  30. package/element/DGZEznLT2.js +1 -0
  31. package/element/DLF5ysgi.js +1 -0
  32. package/element/{CVRTTCyF.js → DOOdI-Oh.js} +1 -1
  33. package/element/{Z0-Tddye2.js → DRPgs6nu2.js} +9 -9
  34. package/element/DSx5wvUb2.js +1 -0
  35. package/element/{iknPnbyg2.js → DVFC5Z2L2.js} +28 -28
  36. package/element/{DlqJDAie2.js → DWqIpaZ02.js} +1 -1
  37. package/element/{CJXPO3HP.js → DZGp2V2-.js} +1 -1
  38. package/element/{Ctl9NdWl2.js → D_FNRN5A2.js} +1 -1
  39. package/element/DdACKOZr.js +1 -0
  40. package/element/{ChJXhA9c.js → DdYePHxG.js} +1 -1
  41. package/element/{C9T-_wQ82.js → DlAI3J0X.js} +4 -4
  42. package/element/{CATr-3VW.js → DmIYOIw1.js} +1 -1
  43. package/element/DmpmrPE5.js +1 -0
  44. package/element/DvisvxzJ.js +1 -0
  45. package/element/{C3dOFk9A.js → DyemeRjE2.js} +1 -1
  46. package/element/L4hWU3Nc.js +1 -0
  47. package/element/MU5QuIq0.js +3 -0
  48. package/element/{BCTYvPrD.js → OnH8Izqn.js} +1 -1
  49. package/element/Ot24jlyb2.js +1 -0
  50. package/element/{DnQ6XaLR.js → QDuBhueG.js} +1 -1
  51. package/element/SgRzjPnr.js +14 -0
  52. package/element/{DZtaQWVG2.js → Vk429P022.js} +1 -1
  53. package/element/{2CMH9VMM.js → X0P7ujR0.js} +1 -1
  54. package/element/aXvUP7X72.js +93 -0
  55. package/element/{BccTn5v-2.js → p0Q_2x6C.js} +1 -1
  56. package/element/qBKIp1ZW2.js +36 -0
  57. package/element/web.es.js +42 -42
  58. package/element/{BV9JHI5n2.js → xJZs5Gan.js} +35 -35
  59. package/package.json +1 -1
  60. package/element/BFCgbC5I2.js +0 -14
  61. package/element/BZu3c37u.js +0 -1
  62. package/element/BxbojrJs.js +0 -8
  63. package/element/C6dzWeQk2.js +0 -93
  64. package/element/C7iuJ0h32.js +0 -35
  65. package/element/C9kBlCZx2.js +0 -3
  66. package/element/CM46vluW.js +0 -1
  67. package/element/CMnzxWwG.js +0 -9
  68. package/element/CZbEGemi2.js +0 -4
  69. package/element/CaX2xgrP.js +0 -41
  70. package/element/Cko4QHwX.js +0 -1
  71. package/element/CqBk9L5O.js +0 -1
  72. package/element/D5TKEdBd2.js +0 -3
  73. package/element/DCj_fMN5.js +0 -5
  74. package/element/DF0LxcV7.js +0 -3
  75. package/element/DRP9vxts2.js +0 -4
  76. package/element/DWjheKBP2.js +0 -3
  77. package/element/EjMoIoSK.js +0 -1
  78. package/element/ZYvo9BjF2.js +0 -8
  79. package/element/dT6WSX65.js +0 -1
  80. package/element/h4ZjZXfe2.js +0 -1
  81. package/element/rg8L51I62.js +0 -5
  82. /package/element/{CfMNBPpx2.js → CfMNBPpx.js} +0 -0
  83. /package/element/{DPg_DKOi.js → DPg_DKOi2.js} +0 -0
  84. /package/element/{DnIueBGr2.js → DnIueBGr.js} +0 -0
@@ -0,0 +1,3 @@
1
+ import{r as e}from"./DdACKOZr.js";import{C as t,_ as o,f as l,h as r,p as a,t as n}from"./DrrpB4Om.js";import{a as i,l as f,n as c}from"./CKQOToSD.js";import{t as p}from"./CeHBrY_i.js";import{v as s}from"./BLeZg2Bz.js";import{t as d}from"./MU5QuIq0.js";import{t as u}from"./Rcen6i0h.js";import{t as m}from"./B9ImRAum.js";import{a as g,i as b,n as h,r as x,t as v}from"./p0Q_2x6C.js";import{t as k}from"./CfMNBPpx.js";var y=[[90,-180],[-90,180]],w=[20,0],z="#fb8500",A={topLeft:[276,60],bottomRight:[60,60]},E=new p,L=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),C=({onExplore:p,logoUrl:C})=>{const R=l(null),T=l(null),M=l(null),O=l(null),I=l(null),W=l(null),j=l(null),S=l(!1),Z=l(!1),q=a(()=>(()=>{try{const e=sessionStorage.getItem(s);if(!e)return null;const t=JSON.parse(e);if("number"==typeof t?.center?.lat&&"number"==typeof t?.center?.lng&&"number"==typeof t?.zoom)return t}catch{}return null})(),[]),[D,B]=r(!0),[H,N]=r(!1),{folderTree:U,activeFolderId:F,activeFolder:P,visibleEvents:Y,setActiveFolderId:J,isLoadingEvents:G}=m(),{organization:Q}=c();return o(()=>{if(!R.current||T.current)return;k("leaflet",'.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;top:0;left:0}.leaflet-container{overflow:hidden}.leaflet-tile,.leaflet-marker-icon,.leaflet-marker-shadow{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile::selection{background:0 0}.leaflet-safari .leaflet-tile{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container{-webkit-transform-origin:0 0;width:1600px;height:1600px}.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{width:auto;padding:0;max-width:none!important;max-height:none!important}.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:#33b5e566}.leaflet-tile{filter:inherit;visibility:hidden}.leaflet-tile-loaded{visibility:inherit}.leaflet-zoom-box{box-sizing:border-box;z-index:800;width:0;height:0}.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{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top,.leaflet-bottom{z-index:1000;pointer-events:none;position:absolute}.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;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup{opacity:1}.leaflet-zoom-animated{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{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{outline-offset:1px;background:#ddd}.leaflet-container a{color:#0078a8}.leaflet-zoom-box{background:#ffffff80;border:2px dotted #38f}.leaflet-container{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a,.leaflet-control-layers-toggle{background-position: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:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled{cursor:default;color:#bbb;background-color:#f4f4f4}.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-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in,.leaflet-control-zoom-out{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in,.leaflet-touch .leaflet-control-zoom-out{font-size:22px}.leaflet-control-layers{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.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{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label{font-size:1.08333em;display:block}.leaflet-control-layers-separator{border-top:1px solid #ddd;height:0;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:#fffc;margin:0}.leaflet-control-attribution,.leaflet-control-scale-line{color:#333;padding:0 5px;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{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale{margin-left:5px}.leaflet-bottom .leaflet-control-scale{margin-bottom:5px}.leaflet-control-scale-line{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.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{background-clip:padding-box;border:2px solid #0003}.leaflet-popup{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p{margin:1.3em 0}.leaflet-popup-tip-container{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper,.leaflet-popup-tip{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.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{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.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{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;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{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom{margin-top:6px}.leaflet-tooltip-top{margin-top:-6px}.leaflet-tooltip-bottom:before,.leaflet-tooltip-top:before{margin-left:-6px;left:50%}.leaflet-tooltip-top:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left{margin-left:-6px}.leaflet-tooltip-right{margin-left:6px}.leaflet-tooltip-left:before,.leaflet-tooltip-right:before{margin-top:-6px;top:50%}.leaflet-tooltip-left:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control{-webkit-print-color-adjust:exact;print-color-adjust:exact}}'),k("marker-cluster",".leaflet-cluster-anim .leaflet-marker-icon,.leaflet-cluster-anim .leaflet-marker-shadow{transition:transform .3s ease-out,opacity .3s ease-in}.leaflet-cluster-spider-leg{transition:stroke-dashoffset .3s ease-out,stroke-opacity .3s ease-in}.marker-cluster-small{background-color:#b5e28c99}.marker-cluster-small div{background-color:#6ecc3999}.marker-cluster-medium{background-color:#f1d35799}.marker-cluster-medium div{background-color:#f0c20c99}.marker-cluster-large{background-color:#fd9c7399}.marker-cluster-large div{background-color:#f1801799}.leaflet-oldie .marker-cluster-small{background-color:#b5e28c}.leaflet-oldie .marker-cluster-small div{background-color:#6ecc39}.leaflet-oldie .marker-cluster-medium{background-color:#f1d357}.leaflet-oldie .marker-cluster-medium div{background-color:#f0c20c}.leaflet-oldie .marker-cluster-large{background-color:#fd9c73}.leaflet-oldie .marker-cluster-large div{background-color:#f18017}.marker-cluster{background-clip:padding-box;border-radius:20px}.marker-cluster div{text-align:center;border-radius:15px;width:30px;height:30px;margin-top:5px;margin-left:5px}.marker-cluster span{line-height:30px}");let t,o=!1;return(async()=>{try{const l=await import("./OnH8Izqn.js").then(t=>/* @__PURE__ */e(t.default,1));if(o)return;if("undefined"!=typeof window&&(window.L=l),await Promise.all([import("./C7zv6hcG.js").then(t=>/* @__PURE__ */e(t.default,1)),import("./rtH8O6Hc.js")]),o)return;const r=window.L??l;if(!R.current)return;const a=l.map(R.current,{center:q?.center?[q.center.lat??w[0],q.center.lng??w[1]]:w,zoom:q?.zoom??3,minZoom:3,zoomControl:!0,worldCopyJump:!1,maxBounds:l.latLngBounds(y),maxBoundsViscosity:1});l.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"&copy; OpenStreetMap contributors",maxZoom:19,noWrap:!0}).addTo(a);const n=l.layerGroup().addTo(a),i="function"==typeof r.heatLayer?r.heatLayer([],{radius:30,blur:30,maxZoom:10,minOpacity:.35}):null;i?.addTo(a);const f="function"==typeof r.markerClusterGroup?r.markerClusterGroup({chunkedLoading:!0,showCoverageOnHover:!1,spiderfyOnMaxZoom:!0,zoomToBoundsOnClick:!0,maxClusterRadius:48}):l.layerGroup();f.addTo(a);const c=()=>{j.current&&clearTimeout(j.current),j.current=setTimeout(()=>{try{sessionStorage.setItem(s,JSON.stringify({center:a.getCenter(),zoom:a.getZoom()}))}catch{}},250)};let p;a.on("zoomend",c),a.on("moveend",c),T.current=a,M.current=r,O.current=n,W.current=i,I.current=f,"undefined"!=typeof ResizeObserver&&R.current&&(p=new ResizeObserver(()=>a.invalidateSize(!1)),p.observe(R.current)),requestAnimationFrame(()=>a.invalidateSize(!1)),N(!0),B(!1),t=()=>{p?.disconnect(),j.current&&clearTimeout(j.current),a.off("zoomend",c),a.off("moveend",c),a.remove(),M.current=null,T.current=null,O.current=null,W.current=null,I.current=null}}finally{o||B(!1)}})(),()=>{o=!0,t?.()}},[q]),o(()=>{if(!H)return;const e=M.current;if(!e)return;const o=T.current;if(O.current?.clearLayers(),I.current?.clearLayers(),null===F&&U.length>0){o&&W.current&&(W.current.setLatLngs?.([]),o.hasLayer(W.current)&&o.removeLayer(W.current));const t=o=>{for(const l of o)if(l.centroid){const[t,o]=l.centroid,r=e.divIcon({className:"",html:`<div style="transform:translate(-50%,-50%);background:${x(l.color,z)};color:#fff;border-radius:20px;padding:5px 10px;font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,0.25);border:2px solid rgba(255,255,255,0.4);cursor:pointer;display:inline-flex;align-items:center;gap:6px;"><span>${L(l.folder.name)}</span><span style="background:rgba(0,0,0,0.18);border-radius:10px;padding:1px 5px;font-size:10px;">${l.eventCount}</span></div>`,iconSize:[0,0],iconAnchor:[0,0]});e.marker([o,t],{icon:r}).on("click",()=>J(l.folder._id)).addTo(O.current)}else l.children.length>0&&t(l.children)};t(U)}else{if(0===Y.length)return;const l=0===U.length&&null===F,r=x(P?.color,z);if(o&&W.current&&(l&&!o.hasLayer(W.current)?W.current.addTo(o):l||(W.current.setLatLngs?.([]),o.hasLayer(W.current)&&o.removeLayer(W.current))),Y.forEach(o=>{const l=o.location.x,a=o.location.y,i=e.divIcon({className:"qrati-leaflet-marker-wrapper",html:`<div style="width:42px;height:42px;cursor:pointer;background:${r};border-radius:50% 50% 50% 0;transform:rotate(-45deg);border:2px solid white;box-shadow:0 2px 8px rgba(0,0,0,0.3);display:flex;align-items:center;justify-content:center;overflow:hidden;">${b(C)?`<img src="${b(C)}" style="width:28px;height:28px;border-radius:50%;object-fit:cover;transform:rotate(45deg);" />`:""}</div>`,iconSize:[42,42],iconAnchor:[21,42],popupAnchor:[0,-42]}),c=e.marker([a,l],{icon:i}),s=document.createElement("div");s.style.width="fit-content",((e,o,l)=>{t(/* @__PURE__ */n(f,{client:E,children:/* @__PURE__ */n(g,{event:e,onExplore:l})}),o)})(o,s,p),c.bindPopup(s,{closeButton:!0,maxWidth:256}),I.current?.addLayer(c)}),l&&W.current){const e=Y.reduce((e,t)=>Math.max(e,t.views??0),1),t=Y.map(e=>[e.location.y,e.location.x,e.views??1]);W.current.setOptions?.({radius:30,blur:30,maxZoom:10,minOpacity:.35,max:e}),W.current.setLatLngs?.(t)}if(l&&!Z.current&&o&&(Z.current=!0,!q)){const t=e.latLngBounds([]);Y.forEach(e=>t.extend([e.location.y,e.location.x])),t.isValid()&&o.fitBounds(t,{paddingTopLeft:A.topLeft,paddingBottomRight:A.bottomRight,maxZoom:8})}}},[F,U,Y,H,p,C,J,P,q]),o(()=>{if(!H)return;const e=T.current,t=M.current;if(!e||!t)return;if(!S.current&&q)return void(S.current=!0);S.current=!0;const o={paddingTopLeft:A.topLeft,paddingBottomRight:A.bottomRight,duration:3,easeLinearity:1};if(F){const l=h(U,F);if(!l?.folder.boundary?.length)return;const r=t.latLngBounds([]);for(const e of l.folder.boundary)r.extend([e.y,e.x]);r.isValid()&&e.flyToBounds(r,{...o,maxZoom:14})}else{const l=t.latLngBounds([]),r=e=>{for(const t of e)t.centroid?l.extend([t.centroid[1],t.centroid[0]]):r(t.children)};r(U),l.isValid()&&e.flyToBounds(l,{...o,maxZoom:8})}},[F,U,H,q]),/* @__PURE__ */n("div",{class:"relative h-screen w-full sm:h-[calc(100vh-4rem)]",style:i(Q),children:[
2
+ /* @__PURE__ */n(v,{positionClass:"absolute top-3 left-16 z-[1000]",folderTree:U,activeFolderId:F,setActiveFolderId:J}),G&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-10 flex items-center justify-center bg-white/60",children:/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"})}),D&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-20 flex items-center justify-center bg-white/85",children:/* @__PURE__ */n("div",{class:"flex flex-col items-center gap-3",children:[/* @__PURE__ */n("div",{class:"border-primary size-10 animate-spin rounded-full border-4 border-t-transparent"}),/* @__PURE__ */n("p",{class:"text-sm font-medium text-slate-700",children:"Loading map…"})]})}),!G&&0===Y.length&&(0===U.length||null!==F)&&/* @__PURE__ */n("div",{class:"absolute inset-0 z-30 flex items-center justify-center bg-white/90",children:/* @__PURE__ */n(d,{title:"No Events",description:"Check back later for our awesome events!",iconSvg:/* @__PURE__ */n(u,{})})}),
3
+ /* @__PURE__ */n("div",{ref:R,class:"h-full w-full rounded-xl border border-slate-200"})]})};export{C as default};
@@ -0,0 +1,5 @@
1
+ import{h as a,t as o}from"./DrrpB4Om.js";import{n as e}from"./CKQOToSD.js";import{x as s}from"./BLeZg2Bz.js";import{c as r,t as l}from"./DdYePHxG.js";import{t as i}from"./DmIYOIw1.js";import{n as t}from"./DGGc10Cy.js";import{t as n}from"./DyemeRjE2.js";import{i as d,s as m,t as p}from"./DWqIpaZ02.js";import{n as c,r as g,t as u}from"./DlRUi0u42.js";var f=()=>{const{t:f}=t(),h=r(),[w,v]=a(""),[b,y]=a(""),[j,C]=a(!1),[N,A]=a(null),[P,k]=a(!1),[x,S]=a({}),{loginUsingEmail:E,loginWithGoogle:F,loginWithApple:L}=e(),[O,W]=a({google:!1,apple:!1}),D=a=>{S(o=>o[a]?{...o,[a]:void 0}:o)},G=async(a,o)=>{W(o=>({...o,[a]:!0})),A(null);try{await(o?.())}catch(e){e instanceof Error?A(e.message):A(`Failed to login with ${a.charAt(0).toUpperCase()+a.slice(1)}`)}finally{W(o=>({...o,[a]:!1}))}};/* @__PURE__ */
2
+ return o("div",{className:"bg-background w-full space-y-6",children:[/* @__PURE__ */o("form",{noValidate:!0,onSubmit:async a=>{a.preventDefault();const o=d(w),e=m(b);if(o||e)return void S({email:o,password:e});S({}),C(!0),A(null);const s=await(E?.(w.toLowerCase(),b));s?.error&&A(s.error),C(!1)},className:"space-y-6",children:[
3
+ /* @__PURE__ */o("div",{className:"space-y-9",children:[/* @__PURE__ */o(p,{label:f("auth.email","Email address"),name:"email",disabled:j,type:"email",value:w,onChange:a=>{v(a.target.value),D("email")},autoComplete:"email",error:x.email}),/* @__PURE__ */o(p,{label:f("auth.password","Password"),name:"password",disabled:j,type:P?"text":"password",value:b,onChange:a=>{y(a.target.value),D("password")},autoComplete:"current-password",error:x.password,actionLabel:P?"Hide password":"Show password",actionIcon:/* @__PURE__ */o(P?u:c,{className:"size-5"}),onActionClick:()=>k(!P)})]}),N&&/* @__PURE__ */o(i,{align:"center",color:"error",className:"font-medium",children:N}),
4
+ /* @__PURE__ */o("div",{className:"flex justify-end",children:/* @__PURE__ */o(l,{to:s.FORGOT_PASSWORD,state:{from:h.pathname},children:/* @__PURE__ */o(i,{variant:"h6",className:"w-fit",children:f("button.forgotPassword","Forgot Password?")})})}),
5
+ /* @__PURE__ */o(n,{type:"submit",color:"primary",className:"w-full",loading:j,disabled:j,children:f("button.login","Login")})]}),/* @__PURE__ */o("div",{className:"grid grid-cols-2 gap-4",children:[/* @__PURE__ */o(g,{disabled:j||O.google||O.apple,loading:O.google,onClick:()=>G("google",F),provider:"google"}),/* @__PURE__ */o(g,{disabled:j||O.google||O.apple,loading:O.apple,onClick:()=>G("apple",L),provider:"apple"})]})]})};export{f as default};
@@ -1 +1 @@
1
- import{t as e}from"./Cko4QHwX.js";var t=/* @__PURE__ */e((e,t)=>{var i,r;i=e,r=function(e){var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,r=this._featureGroup,n=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=/* @__PURE__ */(new Date).getTime(),d=L.bind(function(){var p=/* @__PURE__ */(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();l<h&&!(s&&l%200==0&&/* @__PURE__ */(new Date).getTime()-p>o);l++)if((i=e[l])instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var c=i.__parent.getAllChildMarkers(),f=c[0]===i?c[1]:c[0];r.removeLayer(f)}}else n.addLayer(i),t||this.fire("layeradd",{layer:i});a&&a(l,h,/* @__PURE__ */(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var p=this._needsClustering;l<h;l++)(i=e[l])instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||p.push(i):n.addLayer(i);return this},removeLayers:function(e){var t,i,r=e.length,n=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=r;for(t=0;t<h;t++)(i=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),n.hasLayer(i)&&(n.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,r,n,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),r=s.length-1;r>=0;r--){for(i=!0,n=o.length-1;n>=0;n--)if(o[n].layer===s[r]){i=!1;break}i&&e.call(t,s[r])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(t=(i=this._needsRemoving).length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;"function"!=typeof t&&(t=function(){});var r=function(){!i.hasLayer(e)&&!i.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",r,this),this.off("animationend",r,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",r,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",r,this),this.on("animationend",r,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,i,r;if(this._map=e,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)(r=this._needsRemoving[t]).newlatlng=r.layer._latlng,r.layer._latlng=r.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)r=this._needsRemoving[t],this._removeLayer(r.layer,!0),r.layer._latlng=r.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,r=this._gridUnclustered,n=Math.floor(this._map.getMinZoom());t>=n&&r[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var r=this._gridClusters,n=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],r[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),n[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return i+=t<10?"small":t<100?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom;(t||r||n)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom,n=this._map;(e||i||r)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,r=i;"function"!=typeof i&&(r=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=t;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,r,n=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=n[t].getNearObject(i);if(a)return a._addChild(e),void(e.__parent=a);if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);n[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(r=t-1;r>h._zoom;r--)u=new this._markerCluster(this,r,u),n[r].addObject(u,this._map.project(a.getLatLng(),r));return h._addChild(u),void this._removeFromGridUnclustered(a,t)}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,r=e.getLayers(),n=0;for(t=t||[];n<r.length;n++)(i=r[n])instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i,r=this._getExpandedVisibleBounds(),n=this._featureGroup,s=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(r,e,s,function(s){var o,a=s._latlng,h=s._markers;for(r.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,r)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,r)),i=h.length-1;i>=0;i--)o=h[i],r.contains(o._latlng)||n.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),n.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(r,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(r,e,s,function(e){n.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,r=this._featureGroup;r.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){r.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var r=this._getExpandedVisibleBounds(),n=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,n,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(r,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(r,i,n,function(e){e._recursivelyRemoveChildrenFromMap(r,n,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,r){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),r=this._group._map,n=r.getBoundsZoom(this._bounds),s=this._zoom+1,o=r.getZoom();i.length>0&&n>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}n>s?this._group._map.setView(this._latlng,s):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,r,n=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<n.length;e++)i=n[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)(t=s[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,r=t._childCount,o+=i.lat*r,a+=i.lng*r;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,r,n=e._markers;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())},function(e){var i,r,n=e._childClusters;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,r){this._recursively(e,r,t,function(n){n._recursivelyAnimateChildrenIn(e,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),i),n._isSingleParent()&&i-1===r?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(e,t,i)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(r){if(t!==r._zoom)for(var n=r._markers.length-1;n>=0;n--){var s=r._markers[n];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),r._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,r){var n,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)n=e._markers[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)n=e._childClusters[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())})},_recursively:function(e,t,i,r,n){var s,o,a=this._childClusters,h=this._zoom;if(t<=h&&(r&&r(this),n&&h===i&&n(this)),h<t||h<i)for(s=a.length-1;s>=0;s--)(o=a[s])._boundsNeedUpdate&&o._recalculateBounds(),e.intersects(o._bounds)&&o._recursively(e,t,i,r,n)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),r=this._getCoord(t.y),n=this._grid,s=n[r]=n[r]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,r,n=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[n]=a[n]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,r=h.length;i<r;i++)if(h[i]===e)return h.splice(i,1),1===r&&delete a[n],!0},eachObject:function(e,t){var i,r,n,s,o,a,h=this._grid;for(i in h)for(r in o=h[i])for(n=0,s=(a=o[r]).length;n<s;n++)e.call(t,a[n])&&(n--,s--)},getNearObject:function(e){var t,i,r,n,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,p=null;for(t=u-1;t<=u+1;t++)if(n=this._grid[t])for(i=l-1;i<=l+1;i++)if(s=n[i])for(r=0,o=s.length;r<o;r++)a=s[r],((h=this._sqDist(_[L.Util.stamp(a)],e))<d||h<=d&&null===p)&&(d=h,p=a);return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r}},L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,r,n,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)r=t[i],(n=this.getDistant(r,e))>0&&(a.push(r),n>s&&(s=n,o=r));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?i=(i=i.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,i=!1,r=!1,n=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(!1===i||d.lat>i)&&(o=d,i=d.lat),(!1===r||d.lat<r)&&(a=d,r=d.lat),(!1===n||d.lng>n)&&(h=d,n=d.lng),(!1===s||d.lng<s)&&(l=d,s=d.lng)}return r!==i?(_=a,u=o):(_=l,u=h),[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e))}},L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),r=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,i):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,i):(i.y+=10,e=this._generatePointsCircle(t.length,i)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,r,n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,s=this._2PI/e,o=[];for(n=Math.max(n,35),o.length=e,i=0;i<e;i++)r=this._circleStartAngle+i*s,o[i]=new L.Point(t.x+n*Math.cos(r),t.y+n*Math.sin(r))._round();return o},_generatePointsSpiral:function(e,t){var i,r=this._group.options.spiderfyDistanceMultiplier,n=r*this._spiralLengthStart,s=r*this._spiralFootSeparation,o=r*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e;i>=0;i--)i<e&&(h[i]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round()),n+=o/(a+=s/n+5e-4*i);return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,r=i._map,n=i._featureGroup,s=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],n.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,r,n,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),r=e[i],n=new L.Polyline([this._latlng,s],l),a.addLayer(n),r._spiderLeg=n,r._preSpiderfyLatlng=r._latlng,r.setLatLng(s),r.setZIndexOffset&&r.setZIndexOffset(1e6),h.addLayer(r);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,r,n,s,o,a,h=this,l=this._group,u=l._map,_=l._featureGroup,d=this._latlng,p=u.latLngToLayerPoint(d),c=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),c?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,l._ignoreMove=!0,i=0;i<e.length;i++)r=e[i],a=u.layerPointToLatLng(t[i]),n=new L.Polyline([d,a],f),u.addLayer(n),r._spiderLeg=n,c&&(o=(s=n._path).getTotalLength()+.1,s.style.strokeDasharray=o,s.style.strokeDashoffset=o),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),_.addLayer(r),r._setPos&&r._setPos(p);for(l._forceLayout(),l._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),(r=e[i])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),c&&((s=(n=r._spiderLeg)._path).style.strokeDashoffset=0,n.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout(function(){l._animationEnd(),l.fire("spiderfied",{cluster:h,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,r,n,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)(t=d[i])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),p&&(s=(n=(r=t._spiderLeg)._path).getTotalLength()+.1,n.style.strokeDashoffset=s,r.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?r(e):"function"==typeof define&&define.amd?define(["exports"],r):r(((i=i||self).Leaflet=i.Leaflet||{},i.Leaflet.markercluster={}))});export default t();
1
+ import{t as e}from"./DdACKOZr.js";var t=/* @__PURE__ */e((e,t)=>{var i,r;i=e,r=function(e){var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnEveryZoom:!1,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyShapePositions:null,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,r=this._featureGroup,n=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=/* @__PURE__ */(new Date).getTime(),d=L.bind(function(){var p=/* @__PURE__ */(new Date).getTime();for(this._map&&this._unspiderfy&&this._unspiderfy();l<h&&!(s&&l%200==0&&/* @__PURE__ */(new Date).getTime()-p>o);l++)if((i=e[l])instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var c=i.__parent.getAllChildMarkers(),f=c[0]===i?c[1]:c[0];r.removeLayer(f)}}else n.addLayer(i),t||this.fire("layeradd",{layer:i});a&&a(l,h,/* @__PURE__ */(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var p=this._needsClustering;l<h;l++)(i=e[l])instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||p.push(i):n.addLayer(i);return this},removeLayers:function(e){var t,i,r=e.length,n=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=r;for(t=0;t<h;t++)(i=a[t])instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;t<r;t++)(i=e[t])instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),r=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),n.hasLayer(i)&&(n.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,r,n,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),r=s.length-1;r>=0;r--){for(i=!0,n=o.length-1;n>=0;n--)if(o[n].layer===s[r]){i=!1;break}i&&e.call(t,s[r])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(t=(i=this._needsRemoving).length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){var i=this._map;"function"!=typeof t&&(t=function(){});var r=function(){!i.hasLayer(e)&&!i.hasLayer(e.__parent)||this._inZoomAnimation||(this._map.off("moveend",r,this),this.off("animationend",r,this),i.hasLayer(e)?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",r,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",r,this),this.on("animationend",r,this),e.__parent.zoomToBounds())},onAdd:function(e){var t,i,r;if(this._map=e,!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;t<i;t++)(r=this._needsRemoving[t]).newlatlng=r.layer._latlng,r.layer._latlng=r.latlng;for(t=0,i=this._needsRemoving.length;t<i;t++)r=this._needsRemoving[t],this._removeLayer(r.layer,!0),r.layer._latlng=r.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,r=this._gridUnclustered,n=Math.floor(this._map.getMinZoom());t>=n&&r[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var r=this._gridClusters,n=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],r[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),n[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return i+=t<10?"small":t<100?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,r=this.options.zoomToBoundsOnClick,n=this.options.spiderfyOnEveryZoom;(t||r||n)&&this.on("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){var t=e.layer,i=t;if("clusterkeypress"!==e.type||!e.originalEvent||13===e.originalEvent.keyCode){for(;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),this.options.spiderfyOnEveryZoom&&t.spiderfy(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()}},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,r=this.options.spiderfyOnEveryZoom,n=this._map;(e||i||r)&&this.off("clusterclick clusterkeypress",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,r=i;"function"!=typeof i&&(r=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var n=e;n>=t;n--)this._gridClusters[n]=new L.DistanceGrid(r(n)),this._gridUnclustered[n]=new L.DistanceGrid(r(n));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,r,n=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=n[t].getNearObject(i);if(a)return a._addChild(e),void(e.__parent=a);if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);n[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(r=t-1;r>h._zoom;r--)u=new this._markerCluster(this,r,u),n[r].addObject(u,this._map.project(a.getLatLng(),r));return h._addChild(u),void this._removeFromGridUnclustered(a,t)}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,r=e.getLayers(),n=0;for(t=t||[];n<r.length;n++)(i=r[n])instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){return e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}})}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i,r=this._getExpandedVisibleBounds(),n=this._featureGroup,s=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(r,e,s,function(s){var o,a=s._latlng,h=s._markers;for(r.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(n.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,r)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,r)),i=h.length-1;i>=0;i--)o=h[i],r.contains(o._latlng)||n.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(r,t),n.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(r,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(r,e,s,function(e){n.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,r=this._featureGroup;r.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){r.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var r=this._getExpandedVisibleBounds(),n=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(r,n,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(r,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(r,i,n,function(e){e._recursivelyRemoveChildrenFromMap(r,n,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,r){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),r&&this._addChild(r)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e,t);for(var r=this._markers.length-1;r>=0;r--)t&&this._markers[r].__dragStart||e.push(this._markers[r]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),r=this._group._map,n=r.getBoundsZoom(this._bounds),s=this._zoom+1,o=r.getZoom();i.length>0&&n>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}n>s?this._group._map.setView(this._latlng,s):n<=o?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,r,n=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<n.length;e++)i=n[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)(t=s[e])._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,r=t._childCount,o+=i.lat*r,a+=i.lng*r;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,r,n=e._markers;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())},function(e){var i,r,n=e._childClusters;for(i=n.length-1;i>=0;i--)(r=n[i])._icon&&(r._setPos(t),r.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,r){this._recursively(e,r,t,function(n){n._recursivelyAnimateChildrenIn(e,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),i),n._isSingleParent()&&i-1===r?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(e,t,i)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(r){if(t!==r._zoom)for(var n=r._markers.length-1;n>=0;n--){var s=r._markers[n];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),r._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._restorePosition();else for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,r){var n,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)n=e._markers[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)n=e._childClusters[s],r&&r.contains(n._latlng)||(e._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())})},_recursively:function(e,t,i,r,n){var s,o,a=this._childClusters,h=this._zoom;if(t<=h&&(r&&r(this),n&&h===i&&n(this)),h<t||h<i)for(s=a.length-1;s>=0;s--)(o=a[s])._boundsNeedUpdate&&o._recalculateBounds(),e.intersects(o._bounds)&&o._recursively(e,t,i,r,n)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),r=this._getCoord(t.y),n=this._grid,s=n[r]=n[r]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,r,n=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[n]=a[n]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,r=h.length;i<r;i++)if(h[i]===e)return h.splice(i,1),1===r&&delete a[n],!0},eachObject:function(e,t){var i,r,n,s,o,a,h=this._grid;for(i in h)for(r in o=h[i])for(n=0,s=(a=o[r]).length;n<s;n++)e.call(t,a[n])&&(n--,s--)},getNearObject:function(e){var t,i,r,n,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,p=null;for(t=u-1;t<=u+1;t++)if(n=this._grid[t])for(i=l-1;i<=l+1;i++)if(s=n[i])for(r=0,o=s.length;r<o;r++)a=s[r],((h=this._sqDist(_[L.Util.stamp(a)],e))<d||h<=d&&null===p)&&(d=h,p=a);return p},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r}},L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat;return(t[0].lng-t[1].lng)*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,r,n,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)r=t[i],(n=this.getDistant(r,e))>0&&(a.push(r),n>s&&(s=n,o=r));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],r=this.findMostDistantPointFromBaseLine(e,t);return r.maxPoint?i=(i=i.concat(this.buildConvexHull([e[0],r.maxPoint],r.newPoints))).concat(this.buildConvexHull([r.maxPoint,e[1]],r.newPoints)):[e[0]]},getConvexHull:function(e){var t,i=!1,r=!1,n=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(!1===i||d.lat>i)&&(o=d,i=d.lat),(!1===r||d.lat<r)&&(a=d,r=d.lat),(!1===n||d.lng>n)&&(h=d,n=d.lng),(!1===s||d.lng<s)&&(l=d,s=d.lng)}return r!==i?(_=a,u=o):(_=l,u=h),[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e))}},L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),r=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),r.push(e);return L.QuickHull.getConvexHull(r)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group._map.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,this._group.options.spiderfyShapePositions?e=this._group.options.spiderfyShapePositions(t.length,i):t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,i):(i.y+=10,e=this._generatePointsCircle(t.length,i)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,r,n=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e)/this._2PI,s=this._2PI/e,o=[];for(n=Math.max(n,35),o.length=e,i=0;i<e;i++)r=this._circleStartAngle+i*s,o[i]=new L.Point(t.x+n*Math.cos(r),t.y+n*Math.sin(r))._round();return o},_generatePointsSpiral:function(e,t){var i,r=this._group.options.spiderfyDistanceMultiplier,n=r*this._spiralLengthStart,s=r*this._spiralFootSeparation,o=r*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e;i>=0;i--)i<e&&(h[i]=new L.Point(t.x+n*Math.cos(a),t.y+n*Math.sin(a))._round()),n+=o/(a+=s/n+5e-4*i);return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,r=i._map,n=i._featureGroup,s=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],n.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(r.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,r,n,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),r=e[i],n=new L.Polyline([this._latlng,s],l),a.addLayer(n),r._spiderLeg=n,r._preSpiderfyLatlng=r._latlng,r.setLatLng(s),r.setZIndexOffset&&r.setZIndexOffset(1e6),h.addLayer(r);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,r,n,s,o,a,h=this,l=this._group,u=l._map,_=l._featureGroup,d=this._latlng,p=u.latLngToLayerPoint(d),c=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),c?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,l._ignoreMove=!0,i=0;i<e.length;i++)r=e[i],a=u.layerPointToLatLng(t[i]),n=new L.Polyline([d,a],f),u.addLayer(n),r._spiderLeg=n,c&&(o=(s=n._path).getTotalLength()+.1,s.style.strokeDasharray=o,s.style.strokeDashoffset=o),r.setZIndexOffset&&r.setZIndexOffset(1e6),r.clusterHide&&r.clusterHide(),_.addLayer(r),r._setPos&&r._setPos(p);for(l._forceLayout(),l._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),(r=e[i])._preSpiderfyLatlng=r._latlng,r.setLatLng(a),r.clusterShow&&r.clusterShow(),c&&((s=(n=r._spiderLeg)._path).style.strokeDashoffset=0,n.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout(function(){l._animationEnd(),l.fire("spiderfied",{cluster:h,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,r,n,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),p=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)(t=d[i])._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),p&&(s=(n=(r=t._spiderLeg)._path).getTotalLength()+.1,n.style.strokeDashoffset=s,r.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)(t=d[i])._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof e&&void 0!==t?r(e):"function"==typeof define&&define.amd?define(["exports"],r):r(((i=i||self).Leaflet=i.Leaflet||{},i.Leaflet.markercluster={}))});export default t();
@@ -1 +1 @@
1
- import{B as e,F as t,R as r,V as s}from"./CaX2xgrP.js";var i=class extends r{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(t,r){const{state:i}=t,a=super.createResult(t,r),{isFetching:c,isRefetching:h,isError:o,isRefetchError:n}=a,P=i.fetchMeta?.fetchMore?.direction,g=o&&"forward"===P,u=c&&"forward"===P,f=o&&"backward"===P,d=c&&"backward"===P;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:e(r,i.data),hasPreviousPage:s(r,i.data),isFetchNextPageError:g,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:d,isRefetchError:n&&!g&&!f,isRefetching:h&&!u&&!d}}};function a(e,r){return t(e,i,r)}var c=e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0,h=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0;export{c as n,a as r,h as t};
1
+ import{c as e,d as t,m as r,p as s}from"./CKQOToSD.js";var i=class extends t{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:i}=e,a=super.createResult(e,t),{isFetching:c,isRefetching:h,isError:o,isRefetchError:n}=a,P=i.fetchMeta?.fetchMore?.direction,g=o&&"forward"===P,u=c&&"forward"===P,f=o&&"backward"===P,d=c&&"backward"===P;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:s(t,i.data),hasPreviousPage:r(t,i.data),isFetchNextPageError:g,isFetchingNextPage:u,isFetchPreviousPageError:f,isFetchingPreviousPage:d,isRefetchError:n&&!g&&!f,isRefetching:h&&!u&&!d}}};function a(t,r){return e(t,i,r)}var c=e=>e?.meta?.currentPage>1?e.meta.currentPage-1:void 0,h=e=>e?.meta?.currentPage<e?.meta?.totalPages?e.meta.currentPage+1:void 0;export{c as n,a as r,h as t};
@@ -0,0 +1,3 @@
1
+ import{t as e}from"./DrrpB4Om.js";function t({className:t}){/* @__PURE__ */
2
+ return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M6 20q-.825 0-1.412-.587T4 18v-2q0-.425.288-.712T5 15t.713.288T6 16v2h12v-2q0-.425.288-.712T19 15t.713.288T20 16v2q0 .825-.587 1.413T18 20zm5-12.15L9.125 9.725q-.3.3-.712.288T7.7 9.7q-.275-.3-.288-.7t.288-.7l3.6-3.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l3.6 3.6q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L13 7.85V15q0 .425-.288.713T12 16t-.712-.288T11 15z"})})}var r=/\.(mp4|mov|avi|mkv|webm|qt)$/i,n=/heic|heif/i,i=/\.(heic|heif)$/i,o=/\.(heic|heif|jpg|jpeg|png|webp|gif)$/i;function a(e){return e.type.startsWith("video/")||r.test(e.name)}function f(e){return e.type.startsWith("image/")||o.test(e.name)}function s(e){return n.test(e.type)||i.test(e.name)}async function c(e){const t=e.type.trim().toLowerCase(),n=e.name.toLowerCase(),a=r.test(n),f=o.test(n),s=i.test(n);if(t&&"application/octet-stream"!==t&&!(t.startsWith("image/")&&a||t.startsWith("video/")&&f||t.startsWith("image/")&&s))return t;try{const t=new Uint8Array(await e.slice(0,12).arrayBuffer());if(82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]){if(87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])return"image/webp";if(65===t[8]&&86===t[9]&&73===t[10]&&32===t[11])return"video/x-msvideo"}if(255===t[0]&&216===t[1]&&255===t[2])return"image/jpeg";if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return"image/png";if(71===t[0]&&73===t[1]&&70===t[2]&&56===t[3])return"image/gif";if(26===t[0]&&69===t[1]&&223===t[2]&&163===t[3])return n.endsWith(".webm")?"video/webm":"video/x-matroska";const r=102===t[4]&&116===t[5]&&121===t[6]&&112===t[7],i=109===t[4]&&111===t[5]&&111===t[6]&&118===t[7],o=109===t[4]&&100===t[5]&&97===t[6]&&116===t[7];if(r||i||o){if(r){const e=String.fromCharCode(t[8]??0,t[9]??0,t[10]??0,t[11]??0).trim().toLowerCase();if("heic"===e||"heix"===e||"mif1"===e)return"image/heic";if("qt "===e)return"video/quicktime"}return a&&(n.endsWith(".mov")||n.endsWith(".qt"))?"video/quicktime":"video/mp4"}}catch{}return t||"application/octet-stream"}var l="image/jpeg",u=/* @__PURE__ */new WeakMap;async function h(e){if(!s(e))return e;const t=u.get(e);if(t)return t;const{loadHeic2any:r}=await import("./DnIueBGr.js"),n=await(await r())({blob:e,toType:l}),i=Array.isArray(n)?n[0]:n,o=e.name.replace(/\.(heic|heif)$/i,""),a=new File([i],`${o}.jpg`,{type:l});return u.set(e,a),a}async function d(e){if(e instanceof File&&s(e)){const t=await h(e);return URL.createObjectURL(t)}return URL.createObjectURL(e)}function g(e,t){return new Promise(function(r,n){let i;return w(e).then(function(e){try{return i=e,r(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(e){return n(e)}},n)})}var w=e=>new Promise((t,r)=>{const n=new FileReader;n.addEventListener("load",({target:{result:e}})=>{const n=new DataView(e);let i=0;if(65496!==n.getUint16(i))return r("not a valid JPEG");for(i+=2;;){const o=n.getUint16(i);if(65498===o)break;const a=n.getUint16(i+2);if(65505===o&&1165519206===n.getUint32(i+4)){const o=i+10;let f;switch(n.getUint16(o)){case 18761:f=!0;break;case 19789:f=!1;break;default:return r("TIFF header contains invalid endian")}if(42!==n.getUint16(o+2,f))return r("TIFF header contains invalid version");const s=n.getUint32(o+4,f),c=o+s+2+12*n.getUint16(o+s,f);for(let e=o+s+2;e<c;e+=12)if(274==n.getUint16(e,f)){if(3!==n.getUint16(e+2,f))return r("Orientation data type is invalid");if(1!==n.getUint32(e+4,f))return r("Orientation data count is invalid");n.setUint16(e+8,1,f);break}return t(e.slice(i,i+2+a))}i+=2+a}return t(new Blob)}),n.readAsArrayBuffer(e)}),A={},p={get exports(){return A},set exports(e){A=e}};!function(){var e,t,r={};p.exports=r,r.parse=function(e,t){for(var n=r.bin.readUshort,i=r.bin.readUint,o=0,a={},f=new Uint8Array(e),s=f.length-4;101010256!=i(f,s);)s--;o=s,o+=4;var c=n(f,o+=4);n(f,o+=2);var l=i(f,o+=2),u=i(f,o+=4);o+=4,o=u;for(var h=0;h<c;h++){i(f,o),o+=4,o+=4,o+=4,i(f,o+=4),l=i(f,o+=4);var d=i(f,o+=4),g=n(f,o+=4),w=n(f,o+2),A=n(f,o+4);o+=6;var p=i(f,o+=8);o+=4,o+=g+w+A,r._readLocal(f,p,a,l,d,t)}return a},r._readLocal=function(e,t,n,i,o,a){var f=r.bin.readUshort,s=r.bin.readUint;s(e,t),f(e,t+=4),f(e,t+=2);var c=f(e,t+=2);s(e,t+=2),s(e,t+=4),t+=4;var l=f(e,t+=8),u=f(e,t+=2);t+=2;var h=r.bin.readUTF8(e,t,l);if(t+=l,t+=u,a)n[h]={size:o,csize:i};else{var d=new Uint8Array(e.buffer,t);if(0==c)n[h]=new Uint8Array(d.buffer.slice(t,t+i));else{if(8!=c)throw"unknown compression method: "+c;var g=new Uint8Array(o);r.inflateRaw(d,g),n[h]=g}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){t??={level:6};var n=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[n]=120,i[n+1]=156,n+=2,n=r.F.deflateRaw(e,i,n,t.level);var o=r.adler(e,0,e.length);return i[n+0]=o>>>24&255,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=o>>>0&255,new Uint8Array(i.buffer,0,n+4)},r.deflateRaw=function(e,t){t??={level:6};var n=new Uint8Array(50+Math.floor(1.1*e.length)),i=r.F.deflateRaw(e,n,i,t.level);return new Uint8Array(n.buffer,0,i)},r.encode=function(e,t){t??=!1;var n=0,i=r.bin.writeUint,o=r.bin.writeUshort,a={};for(var f in e){var s=!r._noNeed(f)&&!t,c=e[f],l=r.crc.crc(c,0,c.length);a[f]={cpr:s,usize:c.length,crc:l,file:s?r.deflateRaw(c):c}}for(var f in a)n+=a[f].file.length+30+46+2*r.bin.sizeUTF8(f);n+=22;var u=new Uint8Array(n),h=0,d=[];for(var f in a){var g=a[f];d.push(h),h=r._writeHeader(u,h,f,g,0)}var w=0,A=h;for(var f in a)g=a[f],d.push(h),h=r._writeHeader(u,h,f,g,1,d[w++]);var p=h-A;return i(u,h,101010256),h+=4,o(u,h+=4,w),o(u,h+=2,w),i(u,h+=2,p),i(u,h+=4,A),h+=4,h+=2,u.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},r._writeHeader=function(e,t,n,i,o,a){var f=r.bin.writeUint,s=r.bin.writeUshort,c=i.file;return f(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),s(e,t,20),s(e,t+=2,0),s(e,t+=2,i.cpr?8:0),f(e,t+=2,0),f(e,t+=4,i.crc),f(e,t+=4,c.length),f(e,t+=4,i.usize),s(e,t+=4,r.bin.sizeUTF8(n)),s(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,f(e,t+=6,a),t+=4),t+=r.bin.writeUTF8(e,t,n),0==o&&(e.set(c,t),t+=c.length),t},r.crc={table:function(){for(var e=/* @__PURE__ */new Uint32Array(256),t=0;t<256;t++){for(var r=t,n=0;n<8;n++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update:function(e,t,n,i){for(var o=0;o<i;o++)e=r.crc.table[255&(e^t[n+o])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^r.crc.update(4294967295,e,t,n)}},r.adler=function(e,t,r){for(var n=1,i=0,o=t,a=t+r;o<a;){for(var f=Math.min(o+5552,a);o<f;)i+=n+=e[o++];n%=65521,i%=65521}return i<<16|n},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII:function(e,t,r){for(var n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var i,o="",a=0;a<n;a++)o+="%"+r.bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(o)}catch(i){return r.bin.readASCII(e,t,n)}return i},writeUTF8:function(e,t,r){for(var n=r.length,i=0,o=0;o<n;o++){var a=r.charCodeAt(o);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+i]=240|a>>18,e[t+i+1]=128|a>>12&63,e[t+i+2]=128|a>>6&63,e[t+i+3]=128|63&a,i+=4}else e[t+i]=224|a>>12,e[t+i+1]=128|a>>6&63,e[t+i+2]=128|63&a,i+=3;else e[t+i]=192|a>>6,e[t+i+1]=128|63&a,i+=2;else e[t+i]=a,i++}return i},sizeUTF8:function(e){for(var t=e.length,r=0,n=0;n<t;n++){var i=e.charCodeAt(n);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw"e";r+=4}else r+=3;else r+=2;else r++}return r}},r.F={},r.F.deflateRaw=function(e,t,n,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],a=r.F.U,f=r.F._goodIndex;r.F._hash;var s=r.F._putsE,c=0,l=n<<3,u=0,h=e.length;if(0==i){for(;c<h;)s(t,l,c+(E=Math.min(65535,h-c))==h?1:0),l=r.F._copyExact(e,c,E,t,l+8),c+=E;return l>>>3}var d=a.lits,g=a.strt,w=a.prev,A=0,p=0,m=0,v=0,b=0,y=0;for(h>2&&(g[y=r.F._hash(e,0)]=0),c=0;c<h;c++){if(b=y,c+1<h-2){y=r.F._hash(e,c+1);var U=c+1&32767;w[U]=g[y],g[y]=U}if(u<=c){(A>14e3||p>26697)&&h-c>100&&(u<c&&(d[A]=c-u,A+=2,u=c),l=r.F._writeBlock(c==h-1||u==h?1:0,d,A,v,e,m,c-m,t,l),A=p=v=0,m=c);var F=0;c<h-2&&(F=r.F._bestMatch(e,c,w,b,Math.min(o[2],h-c),o[3]));var E=F>>>16,_=65535&F;if(0!=F){_=65535&F;var C=f(E=F>>>16,a.of0);a.lhst[257+C]++;var T=f(_,a.df0);a.dhst[T]++,v+=a.exb[C]+a.dxb[T],d[A]=E<<23|c-u,d[A+1]=_<<16|C<<8|T,A+=2,u=c+E}else a.lhst[e[c]]++;p++}}for(m==c&&0!=e.length||(u<c&&(d[A]=c-u,A+=2,u=c),l=r.F._writeBlock(1,d,A,v,e,m,c-m,t,l),A=0,p=0,A=p=v=0,m=c);7&l;)l++;return l>>>3},r.F._bestMatch=function(e,t,n,i,o,a){var f=32767&t,s=n[f],c=f-s+32768&32767;if(s==f||i!=r.F._hash(e,t-c))return 0;for(var l=0,u=0,h=Math.min(32767,t);c<=h&&0!=--a&&s!=f;){if(0==l||e[t+l]==e[t+l-c]){var d=r.F._howLong(e,t,c);if(d>l){if(u=c,(l=d)>=o)break;c+2<d&&(d=c+2);for(var g=0,w=0;w<d-2;w++){var A=t-c+w+32768&32767,p=A-n[A]+32768&32767;p>g&&(g=p,s=A)}}}c+=(f=s)-(s=n[f])+32768&32767}return l<<16|u},r.F._howLong=function(e,t,r){if(e[t]!=e[t-r]||e[t+1]!=e[t+1-r]||e[t+2]!=e[t+2-r])return 0;var n=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-r];)t++;return t-n},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,n,i,o,a,f,s,c){var l,u,h,d,g,w,A,p,m,v=r.F.U,b=r.F._putsF,y=r.F._putsE;v.lhst[256]++,u=(l=r.F.getTrees())[0],h=l[1],d=l[2],g=l[3],w=l[4],A=l[5],p=l[6],m=l[7];var U=32+(c+3&7?8-(c+3&7):0)+(f<<3),F=i+r.F.contSize(v.fltree,v.lhst)+r.F.contSize(v.fdtree,v.dhst),E=i+r.F.contSize(v.ltree,v.lhst)+r.F.contSize(v.dtree,v.dhst);E+=14+3*A+r.F.contSize(v.itree,v.ihst)+(2*v.ihst[16]+3*v.ihst[17]+7*v.ihst[18]);for(var _=0;_<286;_++)v.lhst[_]=0;for(_=0;_<30;_++)v.dhst[_]=0;for(_=0;_<19;_++)v.ihst[_]=0;var C=U<F&&U<E?0:F<E?1:2;if(b(s,c,e),b(s,c+1,C),c+=3,0==C){for(;7&c;)c++;c=r.F._copyExact(o,a,f,s,c)}else{var T,B;if(1==C&&(T=v.fltree,B=v.fdtree),2==C){r.F.makeCodes(v.ltree,u),r.F.revCodes(v.ltree,u),r.F.makeCodes(v.dtree,h),r.F.revCodes(v.dtree,h),r.F.makeCodes(v.itree,d),r.F.revCodes(v.itree,d),T=v.ltree,B=v.dtree,y(s,c,g-257),y(s,c+=5,w-1),y(s,c+=5,A-4),c+=4;for(var I=0;I<A;I++)y(s,c+3*I,v.itree[1+(v.ordr[I]<<1)]);c+=3*A,c=r.F._codeTiny(p,v.itree,s,c),c=r.F._codeTiny(m,v.itree,s,c)}for(var M=a,x=0;x<n;x+=2){for(var R=t[x],S=R>>>23,Q=M+(8388607&R);M<Q;)c=r.F._writeLit(o[M++],T,s,c);if(0!=S){var k=t[x+1],L=k>>16,H=k>>8&255,O=255&k;y(s,c=r.F._writeLit(257+H,T,s,c),S-v.of0[H]),c+=v.exb[H],b(s,c=r.F._writeLit(O,B,s,c),L-v.df0[O]),c+=v.dxb[O],M+=S}}c=r.F._writeLit(256,T,s,c)}return c},r.F._copyExact=function(e,t,r,n,i){var o=i>>>3;return n[o]=r,n[o+1]=r>>>8,n[o+2]=255-n[o],n[o+3]=255-n[o+1],o+=4,n.set(new Uint8Array(e.buffer,t,r),o),i+(r+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),n=r.F._hufTree(e.dhst,e.dtree,15),i=[],o=r.F._lenCodes(e.ltree,i),a=[],f=r.F._lenCodes(e.dtree,a),s=0;s<i.length;s+=2)e.ihst[i[s]]++;for(s=0;s<a.length;s+=2)e.ihst[a[s]]++;for(var c=r.F._hufTree(e.ihst,e.itree,7),l=19;l>4&&0==e.itree[1+(e.ordr[l-1]<<1)];)l--;return[t,n,c,o,f,l,i,a]},r.F.getSecond=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(e[r+1]);return t},r.F.nonZero=function(e){for(var t="",r=0;r<e.length;r+=2)0!=e[r+1]&&(t+=(r>>1)+",");return t},r.F.contSize=function(e,t){for(var r=0,n=0;n<t.length;n++)r+=t[n]*e[1+(n<<1)];return r},r.F._codeTiny=function(e,t,n,i){for(var o=0;o<e.length;o+=2){var a=e[o],f=e[o+1];i=r.F._writeLit(a,t,n,i);var s=16==a?2:17==a?3:7;a>15&&(r.F._putsE(n,i,f,s),i+=s)}return i},r.F._lenCodes=function(e,t){for(var r=e.length;2!=r&&0==e[r-1];)r-=2;for(var n=0;n<r;n+=2){var i=e[n+1],o=n+3<r?e[n+3]:-1,a=n+5<r?e[n+5]:-1,f=0==n?-1:e[n-1];if(0==i&&o==i&&a==i){for(var s=n+5;s+2<r&&e[s+2]==i;)s+=2;(c=Math.min(s+1-n>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),n+=2*c-2}else if(i==f&&o==i&&a==i){for(s=n+5;s+2<r&&e[s+2]==i;)s+=2;var c=Math.min(s+1-n>>>1,6);t.push(16,c-3),n+=2*c-2}else t.push(i,0)}return r>>>1},r.F._hufTree=function(e,t,n){var i=[],o=e.length,a=t.length,f=0;for(f=0;f<a;f+=2)t[f]=0,t[f+1]=0;for(f=0;f<o;f++)0!=e[f]&&i.push({lit:f,f:e[f]});var s=i.length,c=i.slice(0);if(0==s)return 0;if(1==s){var l=i[0].lit;return c=0==l?1:0,t[1+(l<<1)]=1,t[1+(c<<1)]=1,1}i.sort(function(e,t){return e.f-t.f});var u=i[0],h=i[1],d=0,g=1,w=2;for(i[0]={lit:-1,f:u.f+h.f,l:u,r:h,d:0};g!=s-1;)u=d!=g&&(w==s||i[d].f<i[w].f)?i[d++]:i[w++],h=d!=g&&(w==s||i[d].f<i[w].f)?i[d++]:i[w++],i[g++]={lit:-1,f:u.f+h.f,l:u,r:h};var A=r.F.setDepth(i[g-1],0);for(A>n&&(r.F.restrictDepth(c,n,A),A=n),f=0;f<s;f++)t[1+(c[f].lit<<1)]=c[f].d;return A},r.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,r){var n=0,i=1<<r-t,o=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),n=0;n<e.length&&e[n].d>t;n++){var a=e[n].d;e[n].d=t,o+=i-(1<<r-a)}for(o>>>=r-t;o>0;)(a=e[n].d)<t?(e[n].d++,o-=1<<t-a-1):n++;for(;n>=0;n--)e[n].d==t&&o<0&&(e[n].d--,o++);0!=o&&console.log("debt left")},r.F._goodIndex=function(e,t){var r=0;return t[16|r]<=e&&(r|=16),t[8|r]<=e&&(r|=8),t[4|r]<=e&&(r|=4),t[2|r]<=e&&(r|=2),t[1|r]<=e&&(r|=1),r},r.F._writeLit=function(e,t,n,i){return r.F._putsF(n,i,t[e<<1]),i+t[1+(e<<1)]},r.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var i=r.F,o=i._bitsF,a=i._bitsE,f=i._decodeTiny,s=i.makeCodes,c=i.codes2map,l=i._get17,u=i.U,h=null==t;h&&(t=new n(e.length>>>2<<3));for(var d,g,w=0,A=0,p=0,m=0,v=0,b=0,y=0,U=0,F=0;0==w;)if(w=o(e,F,1),A=o(e,F+1,2),F+=3,0!=A){if(h&&(t=r.F._check(t,U+(1<<17))),1==A&&(d=u.flmap,g=u.fdmap,b=511,y=31),2==A){p=a(e,F,5)+257,m=a(e,F+5,5)+1,v=a(e,F+10,4)+4,F+=14;for(var E=0;E<38;E+=2)u.itree[E]=0,u.itree[E+1]=0;var _=1;for(E=0;E<v;E++){var C=a(e,F+3*E,3);u.itree[1+(u.ordr[E]<<1)]=C,C>_&&(_=C)}F+=3*v,s(u.itree,_),c(u.itree,_,u.imap),d=u.lmap,g=u.dmap,F=f(u.imap,(1<<_)-1,p+m,e,F,u.ttree);var T=i._copyOut(u.ttree,0,p,u.ltree);b=(1<<T)-1;var B=i._copyOut(u.ttree,p,m,u.dtree);y=(1<<B)-1,s(u.ltree,T),c(u.ltree,T,d),s(u.dtree,B),c(u.dtree,B,g)}for(;;){var I=d[l(e,F)&b];F+=15&I;var M=I>>>4;if(M>>>8==0)t[U++]=M;else{if(256==M)break;var x=U+M-254;if(M>264){var R=u.ldef[M-257];x=U+(R>>>3)+a(e,F,7&R),F+=7&R}var S=g[l(e,F)&y];F+=15&S;var Q=S>>>4,k=u.ddef[Q],L=(k>>>4)+o(e,F,15&k);for(F+=15&k,h&&(t=r.F._check(t,U+(1<<17)));U<x;)t[U]=t[U++-L],t[U]=t[U++-L],t[U]=t[U++-L],t[U]=t[U++-L];U=x}}}else{7&F&&(F+=8-(7&F));var H=4+(F>>>3),O=e[H-4]|e[H-3]<<8;h&&(t=r.F._check(t,U+O)),t.set(new n(e.buffer,e.byteOffset+H,O),U),F=H+O<<3,U+=O}return t.length==U?t:t.slice(0,U)},r.F._check=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n},r.F._decodeTiny=function(e,t,n,i,o,a){for(var f=r.F._bitsE,s=r.F._get17,c=0;c<n;){var l=e[s(i,o)&t];o+=15&l;var u=l>>>4;if(u<=15)a[c]=u,c++;else{var h=0,d=0;16==u?(d=3+f(i,o,2),o+=2,h=a[c-1]):17==u?(d=3+f(i,o,3),o+=3):18==u&&(d=11+f(i,o,7),o+=7);for(var g=c+d;c<g;)a[c]=h,c++}}return o},r.F._copyOut=function(e,t,r,n){for(var i=0,o=0,a=n.length>>>1;o<r;){var f=e[o+t];n[o<<1]=0,n[1+(o<<1)]=f,f>i&&(i=f),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},r.F.makeCodes=function(e,t){for(var n,i,o,a,f=r.F.U,s=e.length,c=f.bl_count,l=0;l<=t;l++)c[l]=0;for(l=1;l<s;l+=2)c[e[l]]++;var u=f.next_code;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,u[i]=n;for(o=0;o<s;o+=2)0!=(a=e[o+1])&&(e[o]=u[a],u[a]++)},r.F.codes2map=function(e,t,n){for(var i=e.length,o=r.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var f=a>>1,s=e[a+1],c=f<<4|s,l=t-s,u=e[a]<<l,h=u+(1<<l);u!=h;)n[o[u]>>>15-t]=c,u++},r.F.revCodes=function(e,t){for(var n=r.F.U.rev15,i=15-t,o=0;o<e.length;o+=2)e[o]=n[e[o]<<t-e[o+1]]>>>i},r.F._putsE=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.F._putsF=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.F._bitsE=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.F._bitsF=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=r.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),i(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var m=function(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}({__proto__:null,default:A},[A]),v=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},readASCII(e,t,r){let n="";for(let i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},readBytes(e,t,r){const n=[];for(let i=0;i<r;i++)n.push(e[t+i]);return n},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,r,n){let i,o="";for(let a=0;a<n;a++)o+=`%${e.pad(t[r+a].toString(16))}`;try{i=decodeURIComponent(o)}catch(i){return e.readASCII(t,r,n)}return i}};function t(t,r,n,i){const a=r*n,f=o(i),s=Math.ceil(r*f/8),c=new Uint8Array(4*a),l=new Uint32Array(c.buffer),{ctype:u}=i,{depth:h}=i,d=e.readUshort;if(6==u){const e=a<<2;if(8==h)for(var g=0;g<e;g+=4)c[g]=t[g],c[g+1]=t[g+1],c[g+2]=t[g+2],c[g+3]=t[g+3];if(16==h)for(g=0;g<e;g++)c[g]=t[g<<1]}else if(2==u){const e=i.tabs.tRNS;if(null==e){if(8==h)for(g=0;g<a;g++){var w=3*g;l[g]=255<<24|t[w+2]<<16|t[w+1]<<8|t[w]}if(16==h)for(g=0;g<a;g++)w=6*g,l[g]=255<<24|t[w+4]<<16|t[w+2]<<8|t[w]}else{var A=e[0];const r=e[1],n=e[2];if(8==h)for(g=0;g<a;g++){var p=g<<2;w=3*g,l[g]=255<<24|t[w+2]<<16|t[w+1]<<8|t[w],t[w]==A&&t[w+1]==r&&t[w+2]==n&&(c[p+3]=0)}if(16==h)for(g=0;g<a;g++)p=g<<2,w=6*g,l[g]=255<<24|t[w+4]<<16|t[w+2]<<8|t[w],d(t,w)==A&&d(t,w+2)==r&&d(t,w+4)==n&&(c[p+3]=0)}}else if(3==u){const e=i.tabs.PLTE,o=i.tabs.tRNS,f=o?o.length:0;if(1==h)for(var m=0;m<n;m++){var v=m*s,b=m*r;for(g=0;g<r;g++){p=b+g<<2;var y=3*(U=t[v+(g>>3)]>>7-(7&g)&1);c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255}}if(2==h)for(m=0;m<n;m++)for(v=m*s,b=m*r,g=0;g<r;g++)p=b+g<<2,y=3*(U=t[v+(g>>2)]>>6-((3&g)<<1)&3),c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255;if(4==h)for(m=0;m<n;m++)for(v=m*s,b=m*r,g=0;g<r;g++)p=b+g<<2,y=3*(U=t[v+(g>>1)]>>4-((1&g)<<2)&15),c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255;if(8==h)for(g=0;g<a;g++){var U;p=g<<2,y=3*(U=t[g]),c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255}}else if(4==u){if(8==h)for(g=0;g<a;g++){p=g<<2;var F=t[E=g<<1];c[p]=F,c[p+1]=F,c[p+2]=F,c[p+3]=t[E+1]}if(16==h)for(g=0;g<a;g++){var E;p=g<<2,F=t[E=g<<2],c[p]=F,c[p+1]=F,c[p+2]=F,c[p+3]=t[E+2]}}else if(0==u)for(A=i.tabs.tRNS?i.tabs.tRNS:-1,m=0;m<n;m++){const e=m*s,n=m*r;if(1==h)for(var _=0;_<r;_++){var C=(F=255*(t[e+(_>>>3)]>>>7-(7&_)&1))==255*A?0:255;l[n+_]=C<<24|F<<16|F<<8|F}else if(2==h)for(_=0;_<r;_++)C=(F=85*(t[e+(_>>>2)]>>>6-((3&_)<<1)&3))==85*A?0:255,l[n+_]=C<<24|F<<16|F<<8|F;else if(4==h)for(_=0;_<r;_++)C=(F=17*(t[e+(_>>>1)]>>>4-((1&_)<<2)&15))==17*A?0:255,l[n+_]=C<<24|F<<16|F<<8|F;else if(8==h)for(_=0;_<r;_++)C=(F=t[e+_])==A?0:255,l[n+_]=C<<24|F<<16|F<<8|F;else if(16==h)for(_=0;_<r;_++)F=t[e+(_<<1)],C=d(t,e+(_<<1))==A?0:255,l[n+_]=C<<24|F<<16|F<<8|F}return c}function r(e,t,r,f){const s=o(e),c=Math.ceil(r*s/8),l=new Uint8Array((c+1+e.interlace)*f);return t=e.tabs.CgBI?i(t,l):n(t,l),0==e.interlace?t=a(t,e,0,r,f):1==e.interlace&&(t=function(e,t){const r=t.width,n=t.height,i=o(t),f=i>>3,s=Math.ceil(r*i/8),c=new Uint8Array(n*s);let l=0;const u=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],g=[8,8,4,4,2,2,1];let w=0;for(;w<7;){const o=d[w],p=g[w];let m=0,v=0,b=u[w];for(;b<n;)b+=o,v++;let y=h[w];for(;y<r;)y+=p,m++;const U=Math.ceil(m*i/8);a(e,t,l,m,v);let F=0,E=u[w];for(;E<n;){let t=h[w],n=l+F*U<<3;for(;t<r;){var A;if(1==i&&(A=(A=e[n>>3])>>7-(7&n)&1,c[E*s+(t>>3)]|=A<<7-(7&t)),2==i&&(A=(A=e[n>>3])>>6-(7&n)&3,c[E*s+(t>>2)]|=A<<6-((3&t)<<1)),4==i&&(A=(A=e[n>>3])>>4-(7&n)&15,c[E*s+(t>>1)]|=A<<4-((1&t)<<2)),i>=8){const r=E*s+t*f;for(let t=0;t<f;t++)c[r+t]=e[(n>>3)+t]}n+=i,t+=p}F++,E+=o}m*v!=0&&(l+=v*(1+U)),w+=1}return c}(t,e)),t}function n(e,t){return i(new Uint8Array(e.buffer,2,e.length-6),t)}var i=function(){const e={H:{}};return e.H.N=function(t,r){const n=Uint8Array;let i,o,a=0,f=0,s=0,c=0,l=0,u=0,h=0,d=0,g=0;if(3==t[0]&&0==t[1])return r||new n(0);const w=e.H,A=w.b,p=w.e,m=w.R,v=w.n,b=w.A,y=w.Z,U=w.m,F=null==r;for(F&&(r=new n(t.length>>>2<<5));0==a;)if(a=A(t,g,1),f=A(t,g+1,2),g+=3,0!=f){if(F&&(r=e.H.W(r,d+(1<<17))),1==f&&(i=U.J,o=U.h,u=511,h=31),2==f){s=p(t,g,5)+257,c=p(t,g+5,5)+1,l=p(t,g+10,4)+4,g+=14;let e=1;for(var E=0;E<38;E+=2)U.Q[E]=0,U.Q[E+1]=0;for(E=0;E<l;E++){const r=p(t,g+3*E,3);U.Q[1+(U.X[E]<<1)]=r,r>e&&(e=r)}g+=3*l,v(U.Q,e),b(U.Q,e,U.u),i=U.w,o=U.d,g=m(U.u,(1<<e)-1,s+c,t,g,U.v);const r=w.V(U.v,0,s,U.C);u=(1<<r)-1;const n=w.V(U.v,s,c,U.D);h=(1<<n)-1,v(U.C,r),b(U.C,r,i),v(U.D,n),b(U.D,n,o)}for(;;){const e=i[y(t,g)&u];g+=15&e;const n=e>>>4;if(n>>>8==0)r[d++]=n;else{if(256==n)break;{let e=d+n-254;if(n>264){const r=U.q[n-257];e=d+(r>>>3)+p(t,g,7&r),g+=7&r}const i=o[y(t,g)&h];g+=15&i;const a=i>>>4,f=U.c[a],s=(f>>>4)+A(t,g,15&f);for(g+=15&f;d<e;)r[d]=r[d++-s],r[d]=r[d++-s],r[d]=r[d++-s],r[d]=r[d++-s];d=e}}}}else{7&g&&(g+=8-(7&g));const i=4+(g>>>3),o=t[i-4]|t[i-3]<<8;F&&(r=e.H.W(r,d+o)),r.set(new n(t.buffer,t.byteOffset+i,o),d),g=i+o<<3,d+=o}return r.length==d?r:r.slice(0,d)},e.H.W=function(e,t){const r=e.length;if(t<=r)return e;const n=new Uint8Array(r<<1);return n.set(e,0),n},e.H.R=function(t,r,n,i,o,a){const f=e.H.e,s=e.H.Z;let c=0;for(;c<n;){const e=t[s(i,o)&r];o+=15&e;const n=e>>>4;if(n<=15)a[c]=n,c++;else{let e=0,t=0;16==n?(t=3+f(i,o,2),o+=2,e=a[c-1]):17==n?(t=3+f(i,o,3),o+=3):18==n&&(t=11+f(i,o,7),o+=7);const r=c+t;for(;c<r;)a[c]=e,c++}}return o},e.H.V=function(e,t,r,n){let i=0,o=0;const a=n.length>>>1;for(;o<r;){const r=e[o+t];n[o<<1]=0,n[1+(o<<1)]=r,r>i&&(i=r),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},e.H.n=function(t,r){const n=e.H.m,i=t.length;let o,a,f,s;const c=n.j;for(var l=0;l<=r;l++)c[l]=0;for(l=1;l<i;l+=2)c[t[l]]++;const u=n.K;for(o=0,c[0]=0,a=1;a<=r;a++)o=o+c[a-1]<<1,u[a]=o;for(f=0;f<i;f+=2)s=t[f+1],0!=s&&(t[f]=u[s],u[s]++)},e.H.A=function(t,r,n){const i=t.length,o=e.H.m.r;for(let e=0;e<i;e+=2)if(0!=t[e+1]){const i=e>>1,a=t[e+1],f=i<<4|a,s=r-a;let c=t[e]<<s;const l=c+(1<<s);for(;c!=l;)n[o[c]>>>15-r]=f,c++}},e.H.l=function(t,r){const n=e.H.m.r,i=15-r;for(let e=0;e<t.length;e+=2)t[e]=n[t[e]<<r-t[e+1]]>>>i},e.H.M=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},e.H.I=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},e.H.e=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},e.H.b=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new e(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var r=0;r<32768;r++){let e=r;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[r]=(e>>>16|e<<16)>>>17}function n(e,t,r){for(;0!=t--;)e.push(0,r)}for(r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];n(t._,144,8),n(t._,112,9),n(t._,24,7),n(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),n(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),n(t.Q,19,0),n(t.C,286,0),n(t.D,30,0),n(t.v,320,0)}(),e.H.N}();function o(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,r,n,i){let a=o(t);const s=Math.ceil(n*a/8);let c,l;a=Math.ceil(a/8);let u=e[r],h=0;if(u>1&&(e[r]=[0,0,1][u-2]),3==u)for(h=a;h<s;h++)e[h+1]=e[h+1]+(e[h+1-a]>>>1)&255;for(let o=0;o<i;o++)if(c=r+o*s,l=c+o+1,u=e[l-1],h=0,0==u)for(;h<s;h++)e[c+h]=e[l+h];else if(1==u){for(;h<a;h++)e[c+h]=e[l+h];for(;h<s;h++)e[c+h]=e[l+h]+e[c+h-a]}else if(2==u)for(;h<s;h++)e[c+h]=e[l+h]+e[c+h-s];else if(3==u){for(;h<a;h++)e[c+h]=e[l+h]+(e[c+h-s]>>>1);for(;h<s;h++)e[c+h]=e[l+h]+(e[c+h-s]+e[c+h-a]>>>1)}else{for(;h<a;h++)e[c+h]=e[l+h]+f(0,e[c+h-s],0);for(;h<s;h++)e[c+h]=e[l+h]+f(e[c+h-a],e[c+h-s],e[c+h-a-s])}return e}function f(e,t,r){const n=e+t-r,i=n-e,o=n-t,a=n-r;return i*i<=o*o&&i*i<=a*a?e:o*o<=a*a?t:r}function s(t,r,n){n.width=e.readUint(t,r),r+=4,n.height=e.readUint(t,r),r+=4,n.depth=t[r],r++,n.ctype=t[r],r++,n.compress=t[r],r++,n.filter=t[r],r++,n.interlace=t[r],r++}function c(e,t,r,n,i,o,a,f,s){const c=Math.min(t,i),l=Math.min(r,o);let u=0,h=0;for(let y=0;y<l;y++)for(let r=0;r<c;r++)if(a>=0&&f>=0?(u=y*t+r<<2,h=(f+y)*i+a+r<<2):(u=(-f+y)*t-a+r<<2,h=y*i+r<<2),0==s)n[h]=e[u],n[h+1]=e[u+1],n[h+2]=e[u+2],n[h+3]=e[u+3];else if(1==s){var d=e[u+3]*(1/255),g=e[u]*d,w=e[u+1]*d,A=e[u+2]*d,p=n[h+3]*(1/255),m=n[h]*p,v=n[h+1]*p,b=n[h+2]*p;const t=1-d,r=d+p*t,i=0==r?0:1/r;n[h+3]=255*r,n[h+0]=(g+m*t)*i,n[h+1]=(w+v*t)*i,n[h+2]=(A+b*t)*i}else if(2==s)d=e[u+3],g=e[u],w=e[u+1],A=e[u+2],p=n[h+3],m=n[h],v=n[h+1],b=n[h+2],d==p&&g==m&&w==v&&A==b?(n[h]=0,n[h+1]=0,n[h+2]=0,n[h+3]=0):(n[h]=g,n[h+1]=w,n[h+2]=A,n[h+3]=d);else if(3==s){if(d=e[u+3],g=e[u],w=e[u+1],A=e[u+2],p=n[h+3],m=n[h],v=n[h+1],b=n[h+2],d==p&&g==m&&w==v&&A==b)continue;if(d<220&&p>20)return!1}return!0}return{decode:function(t){const o=new Uint8Array(t);let a=8;const f=e,c=f.readUshort,l=f.readUint,u={tabs:{},frames:[]},h=new Uint8Array(o.length);let d,g=0,w=0;const A=[137,80,78,71,13,10,26,10];for(var p=0;p<8;p++)if(o[p]!=A[p])throw"The input is not a PNG file!";for(;a<o.length;){const t=f.readUint(o,a);a+=4;const A=f.readASCII(o,a,4);if(a+=4,"IHDR"==A)s(o,a,u);else if("iCCP"==A){for(var m=a;0!=o[m];)m++;f.readASCII(o,a,m-a),o[m+1];const r=o.slice(m+2,a+t);let s=null;try{s=n(r)}catch(e){s=i(r)}u.tabs[A]=s}else if("CgBI"==A)u.tabs[A]=o.slice(a,a+4);else if("IDAT"==A){for(p=0;p<t;p++)h[g+p]=o[a+p];g+=t}else if("acTL"==A)u.tabs[A]={num_frames:l(o,a),num_plays:l(o,a+4)},d=new Uint8Array(o.length);else if("fcTL"==A){0!=w&&((E=u.frames[u.frames.length-1]).data=r(u,d.slice(0,w),E.rect.width,E.rect.height),w=0);const e={x:l(o,a+12),y:l(o,a+16),width:l(o,a+4),height:l(o,a+8)};let t=c(o,a+22);t=c(o,a+20)/(0==t?100:t);const n={rect:e,delay:Math.round(1e3*t),dispose:o[a+24],blend:o[a+25]};u.frames.push(n)}else if("fdAT"==A){for(p=0;p<t-4;p++)d[w+p]=o[a+p+4];w+=t-4}else if("pHYs"==A)u.tabs[A]=[f.readUint(o,a),f.readUint(o,a+4),o[a+8]];else if("cHRM"==A)for(u.tabs[A]=[],p=0;p<8;p++)u.tabs[A].push(f.readUint(o,a+4*p));else if("tEXt"==A||"zTXt"==A){u.tabs[A]??(u.tabs[A]={});var v=f.nextZero(o,a),b=f.readASCII(o,a,v-a),y=a+t-v-1;if("tEXt"==A)F=f.readASCII(o,v+1,y);else{var U=n(o.slice(v+2,v+2+y));F=f.readUTF8(U,0,U.length)}u.tabs[A][b]=F}else if("iTXt"==A){u.tabs[A]??(u.tabs[A]={}),v=0,m=a,v=f.nextZero(o,m),b=f.readASCII(o,m,v-m);const e=o[m=v+1];var F;o[m+1],m+=2,v=f.nextZero(o,m),f.readASCII(o,m,v-m),m=v+1,v=f.nextZero(o,m),f.readUTF8(o,m,v-m),y=t-((m=v+1)-a),0==e?F=f.readUTF8(o,m,y):(U=n(o.slice(m,m+y)),F=f.readUTF8(U,0,U.length)),u.tabs[A][b]=F}else if("PLTE"==A)u.tabs[A]=f.readBytes(o,a,t);else if("hIST"==A){const e=u.tabs.PLTE.length/3;for(u.tabs[A]=[],p=0;p<e;p++)u.tabs[A].push(c(o,a+2*p))}else if("tRNS"==A)3==u.ctype?u.tabs[A]=f.readBytes(o,a,t):0==u.ctype?u.tabs[A]=c(o,a):2==u.ctype&&(u.tabs[A]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==A)u.tabs[A]=f.readUint(o,a)/1e5;else if("sRGB"==A)u.tabs[A]=o[a];else if("bKGD"==A)0==u.ctype||4==u.ctype?u.tabs[A]=[c(o,a)]:2==u.ctype||6==u.ctype?u.tabs[A]=[c(o,a),c(o,a+2),c(o,a+4)]:3==u.ctype&&(u.tabs[A]=o[a]);else if("IEND"==A)break;a+=t,f.readUint(o,a),a+=4}var E;return 0!=w&&((E=u.frames[u.frames.length-1]).data=r(u,d.slice(0,w),E.rect.width,E.rect.height)),u.data=r(u,h,u.width,u.height),delete u.compress,delete u.interlace,delete u.filter,u},toRGBA8:function(e){const r=e.width,n=e.height;if(null==e.tabs.acTL)return[t(e.data,r,n,e).buffer];const i=[];e.frames[0].data??(e.frames[0].data=e.data);const o=r*n*4,a=new Uint8Array(o),f=new Uint8Array(o),s=new Uint8Array(o);for(let u=0;u<e.frames.length;u++){const h=e.frames[u],d=h.rect.x,g=h.rect.y,w=h.rect.width,A=h.rect.height,p=t(h.data,w,A,e);if(0!=u)for(var l=0;l<o;l++)s[l]=a[l];if(0==h.blend?c(p,w,A,a,r,n,d,g,0):1==h.blend&&c(p,w,A,a,r,n,d,g,1),i.push(a.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)c(f,w,A,a,r,n,d,g,0);else if(2==h.dispose)for(l=0;l<o;l++)a[l]=s[l]}return i},_paeth:f,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=v,{_bin:t}=v,r=v._paeth;var n={table:function(){const e=/* @__PURE__ */new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update(e,t,r,i){for(let o=0;o<i;o++)e=n.table[255&(e^t[r+o])]^e>>>8;return e},crc:(e,t,r)=>4294967295^n.update(4294967295,e,t,r)};function i(e,t,r,n){t[r]+=e[0]*n>>4,t[r+1]+=e[1]*n>>4,t[r+2]+=e[2]*n>>4,t[r+3]+=e[3]*n>>4}function o(e){return Math.max(0,Math.min(255,e))}function a(e,t){const r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function f(e,t,r,n,f,s,c){c??=1;const l=n.length,u=[];for(var h=0;h<l;h++){const e=n[h];u.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(h=0;h<l;h++){let e=4294967295;for(var d=0,g=0;g<l;g++){var w=a(u[h],u[g]);g!=h&&w<e&&(e=w,d=g)}}const A=new Uint32Array(f.buffer),p=new Int16Array(t*r*4),m=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<m.length;h++)m[h]=255*((m[h]+.5)/16-.5);for(let b=0;b<r;b++)for(let f=0;f<t;f++){var v;h=4*(b*t+f),2!=c?v=[o(e[h]+p[h]),o(e[h+1]+p[h+1]),o(e[h+2]+p[h+2]),o(e[h+3]+p[h+3])]:(w=m[4*(3&b)+(3&f)],v=[o(e[h]+w),o(e[h+1]+w),o(e[h+2]+w),o(e[h+3]+w)]),d=0;let y=16777215;for(g=0;g<l;g++){const e=a(v,u[g]);e<y&&(y=e,d=g)}const U=u[d],F=[v[0]-U[0],v[1]-U[1],v[2]-U[2],v[3]-U[3]];1==c&&(f!=t-1&&i(F,p,h+4,7),b!=r-1&&(0!=f&&i(F,p,h+4*t-4,3),i(F,p,h+4*t,5),f!=t-1&&i(F,p,h+4*t+4,1))),s[h>>2]=d,A[h>>2]=n[d]}}function s(e,r,i,o,a){a??={};const{crc:f}=n,s=t.writeUint,c=t.writeUshort,l=t.writeASCII;let u=8;const h=e.frames.length>1;let d,g=!1,w=33+(h?20:0);if(null!=a.sRGB&&(w+=13),null!=a.pHYs&&(w+=21),null!=a.iCCP&&(d=pako.deflate(a.iCCP),w+=21+d.length+4),3==e.ctype){for(var A=e.plte.length,p=0;p<A;p++)e.plte[p]>>>24!=255&&(g=!0);w+=8+3*A+4+(g?8+1*A+4:0)}for(var m=0;m<e.frames.length;m++)h&&(w+=38),w+=(U=e.frames[m]).cimg.length+12,0!=m&&(w+=4);w+=12;const v=new Uint8Array(w),b=[137,80,78,71,13,10,26,10];for(p=0;p<8;p++)v[p]=b[p];if(s(v,u,13),u+=4,l(v,u,"IHDR"),u+=4,s(v,u,r),u+=4,s(v,u,i),u+=4,v[u]=e.depth,u++,v[u]=e.ctype,u++,v[u]=0,u++,v[u]=0,u++,v[u]=0,u++,s(v,u,f(v,u-17,17)),u+=4,null!=a.sRGB&&(s(v,u,1),u+=4,l(v,u,"sRGB"),u+=4,v[u]=a.sRGB,u++,s(v,u,f(v,u-5,5)),u+=4),null!=a.iCCP){const e=13+d.length;s(v,u,e),u+=4,l(v,u,"iCCP"),u+=4,l(v,u,"ICC profile"),u+=11,u+=2,v.set(d,u),u+=d.length,s(v,u,f(v,u-(e+4),e+4)),u+=4}if(null!=a.pHYs&&(s(v,u,9),u+=4,l(v,u,"pHYs"),u+=4,s(v,u,a.pHYs[0]),u+=4,s(v,u,a.pHYs[1]),u+=4,v[u]=a.pHYs[2],u++,s(v,u,f(v,u-13,13)),u+=4),h&&(s(v,u,8),u+=4,l(v,u,"acTL"),u+=4,s(v,u,e.frames.length),u+=4,s(v,u,null!=a.loop?a.loop:0),u+=4,s(v,u,f(v,u-12,12)),u+=4),3==e.ctype){for(s(v,u,3*(A=e.plte.length)),u+=4,l(v,u,"PLTE"),u+=4,p=0;p<A;p++){const t=3*p,r=e.plte[p],n=255&r,i=r>>>8&255,o=r>>>16&255;v[u+t+0]=n,v[u+t+1]=i,v[u+t+2]=o}if(u+=3*A,s(v,u,f(v,u-3*A-4,3*A+4)),u+=4,g){for(s(v,u,A),u+=4,l(v,u,"tRNS"),u+=4,p=0;p<A;p++)v[u+p]=e.plte[p]>>>24&255;u+=A,s(v,u,f(v,u-A-4,A+4)),u+=4}}let y=0;for(m=0;m<e.frames.length;m++){var U=e.frames[m];h&&(s(v,u,26),u+=4,l(v,u,"fcTL"),u+=4,s(v,u,y++),u+=4,s(v,u,U.rect.width),u+=4,s(v,u,U.rect.height),u+=4,s(v,u,U.rect.x),u+=4,s(v,u,U.rect.y),u+=4,c(v,u,o[m]),u+=2,c(v,u,1e3),u+=2,v[u]=U.dispose,u++,v[u]=U.blend,u++,s(v,u,f(v,u-30,30)),u+=4);const t=U.cimg;s(v,u,(A=t.length)+(0==m?0:4)),u+=4;const r=u;l(v,u,0==m?"IDAT":"fdAT"),u+=4,0!=m&&(s(v,u,y++),u+=4),v.set(t,u),u+=A,s(v,u,f(v,r,u-r)),u+=4}return s(v,u,0),u+=4,l(v,u,"IEND"),u+=4,s(v,u,f(v,u-4,4)),u+=4,v.buffer}function c(e,t,r){for(let n=0;n<e.frames.length;n++){const i=e.frames[n];i.rect.width;const o=i.rect.height,a=new Uint8Array(o*i.bpl+o);i.cimg=d(i.img,o,i.bpp,i.bpl,a,t,r)}}function l(t,r,n,i,o){const a=o[0],s=o[1],c=o[2],l=o[3],d=o[4],g=o[5];let A=6,p=8,m=255;for(var v=0;v<t.length;v++){const e=new Uint8Array(t[v]);for(var b=e.length,y=0;y<b;y+=4)m&=e[y+3]}const U=255!=m,F=function(t,r,n,i,o,a){const f=[];for(var s=0;s<t.length;s++){const u=new Uint8Array(t[s]),d=new Uint32Array(u.buffer);var c;let w=0,A=0,p=r,m=n,v=i?1:0;if(0!=s){const b=a||i||1==s||0!=f[s-2].dispose?1:2;let y=0,U=1e9;for(let e=0;e<b;e++){var l=new Uint8Array(t[s-1-e]);const i=new Uint32Array(t[s-1-e]);let a=r,f=n,c=-1,u=-1;for(let e=0;e<n;e++)for(let t=0;t<r;t++)d[g=e*r+t]!=i[g]&&(t<a&&(a=t),t>c&&(c=t),e<f&&(f=e),e>u&&(u=e));-1==c&&(a=f=c=u=0),o&&(!(1&~a)&&a--,!(1&~f)&&f--);const h=(c-a+1)*(u-f+1);h<U&&(U=h,y=e,w=a,A=f,p=c-a+1,m=u-f+1)}l=new Uint8Array(t[s-1-y]),1==y&&(f[s-1].dispose=2),c=new Uint8Array(p*m*4),e(l,r,n,c,p,m,-w,-A,0),v=e(u,r,n,c,p,m,-w,-A,3)?1:0,1==v?h(u,r,n,c,{x:w,y:A,width:p,height:m}):e(u,r,n,c,p,m,-w,-A,0)}else c=u.slice(0);f.push({rect:{x:w,y:A,width:p,height:m},img:c,blend:v,dispose:0})}if(i)for(s=0;s<f.length;s++){if(1==(w=f[s]).blend)continue;const e=w.rect,i=f[s-1].rect,a=Math.min(e.x,i.x),c=Math.min(e.y,i.y),l={x:a,y:c,width:Math.max(e.x+e.width,i.x+i.width)-a,height:Math.max(e.y+e.height,i.y+i.height)-c};f[s-1].dispose=1,s-1!=0&&u(t,r,n,f,s-1,l,o),u(t,r,n,f,s,l,o)}let d=0;if(1!=t.length)for(var g=0;g<f.length;g++){var w;d+=(w=f[g]).rect.width*w.rect.height}return f}(t,r,n,a,s,c),E={},_=[],C=[];if(0!=i){const e=[];for(y=0;y<F.length;y++)e.push(F[y].img.buffer);const t=w(function(e){let t=0;for(var r=0;r<e.length;r++)t+=e[r].byteLength;const n=new Uint8Array(t);let i=0;for(r=0;r<e.length;r++){const t=new Uint8Array(e[r]),o=t.length;for(let e=0;e<o;e+=4){let r=t[e],o=t[e+1],a=t[e+2];const f=t[e+3];0==f&&(r=o=a=0),n[i+e]=r,n[i+e+1]=o,n[i+e+2]=a,n[i+e+3]=f}i+=o}return n.buffer}(e),i);for(y=0;y<t.plte.length;y++)_.push(t.plte[y].est.rgba);let r=0;for(y=0;y<F.length;y++){const e=(B=F[y]).img.length;var T=new Uint8Array(t.inds.buffer,r>>2,e>>2);C.push(T);const n=new Uint8Array(t.abuf,r,e);g&&f(B.img,B.rect.width,B.rect.height,_,n,T),B.img.set(n),r+=e}}else for(v=0;v<F.length;v++){var B=F[v];const e=new Uint32Array(B.img.buffer);var I=B.rect.width;for(b=e.length,T=new Uint8Array(b),C.push(T),y=0;y<b;y++){const t=e[y];if(0!=y&&t==e[y-1])T[y]=T[y-1];else if(y>I&&t==e[y-I])T[y]=T[y-I];else{let e=E[t];if(null==e&&(E[t]=e=_.length,_.push(t),_.length>=300))break;T[y]=e}}}const M=_.length;for(M<=256&&0==d&&(p=M<=2?1:M<=4?2:M<=16?4:8,p=Math.max(p,l)),v=0;v<F.length;v++){(B=F[v]).rect.x,B.rect.y,I=B.rect.width;const e=B.rect.height;let t=B.img;new Uint32Array(t.buffer);let r=4*I,n=4;if(M<=256&&0==d){r=Math.ceil(p*I/8);var x=new Uint8Array(r*e);const i=C[v];for(let t=0;t<e;t++){y=t*r;const e=t*I;if(8==p)for(var R=0;R<I;R++)x[y+R]=i[e+R];else if(4==p)for(R=0;R<I;R++)x[y+(R>>1)]|=i[e+R]<<4-4*(1&R);else if(2==p)for(R=0;R<I;R++)x[y+(R>>2)]|=i[e+R]<<6-2*(3&R);else if(1==p)for(R=0;R<I;R++)x[y+(R>>3)]|=i[e+R]<<7-1*(7&R)}t=x,A=3,n=1}else if(0==U&&1==F.length){x=new Uint8Array(I*e*3);const i=I*e;for(y=0;y<i;y++){const e=3*y,r=4*y;x[e]=t[r],x[e+1]=t[r+1],x[e+2]=t[r+2]}t=x,A=2,n=3,r=3*I}B.img=t,B.bpl=r,B.bpp=n}return{ctype:A,depth:p,plte:_,frames:F}}function u(t,r,n,i,o,a,f){const s=Uint8Array,c=Uint32Array,l=new s(t[o-1]),u=new c(t[o-1]),d=o+1<t.length?new s(t[o+1]):null,g=new s(t[o]),w=new c(g.buffer);let A=r,p=n,m=-1,v=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const n=a.x+t,f=a.y+e,s=f*r+n,c=w[s];0==c||0==i[o-1].dispose&&u[s]==c&&(null==d||0!=d[4*s+3])||(n<A&&(A=n),n>m&&(m=n),f<p&&(p=f),f>v&&(v=f))}-1==m&&(A=p=m=v=0),f&&(!(1&~A)&&A--,!(1&~p)&&p--),a={x:A,y:p,width:m-A+1,height:v-p+1};const b=i[o];b.rect=a,b.blend=1,b.img=new Uint8Array(a.width*a.height*4),0==i[o-1].dispose?(e(l,r,n,b.img,a.width,a.height,-a.x,-a.y,0),h(g,r,n,b.img,a)):e(g,r,n,b.img,a.width,a.height,-a.x,-a.y,0)}function h(t,r,n,i,o){e(t,r,n,i,o.width,o.height,-o.x,-o.y,2)}function d(e,t,r,n,i,o,a){const f=[];let s,c=[0,1,2,3,4];-1!=o?c=[o]:(t*n>5e5||1==r)&&(c=[0]),a&&(s={level:0});const l=m;for(var u=0;u<c.length;u++){for(let o=0;o<t;o++)g(i,e,o,n,r,c[u]);f.push(l.deflate(i,s))}let h,d=1e9;for(u=0;u<f.length;u++)f[u].length<d&&(h=u,d=f[u].length);return f[h]}function g(e,t,n,i,o,a){const f=n*i;let s=f+n;if(e[s]=a,s++,0==a)if(i<500)for(var c=0;c<i;c++)e[s+c]=t[f+c];else e.set(new Uint8Array(t.buffer,f,i),s);else if(1==a){for(c=0;c<o;c++)e[s+c]=t[f+c];for(c=o;c<i;c++)e[s+c]=t[f+c]-t[f+c-o]+256&255}else if(0==n){for(c=0;c<o;c++)e[s+c]=t[f+c];if(2==a)for(c=o;c<i;c++)e[s+c]=t[f+c];if(3==a)for(c=o;c<i;c++)e[s+c]=t[f+c]-(t[f+c-o]>>1)+256&255;if(4==a)for(c=o;c<i;c++)e[s+c]=t[f+c]-r(t[f+c-o],0,0)+256&255}else{if(2==a)for(c=0;c<i;c++)e[s+c]=t[f+c]+256-t[f+c-i]&255;if(3==a){for(c=0;c<o;c++)e[s+c]=t[f+c]+256-(t[f+c-i]>>1)&255;for(c=o;c<i;c++)e[s+c]=t[f+c]+256-(t[f+c-i]+t[f+c-o]>>1)&255}if(4==a){for(c=0;c<o;c++)e[s+c]=t[f+c]+256-r(0,t[f+c-i],0)&255;for(c=o;c<i;c++)e[s+c]=t[f+c]+256-r(t[f+c-o],t[f+c-i],t[f+c-o-i])&255}}}function w(e,t){const r=new Uint8Array(e),n=r.slice(0),i=new Uint32Array(n.buffer),o=A(n,t),a=o[0],f=o[1],s=r.length,c=new Uint8Array(s>>2);let l;if(r.length<2e7)for(var u=0;u<s;u+=4)l=p(a,h=r[u]*(1/255),d=r[u+1]*(1/255),g=r[u+2]*(1/255),w=r[u+3]*(1/255)),c[u>>2]=l.ind,i[u>>2]=l.est.rgba;else for(u=0;u<s;u+=4){var h=r[u]*(1/255),d=r[u+1]*(1/255),g=r[u+2]*(1/255),w=r[u+3]*(1/255);for(l=a;l.left;)l=b(l.est,h,d,g,w)<=0?l.left:l.right;c[u>>2]=l.ind,i[u>>2]=l.est.rgba}return{abuf:n.buffer,inds:c,plte:f}}function A(e,t,r){r??=1e-4;const n=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=F(e,i.i0,i.i1),i.est=E(i.bst);const o=[i];for(;o.length<t;){let t=0,i=0;for(var a=0;a<o.length;a++)o[a].est.L>t&&(t=o[a].est.L,i=a);if(t<r)break;const f=o[i],s=y(e,n,f.i0,f.i1,f.est.e,f.est.eMq255);if(f.i0>=s||f.i1<=s){f.est.L=0;continue}const c={i0:f.i0,i1:s,bst:null,est:null,tdst:0,left:null,right:null};c.bst=F(e,c.i0,c.i1),c.est=E(c.bst);const l={i0:s,i1:f.i1,bst:null,est:null,tdst:0,left:null,right:null};for(l.bst={R:[],m:[],N:f.bst.N-c.bst.N},a=0;a<16;a++)l.bst.R[a]=f.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)l.bst.m[a]=f.bst.m[a]-c.bst.m[a];l.est=E(l.bst),f.left=c,f.right=l,o[i]=c,o.push(l)}for(o.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<o.length;a++)o[a].ind=a;return[i,o]}function p(e,t,r,n,i){if(null==e.left)return e.tdst=function(e,t,r,n,i){const o=t-e[0],a=r-e[1],f=n-e[2],s=i-e[3];return o*o+a*a+f*f+s*s}(e.est.q,t,r,n,i),e;const o=b(e.est,t,r,n,i);let a=e.left,f=e.right;o>0&&(a=e.right,f=e.left);const s=p(a,t,r,n,i);if(s.tdst<=o*o)return s;const c=p(f,t,r,n,i);return c.tdst<s.tdst?c:s}function b(e,t,r,n,i){const{e:o}=e;return o[0]*t+o[1]*r+o[2]*n+o[3]*i-e.eMq}function y(e,t,r,n,i,o){for(n-=4;r<n;){for(;U(e,r,i)<=o;)r+=4;for(;U(e,n,i)>o;)n-=4;if(r>=n)break;const a=t[r>>2];t[r>>2]=t[n>>2],t[n>>2]=a,r+=4,n-=4}for(;U(e,r,i)>o;)r-=4;return r+4}function U(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]}function F(e,t,r){const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=r-t>>2;for(let a=t;a<r;a+=4){const t=e[a]*(1/255),r=e[a+1]*(1/255),o=e[a+2]*(1/255),f=e[a+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=o,i[3]+=f,n[0]+=t*t,n[1]+=t*r,n[2]+=t*o,n[3]+=t*f,n[5]+=r*r,n[6]+=r*o,n[7]+=r*f,n[10]+=o*o,n[11]+=o*f,n[15]+=f*f}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:o}}function E(e){const{R:t}=e,{m:r}=e,{N:n}=e,i=r[0],o=r[1],a=r[2],f=r[3],s=0==n?0:1/n,c=[t[0]-i*i*s,t[1]-i*o*s,t[2]-i*a*s,t[3]-i*f*s,t[4]-o*i*s,t[5]-o*o*s,t[6]-o*a*s,t[7]-o*f*s,t[8]-a*i*s,t[9]-a*o*s,t[10]-a*a*s,t[11]-a*f*s,t[12]-f*i*s,t[13]-f*o*s,t[14]-f*a*s,t[15]-f*f*s],l=c,u=_;let h=[Math.random(),Math.random(),Math.random(),Math.random()],d=0,g=0;if(0!=n)for(let A=0;A<16&&(h=u.multVec(l,h),g=Math.sqrt(u.dot(h,h)),h=u.sml(1/g,h),!(0!=A&&Math.abs(g-d)<1e-9));A++)d=g;const w=[i*s,o*s,a*s,f*s];return{Cov:c,q:w,e:h,L:d,eMq255:u.dot(u.sml(255,w),h),eMq:u.dot(h,w),rgba:(Math.round(255*w[3])<<24|Math.round(255*w[2])<<16|Math.round(255*w[1])<<8|Math.round(255*w[0]))>>>0}}var _={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};v.encode=function(e,t,r,n,i,o,a){n??=0,a??=!1;const f=l(e,t,r,n,[!1,!1,!1,0,a,!1]);return c(f,-1),s(f,t,r,i,o)},v.encodeLL=function(e,t,r,n,i,o,a,f){const l={ctype:0+(1==n?0:2)+(0==i?0:4),depth:o,frames:[]},u=(n+i)*o,h=u*t;for(let s=0;s<e.length;s++)l.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[s]),blend:0,dispose:1,bpp:Math.ceil(u/8),bpl:Math.ceil(h/8)});return c(l,0,!0),s(l,t,r,a,f)},v.encode.compress=l,v.encode.dither=f,v.quantize=w,v.quantize.getKDtree=A,v.quantize.getNearest=p}();var b,y={toArrayBuffer(e,t){const r=e.width,n=e.height,i=r<<2,o=e.getContext("2d").getImageData(0,0,r,n),a=new Uint32Array(o.data.buffer),f=(32*r+31)/32<<2,s=f*n,c=122+s,l=new ArrayBuffer(c),u=new DataView(l),h=1<<20;let d,g,w,A,p=h,m=0,v=0,b=0;function U(e){u.setUint16(v,e,!0),v+=2}function F(e){u.setUint32(v,e,!0),v+=4}function E(e){v+=e}U(19778),F(c),E(4),F(122),F(108),F(r),F(-n>>>0),U(1),U(32),F(3),F(s),F(2835),F(2835),E(8),F(16711680),F(65280),F(255),F(4278190080),F(1466527264),function e(){for(;m<n&&p>0;){for(A=122+m*f,d=0;d<i;)p--,g=a[b++],w=g>>>24,u.setUint32(A+d,g<<8|w),d+=4;m++}b<a.length?(p=h,setTimeout(e,y._dly)):t(l)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9},U={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},F={[U.CHROME]:16384,[U.FIREFOX]:11180,[U.DESKTOP_SAFARI]:16384,[U.IE]:8192,[U.IOS]:4096,[U.ETC]:8192},E="undefined"!=typeof window,_="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,C=E&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),T=(E||_)&&(C&&C.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),B=(E||_)&&(C&&C.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function I(e,t,r=Date.now()){return new Promise(n=>{const i=e.split(","),o=i[0].match(/:(.*?);/)[1],a=globalThis.atob(i[1]);let f=a.length;const s=new Uint8Array(f);for(;f--;)s[f]=a.charCodeAt(f);const c=new Blob([s],{type:o});c.name=t,c.lastModified=r,n(c)})}function M(e){return new Promise((t,r)=>{const n=new B;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function x(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function R(){if(void 0!==R.cachedResult)return R.cachedResult;let e=U.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=U.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=U.IOS:/Safari/i.test(t)?e=U.DESKTOP_SAFARI:/Firefox/i.test(t)?e=U.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=U.IE),R.cachedResult=e,R.cachedResult}function S(e,t){const r=F[R()];let n=e,i=t,o=n*i;const a=n>i?i/n:n/i;for(;o>r*r;){const e=(r+n)/2,t=(r+i)/2;e<t?(i=t,n=t*a):(i=e*a,n=e),o=n*i}return{width:n,height:i}}function Q(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),null===n)throw new Error("getContext of OffscreenCanvas returns null")}catch(e){r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function k(e,t){const{width:r,height:n}=S(e.width,e.height),[i,o]=Q(r,n);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(e,0,0,i.width,i.height),i}function L(){return void 0!==L.cachedResult||(L.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),L.cachedResult}function H(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=k(i,t.fileType||e.type),r([i,o])}catch(e){return n(e)}},f=function(t){try{var r=function(e){try{throw e}catch(e){return n(e)}};try{let t;return M(e).then(function(e){try{return t=e,x(t).then(function(e){try{return i=e,function(){try{return a()}catch(e){return n(e)}}()}catch(e){return r(e)}},r)}catch(e){return r(e)}},r)}catch(e){r(e)}}catch(e){return n(e)}};try{if(L()||[U.DESKTOP_SAFARI,U.MOBILE_SAFARI].includes(R()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return i=e,a()}catch(e){return f()}},f)}catch(e){f()}})}function O(e,t,r,n,i=1){return new Promise(function(o,a){let f;if("image/png"===t){let c,l,u;return c=e.getContext("2d"),({data:l}=c.getImageData(0,0,e.width,e.height)),u=v.encode([l.buffer],e.width,e.height,4096*i),f=new Blob([u],{type:t}),f.name=r,f.lastModified=n,s.call(this)}{if("image/bmp"===t)return new Promise(t=>y.toBlob(e,t)).then(function(e){try{return f=e,f.name=r,f.lastModified=n,h.call(this)}catch(e){return a(e)}}.bind(this),a);{if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then(function(e){try{return f=e,f.name=r,f.lastModified=n,d.call(this)}catch(e){return a(e)}}.bind(this),a);{let g;return g=e.toDataURL(t,i),I(g,r,n).then(function(e){try{return f=e,d.call(this)}catch(e){return a(e)}}.bind(this),a)}function d(){return h.call(this)}}function h(){return s.call(this)}}function s(){return o(f)}})}function P(e){e.width=0,e.height=0}function q(){return new Promise(function(e,t){let r,n,i,o;return void 0!==q.cachedResult?e(q.cachedResult):I("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,H(r).then(function(a){try{return n=a[1],O(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,P(n),H(i).then(function(r){try{return o=r[0],q.cachedResult=1===o.width&&2===o.height,e(q.cachedResult)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)})}function D(e){return new Promise((t,r)=>{const n=new B;n.onload=e=>{const r=new DataView(e.target.result);if(65496!=r.getUint16(0,!1))return t(-2);const n=r.byteLength;let i=2;for(;i<n;){if(r.getUint16(i+2,!1)<=8)return t(-1);const e=r.getUint16(i,!1);if(i+=2,65505==e){if(1165519206!=r.getUint32(i+=2,!1))return t(-1);const e=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,e);const n=r.getUint16(i,e);i+=2;for(let o=0;o<n;o++)if(274==r.getUint16(i+12*o,e))return t(r.getUint16(i+12*o+8,e))}else{if(65280&~e)break;i+=r.getUint16(i,!1)}}return t(-1)},n.onerror=e=>r(e),n.readAsArrayBuffer(e)})}function z(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:i}=t;let o,a=e;return isFinite(i)&&(r>i||n>i)&&([a,o]=Q(r,n),r>n?(a.width=i,a.height=n/r*i):(a.width=r/n*i,a.height=i),o.drawImage(e,0,0,a.width,a.height),P(e)),a}function N(e,t){const{width:r}=e,{height:n}=e,[i,o]=Q(r,n);switch(t>4&&t<9?(i.width=n,i.height=r):(i.width=r,i.height=n),t){case 2:o.transform(-1,0,0,1,r,0);break;case 3:o.transform(-1,0,0,-1,r,n);break;case 4:o.transform(1,0,0,-1,0,n);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,n,0);break;case 7:o.transform(0,-1,-1,0,n,r);break;case 8:o.transform(0,-1,1,0,0,r)}return o.drawImage(e,0,0,r,n),P(e),i}function W(e,t,r=0){return new Promise(function(n,i){let o,a,f,s,c,l,u,h,d,g,w,A,p,m,v,b,y,U,F,E;function _(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function C(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(e,o),100),t.onProgress(o)}return o=r,a=t.maxIteration||10,f=1024*t.maxSizeMB*1024,_(),H(e,t).then(function(r){try{return[,s]=r,_(),c=z(s,t),_(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return D(e).then(function(e){try{return i=e,o.call(this)}catch(e){return n(e)}}.bind(this),n);function o(){return r(i)}return o.call(this)}).then(function(r){try{return l=r,_(),q().then(function(r){try{return u=r?c:N(c,l),_(),h=t.initialQuality||1,d=t.fileType||e.type,O(u,d,e.name,e.lastModified,h).then(function(r){try{{if(g=r,_(),w=g.size>f,A=g.size>e.size,!w&&!A)return C(100),n(g);var o;function T(){if(a--&&(v>f||v>p)){let t,r;return t=E?.95*F.width:F.width,r=E?.95*F.height:F.height,[y,U]=Q(t,r),U.drawImage(F,0,0,t,r),h*="image/png"===d?.85:.95,O(y,d,e.name,e.lastModified,h).then(function(e){try{return b=e,P(F),F=y,v=b.size,C(Math.min(99,Math.floor((m-v)/(m-f)*100))),T}catch(e){return i(e)}},i)}return[1]}return p=e.size,m=g.size,v=m,F=u,E=!t.alwaysKeepResolution&&w,(o=function(e){for(;e;){if(e.then)return void e.then(o,i);try{if(e.pop){if(e.length)return e.pop()?B.call(this):e;e=T}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(T);function B(){return P(F),P(y),P(c),P(u),P(s),C(100),n(b)}}}catch(l){return i(l)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)})}function j(e,t){return new Promise((r,n)=>{b||(b=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"));const i=new Worker(b);i.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)i.terminate();else if(void 0===e.data.progress){if(e.data.error)return n(new Error(e.data.error)),void i.terminate();r(e.data.file),i.terminate()}else t.onProgress(e.data.progress)}),i.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",()=>{n(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}function G(e,t){return new Promise(function(r,n){let i,o,a,f,s,c;if(i={...t},a=0,({onProgress:f}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,s="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof f&&f(a)},!(e instanceof Blob||e instanceof T))return n(/* @__PURE__ */new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(/* @__PURE__ */new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!s||"function"!=typeof Worker||c)return W(e,i).then(function(e){try{return o=e,h.call(this)}catch(e){return n(e)}}.bind(this),n);var l=function(){try{return h.call(this)}catch(e){return n(e)}}.bind(this),u=function(t){try{return W(e,i).then(function(e){try{return o=e,l()}catch(e){return n(e)}},n)}catch(e){return n(e)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",j(e,i).then(function(e){try{return o=e,l()}catch(e){return u()}},u)}catch(e){u()}function h(){try{o.name=e.name,o.lastModified=e.lastModified}catch(e){}try{i.preserveExif&&"image/jpeg"===e.type&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(o=g(e,o))}catch(e){}return r(o)}})}function K({className:t}){/* @__PURE__ */
3
+ return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M12 20q-3.35 0-5.675-2.325T4 12t2.325-5.675T12 4q1.725 0 3.3.712T18 6.75V5q0-.425.288-.712T19 4t.713.288T20 5v5q0 .425-.288.713T19 11h-5q-.425 0-.712-.288T13 10t.288-.712T14 9h3.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12t1.75 4.25T12 18q1.7 0 3.113-.862t2.187-2.313q.2-.35.563-.487t.737-.013q.4.125.575.525t-.025.75q-1.025 2-2.925 3.2T12 20"})})}G.getDataUrlFromFile=M,G.getFilefromDataUrl=I,G.loadImage=x,G.drawImageInCanvas=k,G.drawFileInCanvas=H,G.canvasToFile=O,G.getExifOrientation=D,G.handleMaxWidthOrHeight=z,G.followExifOrientation=N,G.cleanupCanvasMemory=P,G.isAutoOrientationInBrowser=q,G.approximateBelowMaximumCanvasSizeOfBrowser=S,G.copyExifWithoutOrientation=g,G.getBrowserName=R,G.version="2.0.2";export{f as a,t as c,h as i,G as n,a as o,d as r,c as s,K as t};
@@ -0,0 +1 @@
1
+ import{n as r,s as e}from"./CKQOToSD.js";import{t as a}from"./DmpmrPE5.js";import{i as t}from"./BLeZg2Bz.js";var o=({eventSlug:o})=>{const{props:s}=r(),n=s?.organizationId,{isLoading:i,data:d,isError:g,error:m}=e({queryKey:[`event-data-${n??""}-${o??""}`],queryFn:async()=>{try{const r=await a.get(t.EVENT_DATA,{searchParams:o?{eventSlug:o}:void 0,headers:{"x-org-id":n}}).json();if(r.error)throw new Error(r.error);return r.data}catch(r){throw new Error(r instanceof Error?r.message:String(r)||"Failed to fetch event data")}},enabled:!!n&&!!o,staleTime:3e5,gcTime:6e5,refetchOnWindowFocus:"always"});return{loading:i,event:d?.event,ads:d?.ads,gamConfig:d?.gamConfig,parameters:d?.parameters,isError:g,error:m}};export{o as t};
@@ -0,0 +1,41 @@
1
+ import{E as e,_ as t,h as r,p as n,r as s,s as i,t as a,v as o,y as c}from"./DrrpB4Om.js";import{n as l,t as u}from"./DmpmrPE5.js";import{S as h,h as d,i as f}from"./BLeZg2Bz.js";var p={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m=new class{#e=p;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},y="undefined"==typeof window||"Deno"in globalThis;function g(){}function v(e,t){return"function"==typeof e?e(t):e}function w(e){return"number"==typeof e&&e>=0&&e!==1/0}function b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function S(e,t){return"function"==typeof e?e(t):e}function R(e,t){return"function"==typeof e?e(t):e}function I(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:a,stale:o}=e;if(a)if(n){if(t.queryHash!==C(a,t.options))return!1}else if(!E(t.queryKey,a))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof o&&t.isStale()!==o||s&&s!==t.state.fetchStatus||i&&!i(t))}function O(e,t){const{exact:r,status:n,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(T(t.options.mutationKey)!==T(i))return!1}else if(!E(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function C(e,t){return(t?.queryKeyHashFn||T)(e)}function T(e){return JSON.stringify(e,(e,t)=>P(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function E(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>E(e[r],t[r]))}var F=Object.prototype.hasOwnProperty;function A(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=k(e)&&k(t);if(!(n||P(e)&&P(t)))return t;const s=(n?e:Object.keys(e)).length,i=n?t:Object.keys(t),a=i.length,o=n?new Array(a):{};let c=0;for(let l=0;l<a;l++){const a=n?l:i[l],u=e[a],h=t[a];if(u===h){o[a]=u,(n?l<s:F.call(e,a))&&c++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){o[a]=h;continue}const d=A(u,h,r+1);o[a]=d,d===u&&c++}return s===a&&c===s?e:o}function x(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function k(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P(e){if(!D(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!D(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function D(e){return"[object Object]"===Object.prototype.toString.call(e)}function M(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?A(e,t):t}function q(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Q(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var L=/* @__PURE__ */Symbol();function U(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==L?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function _(e,t){return"function"==typeof e?e(...t):!!e}var j=/* @__PURE__ */(()=>{let e=()=>y;return{isServer:()=>e(),setIsServer(t){e=t}}})(),N=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$=new class extends N{#r;#n;#s;constructor(){super(),this.#s=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#s=e,this.#n?.(),this.#n=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:"hidden"!==globalThis.document?.visibilityState}},z=function(e){setTimeout(e,0)},H=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},s=z;const i=n=>{t?e.push(n):s(()=>{r(n)})};return{batch:i=>{let a;t++;try{a=i()}finally{t--,t||(()=>{const t=e;e=[],t.length&&s(()=>{n(()=>{t.forEach(e=>{r(e)})})})})()}return a},batchCalls:e=>(...t)=>{i(()=>{e(...t)})},schedule:i,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{s=e}}}(),V=new class extends N{#i=!0;#n;#s;constructor(){super(),this.#s=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#n||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#s=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#i!==e&&(this.#i=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#i}};function G(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});function n(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{n({status:"fulfilled",value:t}),e(t)},r.reject=e=>{n({status:"rejected",reason:e}),t(e)},r}function W(e){return Math.min(1e3*2**e,3e4)}function Z(e){return"online"!==(e??"online")||V.isOnline()}var K=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function B(e){let t,r=!1,n=0;const s=G(),i=()=>"pending"!==s.status,a=()=>$.isFocused()&&("always"===e.networkMode||V.isOnline())&&e.canRun(),o=()=>Z(e.networkMode)&&e.canRun(),c=e=>{i()||(t?.(),s.resolve(e))},l=e=>{i()||(t?.(),s.reject(e))},u=()=>new Promise(r=>{t=e=>{(i()||a())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,i()||e.onContinue?.()}),h=()=>{if(i())return;let t;const s=0===n?e.initialPromise:void 0;try{t=s??e.fn()}catch(o){t=Promise.reject(o)}Promise.resolve(t).then(c).catch(t=>{if(i())return;const s=e.retry??(j.isServer()?0:3),o=e.retryDelay??W,c="function"==typeof o?o(n,t):o,d=!0===s||"number"==typeof s&&n<s||"function"==typeof s&&s(n,t);var f;!r&&d?(n++,e.onFail?.(n,t),(f=c,new Promise(e=>{m.setTimeout(e,f)})).then(()=>a()?void 0:u()).then(()=>{r?l(t):h()})):l(t)})};return{promise:s,status:()=>s.status,cancel:t=>{if(!i()){const r=new K(t);l(r),e.onCancel?.(r)}},continue:()=>(t?.(),s),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:o,start:()=>(o()?h():u().then(h),s)}}var J=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),w(this.gcTime)&&(this.#a=m.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(j.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#a&&(m.clearTimeout(this.#a),this.#a=void 0)}};function Y(e){return{onFetch:(t,r)=>{const n=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,i=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let o={pages:[],pageParams:[]},c=0;const l=async()=>{let r=!1;const l=e=>{!function(e,r,n){let s,i=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t.signal,i||(i=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)})}(e,0,()=>r=!0)},u=U(t.options,t.fetchOptions),h=async(e,n,s)=>{if(r)return Promise.reject(t.signal.reason);if(null==n&&e.pages.length)return Promise.resolve(e);const i=await u((()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:n,direction:s?"backward":"forward",meta:t.options.meta};return l(e),e})()),{maxPages:a}=t.options,o=s?Q:q;return{pages:o(e.pages,i,a),pageParams:o(e.pageParams,n,a)}};if(s&&i.length){const e="backward"===s,t=e?ee:X,r={pages:i,pageParams:a};o=await h(r,t(n,r),e)}else{const t=e??i.length;do{const e=0===c?a[0]??n.initialPageParam:X(n,o);if(c>0&&null==e)break;o=await h(o,e),c++}while(c<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=l}}}function X(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function ee(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function te(e,t){return!!t&&null!=X(e,t)}function re(e,t){return!(!t||!e.getPreviousPageParam)&&null!=ee(e,t)}var ne=class extends J{#o;#c;#l;#u;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#u=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=ae(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#o}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#o=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=ae(this.options);void 0!==e.data&&(this.setState(ie(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,t){const r=M(this.state.data,e,this.options);return this.#m({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#m({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(g).catch(g):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==R(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===L||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===S(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!b(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#y()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},s=()=>{const e=U(this.options,t),r=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return n(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},i=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:s};return n(e),e})();("infinite"===this.#o?Y(this.options.pages):this.options.behavior)?.onFetch(i,this),this.#l=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===i.fetchOptions?.meta||this.#m({type:"fetch",meta:i.fetchOptions?.meta}),this.#d=B({initialPromise:t?.initialPromise,fn:i.fetchFn,onCancel:e=>{e instanceof K&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(a){if(a instanceof K){if(a.silent)return this.#d.promise;if(a.revert){if(void 0===this.state.data)throw a;return this.state.data}}throw this.#m({type:"error",error:a}),this.#u.config.onError?.(a,this),this.#u.config.onSettled?.(this.state.data,a,this),a}finally{this.scheduleGc()}}#m(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...se(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ie(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":const n=e.error;return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),H.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function se(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Z(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ie(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ae(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var oe=class extends N{constructor(e,t){super(),this.options=t,this.#h=e,this.#g=null,this.#v=G(),this.bindMethods(),this.setOptions(t)}#h;#w=void 0;#b=void 0;#S=void 0;#R;#I;#v;#g;#O;#C;#T;#E;#F;#A;#x=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#w.addObserver(this),ce(this.#w,this.options)?this.#k():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return le(this.#w,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return le(this.#w,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#D(),this.#M(),this.#w.removeObserver(this)}setOptions(e){const t=this.options,r=this.#w;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof R(this.options.enabled,this.#w))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#q(),this.#w.setOptions(this.options),t._defaulted&&!x(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#w,observer:this});const n=this.hasListeners();n&&ue(this.#w,r,this.options,t)&&this.#k(),this.updateResult(),!n||this.#w===r&&R(this.options.enabled,this.#w)===R(t.enabled,this.#w)&&S(this.options.staleTime,this.#w)===S(t.staleTime,this.#w)||this.#Q();const s=this.#L();!n||this.#w===r&&R(this.options.enabled,this.#w)===R(t.enabled,this.#w)&&s===this.#A||this.#U(s)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var n;return n=r,x(this.getCurrentResult(),n)||(this.#S=r,this.#I=this.options,this.#R=this.#w.state),r}getCurrentResult(){return this.#S}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#x.add(e)}getCurrentQuery(){return this.#w}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#k({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#S))}#k(e){this.#q();let t=this.#w.fetch(this.options,e);return e?.throwOnError||(t=t.catch(g)),t}#Q(){this.#D();const e=S(this.options.staleTime,this.#w);if(j.isServer()||this.#S.isStale||!w(e))return;const t=b(this.#S.dataUpdatedAt,e)+1;this.#E=m.setTimeout(()=>{this.#S.isStale||this.updateResult()},t)}#L(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#w):this.options.refetchInterval)??!1}#U(e){this.#M(),this.#A=e,!j.isServer()&&!1!==R(this.options.enabled,this.#w)&&w(this.#A)&&0!==this.#A&&(this.#F=m.setInterval(()=>{(this.options.refetchIntervalInBackground||$.isFocused())&&this.#k()},this.#A))}#P(){this.#Q(),this.#U(this.#L())}#D(){void 0!==this.#E&&(m.clearTimeout(this.#E),this.#E=void 0)}#M(){void 0!==this.#F&&(m.clearInterval(this.#F),this.#F=void 0)}createResult(e,t){const r=this.#w,n=this.options,s=this.#S,i=this.#R,a=this.#I,o=e!==r?e.state:this.#b,{state:c}=e;let l,u={...c},h=!1;if(t._optimisticResults){const s=this.hasListeners(),i=!s&&ce(e,t),a=s&&ue(e,r,t,n);(i||a)&&(u={...u,...se(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(u.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=u;l=u.data;let m=!1;if(void 0!==t.placeholderData&&void 0===l&&"pending"===p){let e;s?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(e=s.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#T?.state.data,this.#T):t.placeholderData,void 0!==e&&(p="success",l=M(s?.data,e,t),h=!0)}if(t.select&&void 0!==l&&!m)if(s&&l===i?.data&&t.select===this.#O)l=this.#C;else try{this.#O=t.select,l=t.select(l),l=M(s?.data,l,t),this.#C=l,this.#g=null}catch(I){this.#g=I}this.#g&&(d=this.#g,l=this.#C,f=Date.now(),p="error");const y="fetching"===u.fetchStatus,g="pending"===p,v="error"===p,w=g&&y,b=void 0!==l,S={status:p,fetchStatus:u.fetchStatus,isPending:g,isSuccess:"success"===p,isError:v,isInitialLoading:w,isLoading:w,data:l,dataUpdatedAt:u.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>o.dataUpdateCount||u.errorUpdateCount>o.errorUpdateCount,isFetching:y,isRefetching:y&&!g,isLoadingError:v&&!b,isPaused:"paused"===u.fetchStatus,isPlaceholderData:h,isRefetchError:v&&b,isStale:he(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==R(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==S.data,n="error"===S.status&&!t,s=e=>{n?e.reject(S.error):t&&e.resolve(S.data)},i=()=>{s(this.#v=S.promise=G())},a=this.#v;switch(a.status){case"pending":e.queryHash===r.queryHash&&s(a);break;case"fulfilled":(n||S.data!==a.value)&&i();break;case"rejected":n&&S.error===a.reason||i()}}return S}updateResult(){const e=this.#S,t=this.createResult(this.#w,this.options);this.#R=this.#w.state,this.#I=this.options,void 0!==this.#R.data&&(this.#T=this.#w),x(t,e)||(this.#S=t,this.#_({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#x.size)return!0;const n=new Set(r??this.#x);return this.options.throwOnError&&n.add("error"),Object.keys(this.#S).some(t=>{const r=t;return this.#S[r]!==e[r]&&n.has(r)})})()}))}#q(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#w)return;const t=this.#w;this.#w=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#_(e){H.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#S)}),this.#h.getQueryCache().notify({query:this.#w,type:"observerResultsUpdated"})})}};function ce(e,t){return function(e,t){return!1!==R(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===R(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&le(e,t,t.refetchOnMount)}function le(e,t,r){if(!1!==R(t.enabled,e)&&"static"!==S(t.staleTime,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&he(e,t)}return!1}function ue(e,t,r,n){return(e!==t||!1===R(n.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&he(e,r)}function he(e,t){return!1!==R(t.enabled,e)&&e.isStaleByTime(S(t.staleTime,e))}var de=e(void 0),fe=e=>{const t=c(de);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},pe=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */a(de.Provider,{value:e,children:r})),me=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),ye=e(!1),ge=(ye.Provider,(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()}));function ve(e,n,i){const a=c(ye),l=c(me),u=fe(i),h=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const d=u.getQueryCache().get(h.queryHash),f=!1!==e.subscribed;h._optimisticResults=a?"isRestoring":f?"optimistic":void 0,(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),n=e.staleTime;e.staleTime="function"==typeof n?(...e)=>r(n(...e)):r(n),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(h),((e,t,r)=>{const n=r?.state.error&&"function"==typeof e.throwOnError?_(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))})(h,l,d),(e=>{t(()=>{e.clearReset()},[e])})(l);const p=!u.getQueryCache().get(h.queryHash),[m]=r(()=>new n(u,h)),y=m.getOptimisticResult(h),v=!a&&f;if(s(o(e=>{const t=v?m.subscribe(H.batchCalls(e)):g;return m.updateResult(),t},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),t(()=>{m.setOptions(h)},[h,m]),((e,t)=>e?.suspense&&t.isPending)(h,y))throw ge(h,m,l);if((({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(s&&void 0===e.data||_(r,[e.error,n])))({result:y,errorResetBoundary:l,throwOnError:h.throwOnError,query:d,suspense:h.suspense}))throw y.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(h,y),h.experimental_prefetchInRender&&!j.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(y,a)&&(p?ge(h,m,l):d?.promise)?.catch(g).finally(()=>{m.updateResult()}),h.notifyOnChangeProps?y:m.trackResult(y)}function we(e,t){return ve(e,oe,t)}function be({title:e,children:t}){/* @__PURE__ */
2
+ return a("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */a("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */a("g",{transform:"translate(-443.142 -257.876)",children:[
3
+ /* @__PURE__ */a("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
4
+ /* @__PURE__ */a("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
5
+ /* @__PURE__ */a("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
6
+ /* @__PURE__ */a("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
7
+ /* @__PURE__ */a("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
8
+ /* @__PURE__ */a("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
9
+ /* @__PURE__ */a("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
10
+ /* @__PURE__ */a("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
11
+ /* @__PURE__ */a("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
12
+ /* @__PURE__ */a("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
13
+ /* @__PURE__ */a("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
14
+ /* @__PURE__ */a("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
15
+ /* @__PURE__ */a("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
16
+ /* @__PURE__ */a("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
17
+ /* @__PURE__ */a("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
18
+ /* @__PURE__ */a("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
19
+ /* @__PURE__ */a("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
20
+ /* @__PURE__ */a("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
21
+ /* @__PURE__ */a("g",{transform:"translate(696.754 297.373)",children:[
22
+ /* @__PURE__ */a("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
23
+ /* @__PURE__ */a("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
24
+ /* @__PURE__ */a("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
25
+ /* @__PURE__ */a("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
26
+ /* @__PURE__ */a("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
27
+ /* @__PURE__ */a("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
28
+ /* @__PURE__ */a("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
29
+ /* @__PURE__ */a("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */a("div",{className:"space-y-4",children:[/* @__PURE__ */a("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */a("p",{className:"text-muted-foreground text-center",children:t})]})]})}var Se=({organizationId:e})=>/* @__PURE__ */a("a",{className:"font-medium text-blue-500",href:d.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Guide"});function Re({organizationId:e,errorType:t,errorMessage:r}){/* @__PURE__ */
30
+ return a(be,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom auth is enabled. Pass ",
31
+ /* @__PURE__ */a("code",{children:"uid"}),", ",
32
+ /* @__PURE__ */a("code",{children:"fname"}),", and ",
33
+ /* @__PURE__ */a("code",{children:"lname"})," as props to QratiConnect to complete setup. See our ",
34
+ /* @__PURE__ */a(Se,{organizationId:e})," for details."]}:"service-unavailable"===t?{title:"We'll be right back!",children:["Our service is getting a quick tune-up. Hang tight — great things are coming your way soon! See our"," ",
35
+ /* @__PURE__ */a(Se,{organizationId:e})," if you need help in the meantime."]}:"generic-error"===t&&r?{title:"Setup needed",children:[r," See our ",
36
+ /* @__PURE__ */a(Se,{organizationId:e})," for details."]}:"page-not-registered"===t?{title:"Page not registered",children:["Add the current page URL in Allowed URLs under"," ",
37
+ /* @__PURE__ */a("a",{className:"font-medium text-blue-500",href:d.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨ Integration Settings. See our ",
38
+ /* @__PURE__ */a(Se,{organizationId:e})," for details."]}:{title:"Heads up",children:["Something needs attention. See our ",
39
+ /* @__PURE__ */a(Se,{organizationId:e})," for details or contact Qrati support."]})}var Ie='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Oe=e=>e.trim().replace(/\s+/g," "),Ce=e=>e?.replace(/\/+$/,"")||"",Te=e=>{if(!e)return Ie;const t=Oe("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${Ie}`:`"${t}", ${Ie}`:"inherit"};function Ee(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=Ee(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Fe(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=Ee(e))&&(n&&(n+=" "),n+=t);return n}var Ae=(...e)=>Fe(e.filter(Boolean)),xe=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},ke="px",Pe=(e,t="light")=>{const r=e?.themeSettings?.colors??{},n=e?.themeSettings?.border,s=e?.themeSettings?.shadow,i=e?.integrationSettings,a="dark"===t,o=(e,t,n,s)=>{const i=a?s:n;return r[a?t:e]||i},c=o("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":o("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":o("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":o("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":o("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":o("borderLight","borderDark","#dddddd","#353538"),"--input":o("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":xe(c),"--popover":o("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":o("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":o("infoLight","infoDark","#2563eb","#5b8def"),"--warning":o("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":o("successLight","successDark","#10b981","#34d399"),"--destructive":o("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${n?.width??"1"}${n?.unit??"px"}`,"--radius":`${n?.radius??"10"}${n?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${s?.outerHorizontalOffset??"0"}${s?.unit??ke}`,"--shadow-outer-vertical-offset":`${s?.outerVerticalOffset??"0"}${s?.unit??ke}`,"--shadow-outer-blur":`${s?.outerBlur??"0"}${s?.unit??ke}`,"--shadow-outer-spread":`${s?.outerSpread??"0"}${s?.unit??ke}`,...i?.fontFamily&&"system"!==i.fontFamily?{"--font-family":Te(i)}:{}}},De=async e=>{try{return await e()}catch{return null}},Me=(e,t=1)=>{const r=(new TextEncoder).encode(e),n=3432918353,s=461845907;let i=t>>>0;const a=Math.floor(r.length/4),o=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<a;h++){let e=o.getUint32(4*h,!0);e=Math.imul(e,n),e=e<<15|e>>>17,e=Math.imul(e,s),i^=e,i=i<<13|i>>>19,i=Math.imul(i,5)+3864292196>>>0}let c=0;const l=4*a,u=3&r.length;return 3===u&&(c^=r[l+2]<<16),u>=2&&(c^=r[l+1]<<8),u>=1&&(c^=r[l],c=Math.imul(c,n),c=c<<15|c>>>17,c=Math.imul(c,s),i^=c),i^=r.length,i^=i>>>16,i=Math.imul(i,2246822507)>>>0,i^=i>>>13,i=Math.imul(i,3266489909)>>>0,i^=i>>>16,i.toString(16).padStart(8,"0")},qe=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(qe).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const n of t){const t=e[n];void 0!==t&&r.push(`${qe(n)}:${qe(t)}`)}return`{${r.join(",")}}`},Qe=async({debug:e=!1}={})=>{const t=performance.now(),r=await De(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?qe(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),n=await De(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const n of t){const t=e.canPlayType(n);r[n]=""===t?"no":t}return qe(r)})()),s=await De(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const n={};for(const i of e)r.style.fontFamily=i,n[i]=r.offsetWidth;const s=[];for(const i of t){let t=!1;for(const a of e)if(r.style.fontFamily=`"${i}", ${a}`,r.offsetWidth!==n[a]){s.push(i),t=!0;break}t||(r.style.fontFamily=`"${i}"`,r.offsetWidth!==n.monospace&&r.offsetWidth!==n.serif&&s.push(i))}return document.body.removeChild(r),s.length?s.sort().join(","):null})()),i=await De(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),a=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,o=Intl.DateTimeFormat().resolvedOptions(),c=o.timeZone,l=/* @__PURE__ */(new Date).getTimezoneOffset(),u=o.calendar||null,h=void 0!==o.hour12?o.hour12?"h12":"h23":o.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",m=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",y=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:v,colorDepth:w}=window.screen,b="ontouchstart"in window||window.navigator.maxTouchPoints>0,S=await De(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),n=r.createLinearGradient(0,0,280,100);return n.addColorStop(0,"#f60"),n.addColorStop(.4,"#09f"),n.addColorStop(.7,"#f09"),n.addColorStop(1,"#0f9"),r.fillStyle=n,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),Me(t.toDataURL("image/png"))})(e)),R=await De(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return Me(qe({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),I=await De(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return Me(qe(r))})(e)),O=await De(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const n=t.createDynamicsCompressor();n.threshold.value=-48,n.knee.value=30,n.ratio.value=14,n.attack.value=0,n.release.value=.3;const s=t.createGain();s.gain.value=.4,r.connect(n),n.connect(s),s.connect(t.destination),r.start(0);const i=(await t.startRendering()).getChannelData(0);let a=0,o=0;for(let l=3e3;l<5800;l+=2){const e=i[l];a=31*a+Math.floor(1e5*(e+1))|0,o=Math.imul(o^Math.floor(98765*e),2246822519)}const c=a>>>0^o>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(i.slice(4500,5e3)),n=e.width/r.length;for(let s=0;s<r.length;s++){const i=s*n,a=(r[s]+1)/2*e.height;0===s?t.moveTo(i,a):t.lineTo(i,a)}t.stroke(),document.body.appendChild(e)}return Me(c.toString(16))})(e)),C=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,T=await De(()=>window.screen.orientation?.type||null),E=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,F=E&&E.type||null,A=E?.effectiveType||null,x=!0===E?.saveData,k="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,P="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,D=await De(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),M=await De(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return qe(t)}),q={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:n||null,fonts:s,numberingSystem:i,languages:a,timezone:c,timezoneOffset:l,intlCalendar:u,hourCycle:h,reducedMotion:d,colorScheme:f,prefersContrast:p,prefersReducedTransparency:m,pdfViewerEnabled:k,webdriver:P,intlSupportedCalendars:D||null,permissionsState:M||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:y,devicePixelRatio:g,pixelDepth:v,colorDepth:w,touchSupport:b,screenOrientation:T||null,connectionType:F,effectiveType:A,saveData:x,canvasID:S,webglID:R,webgpuID:I,audioID:O},Q={aspectRatio:C,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(q,Q);const L=Me(qe(q)),U=Math.round(performance.now()-t);return{fingerprint:L,...q,elapsedMs:U}};"undefined"!=typeof window&&(window.getBrowserFingerprint=Qe);var Le=async(e,t)=>{if(e instanceof l){try{const t=e.data;if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},Ue=e(void 0),_e=({props:e={},children:s})=>{const{organizationId:c,uid:d,fname:p,lname:m,theme:y="light"}=e,g=fe(),[v,w]=r(null),[b,S]=r(()=>{if("undefined"==typeof window)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:R,data:I,error:O}=we({queryKey:[h.QRATI_CONNECT_SESSION,c,d??null,p??null,m??null],queryFn:async()=>{const e=await(async()=>{const e=await Qe();return"string"==typeof e?e:e?.fingerprint})();try{return(await u.post(f.INITIALIZE_SESSION,{json:{uid:d,fname:p,lname:m,browserFingerprint:e},headers:{"x-org-id":c,...!b?.token||d||p||m?{}:{Authorization:`Bearer ${b.token}`}}}).json()).data}catch(t){if(t instanceof l)try{const e=t.data;t.apiMessage=e?.message||e?.error}catch{}throw t}},enabled:!!c});t(()=>{const e=I?.authSession?.session?.token??I?.authSession?.token,t=I?.authSession?.user;t&&e?(S(r=>({...r,...t,token:e,tcAccepted:void 0===t.tcAccepted?r?.tcAccepted:t.tcAccepted})),localStorage.setItem("qrati_token",e)):I?.organization?.customAuth&&d&&p&&S(e=>e??{_id:d,uid:d,name:m?`${p} ${m}`:p,fname:p,lname:m})},[I]);const C=n(()=>{const e=I?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=Ce("https://qrati.com"),n=t?Oe(t):"";return r&&n?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(n)}`:null})(0,e),r=((e,t)=>{const r=Ce("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const n=Oe(e.fontFamily);if("custom"===n&&t){const r=e.customFontName||"QratiCustomFont",n=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${s=r,s.replace(/"/g,'\\"')}";src:url("${t}") format("${n}");font-weight:400 700;font-style:normal;font-display:swap;}`}var s;const i=r||(e=>{if(!e)return null;const t=Oe(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(n);return i?`@import url("${i}");`:""})(I?.organization?.integrationSettings,I?.organization?.customFontUrl?r||I.organization.customFontUrl:void 0,t||void 0)},[I?.organization?.integrationSettings,I?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),C){if(C.startsWith("@import")){const t=C.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=C,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[C,c]);const T=o(async e=>{S(t=>({...t,...e}))},[]),E=o(async(e,t,r,n)=>{try{const s=await u.post(f.REGISTER,{json:{email:e,password:t,fname:r,lname:n},headers:{"x-org-id":c}}).json();return s.error?{error:s.error}:(S({...s.user,token:s.token}),s.token&&localStorage.setItem("qrati_token",s.token),s)}catch(O){return{error:await Le(O,"Registration failed")}}},[c]),F=o(async(e,t)=>{try{const r=await u.post(f.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:(S({...r.user,token:r.token}),r.token&&localStorage.setItem("qrati_token",r.token),r)}catch(O){return{error:await Le(O,"Invalid email or password")}}},[c]),A=o(async e=>{const t=await((e,t,r)=>new Promise((n,s)=>{if(!e)return void s(/* @__PURE__ */new Error("Provider is required"));if(!t)return void s(/* @__PURE__ */new Error("Organization ID is required"));const i=new URL(`${r}/qc-social-auth`);i.searchParams.set("provider",e),i.searchParams.set("organizationId",t),i.searchParams.set("origin",window.location.origin);const a=(window.screen.width-500)/2,o=(window.screen.height-600)/2,c=window.open(i.toString(),"qrati_social_auth",`width=500,height=600,left=${a},top=${o},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void s(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const l=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",u)},u=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:i,data:a,error:o,organizationId:u}=e.data||{};if(u===t)switch(i){case"QRATI_SOCIAL_AUTH_SUCCESS":l(),c.close(),n({user:a.user,session:a.session,token:a.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",o),l(),c.close(),s(new Error(o||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":l(),c.close(),s(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",u,"expected:",t)},h=setInterval(()=>{try{c.closed&&(l(),s(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",u);const d=setTimeout(()=>{l(),c.closed||c.close(),s(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,c??"","https://qrati.com");return t?.user&&t?.token&&(S({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t},[c]),x=o(async()=>A("google"),[A]),k=o(async()=>A("apple"),[A]),P=o(async e=>{try{const t=await u.post(f.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(O){return{error:await Le(O,"Failed to send password reset code")}}},[c]),D=o(async(e,t)=>{try{const r=await u.post(f.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(O){return{error:await Le(O,"Invalid code, please check your email")}}},[c]),M=o(async(e,t)=>{try{const r=await u.post(f.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(O){return{error:O?.message}}},[c]),q=o(async()=>{try{const e=await u.post(f.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${b?.token}`}}).json();return e.error?{error:e.error}:(S(null),localStorage.removeItem("qrati_token"),await g.invalidateQueries({queryKey:[h.QRATI_CONNECT_SESSION]}),e)}catch(O){return{error:O?.message}}},[c,b?.token]),Q=n(()=>({props:e,initializing:R,sessionId:I?.sessionId,organization:I?.organization,folders:I?.folders,orgRole:I?.orgRole??null,loadingUser:R,user:b,updateUser:T,registerUsingEmail:E,loginWithGoogle:x,loginWithApple:k,loginUsingEmail:F,sendPasswordResetCode:P,verifyPasswordResetCode:D,resetPassword:M,signout:q,error:O,portalContainer:v}),[e,R,I,b,T,E,x,k,F,P,D,M,q,O,v]);if(O){const e=O,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
40
+ return a(i,{fallback:null,children:/* @__PURE__ */a(Re,{organizationId:c??"",errorType:t,errorMessage:"generic-error"===t?e.apiMessage:void 0})})}/* @__PURE__ */
41
+ return a(Ue.Provider,{value:Q,children:/* @__PURE__ */a("div",{ref:w,id:"qrati-connect-container",style:{...Pe(I?.organization,y),fontFamily:I?.organization?.integrationSettings?.fontFamily&&"system"!==I.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:Ae("bg-background text-foreground relative min-h-[80vh]"),children:s})})},je=()=>{const e=c(Ue);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{_ as A,C,E as D,g as E,S as O,T as S,I as T,V as _,Pe as a,N as b,ve as c,oe as d,ne as f,B as g,J as h,Ae as i,L as j,x as k,pe as l,re as m,je as n,Fe as o,te as p,Qe as r,we as s,_e as t,fe as u,H as v,O as w,v as x,$ as y};