@nuxt/scripts 1.0.0-beta.7 → 1.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/devtools-client/200.html +1 -0
  2. package/dist/devtools-client/404.html +1 -0
  3. package/dist/devtools-client/_fonts/4ppnHhMi-pBsWSPo7mY0avYxlDoAg1N3PTzCwXLZ5rA-d9oibkGnTd1JL3tc_xnaVgBLYmOB8kjrK2cvZaqwj9s.woff2 +0 -0
  4. package/dist/devtools-client/_fonts/4qBuU9MRVUlPZNPSF7Xom_sK8RBEnfYu-9VXFrdq8A8-8TDwLE1HAj1sQn7XxVWtM_7sIaPM-DTdO3Pf8U2DF1U.woff2 +0 -0
  5. package/dist/devtools-client/_fonts/6dYsbWUd_BpKJ7mdDihgOcya1gHXLpJBuMYXux3WMjE-q3fYNS8YbW5n7ZeXI2vSNgkRWW5VDPKAl51SNTjG2qk.woff2 +0 -0
  6. package/dist/devtools-client/_fonts/Lr-hqqZZsYmCt0ITUlr1CUrWim9fsKvoDFZliMxgNHY-iTa_Yt_PzhOY9TX7ZXdSlEPim6iRt92xhECwaxWxd5w.woff2 +0 -0
  7. package/dist/devtools-client/_fonts/OknHvWI6KtYn1JQBzX7eSpNDBQ8520F9TvSUJYkVf6A-xeZn9253svK_8Q2LD0XEruY_MnEsuCRO5LenPoggC0Y.woff2 +0 -0
  8. package/dist/devtools-client/_fonts/PV2hrQG6wq5BlIPDjdL1IcOflycaghyt5MHzlBqZtlo-lb_WexLz3VZqfTN0oi554iBH5tT2j2UFEV-XErCAS3E.woff2 +0 -0
  9. package/dist/devtools-client/_fonts/UA7OtwYHwGN_HjcVGTdmiQxUit7FlqkCwxVUWSeXVnQ-B4OXCFOL_tWrYODpQTc07aMaj0c2cewTOmBRWR9tD-A.woff2 +0 -0
  10. package/dist/devtools-client/_fonts/VE4cDVCv5MxbFM7ZLoLCGbIpNd71zhp7MDI9lmN5Y7I-xZyDYCUVrd6LV8eVGF3Um3UZjBFuUtDGtvdyTBBRYBo.woff2 +0 -0
  11. package/dist/devtools-client/_fonts/fVoGbnMbBFd5L9BBp9fUPavUSkZ_EmsQNSyadkT-108-U4T0khaeLQSIhtt9eVvaCEKJjtWJ4ioRJOf8hvqkWY0.woff2 +0 -0
  12. package/dist/devtools-client/_fonts/lQAxeCEs1R0Lw-H9XRU1RlOARQN8J6npRsPjyEDMe5s-_DUSLEkO3tKTuun_gSnDLoQPVEnpOnyqZMOw0ByZ6PA.woff2 +0 -0
  13. package/dist/devtools-client/_fonts/lntlqNHKLV2n82yTwMde70QqOjcfLE2XJ5oKZ3vRPWc-z6TxpIZQdWXztWLr9_OFWqt_WJJoeGtuK_-XQMZGQwE.woff2 +0 -0
  14. package/dist/devtools-client/_fonts/qxAYvKsXWeYv731eb-h5TRurcdIP_W44mpNdX-HABAk-zUDeMEFlNtNbrwvT9JxLEBg0TphGy70O6RfIoIX_ZwU.woff2 +0 -0
  15. package/dist/devtools-client/_nuxt/B3kN3DAy.js +1 -0
  16. package/dist/devtools-client/_nuxt/B8PEiB0p.js +1 -0
  17. package/dist/devtools-client/_nuxt/C8jhSQ8l.js +1 -0
  18. package/dist/devtools-client/_nuxt/CJD6wrkT.js +188 -0
  19. package/dist/devtools-client/_nuxt/CfOsp0mU.js +1 -0
  20. package/dist/devtools-client/_nuxt/DKL6PHO3.js +1 -0
  21. package/dist/devtools-client/_nuxt/ajngqPCs.js +1 -0
  22. package/dist/devtools-client/_nuxt/builds/latest.json +1 -0
  23. package/dist/devtools-client/_nuxt/builds/meta/cb4e67c6-e8b7-4205-95b7-708fd96ffab6.json +1 -0
  24. package/dist/devtools-client/_nuxt/dlaR8P-P.js +1 -0
  25. package/dist/devtools-client/_nuxt/entry.BwpOBArY.css +1 -0
  26. package/dist/devtools-client/_nuxt/error-404.CvOVjXeC.css +1 -0
  27. package/dist/devtools-client/_nuxt/error-500.BIm53nmx.css +1 -0
  28. package/dist/devtools-client/_nuxt/first-party.C8Ha4JLM.css +1 -0
  29. package/dist/devtools-client/_nuxt/index.CA-OpSj0.css +1 -0
  30. package/dist/devtools-client/_nuxt/registry.B9lnjF_b.css +1 -0
  31. package/dist/devtools-client/_nuxt/wDzz0qaB.js +1 -0
  32. package/dist/devtools-client/docs/index.html +1 -0
  33. package/dist/devtools-client/first-party/index.html +1 -0
  34. package/dist/devtools-client/index.html +1 -0
  35. package/dist/devtools-client/registry/index.html +1 -0
  36. package/dist/module.d.mts +29 -84
  37. package/dist/module.d.ts +121 -0
  38. package/dist/module.json +1 -1
  39. package/dist/module.mjs +940 -755
  40. package/dist/registry.d.mts +91 -4
  41. package/dist/registry.d.ts +93 -0
  42. package/dist/registry.mjs +668 -326
  43. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +19 -87
  44. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +79 -180
  45. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +19 -87
  46. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +6 -55
  47. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +12 -83
  48. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +6 -55
  49. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.d.vue.ts +5 -1
  50. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue +24 -38
  51. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsCircle.vue.d.ts +5 -1
  52. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.d.vue.ts +43 -0
  53. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue +60 -0
  54. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsGeoJson.vue.d.ts +43 -0
  55. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +4 -0
  56. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +22 -26
  57. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +4 -0
  58. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.d.vue.ts +11 -8
  59. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue +57 -57
  60. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsInfoWindow.vue.d.ts +11 -8
  61. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.d.vue.ts +24 -42
  62. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue +70 -73
  63. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarker.vue.d.ts +24 -42
  64. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.d.vue.ts +42 -5
  65. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue +83 -37
  66. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsMarkerClusterer.vue.d.ts +42 -5
  67. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +77 -0
  68. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +223 -0
  69. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +77 -0
  70. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +10 -3
  71. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +9 -41
  72. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +10 -3
  73. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.d.vue.ts +7 -3
  74. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue +23 -38
  75. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolygon.vue.d.ts +7 -3
  76. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.d.vue.ts +7 -3
  77. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue +23 -38
  78. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPolyline.vue.d.ts +7 -3
  79. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.d.vue.ts +7 -3
  80. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue +24 -38
  81. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsRectangle.vue.d.ts +7 -3
  82. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.d.vue.ts +200 -0
  83. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +166 -0
  84. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue.d.ts +200 -0
  85. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +13 -0
  86. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +8 -0
  87. package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +10 -0
  88. package/dist/runtime/components/GoogleMaps/injectionKeys.js +2 -0
  89. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +48 -0
  90. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +51 -0
  91. package/dist/runtime/components/ScriptBlueskyEmbed.d.vue.ts +84 -0
  92. package/dist/runtime/components/ScriptBlueskyEmbed.vue +89 -0
  93. package/dist/runtime/components/ScriptBlueskyEmbed.vue.d.ts +84 -0
  94. package/dist/runtime/components/ScriptCarbonAds.d.vue.ts +4 -7
  95. package/dist/runtime/components/ScriptCarbonAds.vue +1 -0
  96. package/dist/runtime/components/ScriptCarbonAds.vue.d.ts +4 -7
  97. package/dist/runtime/components/ScriptCrisp.d.vue.ts +7 -11
  98. package/dist/runtime/components/ScriptCrisp.vue +2 -1
  99. package/dist/runtime/components/ScriptCrisp.vue.d.ts +7 -11
  100. package/dist/runtime/components/ScriptGoogleAdsense.d.vue.ts +4 -7
  101. package/dist/runtime/components/ScriptGoogleAdsense.vue +2 -1
  102. package/dist/runtime/components/ScriptGoogleAdsense.vue.d.ts +4 -7
  103. package/dist/runtime/components/ScriptGravatar.d.vue.ts +22 -0
  104. package/dist/runtime/components/ScriptGravatar.vue +46 -0
  105. package/dist/runtime/components/ScriptGravatar.vue.d.ts +22 -0
  106. package/dist/runtime/components/ScriptInstagramEmbed.d.vue.ts +12 -15
  107. package/dist/runtime/components/ScriptInstagramEmbed.vue +9 -3
  108. package/dist/runtime/components/ScriptInstagramEmbed.vue.d.ts +12 -15
  109. package/dist/runtime/components/ScriptIntercom.d.vue.ts +7 -11
  110. package/dist/runtime/components/ScriptIntercom.vue +5 -3
  111. package/dist/runtime/components/ScriptIntercom.vue.d.ts +7 -11
  112. package/dist/runtime/components/ScriptLemonSqueezy.d.vue.ts +2 -3
  113. package/dist/runtime/components/ScriptLemonSqueezy.vue +1 -0
  114. package/dist/runtime/components/ScriptLemonSqueezy.vue.d.ts +2 -3
  115. package/dist/runtime/components/ScriptPayPalButtons.d.vue.ts +43 -37
  116. package/dist/runtime/components/ScriptPayPalButtons.vue +49 -79
  117. package/dist/runtime/components/ScriptPayPalButtons.vue.d.ts +43 -37
  118. package/dist/runtime/components/ScriptPayPalMessages.d.vue.ts +37 -28
  119. package/dist/runtime/components/ScriptPayPalMessages.vue +47 -50
  120. package/dist/runtime/components/ScriptPayPalMessages.vue.d.ts +37 -28
  121. package/dist/runtime/components/ScriptStripePricingTable.d.vue.ts +5 -9
  122. package/dist/runtime/components/ScriptStripePricingTable.vue +3 -2
  123. package/dist/runtime/components/ScriptStripePricingTable.vue.d.ts +5 -9
  124. package/dist/runtime/components/ScriptVimeoPlayer.d.vue.ts +17 -11
  125. package/dist/runtime/components/ScriptVimeoPlayer.vue +14 -10
  126. package/dist/runtime/components/ScriptVimeoPlayer.vue.d.ts +17 -11
  127. package/dist/runtime/components/ScriptXEmbed.d.vue.ts +10 -13
  128. package/dist/runtime/components/ScriptXEmbed.vue +15 -8
  129. package/dist/runtime/components/ScriptXEmbed.vue.d.ts +10 -13
  130. package/dist/runtime/components/ScriptYouTubePlayer.d.vue.ts +10 -15
  131. package/dist/runtime/components/ScriptYouTubePlayer.vue +12 -5
  132. package/dist/runtime/components/ScriptYouTubePlayer.vue.d.ts +10 -15
  133. package/dist/runtime/composables/useScript.js +148 -8
  134. package/dist/runtime/composables/useScriptEventPage.js +2 -2
  135. package/dist/runtime/composables/useScriptTriggerConsent.d.ts +10 -0
  136. package/dist/runtime/composables/useScriptTriggerConsent.js +33 -20
  137. package/dist/runtime/composables/useScriptTriggerElement.js +1 -1
  138. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +1 -1
  139. package/dist/runtime/devtools-standalone-bridge.client.d.ts +8 -0
  140. package/dist/runtime/devtools-standalone-bridge.client.js +50 -0
  141. package/dist/runtime/registry/bing-uet.d.ts +20 -0
  142. package/dist/runtime/registry/bing-uet.js +29 -0
  143. package/dist/runtime/registry/bluesky-embed.d.ts +116 -0
  144. package/dist/runtime/registry/bluesky-embed.js +72 -0
  145. package/dist/runtime/registry/clarity.d.ts +10 -15
  146. package/dist/runtime/registry/clarity.js +22 -31
  147. package/dist/runtime/registry/cloudflare-web-analytics.d.ts +2 -13
  148. package/dist/runtime/registry/cloudflare-web-analytics.js +2 -14
  149. package/dist/runtime/registry/crisp.d.ts +10 -40
  150. package/dist/runtime/registry/crisp.js +2 -33
  151. package/dist/runtime/registry/databuddy-analytics.d.ts +2 -35
  152. package/dist/runtime/registry/databuddy-analytics.js +20 -45
  153. package/dist/runtime/registry/fathom-analytics.d.ts +7 -26
  154. package/dist/runtime/registry/fathom-analytics.js +3 -25
  155. package/dist/runtime/registry/google-adsense.d.ts +3 -11
  156. package/dist/runtime/registry/google-adsense.js +2 -11
  157. package/dist/runtime/registry/google-analytics.d.ts +3 -5
  158. package/dist/runtime/registry/google-analytics.js +3 -8
  159. package/dist/runtime/registry/google-maps.d.ts +3 -9
  160. package/dist/runtime/registry/google-maps.js +2 -8
  161. package/dist/runtime/registry/google-recaptcha.d.ts +2 -6
  162. package/dist/runtime/registry/google-recaptcha.js +4 -12
  163. package/dist/runtime/registry/google-sign-in.d.ts +2 -13
  164. package/dist/runtime/registry/google-sign-in.js +2 -22
  165. package/dist/runtime/registry/google-tag-manager.d.ts +3 -28
  166. package/dist/runtime/registry/google-tag-manager.js +4 -27
  167. package/dist/runtime/registry/gravatar.d.ts +26 -0
  168. package/dist/runtime/registry/gravatar.js +36 -0
  169. package/dist/runtime/registry/hotjar.d.ts +4 -6
  170. package/dist/runtime/registry/hotjar.js +2 -5
  171. package/dist/runtime/registry/instagram-embed.d.ts +3 -18
  172. package/dist/runtime/registry/instagram-embed.js +4 -19
  173. package/dist/runtime/registry/intercom.d.ts +5 -13
  174. package/dist/runtime/registry/intercom.js +2 -12
  175. package/dist/runtime/registry/matomo-analytics.d.ts +3 -12
  176. package/dist/runtime/registry/matomo-analytics.js +3 -12
  177. package/dist/runtime/registry/meta-pixel.d.ts +4 -6
  178. package/dist/runtime/registry/meta-pixel.js +2 -4
  179. package/dist/runtime/registry/mixpanel-analytics.d.ts +22 -0
  180. package/dist/runtime/registry/mixpanel-analytics.js +46 -0
  181. package/dist/runtime/registry/npm.d.ts +3 -7
  182. package/dist/runtime/registry/npm.js +2 -9
  183. package/dist/runtime/registry/paypal.d.ts +4 -25
  184. package/dist/runtime/registry/paypal.js +3 -66
  185. package/dist/runtime/registry/plausible-analytics.js +19 -14
  186. package/dist/runtime/registry/posthog.d.ts +10 -12
  187. package/dist/runtime/registry/posthog.js +3 -12
  188. package/dist/runtime/registry/reddit-pixel.d.ts +5 -6
  189. package/dist/runtime/registry/reddit-pixel.js +2 -4
  190. package/dist/runtime/registry/rybbit-analytics.d.ts +2 -14
  191. package/dist/runtime/registry/rybbit-analytics.js +10 -20
  192. package/dist/runtime/registry/schemas.d.ts +982 -0
  193. package/dist/runtime/registry/schemas.js +937 -0
  194. package/dist/runtime/registry/segment.d.ts +2 -5
  195. package/dist/runtime/registry/segment.js +2 -5
  196. package/dist/runtime/registry/snapchat-pixel.d.ts +5 -34
  197. package/dist/runtime/registry/snapchat-pixel.js +2 -20
  198. package/dist/runtime/registry/stripe.d.ts +3 -4
  199. package/dist/runtime/registry/stripe.js +2 -4
  200. package/dist/runtime/registry/tiktok-pixel.d.ts +4 -7
  201. package/dist/runtime/registry/tiktok-pixel.js +2 -6
  202. package/dist/runtime/registry/umami-analytics.d.ts +2 -31
  203. package/dist/runtime/registry/umami-analytics.js +2 -36
  204. package/dist/runtime/registry/vercel-analytics.d.ts +29 -0
  205. package/dist/runtime/registry/vercel-analytics.js +84 -0
  206. package/dist/runtime/registry/vimeo-player.d.ts +2 -2
  207. package/dist/runtime/registry/vimeo-player.js +1 -1
  208. package/dist/runtime/registry/x-embed.d.ts +3 -17
  209. package/dist/runtime/registry/x-embed.js +3 -18
  210. package/dist/runtime/registry/x-pixel.d.ts +4 -7
  211. package/dist/runtime/registry/x-pixel.js +2 -5
  212. package/dist/runtime/registry/youtube-player.d.ts +7 -7
  213. package/dist/runtime/registry/youtube-player.js +1 -1
  214. package/dist/runtime/server/bluesky-embed-image.d.ts +2 -0
  215. package/dist/runtime/server/bluesky-embed-image.js +7 -0
  216. package/dist/runtime/server/bluesky-embed.d.ts +16 -0
  217. package/dist/runtime/server/bluesky-embed.js +59 -0
  218. package/dist/runtime/server/google-maps-geocode-proxy.d.ts +2 -0
  219. package/dist/runtime/server/google-maps-geocode-proxy.js +34 -0
  220. package/dist/runtime/server/google-static-maps-proxy.js +2 -13
  221. package/dist/runtime/server/gravatar-proxy.d.ts +2 -0
  222. package/dist/runtime/server/gravatar-proxy.js +46 -0
  223. package/dist/runtime/server/instagram-embed-asset.js +8 -41
  224. package/dist/runtime/server/instagram-embed-image.js +6 -53
  225. package/dist/runtime/server/instagram-embed.d.ts +16 -0
  226. package/dist/runtime/server/instagram-embed.js +176 -35
  227. package/dist/runtime/server/proxy-handler.js +101 -83
  228. package/dist/runtime/server/utils/image-proxy.d.ts +12 -0
  229. package/dist/runtime/server/utils/image-proxy.js +70 -0
  230. package/dist/runtime/server/utils/privacy.d.ts +1 -10
  231. package/dist/runtime/server/utils/privacy.js +60 -40
  232. package/dist/runtime/server/x-embed-image.js +5 -49
  233. package/dist/runtime/server/x-embed.js +3 -2
  234. package/dist/runtime/types.d.ts +277 -53
  235. package/dist/runtime/types.js +0 -2
  236. package/dist/runtime/utils/pure.d.ts +1 -1
  237. package/dist/runtime/utils.d.ts +6 -4
  238. package/dist/runtime/utils.js +31 -14
  239. package/dist/stats.d.mts +202 -0
  240. package/dist/stats.d.ts +202 -0
  241. package/dist/stats.mjs +3875 -0
  242. package/dist/types-source.d.mts +17 -0
  243. package/dist/types-source.d.ts +17 -0
  244. package/dist/types-source.mjs +3835 -0
  245. package/dist/types.d.mts +4 -2
  246. package/package.json +35 -61
  247. package/README.md +0 -86
  248. package/dist/client/200.html +0 -1
  249. package/dist/client/404.html +0 -1
  250. package/dist/client/_nuxt/BJa0m50V.js +0 -1
  251. package/dist/client/_nuxt/BPQ3VLAy.js +0 -1
  252. package/dist/client/_nuxt/Ci5iXYuB.js +0 -1
  253. package/dist/client/_nuxt/DaI2y8Uz.js +0 -162
  254. package/dist/client/_nuxt/builds/latest.json +0 -1
  255. package/dist/client/_nuxt/builds/meta/9b4fb16a-3c62-48b0-8295-126cb077b5d3.json +0 -1
  256. package/dist/client/_nuxt/entry.D45OuV0w.css +0 -1
  257. package/dist/client/_nuxt/error-404.B57D-jUQ.css +0 -1
  258. package/dist/client/_nuxt/error-500.DTHUW7BI.css +0 -1
  259. package/dist/client/_nuxt/vPLZfVXe.js +0 -1
  260. package/dist/client/index.html +0 -1
  261. package/dist/runtime/components/ScriptPayPalMarks.d.vue.ts +0 -52
  262. package/dist/runtime/components/ScriptPayPalMarks.vue +0 -69
  263. package/dist/runtime/components/ScriptPayPalMarks.vue.d.ts +0 -52
  264. package/dist/runtime/validation/mock.d.ts +0 -42
  265. package/dist/runtime/validation/mock.js +0 -21
  266. package/dist/runtime/validation/valibot.d.ts +0 -1
  267. package/dist/runtime/validation/valibot.js +0 -1
  268. /package/dist/{client → devtools-client}/_nuxt/CVO1_9PV.js +0 -0
  269. /package/dist/{client → devtools-client}/_nuxt/Cp-IABpG.js +0 -0
  270. /package/dist/{client → devtools-client}/_nuxt/D0r3Knsf.js +0 -0
@@ -1,59 +1,41 @@
1
- import type { InjectionKey, ShallowRef } from 'vue';
2
- export declare const MARKER_INJECTION_KEY: InjectionKey<{
3
- marker: ShallowRef<google.maps.Marker | undefined>;
4
- }>;
1
+ export { MARKER_INJECTION_KEY } from './useGoogleMapsResource.js';
5
2
  declare const _default: typeof __VLS_export;
6
3
  export default _default;
7
4
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
8
- options?: Omit<google.maps.MarkerOptions, "map">;
9
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
5
+ /**
6
+ * The position of the marker on the map.
7
+ * @see https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.position
8
+ */
9
+ position?: google.maps.LatLngLiteral | google.maps.LatLng;
10
+ /**
11
+ * Configuration options for the marker.
12
+ * @see https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions
13
+ */
14
+ options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
15
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
16
  click: (payload: google.maps.MapMouseEvent) => any;
11
- contextmenu: (payload: google.maps.MapMouseEvent) => any;
12
- dblclick: (payload: google.maps.MapMouseEvent) => any;
13
17
  drag: (payload: google.maps.MapMouseEvent) => any;
14
18
  dragend: (payload: google.maps.MapMouseEvent) => any;
15
19
  dragstart: (payload: google.maps.MapMouseEvent) => any;
16
- mousedown: (payload: google.maps.MapMouseEvent) => any;
17
- mouseout: (payload: google.maps.MapMouseEvent) => any;
18
- mouseover: (payload: google.maps.MapMouseEvent) => any;
19
- mouseup: (payload: google.maps.MapMouseEvent) => any;
20
- animation_changed: () => any;
21
- clickable_changed: () => any;
22
- cursor_changed: () => any;
23
- draggable_changed: () => any;
24
- flat_changed: () => any;
25
- icon_changed: () => any;
26
- position_changed: () => any;
27
- shape_changed: () => any;
28
- title_changed: () => any;
29
- visible_changed: () => any;
30
- zindex_changed: () => any;
31
20
  }, string, import("vue").PublicProps, Readonly<{
32
- options?: Omit<google.maps.MarkerOptions, "map">;
21
+ /**
22
+ * The position of the marker on the map.
23
+ * @see https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.position
24
+ */
25
+ position?: google.maps.LatLngLiteral | google.maps.LatLng;
26
+ /**
27
+ * Configuration options for the marker.
28
+ * @see https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions
29
+ */
30
+ options?: Omit<google.maps.marker.AdvancedMarkerElementOptions, "map">;
33
31
  }> & Readonly<{
34
32
  onClick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
35
- onContextmenu?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
36
- onDblclick?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
37
33
  onDrag?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
38
34
  onDragend?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
39
35
  onDragstart?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
40
- onMousedown?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
41
- onMouseout?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
42
- onMouseover?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
43
- onMouseup?: ((payload: google.maps.MapMouseEvent) => any) | undefined;
44
- onAnimation_changed?: (() => any) | undefined;
45
- onClickable_changed?: (() => any) | undefined;
46
- onCursor_changed?: (() => any) | undefined;
47
- onDraggable_changed?: (() => any) | undefined;
48
- onFlat_changed?: (() => any) | undefined;
49
- onIcon_changed?: (() => any) | undefined;
50
- onPosition_changed?: (() => any) | undefined;
51
- onShape_changed?: (() => any) | undefined;
52
- onTitle_changed?: (() => any) | undefined;
53
- onVisible_changed?: (() => any) | undefined;
54
- onZindex_changed?: (() => any) | undefined;
55
36
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
56
- default?: (props: {}) => any;
37
+ default?: () => any;
38
+ content?: () => any;
57
39
  }>;
58
40
  type __VLS_WithSlots<T, S> = T & {
59
41
  new (): {
@@ -1,4 +1,4 @@
1
- import { type InjectionKey, type ShallowRef } from 'vue';
1
+ import type { InjectionKey, ShallowRef } from 'vue';
2
2
  export interface MarkerClustererInstance {
3
3
  render: () => void;
4
4
  setMap: (map: google.maps.Map | null) => void;
@@ -12,26 +12,63 @@ export interface MarkerClustererOptions {
12
12
  renderer?: unknown;
13
13
  onClusterClick?: unknown;
14
14
  }
15
- export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<{
15
+ export interface Cluster {
16
+ marker: google.maps.marker.AdvancedMarkerElement;
17
+ markers?: google.maps.marker.AdvancedMarkerElement[];
18
+ position: google.maps.LatLng;
19
+ bounds: google.maps.LatLngBounds | undefined;
20
+ count: number;
21
+ }
22
+ export interface ClusterStats {
23
+ markers: {
24
+ sum: number;
25
+ };
26
+ clusters: {
27
+ count: number;
28
+ markers: {
29
+ min: number;
30
+ max: number;
31
+ mean: number;
32
+ sum: number;
33
+ };
34
+ };
35
+ }
36
+ export interface MarkerClustererContext {
16
37
  markerClusterer: ShallowRef<MarkerClustererInstance | undefined>;
17
38
  requestRerender: () => void;
18
- }>;
39
+ /** Increments after each clustering cycle; watch to detect cluster membership changes */
40
+ clusteringVersion: ShallowRef<number>;
41
+ }
42
+ export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<MarkerClustererContext>;
19
43
  declare const _default: typeof __VLS_export;
20
44
  export default _default;
21
45
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
46
+ /**
47
+ * Configuration options for the marker clusterer.
48
+ * @see https://googlemaps.github.io/js-markerclusterer/interfaces/MarkerClustererOptions.html
49
+ */
22
50
  options?: Omit<MarkerClustererOptions, "map">;
23
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
51
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
52
  click: (payload: MarkerClustererInstance) => any;
25
53
  clusteringbegin: (payload: MarkerClustererInstance) => any;
26
54
  clusteringend: (payload: MarkerClustererInstance) => any;
27
55
  }, string, import("vue").PublicProps, Readonly<{
56
+ /**
57
+ * Configuration options for the marker clusterer.
58
+ * @see https://googlemaps.github.io/js-markerclusterer/interfaces/MarkerClustererOptions.html
59
+ */
28
60
  options?: Omit<MarkerClustererOptions, "map">;
29
61
  }> & Readonly<{
30
62
  onClick?: ((payload: MarkerClustererInstance) => any) | undefined;
31
63
  onClusteringbegin?: ((payload: MarkerClustererInstance) => any) | undefined;
32
64
  onClusteringend?: ((payload: MarkerClustererInstance) => any) | undefined;
33
65
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
34
- default?: (props: {}) => any;
66
+ default?: () => any;
67
+ renderer?: (props: {
68
+ cluster: Cluster;
69
+ stats: ClusterStats;
70
+ map: google.maps.Map;
71
+ }) => any;
35
72
  }>;
36
73
  type __VLS_WithSlots<T, S> = T & {
37
74
  new (): {
@@ -1,11 +1,6 @@
1
- <template>
2
- <slot v-if="markerClusterer" />
3
- </template>
4
-
5
1
  <script>
6
- import { inject, onUnmounted, provide, shallowRef } from "vue";
7
- import { whenever } from "@vueuse/core";
8
- import { MAP_INJECTION_KEY } from "./ScriptGoogleMaps.vue";
2
+ import { getCurrentInstance, h, inject, onBeforeUnmount, provide, shallowRef, useSlots, render as vueRender, watch } from "vue";
3
+ import { bindGoogleMapsEvents, MAP_INJECTION_KEY, useGoogleMapsResource } from "./useGoogleMapsResource";
9
4
  export const MARKER_CLUSTERER_INJECTION_KEY = /* @__PURE__ */ Symbol("marker-clusterer");
10
5
  </script>
11
6
 
@@ -13,50 +8,101 @@ export const MARKER_CLUSTERER_INJECTION_KEY = /* @__PURE__ */ Symbol("marker-clu
13
8
  const props = defineProps({
14
9
  options: { type: Object, required: false }
15
10
  });
11
+ const emit = defineEmits(["click", "clusteringbegin", "clusteringend"]);
12
+ defineSlots();
16
13
  const markerClustererEvents = [
17
14
  "click",
18
15
  "clusteringbegin",
19
16
  "clusteringend"
20
17
  ];
21
- const emit = defineEmits([]);
18
+ const slots = useSlots();
19
+ const instance = getCurrentInstance();
22
20
  const mapContext = inject(MAP_INJECTION_KEY, void 0);
23
- const markerClusterer = shallowRef(void 0);
24
- whenever(() => mapContext?.map.value, async (map) => {
25
- const { MarkerClusterer } = await import("@googlemaps/markerclusterer");
26
- markerClusterer.value = new MarkerClusterer({
27
- map,
28
- ...props.options
29
- });
30
- setupMarkerClustererEventListeners(markerClusterer.value);
31
- }, {
32
- immediate: true,
33
- once: true
21
+ const clusteringVersion = shallowRef(0);
22
+ const renderedContainers = [];
23
+ function cleanupRenderedClusters() {
24
+ for (const container of renderedContainers) {
25
+ vueRender(null, container);
26
+ }
27
+ renderedContainers.length = 0;
28
+ }
29
+ onBeforeUnmount(cleanupRenderedClusters);
30
+ const markerClusterer = useGoogleMapsResource({
31
+ async create({ map, mapsApi }) {
32
+ const { MarkerClusterer } = await import("@googlemaps/markerclusterer");
33
+ if (slots.renderer) {
34
+ await mapsApi.importLibrary("marker");
35
+ }
36
+ const clusterer = new MarkerClusterer({
37
+ map,
38
+ ...props.options,
39
+ ...slots.renderer ? {
40
+ renderer: {
41
+ render(cluster, stats) {
42
+ const container = document.createElement("div");
43
+ const vnode = h({
44
+ render: () => slots.renderer?.({ cluster, stats, map })
45
+ });
46
+ if (instance) {
47
+ vnode.appContext = instance.appContext;
48
+ }
49
+ vueRender(vnode, container);
50
+ renderedContainers.push(container);
51
+ const marker = new mapsApi.marker.AdvancedMarkerElement({
52
+ position: cluster.position,
53
+ content: container.firstElementChild || container
54
+ });
55
+ return marker;
56
+ }
57
+ }
58
+ } : {}
59
+ });
60
+ bindGoogleMapsEvents(clusterer, emit, { withPayload: markerClustererEvents });
61
+ clusterer.addListener("clusteringbegin", () => {
62
+ cleanupRenderedClusters();
63
+ });
64
+ clusterer.addListener("clusteringend", () => {
65
+ clusteringVersion.value++;
66
+ });
67
+ return clusterer;
68
+ },
69
+ cleanup(clusterer, { mapsApi }) {
70
+ mapsApi.event.clearInstanceListeners(clusterer);
71
+ clusterer.setMap(null);
72
+ cleanupRenderedClusters();
73
+ }
34
74
  });
35
- const markerClustererNeedsRerender = shallowRef(false);
75
+ const rerenderPending = shallowRef(false);
36
76
  function requestRerender() {
37
- markerClustererNeedsRerender.value = true;
77
+ rerenderPending.value = true;
38
78
  }
39
- whenever(() => markerClustererNeedsRerender.value && markerClusterer.value, () => {
40
- markerClusterer.value.render();
41
- markerClustererNeedsRerender.value = false;
42
- });
43
- onUnmounted(() => {
44
- if (!markerClusterer.value || !mapContext?.mapsApi.value) {
45
- return;
79
+ watch(
80
+ () => rerenderPending.value && markerClusterer.value,
81
+ (ready) => {
82
+ if (!ready)
83
+ return;
84
+ if (!mapContext?.map.value?.getProjection())
85
+ return;
86
+ rerenderPending.value = false;
87
+ try {
88
+ markerClusterer.value.render();
89
+ } catch (err) {
90
+ if (import.meta.dev) {
91
+ console.error("[nuxt-scripts] MarkerClusterer render failed:", err);
92
+ }
93
+ }
46
94
  }
47
- mapContext.mapsApi.value.event.clearInstanceListeners(markerClusterer.value);
48
- markerClusterer.value.setMap(null);
49
- });
95
+ );
50
96
  provide(
51
97
  MARKER_CLUSTERER_INJECTION_KEY,
52
98
  {
53
99
  markerClusterer,
54
- requestRerender
100
+ requestRerender,
101
+ clusteringVersion
55
102
  }
56
103
  );
57
- function setupMarkerClustererEventListeners(clusterer) {
58
- markerClustererEvents.forEach((event) => {
59
- clusterer.addListener(event, () => emit(event, clusterer));
60
- });
61
- }
62
104
  </script>
105
+
106
+ <template>
107
+ <slot v-if="markerClusterer" />
108
+ </template>
@@ -1,4 +1,4 @@
1
- import { type InjectionKey, type ShallowRef } from 'vue';
1
+ import type { InjectionKey, ShallowRef } from 'vue';
2
2
  export interface MarkerClustererInstance {
3
3
  render: () => void;
4
4
  setMap: (map: google.maps.Map | null) => void;
@@ -12,26 +12,63 @@ export interface MarkerClustererOptions {
12
12
  renderer?: unknown;
13
13
  onClusterClick?: unknown;
14
14
  }
15
- export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<{
15
+ export interface Cluster {
16
+ marker: google.maps.marker.AdvancedMarkerElement;
17
+ markers?: google.maps.marker.AdvancedMarkerElement[];
18
+ position: google.maps.LatLng;
19
+ bounds: google.maps.LatLngBounds | undefined;
20
+ count: number;
21
+ }
22
+ export interface ClusterStats {
23
+ markers: {
24
+ sum: number;
25
+ };
26
+ clusters: {
27
+ count: number;
28
+ markers: {
29
+ min: number;
30
+ max: number;
31
+ mean: number;
32
+ sum: number;
33
+ };
34
+ };
35
+ }
36
+ export interface MarkerClustererContext {
16
37
  markerClusterer: ShallowRef<MarkerClustererInstance | undefined>;
17
38
  requestRerender: () => void;
18
- }>;
39
+ /** Increments after each clustering cycle; watch to detect cluster membership changes */
40
+ clusteringVersion: ShallowRef<number>;
41
+ }
42
+ export declare const MARKER_CLUSTERER_INJECTION_KEY: InjectionKey<MarkerClustererContext>;
19
43
  declare const _default: typeof __VLS_export;
20
44
  export default _default;
21
45
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
46
+ /**
47
+ * Configuration options for the marker clusterer.
48
+ * @see https://googlemaps.github.io/js-markerclusterer/interfaces/MarkerClustererOptions.html
49
+ */
22
50
  options?: Omit<MarkerClustererOptions, "map">;
23
- }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
51
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
24
52
  click: (payload: MarkerClustererInstance) => any;
25
53
  clusteringbegin: (payload: MarkerClustererInstance) => any;
26
54
  clusteringend: (payload: MarkerClustererInstance) => any;
27
55
  }, string, import("vue").PublicProps, Readonly<{
56
+ /**
57
+ * Configuration options for the marker clusterer.
58
+ * @see https://googlemaps.github.io/js-markerclusterer/interfaces/MarkerClustererOptions.html
59
+ */
28
60
  options?: Omit<MarkerClustererOptions, "map">;
29
61
  }> & Readonly<{
30
62
  onClick?: ((payload: MarkerClustererInstance) => any) | undefined;
31
63
  onClusteringbegin?: ((payload: MarkerClustererInstance) => any) | undefined;
32
64
  onClusteringend?: ((payload: MarkerClustererInstance) => any) | undefined;
33
65
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
34
- default?: (props: {}) => any;
66
+ default?: () => any;
67
+ renderer?: (props: {
68
+ cluster: Cluster;
69
+ stats: ClusterStats;
70
+ map: google.maps.Map;
71
+ }) => any;
35
72
  }>;
36
73
  type __VLS_WithSlots<T, S> = T & {
37
74
  new (): {
@@ -0,0 +1,77 @@
1
+ type OverlayAnchor = 'center' | 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right' | 'left-center' | 'right-center';
2
+ type OverlayPane = 'mapPane' | 'overlayLayer' | 'markerLayer' | 'overlayMouseTarget' | 'floatPane';
3
+ type __VLS_Props = {
4
+ /**
5
+ * Geographic position for the overlay. Falls back to parent marker position if omitted.
6
+ * @see https://developers.google.com/maps/documentation/javascript/reference/overlay-view#OverlayView
7
+ */
8
+ position?: google.maps.LatLngLiteral;
9
+ /**
10
+ * Anchor point of the overlay relative to its position.
11
+ * @default 'bottom-center'
12
+ */
13
+ anchor?: OverlayAnchor;
14
+ /**
15
+ * Pixel offset from the anchor position.
16
+ */
17
+ offset?: {
18
+ x: number;
19
+ y: number;
20
+ };
21
+ /**
22
+ * The map pane on which to render the overlay.
23
+ * @default 'floatPane'
24
+ * @see https://developers.google.com/maps/documentation/javascript/reference/overlay-view#MapPanes
25
+ */
26
+ pane?: OverlayPane;
27
+ /**
28
+ * CSS z-index for the overlay element.
29
+ */
30
+ zIndex?: number;
31
+ /**
32
+ * Whether to block map click and gesture events from passing through the overlay.
33
+ * @default true
34
+ */
35
+ blockMapInteraction?: boolean;
36
+ /**
37
+ * Pan the map so the overlay is fully visible when opened, similar to InfoWindow behavior.
38
+ * Set to `true` for default 40px padding, or a number for custom padding.
39
+ * @default true
40
+ */
41
+ panOnOpen?: boolean | number;
42
+ /**
43
+ * Automatically hide the overlay when its parent marker joins a cluster (on zoom out).
44
+ * Only applies when nested inside a ScriptGoogleMapsMarkerClusterer.
45
+ * @default true
46
+ */
47
+ hideWhenClustered?: boolean;
48
+ };
49
+ type __VLS_Slots = {
50
+ default?: () => any;
51
+ };
52
+ type __VLS_ModelProps = {
53
+ 'open'?: boolean;
54
+ };
55
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
56
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
57
+ overlay: import("vue").ShallowRef<google.maps.OverlayView | undefined>;
58
+ dataState: import("vue").ComputedRef<"open" | "closed">;
59
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
60
+ "update:open": (value: boolean) => any;
61
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
62
+ "onUpdate:open"?: ((value: boolean) => any) | undefined;
63
+ }>, {
64
+ anchor: OverlayAnchor;
65
+ pane: OverlayPane;
66
+ blockMapInteraction: boolean;
67
+ panOnOpen: boolean | number;
68
+ hideWhenClustered: boolean;
69
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
70
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
71
+ declare const _default: typeof __VLS_export;
72
+ export default _default;
73
+ type __VLS_WithSlots<T, S> = T & {
74
+ new (): {
75
+ $slots: S;
76
+ };
77
+ };
@@ -0,0 +1,223 @@
1
+ <script setup>
2
+ import { computed, inject, ref, useTemplateRef, watch } from "vue";
3
+ import { MARKER_CLUSTERER_INJECTION_KEY } from "./ScriptGoogleMapsMarkerClusterer.vue";
4
+ import { MARKER_INJECTION_KEY, useGoogleMapsResource } from "./useGoogleMapsResource";
5
+ defineOptions({
6
+ inheritAttrs: false
7
+ });
8
+ const props = defineProps({
9
+ position: { type: null, required: false },
10
+ anchor: { type: String, required: false, default: "bottom-center" },
11
+ offset: { type: Object, required: false },
12
+ pane: { type: String, required: false, default: "floatPane" },
13
+ zIndex: { type: Number, required: false },
14
+ blockMapInteraction: { type: Boolean, required: false, default: true },
15
+ panOnOpen: { type: [Boolean, Number], required: false, default: true },
16
+ hideWhenClustered: { type: Boolean, required: false, default: true }
17
+ });
18
+ defineSlots();
19
+ const open = defineModel("open", { type: Boolean, ...{ default: void 0 } });
20
+ const markerContext = inject(MARKER_INJECTION_KEY, void 0);
21
+ const markerClustererContext = inject(MARKER_CLUSTERER_INJECTION_KEY, void 0);
22
+ function getResolvedPosition() {
23
+ if (props.position)
24
+ return props.position;
25
+ if (markerContext?.advancedMarkerElement.value) {
26
+ const pos = markerContext.advancedMarkerElement.value.position;
27
+ if (pos) {
28
+ if ("lat" in pos && typeof pos.lat === "function")
29
+ return { lat: pos.lat(), lng: pos.lng() };
30
+ return pos;
31
+ }
32
+ }
33
+ return void 0;
34
+ }
35
+ const ANCHOR_TRANSFORMS = {
36
+ "center": "translate(-50%, -50%)",
37
+ "top-left": "translate(0, 0)",
38
+ "top-center": "translate(-50%, 0)",
39
+ "top-right": "translate(-100%, 0)",
40
+ "bottom-left": "translate(0, -100%)",
41
+ "bottom-center": "translate(-50%, -100%)",
42
+ "bottom-right": "translate(-100%, -100%)",
43
+ "left-center": "translate(0, -50%)",
44
+ "right-center": "translate(-100%, -50%)"
45
+ };
46
+ const overlayContent = useTemplateRef("overlay-content");
47
+ const isPositioned = ref(false);
48
+ const dataState = computed(() => isPositioned.value ? "open" : "closed");
49
+ const listeners = [];
50
+ function setDataState(el, state) {
51
+ el.dataset.state = state;
52
+ const child = el.firstElementChild;
53
+ if (child)
54
+ child.dataset.state = state;
55
+ }
56
+ function hideElement(el) {
57
+ el.style.visibility = "hidden";
58
+ el.style.pointerEvents = "none";
59
+ setDataState(el, "closed");
60
+ }
61
+ function panMapToFitOverlay(el, map, padding) {
62
+ const child = el.firstElementChild;
63
+ if (!child)
64
+ return;
65
+ const overlayRect = child.getBoundingClientRect();
66
+ const mapRect = map.getDiv().getBoundingClientRect();
67
+ let panX = 0;
68
+ let panY = 0;
69
+ if (overlayRect.top - padding < mapRect.top)
70
+ panY = overlayRect.top - mapRect.top - padding;
71
+ if (overlayRect.bottom + padding > mapRect.bottom)
72
+ panY = overlayRect.bottom - mapRect.bottom + padding;
73
+ if (overlayRect.left - padding < mapRect.left)
74
+ panX = overlayRect.left - mapRect.left - padding;
75
+ else if (overlayRect.right + padding > mapRect.right)
76
+ panX = overlayRect.right - mapRect.right + padding;
77
+ if (panX !== 0 || panY !== 0)
78
+ map.panBy(panX, panY);
79
+ }
80
+ const overlay = useGoogleMapsResource({
81
+ // ready condition accesses .value on ShallowRefs — tracked by whenever() in useGoogleMapsResource
82
+ ready: () => !!overlayContent.value && !!(props.position || markerContext?.advancedMarkerElement.value),
83
+ create({ mapsApi, map }) {
84
+ const el = overlayContent.value;
85
+ class CustomOverlay extends mapsApi.OverlayView {
86
+ onAdd() {
87
+ const panes = this.getPanes();
88
+ if (panes) {
89
+ panes[props.pane].appendChild(el);
90
+ if (props.blockMapInteraction)
91
+ mapsApi.OverlayView.preventMapHitsAndGesturesFrom(el);
92
+ }
93
+ if (props.panOnOpen) {
94
+ const padding = typeof props.panOnOpen === "number" ? props.panOnOpen : 40;
95
+ requestAnimationFrame(() => {
96
+ panMapToFitOverlay(el, map, padding);
97
+ });
98
+ }
99
+ }
100
+ draw() {
101
+ if (open.value === false) {
102
+ isPositioned.value = false;
103
+ hideElement(el);
104
+ return;
105
+ }
106
+ const position = getResolvedPosition();
107
+ if (!position) {
108
+ isPositioned.value = false;
109
+ hideElement(el);
110
+ return;
111
+ }
112
+ const projection = this.getProjection();
113
+ if (!projection) {
114
+ isPositioned.value = false;
115
+ hideElement(el);
116
+ return;
117
+ }
118
+ const pos = projection.fromLatLngToDivPixel(
119
+ new mapsApi.LatLng(position.lat, position.lng)
120
+ );
121
+ if (!pos) {
122
+ isPositioned.value = false;
123
+ hideElement(el);
124
+ return;
125
+ }
126
+ el.style.position = "absolute";
127
+ el.style.left = `${pos.x + (props.offset?.x ?? 0)}px`;
128
+ el.style.top = `${pos.y + (props.offset?.y ?? 0)}px`;
129
+ el.style.transform = ANCHOR_TRANSFORMS[props.anchor];
130
+ if (props.zIndex !== void 0)
131
+ el.style.zIndex = String(props.zIndex);
132
+ el.style.visibility = "visible";
133
+ el.style.pointerEvents = "auto";
134
+ setDataState(el, "open");
135
+ isPositioned.value = true;
136
+ }
137
+ onRemove() {
138
+ el.parentNode?.removeChild(el);
139
+ }
140
+ }
141
+ el.style.visibility = "hidden";
142
+ el.style.pointerEvents = "none";
143
+ const ov = new CustomOverlay();
144
+ ov.setMap(map);
145
+ if (markerContext?.advancedMarkerElement.value) {
146
+ const ame = markerContext.advancedMarkerElement.value;
147
+ listeners.push(
148
+ ame.addListener("drag", () => ov.draw()),
149
+ ame.addListener("dragend", () => ov.draw())
150
+ );
151
+ }
152
+ return ov;
153
+ },
154
+ cleanup(ov) {
155
+ listeners.forEach((l) => l.remove());
156
+ listeners.length = 0;
157
+ ov.setMap(null);
158
+ }
159
+ });
160
+ if (markerContext) {
161
+ watch(
162
+ () => {
163
+ const pos = markerContext.advancedMarkerElement.value?.position;
164
+ if (!pos)
165
+ return void 0;
166
+ if ("lat" in pos && typeof pos.lat === "function")
167
+ return { lat: pos.lat(), lng: pos.lng() };
168
+ return pos;
169
+ },
170
+ () => {
171
+ overlay.value?.draw();
172
+ }
173
+ );
174
+ }
175
+ watch(
176
+ () => [props.position?.lat, props.position?.lng, props.offset?.x, props.offset?.y, props.zIndex, props.anchor],
177
+ () => {
178
+ overlay.value?.draw();
179
+ }
180
+ );
181
+ watch(() => open.value, () => {
182
+ if (!overlay.value)
183
+ return;
184
+ overlay.value.draw();
185
+ });
186
+ watch([() => props.pane, () => props.blockMapInteraction], () => {
187
+ if (overlay.value) {
188
+ const map = overlay.value.getMap();
189
+ overlay.value.setMap(null);
190
+ if (map)
191
+ overlay.value.setMap(map);
192
+ }
193
+ });
194
+ if (markerClustererContext && markerContext) {
195
+ watch(
196
+ () => markerClustererContext.clusteringVersion.value,
197
+ () => {
198
+ if (!props.hideWhenClustered || open.value === false)
199
+ return;
200
+ const clusterer = markerClustererContext.markerClusterer.value;
201
+ if (!clusterer?.clusters)
202
+ return;
203
+ const parentMarker = markerContext.advancedMarkerElement.value;
204
+ if (!parentMarker)
205
+ return;
206
+ const isClustered = clusterer.clusters.some(
207
+ (cluster) => cluster.count > 1 && cluster.markers?.includes(parentMarker)
208
+ );
209
+ if (isClustered)
210
+ open.value = false;
211
+ }
212
+ );
213
+ }
214
+ defineExpose({ overlay, dataState });
215
+ </script>
216
+
217
+ <template>
218
+ <div style="display: none;">
219
+ <div ref="overlay-content" :data-state="dataState" v-bind="$attrs">
220
+ <slot />
221
+ </div>
222
+ </div>
223
+ </template>