{"version":3,"file":"js/application-be3cd82b7cdf3fdfb530.js","sources":["webpack:///webpack/bootstrap","webpack:///./app/javascript/components sync ^\\.\\/.*$","webpack:///./app/javascript/components/Bank.js","webpack:///./app/javascript/components/BankVerification.js","webpack:///./app/javascript/components/CardPin.js","webpack:///./app/javascript/components/Dashboard.js","webpack:///./app/javascript/components/ForgotPassword.js","webpack:///./app/javascript/components/IdentityVerification.js","webpack:///./app/javascript/components/Login.js","webpack:///./app/javascript/components/OrderOptions.js","webpack:///./app/javascript/components/Personal.js","webpack:///./app/javascript/components/Referral.js","webpack:///./app/javascript/components/Registration.js","webpack:///./app/javascript/components/ReviewAndSubmit.js","webpack:///./app/javascript/components/Signature.js","webpack:///./app/javascript/components/ThankYou.js","webpack:///./app/javascript/components/TripPlanning.js","webpack:///./app/javascript/components/client/Client.js","webpack:///./app/javascript/components/shared/AccountTypes.js","webpack:///./app/javascript/components/shared/ApplicationProgress.js","webpack:///./app/javascript/components/shared/CheckboxInput.js","webpack:///./app/javascript/components/shared/ErrorMessages.js","webpack:///./app/javascript/components/shared/LoadingIndicator.js","webpack:///./app/javascript/components/shared/PasswordInput.js","webpack:///./app/javascript/components/shared/SsnInput.js","webpack:///./app/javascript/components/shared/States.js","webpack:///./app/javascript/components/shared/StripeErrors.js","webpack:///./app/javascript/components/shared/StripeFieldErrors.js","webpack:///./app/javascript/components/shared/UserSummaryCharts.js","webpack:///./app/javascript/components/shared/UserSummaryStats.js","webpack:///./app/javascript/components/shared/Utilities.js","webpack:///./app/javascript/components/shared/charts/BarChart.js","webpack:///./app/javascript/components/shared/charts/LineChart.js","webpack:///./app/javascript/components/shared/charts/PieChart.js","webpack:///./app/javascript/packs/application.js","webpack:///./node_modules/@react-google-maps/api/dist/esm.js","webpack:///./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","webpack:///./node_modules/object-assign/index.js","webpack:///./node_modules/prop-types/checkPropTypes.js","webpack:///./node_modules/prop-types/factoryWithTypeCheckers.js","webpack:///./node_modules/prop-types/index.js","webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js","webpack:///./node_modules/prop-types/lib/has.js","webpack:///./node_modules/react-async-script/lib/esm/async-script-loader.js","webpack:///./node_modules/react-dom/cjs/react-dom-server.browser.development.js","webpack:///./node_modules/react-dom/cjs/react-dom.development.js","webpack:///./node_modules/react-dom/index.js","webpack:///./node_modules/react-dom/server.browser.js","webpack:///./node_modules/react-google-recaptcha/lib/esm/index.js","webpack:///./node_modules/react-google-recaptcha/lib/esm/recaptcha-wrapper.js","webpack:///./node_modules/react-google-recaptcha/lib/esm/recaptcha.js","webpack:///./node_modules/react-is/cjs/react-is.development.js","webpack:///./node_modules/react-is/index.js","webpack:///./node_modules/react-plaid-link/dist/index.umd.js","webpack:///./node_modules/react/cjs/react-jsx-runtime.development.js","webpack:///./node_modules/react/cjs/react.development.js","webpack:///./node_modules/react/index.js","webpack:///./node_modules/react/jsx-runtime.js","webpack:///./node_modules/react_ujs/react_ujs/index.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/detect.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/native.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/pjax.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/turbolinks.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/turbolinksClassic.js","webpack:///./node_modules/react_ujs/react_ujs/src/events/turbolinksClassicDeprecated.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromGlobal.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContext.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContextWithGlobalFallback.js","webpack:///./node_modules/react_ujs/react_ujs/src/getConstructor/fromRequireContextsWithGlobalFallback.js","webpack:///./node_modules/react_ujs/react_ujs/src/reactDomClient.js","webpack:///./node_modules/react_ujs/react_ujs/src/renderHelpers.js","webpack:///./node_modules/scheduler/cjs/scheduler-tracing.development.js","webpack:///./node_modules/scheduler/cjs/scheduler.development.js","webpack:///./node_modules/scheduler/index.js","webpack:///./node_modules/scheduler/tracing.js","webpack:///(webpack)/buildin/global.js"],"sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/packs/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./app/javascript/packs/application.js\");\n","var map = {\n\t\"./Bank\": \"./app/javascript/components/Bank.js\",\n\t\"./Bank.js\": \"./app/javascript/components/Bank.js\",\n\t\"./BankVerification\": \"./app/javascript/components/BankVerification.js\",\n\t\"./BankVerification.js\": \"./app/javascript/components/BankVerification.js\",\n\t\"./CardPin\": \"./app/javascript/components/CardPin.js\",\n\t\"./CardPin.js\": \"./app/javascript/components/CardPin.js\",\n\t\"./Dashboard\": \"./app/javascript/components/Dashboard.js\",\n\t\"./Dashboard.js\": \"./app/javascript/components/Dashboard.js\",\n\t\"./ForgotPassword\": \"./app/javascript/components/ForgotPassword.js\",\n\t\"./ForgotPassword.js\": \"./app/javascript/components/ForgotPassword.js\",\n\t\"./IdentityVerification\": \"./app/javascript/components/IdentityVerification.js\",\n\t\"./IdentityVerification.js\": \"./app/javascript/components/IdentityVerification.js\",\n\t\"./Login\": \"./app/javascript/components/Login.js\",\n\t\"./Login.js\": \"./app/javascript/components/Login.js\",\n\t\"./OrderOptions\": \"./app/javascript/components/OrderOptions.js\",\n\t\"./OrderOptions.js\": \"./app/javascript/components/OrderOptions.js\",\n\t\"./Personal\": \"./app/javascript/components/Personal.js\",\n\t\"./Personal.js\": \"./app/javascript/components/Personal.js\",\n\t\"./Referral\": \"./app/javascript/components/Referral.js\",\n\t\"./Referral.js\": \"./app/javascript/components/Referral.js\",\n\t\"./Registration\": \"./app/javascript/components/Registration.js\",\n\t\"./Registration.js\": \"./app/javascript/components/Registration.js\",\n\t\"./ReviewAndSubmit\": \"./app/javascript/components/ReviewAndSubmit.js\",\n\t\"./ReviewAndSubmit.js\": \"./app/javascript/components/ReviewAndSubmit.js\",\n\t\"./Signature\": \"./app/javascript/components/Signature.js\",\n\t\"./Signature.js\": \"./app/javascript/components/Signature.js\",\n\t\"./ThankYou\": \"./app/javascript/components/ThankYou.js\",\n\t\"./ThankYou.js\": \"./app/javascript/components/ThankYou.js\",\n\t\"./TripPlanning\": \"./app/javascript/components/TripPlanning.js\",\n\t\"./TripPlanning.js\": \"./app/javascript/components/TripPlanning.js\",\n\t\"./client/Client\": \"./app/javascript/components/client/Client.js\",\n\t\"./client/Client.js\": \"./app/javascript/components/client/Client.js\",\n\t\"./shared/AccountTypes\": \"./app/javascript/components/shared/AccountTypes.js\",\n\t\"./shared/AccountTypes.js\": \"./app/javascript/components/shared/AccountTypes.js\",\n\t\"./shared/ApplicationProgress\": \"./app/javascript/components/shared/ApplicationProgress.js\",\n\t\"./shared/ApplicationProgress.js\": \"./app/javascript/components/shared/ApplicationProgress.js\",\n\t\"./shared/CheckboxInput\": \"./app/javascript/components/shared/CheckboxInput.js\",\n\t\"./shared/CheckboxInput.js\": \"./app/javascript/components/shared/CheckboxInput.js\",\n\t\"./shared/ErrorMessages\": \"./app/javascript/components/shared/ErrorMessages.js\",\n\t\"./shared/ErrorMessages.js\": \"./app/javascript/components/shared/ErrorMessages.js\",\n\t\"./shared/LoadingIndicator\": \"./app/javascript/components/shared/LoadingIndicator.js\",\n\t\"./shared/LoadingIndicator.js\": \"./app/javascript/components/shared/LoadingIndicator.js\",\n\t\"./shared/PasswordInput\": \"./app/javascript/components/shared/PasswordInput.js\",\n\t\"./shared/PasswordInput.js\": \"./app/javascript/components/shared/PasswordInput.js\",\n\t\"./shared/SsnInput\": \"./app/javascript/components/shared/SsnInput.js\",\n\t\"./shared/SsnInput.js\": \"./app/javascript/components/shared/SsnInput.js\",\n\t\"./shared/States\": \"./app/javascript/components/shared/States.js\",\n\t\"./shared/States.js\": \"./app/javascript/components/shared/States.js\",\n\t\"./shared/StripeErrors\": \"./app/javascript/components/shared/StripeErrors.js\",\n\t\"./shared/StripeErrors.js\": \"./app/javascript/components/shared/StripeErrors.js\",\n\t\"./shared/StripeFieldErrors\": \"./app/javascript/components/shared/StripeFieldErrors.js\",\n\t\"./shared/StripeFieldErrors.js\": \"./app/javascript/components/shared/StripeFieldErrors.js\",\n\t\"./shared/UserSummaryCharts\": \"./app/javascript/components/shared/UserSummaryCharts.js\",\n\t\"./shared/UserSummaryCharts.js\": \"./app/javascript/components/shared/UserSummaryCharts.js\",\n\t\"./shared/UserSummaryStats\": \"./app/javascript/components/shared/UserSummaryStats.js\",\n\t\"./shared/UserSummaryStats.js\": \"./app/javascript/components/shared/UserSummaryStats.js\",\n\t\"./shared/Utilities\": \"./app/javascript/components/shared/Utilities.js\",\n\t\"./shared/Utilities.js\": \"./app/javascript/components/shared/Utilities.js\",\n\t\"./shared/charts/BarChart\": \"./app/javascript/components/shared/charts/BarChart.js\",\n\t\"./shared/charts/BarChart.js\": \"./app/javascript/components/shared/charts/BarChart.js\",\n\t\"./shared/charts/LineChart\": \"./app/javascript/components/shared/charts/LineChart.js\",\n\t\"./shared/charts/LineChart.js\": \"./app/javascript/components/shared/charts/LineChart.js\",\n\t\"./shared/charts/PieChart\": \"./app/javascript/components/shared/charts/PieChart.js\",\n\t\"./shared/charts/PieChart.js\": \"./app/javascript/components/shared/charts/PieChart.js\"\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = \"./app/javascript/components sync recursive ^\\\\.\\\\/.*$\";","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport StripeErrors from \"./shared/StripeErrors\";\nimport StripeFieldErrors from \"./shared/StripeFieldErrors\";\n\nimport { renderLabel } from \"./shared/Utilities\";\nimport { accountTypes } from \"./shared/AccountTypes\";\n\nexport default function Bank() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n const [stripeErrors, setStripeErrors] = useState([]);\n\n const [bankName, setBankName] = useState();\n const [bankRoutingNumber, setBankRoutingNumber] = useState();\n const [bankAccountNumber, setBankAccountNumber] = useState();\n const [accountType, setAccountType] = useState(null);\n\n const [accountHolderName, setAccountHolderName] = useState(null);\n const [accountHolderType, setAccountHolderType] = useState(null);\n\n const [stripePk, setStripePk] = useState(null);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/bank\");\n \n setBankName(response.result?.bank_account?.bank_name)\n setBankRoutingNumber(response.result?.bank_account?.bank_routing_number)\n setBankAccountNumber(response.result?.bank_account?.bank_account_number)\n setAccountType(response.result?.bank_account?.account_type)\n setStripePk(response.result?.stripe_pk);\n\n setAccountHolderName(`${response.result?.fuel_program_application.first_name} ${response.result?.fuel_program_application.last_name}`);\n setAccountHolderType('individual');\n\n setBusy(false);\n }\n\n const save = async () => {\n setSaveBusy(true);\n\n setErrorMessages([]);\n setStripeErrors([]);\n\n const stripe = Stripe(stripePk);\n\n const stripeResult = await stripe.createToken('bank_account', {\n country: 'US',\n currency: 'usd',\n routing_number: bankRoutingNumber || '0',\n account_number: bankAccountNumber || '0',\n account_holder_name: accountHolderName,\n account_holder_type: accountHolderType\n });\n\n if (stripeResult.error) {\n setStripeErrors([stripeResult.error]);\n } else {\n const request = {\n bank_account: {\n bank_name: bankName || '',\n bank_routing_number: bankRoutingNumber || '',\n bank_account_number: bankAccountNumber || '',\n account_type: accountType || '',\n stripe_token_id: stripeResult.token.id\n }\n };\n \n const response = await client.postData(\"/user-portal/fpa/bank\", request);\n\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n }\n\n setSaveBusy(false);\n }\n\n return (\n
\n <>\n \n

Bank

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n \n
\n
\n
\n setBankName(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Bank Name', bankName, 'bank-name')}\n
\n
\n
\n
\n \n \n
\n
\n
\n\n
\n
\n
\n setBankRoutingNumber(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Bank Routing Number', bankRoutingNumber, 'bank-routing-number')}\n \n
\n
\n
\n
\n setBankAccountNumber(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Bank Account Number', bankAccountNumber, 'bank-account-number')}\n \n
\n
\n
\n\n \n\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState, useCallback } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { renderSimpleLabel } from \"./shared/Utilities\";\nimport { accountTypeDisplay } from \"./shared/Utilities\";\nimport { usePlaidLink, PlaidLinkOnSuccess } from 'react-plaid-link';\n\n// https://github.com/plaid/react-plaid-link\n// https://github.com/plaid/react-plaid-link/blob/master/examples/simple.tsx\n\nexport const GOOD_RESULT = 'Success';\nexport const BAD_RESULT = 'Bad';\n\nexport const VERIFICATION_STATUS_UNVERIFIED = 'Unverified'\nexport const VERIFICATION_STATUS_PENDING_DEPOSIT = 'Pending Deposit Verification'\nexport const VERIFICATION_STATUS_VERIFIED = 'Verified'\nexport const VERIFICATION_STATUS_REJECTED = 'Rejected'\n\nexport const VERIFICATION_METHOD_ACH_DEPOSIT = \"ACH Deposit\"\nexport const VERIFICATION_METHOD_PLAID_INSTANT = \"Plaid (Instant)\"\nexport const VERIFICATION_METHOD_MANUAL = \"Manual\"\n\nexport default function BankVerification() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n const [achVerificationErrorMessages, setAchVerificationErrorMessages] = useState([]);\n \n const [linkToken, setLinkToken] = useState(null);\n const [publicToken, setPublicToken] = useState(null);\n\n const [achDeposit1, setAchDeposit1] = useState(null);\n const [achDeposit2, setAchDeposit2] = useState(null);\n\n const [bankName, setBankName] = useState(null);\n const [accountType, setAccountType] = useState(null);\n\n const [verificationMethod, setVerificationMethod] = useState(null);\n const [verificationStatus, setVerificationStatus] = useState(null);\n const [verifiedAt, setVerifiedAt] = useState(null);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/bank-verification\");\n\n setBankName(response.result?.bank_account?.bank_name);\n setAccountType(response.result?.bank_account.account_type || 'C');\n\n setVerificationMethod(response.result?.bank_account.verification_method);\n setVerificationStatus(response.result?.bank_account.verification_status);\n setVerifiedAt(response.result?.bank_account.verified_at);\n\n setBusy(false);\n }\n \n const { open, ready } = usePlaidLink({\n token: linkToken,\n onSuccess: async (publicToken, metadata) => {\n setPublicToken(publicToken);\n },\n onEvent: null,\n onExit: () => {\n // Do nothing\n }\n });\n\n useEffect(() => {\n if (ready) {\n open();\n }\n }, [ready, open]);\n\n useEffect(async () => {\n if (publicToken) {\n setSaveBusy(true);\n\n const request = {\n bank_account: {\n plaid_token: publicToken\n }\n };\n const response = await client.postData('/user-portal/fpa/verify-bank-account-on-file', request);\n \n if (response.result?.user_bank_account_valid) {\n setVerificationStatus(VERIFICATION_STATUS_VERIFIED);\n } else {\n setVerificationStatus(VERIFICATION_STATUS_REJECTED);\n }\n\n setSaveBusy(false);\n }\n }, [publicToken]);\n\n const handleStartInstantVerification = async () => {\n setSaveBusy(true);\n const response = await client.postData(\"/user-portal/fpa/create-link-token\");\n setVerificationMethod(VERIFICATION_METHOD_PLAID_INSTANT);\n setLinkToken(response.result?.link_token);\n setSaveBusy(false);\n }\n\n const handleStartAchDepositVerification = async () => {\n setSaveBusy(true);\n\n const request = {};\n const response = await client.postData(\"/user-portal/fpa/initiate-ach-deposit-verification\", request);\n\n setVerificationMethod(VERIFICATION_METHOD_ACH_DEPOSIT);\n if (response.status === client.Error) {\n setVerificationStatus(VERIFICATION_STATUS_REJECTED);\n } else {\n setVerificationStatus(VERIFICATION_STATUS_PENDING_DEPOSIT); \n }\n\n setSaveBusy(false);\n }\n\n const handleStartManualVerification = async () => {\n setSaveBusy(true);\n\n const request = {};\n const response = await client.postData(\"/user-portal/fpa/initiate-manual-verification\", request);\n\n setVerificationMethod(VERIFICATION_METHOD_MANUAL);\n if (response.status === client.Error) {\n setVerificationStatus(VERIFICATION_STATUS_REJECTED);\n } else {\n setVerificationStatus(VERIFICATION_STATUS_PENDING_DEPOSIT); \n }\n\n setSaveBusy(false);\n }\n\n const handleVerifyDepositAmounts = async () => {\n setSaveBusy(true);\n setAchVerificationErrorMessages([]);\n\n const request = {\n bank_account: {\n deposit_amount_1: achDeposit1,\n deposit_amount_2: achDeposit2\n }\n };\n const response = await client.postData(\"/user-portal/fpa/verify-ach-deposit-amounts\", request);\n\n if (response.status === client.Error) {\n setAchVerificationErrorMessages(response.error_messages);\n } else {\n if (response.result?.bank_account.verification_status === VERIFICATION_STATUS_VERIFIED) {\n setVerificationStatus(VERIFICATION_STATUS_VERIFIED);\n } else {\n if (response.result?.bank_account.stripe_verification_attempts >= 3) {\n setVerificationStatus(VERIFICATION_STATUS_REJECTED);\n } else {\n setAchVerificationErrorMessages([`Incorrect verification values! Only ${3-response.result?.bank_account.stripe_verification_attempts} self-verification attempt(s) remaining. If you believe you are entering the correct values, please call us at: 800-275-5089 so we may assist you in verifying your account.`]);\n }\n }\n }\n\n setSaveBusy(false);\n }\n\n const save = () => {\n window.location.href = '/user-portal/fpa/review-and-submit'\n }\n\n const renderManualVerificationFailure = () => {\n return (\n
\n
\n

Well, shucks!

\n

Bank verification could not be complete manually.

\n

Please call us at: 800-275-5089 so we may further assist you in verifying your account.

\n
\n
\n );\n }\n\n const renderManualVerification = () => {\n return (\n <>\n
\n
\n

We got this!

\n \n

\n We will manually review the information you have provided and attempt to verify your bank information with a $0.01 ACH deposit by one of our customer service staff [1].\n

\n

\n If we need something, we'll followup by calling or emailing you. If everything looks good we'll auto approve your application. In the mean time, sit tight and enjoy the top-notch customer service.\n

\n
\n

\n [1] Once verified, we will charge a one-time $20 fee for manual verification.\n

\n
\n
\n \n )\n }\n\n\n\n const renderAchDepositVerificationSuccess = () => {\n return (\n <>\n
\n
\n

Right On!

\n \n

Bank verification was successful

\n

Now that your bank has been verified, you can continue and submit your application

\n
\n
\n
\n
\n \n
\n
\n \n );\n }\n\n const renderAchDepositVerificationFailure = () => {\n return (\n
\n
\n

Oh no!

\n

Bank verification with ACH-Deposit could not be completed

\n

We could not verify your account with the depoit amounts you provided

\n

Please call us at: 800-275-5089 so we may assist you in verifying your account.

\n
\n
\n );\n }\n\n const renderPlaidInstantVerificationSuccess = () => {\n return (\n <>\n
\n
\n

Right On!

\n \n

Bank verification was successful

\n

Now that your bank has been verified, you can continue and submit your application

\n
\n
\n
\n
\n \n
\n
\n \n );\n }\n\n const renderPlaidInstantVerificationFailure = () => {\n return (\n
\n
\n

Oh no!

\n

Bank verification could not be completed

\n

The banking institution you chose did not have an account number that matches your Routing/Account numbers from the previous page.

\n

Go back to the 'Bank' page and verify your account numbers, then try your instant verifiation again.

\n

If you don't have access to your bank through Plaid, you can always use the ACH-Deposit verification process.

\n
\n
\n );\n }\n\n const renderVerificationChoices = () => {\n return (\n <>\n

\n We need to verify your bank account information. To do this, we have partnered with 3rd party bank verification providers. Choose from either instant verification or ACH-deposit verification using verifiable and small deposit amounts.\n

\n\n\n
\n
\n Bank Name: {bankName}\n
\n
\n Account Type: {accountTypeDisplay(accountType)}\n
\n
\n  \n
\n
\n\n
\n
\n
\n

Instantly Verify with Plaid

\n

\n Is your bank a large, well known financial institution? If so, you might be able to verify your account by logging into your account and authorizing an identity verification.\n

\n
\n \n
\n
\n
\n\n
\n
\n

Verify with Stripe ACH-Deposits

\n

\n If your bank isn't supported by Plaid, we can verify your bank information using automatic small ACH deposits, which you will then self-verify. This process takes 1-3 business days to complete.\n

\n
\n \n
\n
\n
\n\n
\n
\n

Verify Manually

\n

\n If you need some help verifying your bank, we can charge you a $20 service fee to manually verify your banking information.\n This will entail us making an ACH penny deposit. This process may take up to 10 business days.\n

\n
\n \n
\n
\n
\n\n
\n \n );\n }\n\n const renderStripeAchDepositVerification = () => {\n return (\n <>\n
\n
\n

Cha-ching!

\n \n

\n We sent two small deposits to the bank account you listed. It may take 1-2 business days for the deposit to complete. If you know the deposit amounts, please enter them in the fields below (in no particular order).\n

\n

\n You can exit this application now and come back to continue after the deposits have been made.\n

\n\n \n
\n
\n\n
\n
\n
\n setAchDeposit1(e.target.value)} type=\"number\" step=\"0.01\" min=\"0.01\" max=\"0.99\" className=\"form-control\" aria-disabled=\"false\" placeholder=\"Ex: 0.17\" />\n {renderSimpleLabel('Ach Deposit 1')}\n
\n
\n
\n
\n setAchDeposit2(e.target.value)} type=\"number\" step=\"0.01\" min=\"0.01\" max=\"0.99\" className=\"form-control\" aria-disabled=\"false\" placeholder=\"Ex: 0.23\" />\n {renderSimpleLabel('Ach Deposit 2')}\n
\n
\n
\n\n
\n
\n \n
\n
\n \n )\n }\n\n const renderUIState = () => {\n if (verificationMethod === VERIFICATION_METHOD_PLAID_INSTANT) {\n if (verificationStatus === VERIFICATION_STATUS_VERIFIED) {\n return renderPlaidInstantVerificationSuccess();\n } else if (verificationStatus === VERIFICATION_STATUS_REJECTED ){\n return renderPlaidInstantVerificationFailure();\n } else {\n return renderVerificationChoices();\n }\n } else if (verificationMethod === VERIFICATION_METHOD_ACH_DEPOSIT) {\n if (verificationStatus === VERIFICATION_STATUS_VERIFIED) {\n return renderAchDepositVerificationSuccess();\n } else if (verificationStatus === VERIFICATION_STATUS_REJECTED) {\n return renderAchDepositVerificationFailure();\n } else if (verificationStatus === VERIFICATION_STATUS_PENDING_DEPOSIT) {\n return renderStripeAchDepositVerification();\n } else {\n return renderVerificationChoices();\n }\n } else if (verificationMethod === VERIFICATION_METHOD_MANUAL) {\n if (verificationStatus === VERIFICATION_STATUS_REJECTED) {\n return renderManualVerificationFailure();\n } else if (verificationStatus === VERIFICATION_STATUS_PENDING_DEPOSIT) {\n return renderManualVerification();\n }\n } else {\n return renderVerificationChoices();\n }\n }\n\n return (\n
\n <>\n \n

Bank Verification

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n {renderUIState()}\n \n )}\n
\n \n
\n );\n}\n\n\n\n///\n\n// NEEDS TO ADD \n\n// Try another method Option when in rejected state\n\n///\n///","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { accountTypeDisplay } from \"./shared/Utilities\";\n\nimport { renderLabel } from \"./shared/Utilities\";\n\nexport default function CardPin() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n const [cardPin, setCardPin] = useState();\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/card-pin\");\n\n // Don't do this, we don't want to have the pin on the data-stream\n // setCardPin(response.result?.card_pin);\n\n setBusy(false);\n }\n\n const save = async () => {\n setSaveBusy(true);\n\n const request = {\n fuel_program_application: {\n card_pin: cardPin\n }\n };\n\n const response = await client.postData(\"/user-portal/fpa/card-pin\", request);\n\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setSaveBusy(false);\n }\n\n return (\n
\n <>\n \n

Card Pin

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n\n

\n Please specify a 4-digit secure pin to use when fueling with your card.\n

\n\n
\n
\n
\n setCardPin(e.target.value)} type=\"password\" className=\"form-control\" aria-disabled=\"false\" max={4} maxLength={4} />\n {renderLabel('Choose a pin number for your card', cardPin, 'card-pin')}\n
\n
\n
\n\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport { VERIFICATION_STATUS_PENDING_DEPOSIT } from \"./BankVerification\";\nimport UserSummaryCharts from \"./shared/UserSummaryCharts\";\nimport UserSummaryStats from \"./shared/UserSummaryStats\";\n\nexport default function Dashboard() {\n const [busy, setBusy] = useState(true);\n\n const [hasCompletedApplication, setHasCompletedApplication] = useState(false);\n const [applicationInProgress, setApplicationInProgress] = useState(false);\n const [needsSignature, setNeedsSignature] = useState(false);\n \n const [bankAccountVerificationStatus, setBankAccountVerificationStatus] = useState(false);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/dashboard\");\n\n setHasCompletedApplication(response.result.has_completed_application);\n setApplicationInProgress(response.result.application_in_progress);\n setBankAccountVerificationStatus(response.result.bank_account?.verification_status); \n setNeedsSignature(response.result.needs_signature);\n\n setBusy(false);\n }\n \n const handleApplicationClick = async () => {\n window.location = '/user-portal/fpa/personal';\n }\n\n const handleVerificationClick = async () => {\n window.location = '/user-portal/fpa/bank-verification';\n }\n\n const handleSignatureClick = async () => {\n window.location = '/user-portal/signature-requests';\n }\n\n const startOrResumeButton = () => {\n if (applicationInProgress) {\n if (bankAccountVerificationStatus === VERIFICATION_STATUS_PENDING_DEPOSIT) {\n return (\n \n );\n } else {\n return (\n \n );\n }\n } else {\n return (\n \n );\n }\n }\n\n const renderNothingToDo = () => {\n return (\n <>\n
\n
\n

Welp, nothing to do.

\n \n

\n With no applications to fill out, or bank agreements to update, its pretty dull in here right now. Ho hum.\n

\n
\n Keep an eye out for email announcements and check back later!\n
\n
\n
\n \n );\n }\n\n return (\n
\n <>\n{/* \n
\n
\n
\n \n
\n
\n \n
\n */}\n

Dashboard

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n
\n { !hasCompletedApplication && (\n
\n
\n

{applicationInProgress ? 'Resume' : 'Start'} your application

\n

\n Apply to join the TSD Open Roads RV fuel discount program and enjoy discounts on diesel fuel throughout the continental United States of America.\n

\n
\n {startOrResumeButton()}\n
\n
\n
\n )}\n \n { needsSignature && (\n
\n
\n

Sign updated agreements

\n

\n You have outstanding banking agreements that need signatures in order for your account to remain in good standing\n

\n
\n \n
\n
\n
\n )}\n
\n\n { hasCompletedApplication && !needsSignature && renderNothingToDo() }\n \n )}\n
\n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport client from \"./client/Client\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport PasswordInput from \"./shared/PasswordInput\";\n\nimport { renderLabel } from \"./shared/Utilities\";\n\nconst MODE_SEND_CODE = 'Send Code';\nconst MODE_ENTER_CODE = 'Enter Code';\nconst MODE_CHANGE_PASSWORD = 'Change Password';\n\nexport default function ForgotPassword() {\n const [busy, setBusy] = useState(false);\n\n const [mode, setMode] = useState(MODE_SEND_CODE);\n\n const [email, setEmail] = useState('');\n \n const [verificationCode, setVerificationCode] = useState();\n const [passwordChangeToken, setPasswordChangeToken] = useState();\n\n const [newPassword, setNewPassword] = useState();\n const [newPasswordConfirm, setNewPasswordConfirm] = useState();\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const handleGeneratePasswordResetCodeClick = async () => {\n setBusy(true);\n setErrorMessages([]);\n\n const response = await client.postData(\"/user-portal/generate-password-reset-code\", {\n email: email\n });\n\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n } else {\n setMode(MODE_ENTER_CODE);\n }\n\n setBusy(false);\n }\n\n const handleVerifyPasswordResetCode = async () => {\n setBusy(true);\n setErrorMessages([]);\n\n const response = await client.postData(\"/user-portal/verify-password-reset-code\", {\n email: email,\n password_reset_code: verificationCode\n });\n \n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n } else {\n setPasswordChangeToken(response.result?.password_change_token);\n setMode(MODE_CHANGE_PASSWORD);\n }\n\n setBusy(false);\n }\n\n const handleChangePassword = async () => {\n setBusy(true);\n setErrorMessages([]);\n\n const response = await client.postData(\"/user-portal/change-password\", {\n email: email,\n password_change_token: passwordChangeToken,\n password: newPassword,\n password_confirmation: newPasswordConfirm\n });\n \n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setBusy(false);\n }\n\n const onFormSubmitSendCode = (e) => {\n e.preventDefault();\n handleGeneratePasswordResetCodeClick();\n }\n\n const onFormSubmitEnterCode = (e) => {\n e.preventDefault();\n handleVerifyPasswordResetCode();\n }\n\n const onFormSubmitChangePassword = () => {\n e.preventDefault();\n handleChangePassword();\n }\n\n return (\n
\n
\n
\n\n \n\n { mode === MODE_SEND_CODE && (\n
\n
\n
\n \n

\n Enter your email and we will send a password reset code if the email corresponds to an existing account.\n

\n
\n\n
\n
\n \n setEmail(e.target.value)} className=\"form-control\"/>\n {renderLabel('Your email', email, 'email')}\n
\n
\n \n
\n
\n
\n {/*
\n
\n

\n Remember your password?  \n Login\n

\n
\n
*/}\n
\n )}\n\n { mode === MODE_ENTER_CODE && (\n
\n
\n
\n \n

\n Enter the verification code we sent you.\n

\n
\n\n
\n
\n \n setVerificationCode(e.target.value)} className=\"form-control\"/>\n {renderLabel('Verification Code', verificationCode, 'verification-code')}\n
\n
\n \n
\n
\n
\n
\n )}\n\n { mode === MODE_CHANGE_PASSWORD && (\n
\n
\n
\n \n

\n Enter a new password and password confirmation\n

\n
\n\n
\n
\n \n setNewPassword(val)} id='new-password' />\n {renderLabel('New Password', newPassword, 'new-password')}\n
\n
\n \n setNewPasswordConfirm(val)} id='new-password-confirm' />\n {renderLabel('Confirm Password', newPasswordConfirm, 'new-password-confirm')}\n
\n\n
\n \n
\n
\n
\n
\n )}\n\n
\n
\n
\n );\n}\n","import React, { useEffect, useState, useCallback } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { renderSimpleLabel } from \"./shared/Utilities\";\nimport { accountTypeDisplay } from \"./shared/Utilities\";\nimport { usePlaidLink } from 'react-plaid-link';\n\n// https://github.com/plaid/react-plaid-link\n// https://github.com/plaid/react-plaid-link/blob/master/examples/simple.tsx\n\nconst PLAID_IDENTITY_VERIFICATION_STATUS_PASS_SESSION = 'IDENTITY_VERIFICATION_PASS_SESSION';\nconst PLAID_IDENTITY_VERIFICATION_STATUS_FAIL_SESSION = 'IDENTITY_VERIFICATION_FAIL_SESSION';\n\nexport default function IdentityVerification() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n \n const [linkToken, setLinkToken] = useState(null);\n const [identityVerificationStatus, setIdentityVerificationStatus] = useState(null);\n const [identityVerificationStatusAt, setIdentityVerificationStatusAt] = useState(null);\n const [nextUrl, setNextUrl] = useState(null);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/identity-verification\");\n\n setIdentityVerificationStatus(response.result?.fuel_program_application.plaid_verification_status);\n setIdentityVerificationStatusAt(response.result?.fuel_program_application.plaid_verification_status_at);\n setNextUrl(response.result?.next_url)\n\n setBusy(false);\n }\n \n const { open, ready } = usePlaidLink({\n token: linkToken,\n onSuccess: async (publicToken, metadata) => {\n // Do nothing\n },\n onEvent: async (event, metadata) => {\n if (event == PLAID_IDENTITY_VERIFICATION_STATUS_PASS_SESSION || event == PLAID_IDENTITY_VERIFICATION_STATUS_FAIL_SESSION) {\n setBusy(true);\n\n setIdentityVerificationStatus(event);\n const request = {\n fuel_program_application: {\n plaid_verification_status: event,\n plaid_verification_metadata: JSON.stringify(metadata)\n }\n };\n const response = await client.postData('/user-portal/fpa/identity-verification', request);\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setBusy(false);\n }\n },\n onExit: (event, metadata) => {\n // Do nothing\n }\n });\n\n useEffect(() => {\n if (ready) {\n open();\n }\n }, [ready, open]);\n\n const handleStartInstantVerification = async () => {\n setSaveBusy(true);\n const response = await client.postData(\"/user-portal/fpa/create-identity-verification-link-token\");\n setLinkToken(response.result?.link_token);\n setSaveBusy(false);\n }\n\n const next = () => {\n window.location.href = nextUrl;\n }\n\n const renderPlaidInstantVerificationSuccess = () => {\n return (\n <>\n
\n
\n

Now We're Talking!

\n \n

Identity verification was successful

\n

Now that your identity has been verified, you can continue your application.

\n
\n
\n
\n
\n \n
\n
\n \n );\n }\n\n const renderPlaidInstantVerificationFailure = () => {\n return (\n
\n
\n

Oh no!

\n

Identity verification could not be completed.

\n

\n Please contact customer service at 1-800-275-5089 to assist with the approval process.\n

\n

\n Customer Service Hours\n

\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
Mon08:00 am – 05:00 pm
Tue08:00 am – 05:00 pm
Wed08:00 am – 05:00 pm
Thu08:00 am – 05:00 pm
Fri08:00 am – 05:00 pm
Sat08:00 am – 04:00 pm
Sun08:00 am – 04:00 pm
\n
\n\n
\n
\n \n
\n
\n
\n
\n );\n }\n\n return (\n
\n <>\n \n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n
\n \n\n {identityVerificationStatus ? (\n <>\n {identityVerificationStatus == PLAID_IDENTITY_VERIFICATION_STATUS_FAIL_SESSION ? renderPlaidInstantVerificationFailure() : renderPlaidInstantVerificationSuccess()}\n \n ) : (\n
\n
\n

Third Party Identity Verification

\n

Due to increased security requirements from our financial institutions, we will need to verify
your identity using information such as: phone number, home address, and a photo identity card.

\n\n
\n
\n \n
\n
\n
\n
\n )}\n
\n )}\n
\n \n
\n );\n}\n","import React, { useState, useRef } from \"react\";\nimport client from \"./client/Client\";\nimport { renderLabel } from \"./shared/Utilities\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport PasswordInput from \"./shared/PasswordInput\";\nimport ReCAPTCHA from 'react-google-recaptcha';\n\nexport default function Login(props) {\n const recaptchaRef = useRef(null);\n\n const [busy, setBusy] = useState(false);\n\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n\n const [recaptchaToken, setRecaptchaToken] = useState(null);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const handleLoginClick = async () => {\n if (!recaptchaToken) {\n alert('Please complete the reCAPTCHA');\n return;\n }\n\n // Handle login with the recaptcha token\n console.log(\"Submit login form with reCAPTCHA token:\", recaptchaToken);\n\n const response = await client.postData(\"/user-portal/login\", {\n username: username,\n password: password,\n recaptcha_token: recaptchaToken\n });\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n resetRecaptcha();\n }\n\n setBusy(false)\n }\n\n const resetRecaptcha = () => {\n if (recaptchaRef.current) {\n recaptchaRef.current.reset();\n }\n setRecaptchaToken(null); // Reset the captcha value\n };\n\n const onFormSubmit = (e) => {\n e.preventDefault();\n handleLoginClick();\n }\n\n const onRecaptchaChange = (token) => {\n setRecaptchaToken(token);\n };\n\n return (\n
\n
\n
\n
\n
\n
\n \n {/*

\n Login\n

*/}\n
\n
\n\n \n\n
\n
\n \n setUsername(e.target.value)} className=\"form-control\"/>\n {renderLabel('Your email', username, 'username')}\n
\n
\n \n setPassword(val)} id='password' />\n {renderLabel('Your password', password, 'password')}\n
\n \n \n\n
\n \n
\n \n
\n
\n
\n

\n Need to create an account?  \n Sign Up\n

\n

\n Forgot your password?  \n Forgot Password\n

\n
\n
\n
\n
\n
\n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { accountTypes } from \"./shared/AccountTypes\";\n\nconst FASTEST = 'FASTEST';\nconst FAST = 'FAST';\nconst SLOW = 'SLOW';\n\nexport default function OrderOptions() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [deliveryOption, setDeliveryOption] = useState(SLOW);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/order-options\");\n \n if (response.result?.fuel_program_application.expedited_shipping === 'Y') {\n setDeliveryOption(FASTEST);\n } else if (response.result?.fuel_program_application.expedited_processing === 'Y') {\n setDeliveryOption(FAST);\n } else {\n setDeliveryOption(SLOW);\n }\n\n setBusy(false);\n }\n\n const save = async () => {\n setSaveBusy(true);\n\n const request = {\n fuel_program_application: {\n expedited_shipping: deliveryOption === FASTEST ? 'Y' : 'N',\n expedited_processing: (deliveryOption === FAST || deliveryOption === FASTEST) ? 'Y' : 'N'\n }\n };\n\n const response = await client.postData(\"/user-portal/fpa/order-options\", request);\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setSaveBusy(false);\n }\n\n return (\n
\n <>\n \n

Order Info

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n\n
\n
\n
\n Do you want to expedite the delivery of your fuel card?\n
\n
\n
\n\n
\n
\n
\n
\n setDeliveryOption(FASTEST)} />\n  Yes - Fastest option\n
    \n
  • 48-hour processing
  • \n
  • Overnight shipping
  • \n
    \n US - A one-time charge of $75 USD
    \n Canada - A one-time charge of $120 USD\n
    \n
\n
\n
\n setDeliveryOption(FAST)} />\n  Yes\n
    \n
  • 48-hour processing
  • \n
    \n A one-time charge charge of $20 USD\n
    \n
\n
\n
\n setDeliveryOption(SLOW)} />\n  No\n
\n
\n
\n
\n\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport SsnInput from \"./shared/SsnInput\";\n\nimport { renderLabel } from \"./shared/Utilities\";\nimport { states } from \"./shared/States\";\n\nexport default function Personal() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [firstName, setFirstName] = useState();\n const [lastName, setLastName] = useState();\n const [email, setEmail] = useState();\n const [phone, setPhone] = useState();\n\n const [address1, setAddress1] = useState();\n const [address2, setAddress2] = useState();\n const [city, setCity] = useState();\n const [state, setState] = useState();\n const [zipcode, setZipcode] = useState();\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/personal\");\n \n setFirstName(response.result?.fuel_program_application.first_name || '')\n setLastName(response.result?.fuel_program_application.last_name || '')\n setEmail(response.result?.fuel_program_application.email || '')\n setPhone(response.result?.fuel_program_application.phone || '')\n setAddress1(response.result?.fuel_program_application.address1 || '')\n setAddress2(response.result?.fuel_program_application.address2 || '')\n setCity(response.result?.fuel_program_application.city || '')\n setState(response.result?.fuel_program_application.state || '')\n setZipcode(response.result?.fuel_program_application.zipcode || '')\n\n setBusy(false);\n }\n\n const save = async () => {\n setSaveBusy(true);\n\n const request = {\n fuel_program_application: {\n first_name: firstName || null, // Null is at least defined and will include the empty attribute\n last_name: lastName || null,\n email: email || null,\n phone: phone || null,\n address1: address1 || null,\n address2: address2 || null,\n city: city || null,\n state: state || null,\n zipcode: zipcode || null\n }\n };\n const response = await client.postData(\"/user-portal/fpa/personal\", request);\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setSaveBusy(false);\n }\n\n return (\n
\n <>\n \n

Personal

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n \n
\n
\n
\n setFirstName(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('First Name', firstName, 'first-name')}\n
\n
\n
\n
\n setLastName(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Last Name', lastName, 'last-name')}\n
\n
\n
\n\n
\n
\n
\n setPhone(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Phone', phone, 'phone')}\n
\n
\n
\n
\n setEmail(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" readOnly />\n {renderLabel('Email', email, 'email')}\n
\n
\n
\n\n
\n
\n
\n setAddress1(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Address', address1, 'address1')}\n
\n
\n
\n
\n setAddress2(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Address Line 2', address2, 'address2')}\n
\n
\n
\n\n
\n
\n
\n setCity(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('City', city, 'city')}\n
\n
\n
\n
\n \n \n
\n
\n
\n\n
\n
\n
\n setZipcode(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Zip', zipcode, 'zip')}\n
\n
\n
\n\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\n\nimport { renderLabel } from \"./shared/Utilities\";\n\nexport default function Referral() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [referredBySomeone, setReferredBySomeone] = useState(false);\n const [permanentlyReferredBy, setPermanentlyReferredBy] = useState(false);\n\n const [defaultBrandWelcomeMessage, setDefaultBrandWelcomeMessage] = useState('');\n\n const [referrerName, setReferrerName] = useState('');\n const [referrerAccountId, setReferrerAccountId] = useState();\n \n const [referrers, setReferrers] = useState();\n\n useEffect(() => {\n initialize();\n }, [])\n\n useEffect(() => {\n if (referrers) {\n const referrer = referrers.find((r) => r.id === referrerAccountId);\n setReferrerName(referrer?.brand_referral_code);\n }\n }, [referrerAccountId])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/referral\");\n \n setReferrerName(response.result?.fuel_program_application.referred_by || '');\n setReferrerAccountId(response.result?.fuel_program_application.referrer_account_id);\n\n setReferredBySomeone(!!response.result?.fuel_program_application.referred_by);\n setPermanentlyReferredBy(response.result?.permanently_referred_by);\n\n setDefaultBrandWelcomeMessage(response.result?.default_brand_welcome_message);\n\n setReferrers(response.result?.referrer_accounts);\n\n setBusy(false);\n }\n\n const save = async () => {\n setSaveBusy(true);\n\n const request = {\n fuel_program_application: {\n referred_by: referrerName || '',\n referrer_account_id: referrerAccountId || ''\n }\n };\n\n const response = await client.postData(\"/user-portal/fpa/referral\", request);\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setSaveBusy(false);\n }\n\n const handleReferredByChanged = (e) => {\n setReferrerName(e.target.value);\n setReferrerAccountId(null);\n }\n\n const handleReferredBySomeoneSelected = (selected) => {\n setReferredBySomeone(selected);\n\n if (!selected) {\n setReferrerName(null);\n setReferrerAccountId(null);\n }\n }\n\n return (\n
\n <>\n \n

Referral Info

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n\n {permanentlyReferredBy ? (\n
\n
\n \n
\n
\n
\n {permanentlyReferredBy.brand_name}\n
\n
\n {permanentlyReferredBy.brand_welcome_message ? permanentlyReferredBy.brand_welcome_message : defaultBrandWelcomeMessage}\n
\n {permanentlyReferredBy.brand_welcome_video_embed_code && (\n
\n )}\n
\n
\n ) : (\n <>\n
\n
\n
\n Were you referred by someone?\n
\n
\n
\n handleReferredBySomeoneSelected(true)} /> Yes\n
\n
\n handleReferredBySomeoneSelected(false)} /> No\n
\n
\n
\n
\n\n {referredBySomeone && (\n <>\n
\n
\n
\n \n {renderLabel('Who were you refered by?', referrerName, 'referrer-name')}\n

\n Enter a name of your referrer, or select from popular referrers on the right.\n

\n

\n Help us identify the people responsible for growing our program, and recongnise their contribution.\n

\n
\n
\n\n
\n \n \n {referrers.map((referrer, index) => (\n \n \n \n \n \n ))}\n \n
\n setReferrerAccountId(referrer.id)} />\n \n  \n \n {referrer.brand_name}\n
\n
\n
\n \n )}\n \n )}\n\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\n\nimport ReCAPTCHA from 'react-google-recaptcha';\n\nimport client from \"./client/Client\";\nimport CheckboxInput from \"./shared/CheckboxInput\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport PasswordInput from \"./shared/PasswordInput\";\n\nimport { renderLabel, renderCheckboxLabel, renderSimpleLabel } from \"./shared/Utilities\";\n\n\n\nexport default function Registration(props) {\n const recaptchaRef = useRef(null);\n\n const [busy, setBusy] = useState(true);\n\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [passwordConfirmation, setPasswordConfirmation] = useState('');\n const [emailOptIn, setEmailOptIn] = useState(false);\n\n const [brandName, setBrandName] = useState('');\n const [brandLandingMessage, setBrandLandingMessage] = useState('');\n const [brandLandingImageUrl, setBrandLandingImageUrl] = useState('');\n const [brandLandingAltImageUrl, setBrandLandingAltImageUrl] = useState('');\n \n const [emailOptInText, setEmailOptInText] = useState(undefined);\n const [emailOptInAltText, setEmailOptInAltText] = useState(undefined);\n\n const [recaptchaToken, setRecaptchaToken] = useState(null);\n \n const [errorMessages, setErrorMessages] = useState([]);\n\n useEffect(() => {\n initialize();\n }, []);\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/registration\");\n \n setBrandName(response.result?.brand_name);\n\n setBrandLandingImageUrl(response.result?.brand_landing_image_url);\n setBrandLandingAltImageUrl(response.result?.brand_landing_alt_image_url);\n setBrandLandingMessage(response.result?.brand_landing_message);\n\n setEmailOptInText(response.result?.email_opt_in_text);\n setEmailOptInAltText(response.result?.email_opt_in_alt_text);\n\n setBusy(false);\n }\n\n const resetRecaptcha = () => {\n if (recaptchaRef.current) {\n recaptchaRef.current.reset();\n }\n setRecaptchaToken(null); // Reset the captcha value\n };\n\n const handleRegisterClick = async () => {\n if (!recaptchaToken) {\n alert('Please complete the reCAPTCHA');\n return;\n }\n\n setBusy(true);\n\n const response = await client.postData(\"/user-portal/registration\", {\n email: email,\n password: password,\n password_confirmation: passwordConfirmation,\n email_opt_in: emailOptIn,\n recaptcha_token: recaptchaToken\n });\n\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n resetRecaptcha();\n }\n\n setBusy(false);\n }\n\n const onFormSubmit = (e) => {\n e.preventDefault();\n handleRegisterClick();\n }\n\n const onRecaptchaChange = (token) => {\n setRecaptchaToken(token);\n };\n\n return (\n
\n
\n
\n
\n \n
\n
\n
\n\n
\n
\n
\n
\n { brandName && (\n

\n Preferred Partner\n
\n {brandLandingImageUrl && (\n \n )}\n

\n )}\n {brandLandingMessage ? (\n <>\n

\n

\n

\n
\n

\n There are no signup fees or membership fees to join. There are no long-term contracts\n to sign and no hidden fees.\n

\n

\n

\n Need help?\n
\n \n
\n Phone: 1-800-275-5089\n
\n

\n \n ) : (\n <>\n

\n Signup for Open Roads\n

\n
\n RV Fuel Discount Program\n
\n

\n By joining our program, you will have access to discount diesel prices at specified\n locations such as Love's and Travel Centers of America. Current members are saving\n 30 to 40 cents per gallon off the pump price.\n

\n

\n There are no signup fees or membership fees to join. There are no long-term contracts\n to sign and no hidden fees.\n

\n

\n

\n Need help?\n
\n \n
\n Phone: 1-800-275-5089\n
\n

\n \n )}\n
\n
\n
\n
\n
\n
\n
\n Register a user account and fill an application form to get started.\n
\n
\n\n \n\n
\n
\n \n setEmail(e.target.value)} className=\"form-control\"/>\n {renderLabel('Your email', email, 'email')}\n
\n
\n \n setPassword(val)} id='password' />\n {renderLabel('Your password', password, 'password')}\n
\n
\n \n setPasswordConfirmation(val)} id='password-confirmation' />\n {renderLabel('Password confirmation', passwordConfirmation, 'password-confirmation')}\n
\n {emailOptInText && (\n
\n setEmailOptIn(val)}\n id='email-opt-in'\n label={emailOptInText}\n />\n
\n )}\n {emailOptInAltText && (\n
\n
\n )}\n\n \n\n
\n \n
\n \n \n
\n
\n
\n

\n Already a registered user?  \n Sign In\n

\n
\n
\n
\n
\n
\n\n {brandLandingAltImageUrl && (\n
\n
\n \n
\n
\n )}\n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\n\nimport { renderSimpleLabel } from \"./shared/Utilities\";\n\nexport default function ReviewAndSubmit() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [fuelProgramApplication, setFuelProgramApplication] = useState();\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/review-and-submit\");\n\n setFuelProgramApplication(response.result?.fuel_program_application)\n\n setBusy(false);\n }\n\n const submit = async () => {\n setSaveBusy(true);\n\n const response = await client.postData(\"/user-portal/fpa/review-and-submit\", {});\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setSaveBusy(false);\n }\n\n const last_four = (val) => {\n if (val) {\n return val.substr(val.length-5);\n }\n }\n\n return (\n
\n <>\n \n

Review and Submit Application

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n \n
\n
\n
\n {fuelProgramApplication.first_name} {fuelProgramApplication.last_name} \n {renderSimpleLabel('Name')}\n
\n
\n
\n
\n {fuelProgramApplication.email} \n {renderSimpleLabel('Email')}\n
\n
\n
\n
\n {fuelProgramApplication.phone} \n {renderSimpleLabel('Phone')}\n
\n
\n
\n
\n {fuelProgramApplication.referred_by} \n {renderSimpleLabel('Referred By')}\n
\n
\n
\n\n
\n
\n
\n {fuelProgramApplication.bank_name}
\n Rt #{last_four(fuelProgramApplication.bank_routing_number)} / Acct #{last_four(fuelProgramApplication.bank_account_number)} \n {renderSimpleLabel('Verified Bank Info')}\n
\n
\n
\n
\n {fuelProgramApplication.signed_at}
\n {fuelProgramApplication.signature_hash ? fuelProgramApplication.signature_hash.replace(\"SIGHASH-\", \"Sig#\") : null}\n {renderSimpleLabel('Signature Date')}\n
\n
\n
\n
\n {fuelProgramApplication.expedited_shipping === 'Y' && (\n
\n Fastest: $70 one-time charge
\n - 48-hour processing
\n - Overnight shipping\n
\n )}\n {fuelProgramApplication.expedited_processing === 'Y' && (\n
\n Fast: $20 one-time charge
\n - 48-hour processing
\n
\n )}\n {fuelProgramApplication.expedited_shipping !== 'Y' && fuelProgramApplication.expedited_processing !== 'Y' && (\n
\n No\n
\n )}\n {renderSimpleLabel('Expedited Delivery')}\n
\n
\n
\n\n \n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { accountTypeDisplay } from \"./shared/Utilities\";\n\nimport { renderLabel } from \"./shared/Utilities\";\n\nexport default function Signature() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [bankName, setBankName] = useState();\n const [accountType, setAccountType] = useState();\n\n const [signatureImage, setSignatureImage] = useState();\n const [signatureTyped, setSignatureTyped] = useState();\n const [signatureLanguage, setSignatureLanguage] = useState();\n\n const [newSignatureImage, setNewSignatureImage] = useState();\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/signature\");\n\n setSignatureImage(response.result?.fuel_program_application.signature_image)\n setSignatureTyped(response.result?.fuel_program_application.signature_typed || '')\n\n setSignatureLanguage(response.result?.signature_language)\n\n setBankName(response.result?.bank_account.bank_name);\n setAccountType(response.result?.bank_account.account_type);\n\n setBusy(false);\n \n setTimeout(() => {\n window.initialize_signature_capture();\n setTimeout(() => {\n window.setSignatureCallback((signatureImg) => {\n setNewSignatureImage(signatureImg);\n });\n }, 500);\n }, 250)\n }\n\n const save = async () => {\n setSaveBusy(true);\n\n let signature = signatureImage;\n if (newSignatureImage) {\n signature = newSignatureImage;\n }\n\n const request = {\n fuel_program_application: {\n signature_image: signature || '',\n signature_typed: signatureTyped || ''\n }\n };\n\n const response = await client.postData(\"/user-portal/fpa/signature\", request);\n\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setSaveBusy(false);\n }\n\n const clearCanvas = () => {\n setSignatureImage(null);\n setNewSignatureImage(null);\n window.clear_signature_capture();\n }\n\n return (\n
\n <>\n \n

Signature

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n\n
\n
\n Bank Name: {bankName}\n
\n
\n Account Type: {accountTypeDisplay(accountType)}\n
\n
\n  \n
\n
\n\n\n
\n
\n {signatureLanguage}\n
\n
\n\n
\n
\n
\n \n
\n
\n \n {!!signatureImage && }\n
\n
\n
Sign above
\n \n
\n
\n
\n
\n
\n
\n setSignatureTyped(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Alternatively: Type your name to sign', signatureTyped, 'signature-typed')}\n
\n
\n
\n\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ApplicationProgress from \"./shared/ApplicationProgress\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { accountTypes } from \"./shared/AccountTypes\";\n\nexport default function ThankYou() {\n const [busy, setBusy] = useState(false);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const returnToDashboard = async () => {\n window.location.href = '/user-portal/dashboard';\n }\n\n return (\n
\n <>\n \n

Thank You

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n \n
\n
\n

All Done!

\n \n

Your application was submitted successfully

\n

We will start processing your application soon.

\n
\n
\n
\n
\n \n
\n
\n \n )}\n
\n \n
\n );\n}\n","import React, { useEffect, useState, useRef } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport client from \"./client/Client\";\nimport LoadingIndicator from \"./shared/LoadingIndicator\";\nimport ErrorMessages from \"./shared/ErrorMessages\";\nimport { GoogleMap, LoadScript, Marker, DirectionsRenderer, DirectionsService, InfoWindow} from '@react-google-maps/api';\nimport { renderLabel } from \"./shared/Utilities\";\n\n// export function InfoWindowEx(props) {\n// const infoWindowRef = React.createRef();\n// const contentElement = document.createElement(`div`);\n// useEffect(() => {\n// ReactDOM.render(React.Children.only(props.children), contentElement);\n// infoWindowRef.current.setContent(contentElement);\n// }, [props.children, infoWindowRef]);\n// return ;\n// }\n\nexport default function TripPlanning() {\n const [busy, setBusy] = useState(true);\n const [saveBusy, setSaveBusy] = useState(false);\n\n const [googleMapsApiKey, setGoogleMapsApiKey] = useState();\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [origin, setOrigin] = useState('Harper, KS');\n const [destination, setDestination] = useState('Destin, FL');\n const [waypoints, setWaypoints] = useState([]);\n \n const [selectedMarker, setSelectedMarker] = useState();\n const [selectedLocation, setSelectedLocation] = useState();\n \n const [directionsRequest, setDirectionsRequest] = useState();\n const [directionsGoogleApiResponse, setDirectionsGoogleApiResponse] = useState();\n const [directionsFuelLocationsApiResponse, setDirectionsFuelLocationsApiResponse] = useState();\n\n const containerStyle = {\n width: '100%',\n height: '400px'\n };\n \n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n setBusy(true);\n\n const response = await client.getData(\"/user-portal/trip-planning\");\n\n setGoogleMapsApiKey(response.result?.google_maps_api_key);\n\n setBusy(false);\n }\n\n const getDirections = async () => {\n setSaveBusy(true);\n\n const request = {\n origin: origin,\n destination: destination,\n waypoints: waypoints.map((wypt) => {\n return { location: wypt, stopover: true }\n }),\n travelMode: 'DRIVING'\n };\n\n setDirectionsGoogleApiResponse(undefined);\n setDirectionsFuelLocationsApiResponse(undefined);\n setDirectionsRequest(request);\n \n setSaveBusy(false);\n }\n\n const addWaypoint = () => {\n const waypts = [...waypoints];\n waypts.push(\"\");\n setWaypoints(waypts); \n }\n\n const removeWaypoint = (indx) => {\n const waypts = [...waypoints];\n waypts.splice(indx, 1);\n setWaypoints(waypts); \n }\n\n const updateWaypoint = (value, indx) => {\n const waypts = [...waypoints];\n waypts[indx] = value;\n setWaypoints(waypts);\n }\n\n const onDirectionsReceived = async (googleApiResponse) => {\n setDirectionsGoogleApiResponse(googleApiResponse);\n\n const response = await client.postData(\"/user-portal/trip-planning\", { directions_api_response: googleApiResponse });\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n }\n\n setDirectionsFuelLocationsApiResponse(response);\n }\n\n const setSelected = (location, marker) => {\n setSelectedLocation(location);\n setSelectedMarker(marker);\n\t}\n \n return (\n
\n <>\n

Trip Planning

\n
\n {busy ? ( \n
\n
\n \n
\n
\n ) : (\n <>\n \n\n
\n
\n
\n Build and plan a trip using fuel location and pricing from the Open Roads app.\n
\n
\n
\n\n
\n
\n
\n setOrigin(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Origin City', origin, 'starting-city-name')}\n
\n
\n
\n
\n setDestination(e.target.value)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Destination City', destination, 'ending-city-name')}\n
\n
\n
\n \n
\n
\n\n
\n
\n
\n {waypoints.map((waypoint, indx) => (\n
\n
\n
\n updateWaypoint(e.target.value, indx)} type=\"text\" className=\"form-control\" aria-disabled=\"false\" />\n {renderLabel('Waypoint City/State', waypoint, `waypoint${indx}`)}\n
\n
\n
\n \n
\n
\n ))}\n
\n
\n
\n\n
\n
\n \n
\n
\n\n
\n\n \n \n {/*\n Renders the fuel price locations from the hydrocarbons API call\n */}\n {directionsFuelLocationsApiResponse ? (\n <>\n {directionsFuelLocationsApiResponse.result?.locations.map((location) => (\n setSelected(location, marker)} \n />\n ))}\n \n ) : (<>)}\n\n { selectedMarker && selectedLocation && (\n setSelected(undefined, undefined)}>\n
\n
\n {selectedLocation.store_name}\n
\n
\n ${selectedLocation.discounted_price}/gal\n
\n
\n \n )}\n\n {/*\n Renders the polylines on the map when the google directions response returns\n */}\n {directionsGoogleApiResponse && (\n {\n console.log('DirectionsRenderer onLoad directionsRenderer: ', directionsRenderer)\n }}\n onUnmount={directionsRenderer => {\n console.log('DirectionsRenderer onUnmount directionsRenderer: ', directionsRenderer)\n }}\n />\n )}\n\n {/*\n Updates directions when directionsRequest is available and when the google directions response has \n been cleared or never set before \n */}\n {directionsRequest && !directionsGoogleApiResponse && (\n {\n console.log('DirectionsService onLoad directionsService: ', directionsService)\n }}\n onUnmount={directionsService => {\n console.log('DirectionsService onUnmount directionsService: ', directionsService)\n }}\n />\n )}\n
\n
\n \n )}\n
\n \n
\n );\n}\n","export class Client {\n Success = 'Success';\n Error = 'Error';\n\n async getData(path) {\n let fullPath = path;\n const result = await fetch(fullPath, {\n method: 'GET',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n }\n });\n\n const resultJson = await result.json();\n if (resultJson.result?.redirect_url) {\n window.location = resultJson.result?.redirect_url;\n } else {\n return resultJson;\n }\n }\n\n async postData(path, params) {\n const token = document.querySelector('meta[name=\"csrf-token\"]').content;\n\n let fullPath = path;\n const result = await fetch(fullPath, {\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n \"X-CSRF-Token\": token\n },\n body: JSON.stringify(params)\n });\n\n const resultJson = await result.json();\n if (resultJson.result?.redirect_url) {\n window.location = resultJson.result?.redirect_url;\n } else {\n return resultJson;\n }\n }\n}\n\nconst client = new Client();\nexport default client;","export const accountTypes = [\n [\"Checking\", \"C\"],\n [\"Savings\", \"S\"]\n];","import React, { useEffect, useState } from \"react\";\nimport LoadingIndicator from \"./LoadingIndicator\";\nimport client from \"../client/Client\";\n\nexport default function ApplicationProgress() {\n const [busy, setBusy] = useState(true);\n\n const [locations, setLocations] = useState([]);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/fpa/progress\");\n \n if (response.result?.is_partner) {\n setLocations([\n { title: 'Personal', path: 'personal' },\n { title: 'Verify Identity', path: 'identity-verification' },\n { title: 'Order', path: 'order-options' },\n { title: 'Card Pin', path: 'card-pin' },\n { title: 'Bank', path: 'bank' },\n { title: 'Signature', path: 'signature' },\n { title: 'Verification', path: 'bank-verification' },\n { title: 'Review & Submit', path: 'review-and-submit' },\n { title: 'Complete', path: 'thank-you' },\n ]);\n } else {\n setLocations([\n { title: 'Personal', path: 'personal' },\n { title: 'Verify Identity', path: 'identity-verification' },\n { title: 'Referral', path: 'referral' },\n { title: 'Order', path: 'order-options' },\n { title: 'Card Pin', path: 'card-pin' },\n { title: 'Bank', path: 'bank' },\n { title: 'Signature', path: 'signature' },\n { title: 'Verification', path: 'bank-verification' },\n { title: 'Review & Submit', path: 'review-and-submit' },\n { title: 'Complete', path: 'thank-you' },\n ]);\n }\n\n setBusy(false);\n }\n\n const renderCrumb = (location, index) => {\n const active = window.location.href.endsWith(location.path);\n const myIndex = locations.findIndex((location) => window.location.href.endsWith(location.path));\n return (\n
  • \n {index > myIndex ? location.title : (\n <>\n {(active) ? ({location.title}) : ({location.title}) }\n \n )}\n
  • \n );\n }\n\n if (busy) {\n return (\n
    \n
    \n \n
    \n
    \n );\n }\n\n return (\n
      \n Application Progress:  \n { locations.map((location, index) => renderCrumb(location, index)) }\n
    \n );\n}\n","import React from \"react\";\n\nexport default function CheckboxInput({checked, onChange, id, label}) {\n \n const handleChanged = (password) => {\n onChange(password);\n }\n\n return (\n
    \n handleChanged(e.target.checked)} class=\"custom-control-input\" />\n \n
    \n );\n}\n","import React from \"react\";\n\nexport default function ErrorMessages({ errorMessages, showHeading = false }) {\n return (\n <>\n { errorMessages && errorMessages.length > 0 && (\n
    \n {showHeading &&

    These errors prevented you from saving...

    }\n {errorMessages.map((error_message, index) => (\n
    \n {error_message}\n
    \n ))}\n
    \n )}\n \n );\n}\n","import React from \"react\";\n\nexport default function LoadingIndicator() {\n return (\n \n );\n}\n","import React, { useState } from \"react\";\n\nexport default function PasswordInput({password, onChange, id}) {\n const [showPassword, setShowPassword] = useState(false);\n \n const handleSetPassword = (password) => {\n onChange(password);\n }\n\n const handleToggleShowPassword = () => {\n setShowPassword(!showPassword);\n }\n\n return (\n <>\n handleSetPassword(e.target.value)} className=\"form-control\" />\n \n \n );\n}\n","import React, { useState } from \"react\";\n\nexport default function SsnInput({value, onChange, id}) {\n const [showHidden, setShowHidden] = useState(false);\n \n const handleSetSsn = (ssn) => {\n onChange(ssn);\n }\n\n const handleToggleShowHidden = () => {\n setShowHidden(!showHidden);\n }\n\n return (\n <>\n handleSetSsn(e.target.value)} className=\"form-control\" />\n \n \n );\n}\n","export const states = [\n ['Choose U.S. State or Canadian Province', null],\n ['--- U.S. States ---', null],\n ['Alabama', 'AL'],\n ['Alaska', 'AK'],\n ['Arizona', 'AZ'],\n ['Arkansas', 'AR'],\n ['California', 'CA'],\n ['Colorado', 'CO'],\n ['Connecticut', 'CT'],\n ['Delaware', 'DE'],\n ['District of Columbia', 'DC'],\n ['Florida', 'FL'],\n ['Georgia', 'GA'],\n ['Hawaii', 'HI'],\n ['Idaho', 'ID'],\n ['Illinois', 'IL'],\n ['Indiana', 'IN'],\n ['Iowa', 'IA'],\n ['Kansas', 'KS'],\n ['Kentucky', 'KY'],\n ['Louisiana', 'LA'],\n ['Maine', 'ME'],\n ['Maryland', 'MD'],\n ['Massachusetts', 'MA'],\n ['Michigan', 'MI'],\n ['Minnesota', 'MN'],\n ['Mississippi', 'MS'],\n ['Missouri', 'MO'],\n ['Montana', 'MT'],\n ['Nebraska', 'NE'],\n ['Nevada', 'NV'],\n ['New Hampshire', 'NH'],\n ['New Jersey', 'NJ'],\n ['New Mexico', 'NM'],\n ['New York', 'NY'],\n ['North Carolina', 'NC'],\n ['North Dakota', 'ND'],\n ['Ohio', 'OH'],\n ['Oklahoma', 'OK'],\n ['Oregon', 'OR'],\n ['Pennsylvania', 'PA'],\n ['Puerto Rico', 'PR'],\n ['Rhode Island', 'RI'],\n ['South Carolina', 'SC'],\n ['South Dakota', 'SD'],\n ['Tennessee', 'TN'],\n ['Texas', 'TX'],\n ['Utah', 'UT'],\n ['Vermont', 'VT'],\n ['Virginia', 'VA'],\n ['Washington', 'WA'],\n ['West Virginia', 'WV'],\n ['Wisconsin', 'WI'],\n ['Wyoming', 'WY'],\n ['--- Canadian Provinces ---', null],\n ['Alberta', 'AB'],\n ['British Columbia', 'BC'],\n ['Manitoba', 'MB'],\n ['New Brunswick', 'NB'],\n ['Newfoundland and Labrador', 'NL'],\n ['Northwest Territories', 'NT'],\n ['Nova Scotia', 'NS'],\n ['Nunavut', 'NU'],\n ['Ontario', 'ON'],\n ['Prince Edward Island', 'PE'],\n ['Quebec', 'QC'],\n ['Saskatchewan', 'SK'],\n ['Yukon Territory', 'YT']\n];\n","import React from \"react\";\n\nexport default function StripeErrors({ stripeErrors }) {\n const messages = [];\n\n if (!stripeErrors) {\n return (<>);\n }\n\n stripeErrors.forEach(error => {\n if (error.param !== 'bank_account[routing_number]' && error.param !== 'bank_account[account_number]') {\n messages.push(error.message);\n }\n });\n\n return (\n <>\n { messages && messages.length > 0 && (\n
    \n {messages.map((message, index) => (\n
    \n {message}\n
    \n ))}\n
    \n )}\n \n );\n}\n","import React from \"react\";\n\nexport default function StripeFieldErrors({ stripeErrors, fieldLabel, stripeFieldName}) {\n const messages = [];\n\n if (!stripeErrors) {\n return (<>);\n }\n\n stripeErrors.forEach(error => {\n if (error.param === stripeFieldName) {\n if (error.code === 'parameter_invalid_empty') {\n messages.push({ text: `${fieldLabel} cannot be blank`, details: error.message });\n } else {\n messages.push({ text: `${fieldLabel} is invalid`, details: error.message });\n }\n }\n });\n\n return (\n <>\n { messages && messages.length > 0 && (\n
    \n {messages.map((message, index) => (\n
    \n {message.text} \n
    \n ))}\n
    \n )}\n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport BarChart from \"./charts/BarChart\";\nimport LineChart from \"./charts/LineChart\";\nimport PieChart from \"./charts/PieChart\";\n\nimport LoadingIndicator from \"./LoadingIndicator\";\nimport client from \"../client/Client\";\n\nexport default function UserSummaryCharts() {\n const [busy, setBusy] = useState(true);\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/dashboard\");\n\n setBusy(false);\n }\n\n const lineChartData = {\n labels: [\"JAXY\", \"FEGAY\", \"March\", \"April\", \"May\", \"June\", \"July\"],\n datasets: [{\n label: \"My First dataset\",\n data: [65, 59, 80, 81, 56, 55, 40],\n backgroundColor: [\n 'rgba(105, 0, 132, .2)',\n ],\n borderColor: [\n 'rgba(200, 99, 132, .7)',\n ],\n borderWidth: 2\n }]\n };\n\n const barChartData = {\n labels: [\"Red\", \"Blue\", \"Yellow\", \"Green\", \"Purple\", \"Orange\"],\n datasets: [{\n label: '# of Votes',\n data: [12, 19, 3, 5, 2, 3],\n backgroundColor: [\n 'rgba(255, 99, 132, 0.2)',\n 'rgba(54, 162, 235, 0.2)',\n 'rgba(255, 206, 86, 0.2)',\n 'rgba(75, 192, 192, 0.2)',\n 'rgba(153, 102, 255, 0.2)',\n 'rgba(255, 159, 64, 0.2)'\n ],\n borderColor: [\n 'rgba(255,99,132,1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)',\n 'rgba(153, 102, 255, 1)',\n 'rgba(255, 159, 64, 1)'\n ],\n borderWidth: 1\n }]\n };\n\n const pieChartData = {\n labels: [\"Red\", \"Green\", \"Yellow\", \"Grey\", \"Dark Grey\"],\n datasets: [{\n data: [300, 50, 100, 40, 120],\n backgroundColor: [\"#F7464A\", \"#46BFBD\", \"#FDB45C\", \"#949FB1\", \"#4D5360\"],\n hoverBackgroundColor: [\"#FF5A5E\", \"#5AD3D1\", \"#FFC870\", \"#A8B3C5\", \"#616774\"]\n }]\n };\n\n return (\n <>\n

    Account History

    \n
    \n {busy ? ( \n
    \n
    \n \n
    \n
    \n ) : (\n
    \n
    \n \n
    \n
    \n \n
    \n
    \n \n
    \n
    \n )}\n
    \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport ErrorMessages from \"./ErrorMessages\";\nimport LoadingIndicator from \"./LoadingIndicator\";\nimport client from \"../client/Client\";\n\nexport default function UserSummaryStats() {\n const [busy, setBusy] = useState(true);\n\n const [errorMessages, setErrorMessages] = useState([]);\n\n const [transactions, setTransactions] = useState();\n const [spending, setSpending] = useState();\n const [savings, setSavings] = useState();\n\n useEffect(() => {\n initialize();\n }, [])\n\n const initialize = async () => {\n const response = await client.getData(\"/user-portal/ytd-stats\");\n\n if (response.status === client.Error) {\n setErrorMessages(response.error_messages);\n } else {\n setTransactions(response.result?.transactions);\n setSpending(response.result?.spending);\n setSavings(response.result?.savings);\n }\n \n setBusy(false);\n }\n\n return (\n <>\n {busy ? ( \n
    \n
    \n \n
    \n
    \n ) : (\n
    \n\n { errorMessages && errorMessages.length > 0 ? (\n \n ) : (\n <>\n
    \n
    \n
    \n
    \n
    \n

    {transactions}

    \n

    Transactions (Year to Date)

    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n

    ${spending}

    \n

    Spending (Year to Date)

    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n
    \n

    ${savings}

    \n

    Savings (Year to Date)

    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n \n )}\n
    \n )}\n \n );\n}\n","import React, { useState } from \"react\";\n\nexport const accountTypeDisplay = (accountType) => {\n return accountType === 'C' ? 'Checking' : 'Savings';\n}\n\nexport const renderLabel = (title, value, label_for = null) => {\n return (\n \n )\n}\n\nexport const renderSimpleLabel = (title) => {\n return (\n \n )\n}\n\nexport const renderCheckboxLabel = (label) => {\n return (\n \n )\n}","import React, { useEffect } from \"react\";\n\nexport default function BarChart({data, id}) {\n\n // Data example:\n // {\n // labels: [\"Red\", \"Blue\", \"Yellow\", \"Green\", \"Purple\", \"Orange\"],\n // datasets: [{\n // label: '# of Votes',\n // data: [12, 19, 3, 5, 2, 3],\n // backgroundColor: [\n // 'rgba(255, 99, 132, 0.2)',\n // 'rgba(54, 162, 235, 0.2)',\n // 'rgba(255, 206, 86, 0.2)',\n // 'rgba(75, 192, 192, 0.2)',\n // 'rgba(153, 102, 255, 0.2)',\n // 'rgba(255, 159, 64, 0.2)'\n // ],\n // borderColor: [\n // 'rgba(255,99,132,1)',\n // 'rgba(54, 162, 235, 1)',\n // 'rgba(255, 206, 86, 1)',\n // 'rgba(75, 192, 192, 1)',\n // 'rgba(153, 102, 255, 1)',\n // 'rgba(255, 159, 64, 1)'\n // ],\n // borderWidth: 1\n // }]\n // }\n\n useEffect(() => {\n initChart(data);\n }, [])\n\n const initChart = (data) => {\n var ctxL = document.getElementById(id).getContext('2d');\n var myChart = new Chart(ctxL, {\n type: 'bar',\n data: data,\n options: {\n responsive: true\n }\n });\n }\n\n return (\n <>\n \n \n );\n}\n","import React, { useEffect } from \"react\";\n\nexport default function LineChart({data, id}) {\n\n // Data example:\n // {\n // labels: [\"JAXY\", \"FEGAY\", \"March\", \"April\", \"May\", \"June\", \"July\"],\n // datasets: [{\n // label: \"My First dataset\",\n // data: [65, 59, 80, 81, 56, 55, 40],\n // backgroundColor: [\n // 'rgba(105, 0, 132, .2)',\n // ],\n // borderColor: [\n // 'rgba(200, 99, 132, .7)',\n // ],\n // borderWidth: 2\n // }]\n // };\n\n useEffect(() => {\n initChart(data);\n }, [])\n\n const initChart = (data) => {\n var ctxB = document.getElementById(id).getContext('2d');\n var myChart = new Chart(ctxB, {\n type: 'line',\n data: data,\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true\n }\n }]\n }\n }\n });\n }\n\n return (\n <>\n \n \n );\n}\n","import React, { useEffect } from \"react\";\n\nexport default function PieChart({data, id}) {\n\n // Data example:\n // {\n // labels: [\"Red\", \"Green\", \"Yellow\", \"Grey\", \"Dark Grey\"],\n // datasets: [{\n // data: [300, 50, 100, 40, 120],\n // backgroundColor: [\"#F7464A\", \"#46BFBD\", \"#FDB45C\", \"#949FB1\", \"#4D5360\"],\n // hoverBackgroundColor: [\"#FF5A5E\", \"#5AD3D1\", \"#FFC870\", \"#A8B3C5\", \"#616774\"]\n // }]\n // }\n\n useEffect(() => {\n initChart(data);\n }, [])\n\n const initChart = (data) => {\n var ctxP = document.getElementById(id).getContext('2d');\n var myChart = new Chart(ctxP, {\n type: 'pie',\n data: data,\n options: {\n responsive: true\n }\n });\n }\n\n return (\n <>\n \n \n );\n}\n","/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n//\n// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate\n// layout file, like app/views/layouts/application.html.erb\n\n\n// Uncomment to copy all static images under ../images to the output folder and reference\n// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>)\n// or the `imagePath` JavaScript helper below.\n//\n// const images = require.context('../images', true)\n// const imagePath = (name) => images(name, true)\n\nconsole.log('Hello World from Webpacker')\n// Support component names relative to this directory:\nvar componentRequireContext = require.context(\"components\", true);\nvar ReactRailsUJS = require(\"react_ujs\");\nReactRailsUJS.useContext(componentRequireContext);\n","function _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function () { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function (t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == typeof h && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function (t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator.return && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(typeof e + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function (e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function () { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function (e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function (t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function (t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function (t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function (e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nimport { jsx, jsxs, Fragment } from 'react/jsx-runtime';\nimport { createContext, useContext, memo, useState, useRef, useEffect, PureComponent, createRef, useMemo, Children, isValidElement, cloneElement } from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { createPortal } from 'react-dom';\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nfunction getDefaultExportFromCjs$1(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nvar invariant_1;\nvar hasRequiredInvariant;\nfunction requireInvariant() {\n if (hasRequiredInvariant) return invariant_1;\n hasRequiredInvariant = 1;\n\n /**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\n var NODE_ENV = process.env.NODE_ENV;\n var invariant = function invariant(condition, format, a, b, c, d, e, f) {\n if (NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n };\n invariant_1 = invariant;\n return invariant_1;\n}\nvar invariantExports = requireInvariant();\nvar invariant = /*@__PURE__*/getDefaultExportFromCjs$1(invariantExports);\nvar MapContext = /*#__PURE__*/createContext(null);\nfunction useGoogleMap() {\n invariant(!!useContext, 'useGoogleMap is React hook and requires React version 16.8+');\n var map = useContext(MapContext);\n invariant(!!map, 'useGoogleMap needs a GoogleMap available up in the tree');\n return map;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction reduce(obj, fn, acc) {\n return Object.keys(obj).reduce(function reducer(newAcc, key) {\n return fn(newAcc, obj[key], key);\n }, acc);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction forEach(obj, fn) {\n Object.keys(obj).forEach(key => {\n return fn(obj[key], key);\n });\n}\n\n/* global google */\n/* eslint-disable filenames/match-regex */\nfunction applyUpdaterToNextProps(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nupdaterMap,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprevProps,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nnextProps,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninstance\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var map = {};\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n var iter = (fn, key) => {\n var nextValue = nextProps[key];\n if (nextValue !== prevProps[key]) {\n map[key] = nextValue;\n fn(instance, nextValue);\n }\n };\n forEach(updaterMap, iter);\n return map;\n}\nfunction registerEvents(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nprops,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninstance, eventMap) {\n var registeredList = reduce(eventMap, function reducer(acc, googleEventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onEventName) {\n if (typeof props[onEventName] === 'function') {\n acc.push(google.maps.event.addListener(instance, googleEventName, props[onEventName]));\n }\n return acc;\n }, []);\n return registeredList;\n}\nfunction unregisterEvent(registered) {\n google.maps.event.removeListener(registered);\n}\nfunction unregisterEvents() {\n var events = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n events.forEach(unregisterEvent);\n}\nfunction applyUpdatersToPropsAndRegisterEvents(_ref) {\n var updaterMap = _ref.updaterMap,\n eventMap = _ref.eventMap,\n prevProps = _ref.prevProps,\n nextProps = _ref.nextProps,\n instance = _ref.instance;\n var registeredEvents = registerEvents(nextProps, instance, eventMap);\n applyUpdaterToNextProps(updaterMap, prevProps, nextProps, instance);\n return registeredEvents;\n}\nvar eventMap$i = {\n onDblClick: 'dblclick',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMapTypeIdChanged: 'maptypeid_changed',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseDown: 'mousedown',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n onTilesLoaded: 'tilesloaded',\n onBoundsChanged: 'bounds_changed',\n onCenterChanged: 'center_changed',\n onClick: 'click',\n onDrag: 'drag',\n onHeadingChanged: 'heading_changed',\n onIdle: 'idle',\n onProjectionChanged: 'projection_changed',\n onResize: 'resize',\n onTiltChanged: 'tilt_changed',\n onZoomChanged: 'zoom_changed'\n};\nvar updaterMap$i = {\n extraMapTypes(map, extra) {\n extra.forEach(function forEachExtra(it, i) {\n map.mapTypes.set(String(i), it);\n });\n },\n center(map, center) {\n map.setCenter(center);\n },\n clickableIcons(map, clickable) {\n map.setClickableIcons(clickable);\n },\n heading(map, heading) {\n map.setHeading(heading);\n },\n mapTypeId(map, mapTypeId) {\n map.setMapTypeId(mapTypeId);\n },\n options(map, options) {\n map.setOptions(options);\n },\n streetView(map, streetView) {\n map.setStreetView(streetView);\n },\n tilt(map, tilt) {\n map.setTilt(tilt);\n },\n zoom(map, zoom) {\n map.setZoom(zoom);\n }\n};\n// TODO: unfinished!\nfunction GoogleMapFunctional(_ref) {\n var children = _ref.children,\n options = _ref.options,\n id = _ref.id,\n mapContainerStyle = _ref.mapContainerStyle,\n mapContainerClassName = _ref.mapContainerClassName,\n center = _ref.center,\n onClick = _ref.onClick,\n onDblClick = _ref.onDblClick,\n onDrag = _ref.onDrag,\n onDragEnd = _ref.onDragEnd,\n onDragStart = _ref.onDragStart,\n onMouseMove = _ref.onMouseMove,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseDown = _ref.onMouseDown,\n onMouseUp = _ref.onMouseUp,\n onRightClick = _ref.onRightClick,\n onCenterChanged = _ref.onCenterChanged,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var _useState = useState(null),\n _useState2 = _slicedToArray(_useState, 2),\n map = _useState2[0],\n setMap = _useState2[1];\n var ref = useRef(null);\n // const [extraMapTypesListener, setExtraMapTypesListener] = useState(null)\n var _useState3 = useState(null),\n _useState4 = _slicedToArray(_useState3, 2),\n centerChangedListener = _useState4[0],\n setCenterChangedListener = _useState4[1];\n var _useState5 = useState(null),\n _useState6 = _slicedToArray(_useState5, 2),\n dblclickListener = _useState6[0],\n setDblclickListener = _useState6[1];\n var _useState7 = useState(null),\n _useState8 = _slicedToArray(_useState7, 2),\n dragendListener = _useState8[0],\n setDragendListener = _useState8[1];\n var _useState9 = useState(null),\n _useState10 = _slicedToArray(_useState9, 2),\n dragstartListener = _useState10[0],\n setDragstartListener = _useState10[1];\n var _useState11 = useState(null),\n _useState12 = _slicedToArray(_useState11, 2),\n mousedownListener = _useState12[0],\n setMousedownListener = _useState12[1];\n var _useState13 = useState(null),\n _useState14 = _slicedToArray(_useState13, 2),\n mousemoveListener = _useState14[0],\n setMousemoveListener = _useState14[1];\n var _useState15 = useState(null),\n _useState16 = _slicedToArray(_useState15, 2),\n mouseoutListener = _useState16[0],\n setMouseoutListener = _useState16[1];\n var _useState17 = useState(null),\n _useState18 = _slicedToArray(_useState17, 2),\n mouseoverListener = _useState18[0],\n setMouseoverListener = _useState18[1];\n var _useState19 = useState(null),\n _useState20 = _slicedToArray(_useState19, 2),\n mouseupListener = _useState20[0],\n setMouseupListener = _useState20[1];\n var _useState21 = useState(null),\n _useState22 = _slicedToArray(_useState21, 2),\n rightclickListener = _useState22[0],\n setRightclickListener = _useState22[1];\n var _useState23 = useState(null),\n _useState24 = _slicedToArray(_useState23, 2),\n clickListener = _useState24[0],\n setClickListener = _useState24[1];\n var _useState25 = useState(null),\n _useState26 = _slicedToArray(_useState25, 2),\n dragListener = _useState26[0],\n setDragListener = _useState26[1];\n // Order does matter\n useEffect(() => {\n if (options && map !== null) {\n map.setOptions(options);\n }\n }, [map, options]);\n useEffect(() => {\n if (map !== null && typeof center !== 'undefined') {\n map.setCenter(center);\n }\n }, [map, center]);\n useEffect(() => {\n if (map && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(map, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (map && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(map, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(() => {\n if (map && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(map, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(() => {\n if (map && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(map, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (map && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(map, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(() => {\n if (map && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(map, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (map && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(map, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (map && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(map, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (map && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(map, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (map && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(map, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (map && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(map, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(() => {\n if (map && onCenterChanged) {\n if (centerChangedListener !== null) {\n google.maps.event.removeListener(centerChangedListener);\n }\n setCenterChangedListener(google.maps.event.addListener(map, 'center_changed', onCenterChanged));\n }\n }, [onClick]);\n useEffect(() => {\n var map = ref.current === null ? null : new google.maps.Map(ref.current, options);\n setMap(map);\n if (map !== null && onLoad) {\n onLoad(map);\n }\n return () => {\n if (map !== null) {\n if (onUnmount) {\n onUnmount(map);\n }\n }\n };\n }, []);\n return jsx(\"div\", {\n id: id,\n ref: ref,\n style: mapContainerStyle,\n className: mapContainerClassName,\n children: jsx(MapContext.Provider, {\n value: map,\n children: map !== null ? children : null\n })\n });\n}\n/*#__PURE__*/memo(GoogleMapFunctional);\nclass GoogleMap extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n map: null\n });\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"mapRef\", null);\n _defineProperty(this, \"getInstance\", () => {\n if (this.mapRef === null) {\n return null;\n }\n return new google.maps.Map(this.mapRef, this.props.options);\n });\n _defineProperty(this, \"panTo\", latLng => {\n var map = this.getInstance();\n if (map) {\n map.panTo(latLng);\n }\n });\n _defineProperty(this, \"setMapCallback\", () => {\n if (this.state.map !== null) {\n if (this.props.onLoad) {\n this.props.onLoad(this.state.map);\n }\n }\n });\n _defineProperty(this, \"getRef\", ref => {\n this.mapRef = ref;\n });\n }\n componentDidMount() {\n var map = this.getInstance();\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$i,\n eventMap: eventMap$i,\n prevProps: {},\n nextProps: this.props,\n instance: map\n });\n this.setState(function setMap() {\n return {\n map\n };\n }, this.setMapCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.map !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$i,\n eventMap: eventMap$i,\n prevProps,\n nextProps: this.props,\n instance: this.state.map\n });\n }\n }\n componentWillUnmount() {\n if (this.state.map !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.map);\n }\n unregisterEvents(this.registeredEvents);\n }\n }\n render() {\n return jsx(\"div\", {\n id: this.props.id,\n ref: this.getRef,\n style: this.props.mapContainerStyle,\n className: this.props.mapContainerClassName,\n children: jsx(MapContext.Provider, {\n value: this.state.map,\n children: this.state.map !== null ? this.props.children : null\n })\n });\n }\n}\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) {\n try {\n var i = n[a](c),\n u = i.value;\n } catch (n) {\n return void e(n);\n }\n i.done ? t(u) : Promise.resolve(u).then(r, o);\n}\nfunction _asyncToGenerator(n) {\n return function () {\n var t = this,\n e = arguments;\n return new Promise(function (r, o) {\n var a = n.apply(t, e);\n function _next(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n);\n }\n function _throw(n) {\n asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n);\n }\n _next(void 0);\n });\n };\n}\nfunction makeLoadScriptUrl(_ref) {\n var googleMapsApiKey = _ref.googleMapsApiKey,\n googleMapsClientId = _ref.googleMapsClientId,\n _ref$version = _ref.version,\n version = _ref$version === void 0 ? 'weekly' : _ref$version,\n language = _ref.language,\n region = _ref.region,\n libraries = _ref.libraries,\n channel = _ref.channel,\n mapIds = _ref.mapIds,\n authReferrerPolicy = _ref.authReferrerPolicy;\n var params = [];\n invariant(googleMapsApiKey && googleMapsClientId || !(googleMapsApiKey && googleMapsClientId), 'You need to specify either googleMapsApiKey or googleMapsClientId for @react-google-maps/api load script to work. You cannot use both at the same time.');\n if (googleMapsApiKey) {\n params.push(\"key=\".concat(googleMapsApiKey));\n } else if (googleMapsClientId) {\n params.push(\"client=\".concat(googleMapsClientId));\n }\n if (version) {\n params.push(\"v=\".concat(version));\n }\n if (language) {\n params.push(\"language=\".concat(language));\n }\n if (region) {\n params.push(\"region=\".concat(region));\n }\n if (libraries && libraries.length) {\n params.push(\"libraries=\".concat(libraries.sort().join(',')));\n }\n if (channel) {\n params.push(\"channel=\".concat(channel));\n }\n if (mapIds && mapIds.length) {\n params.push(\"map_ids=\".concat(mapIds.join(',')));\n }\n if (authReferrerPolicy) {\n params.push(\"auth_referrer_policy=\".concat(authReferrerPolicy));\n }\n params.push('loading=async');\n params.push('callback=initMap');\n return \"https://maps.googleapis.com/maps/api/js?\".concat(params.join('&'));\n}\nvar isBrowser = typeof document !== 'undefined';\nfunction injectScript(_ref) {\n var url = _ref.url,\n id = _ref.id,\n nonce = _ref.nonce;\n if (!isBrowser) {\n return Promise.reject(new Error('document is undefined'));\n }\n return new Promise(function injectScriptCallback(resolve, reject) {\n var existingScript = document.getElementById(id);\n var windowWithGoogleMap = window;\n if (existingScript) {\n // Same script id/url: keep same script\n var dataStateAttribute = existingScript.getAttribute('data-state');\n if (existingScript.src === url && dataStateAttribute !== 'error') {\n if (dataStateAttribute === 'ready') {\n return resolve(id);\n } else {\n var originalInitMap = windowWithGoogleMap.initMap;\n var originalErrorCallback = existingScript.onerror;\n windowWithGoogleMap.initMap = function initMap() {\n if (originalInitMap) {\n originalInitMap();\n }\n resolve(id);\n };\n existingScript.onerror = function (err) {\n if (originalErrorCallback) {\n originalErrorCallback(err);\n }\n reject(err);\n };\n return;\n }\n }\n // Same script id, but either\n // 1. requested URL is different\n // 2. script failed to load\n else {\n existingScript.remove();\n }\n }\n var script = document.createElement('script');\n script.type = 'text/javascript';\n script.src = url;\n script.id = id;\n script.async = true;\n script.nonce = nonce || '';\n script.onerror = function onerror(err) {\n script.setAttribute('data-state', 'error');\n reject(err);\n };\n windowWithGoogleMap.initMap = function onload() {\n script.setAttribute('data-state', 'ready');\n resolve(id);\n };\n document.head.appendChild(script);\n }).catch(err => {\n console.error('injectScript error: ', err);\n throw err;\n });\n}\nfunction isGoogleFontStyle(element) {\n // 'Roboto' or 'Google Sans Text' font download\n var href = element.href;\n if (href && (href.indexOf('https://fonts.googleapis.com/css?family=Roboto') === 0 || href.indexOf('https://fonts.googleapis.com/css?family=Google+Sans+Text') === 0)) {\n return true;\n }\n // font style elements\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet.cssText &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet.cssText.replace('\\r\\n', '').indexOf('.gm-style') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.styleSheet.cssText = '';\n return true;\n }\n // font style elements for other browsers\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.innerHTML &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.innerHTML.replace('\\r\\n', '').indexOf('.gm-style') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.innerHTML = '';\n return true;\n }\n // when google tries to add empty style\n if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n element.tagName.toLowerCase() === 'style' &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n !element.styleSheet &&\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n !element.innerHTML) {\n return true;\n }\n return false;\n}\n// Preventing the Google Maps library from downloading an extra font\nfunction preventGoogleFonts() {\n // we override these methods only for one particular head element\n // default methods for other elements are not affected\n var head = document.getElementsByTagName('head')[0];\n if (head) {\n var trueInsertBefore = head.insertBefore.bind(head);\n // TODO: adding return before reflect solves the TS issue\n head.insertBefore = function insertBefore(newElement, referenceElement) {\n if (!isGoogleFontStyle(newElement)) {\n Reflect.apply(trueInsertBefore, head, [newElement, referenceElement]);\n }\n return newElement;\n };\n var trueAppend = head.appendChild.bind(head);\n // TODO: adding return before reflect solves the TS issue\n head.appendChild = function appendChild(textNode) {\n if (!isGoogleFontStyle(textNode)) {\n Reflect.apply(trueAppend, head, [textNode]);\n }\n return textNode;\n };\n }\n}\nvar cleaningUp = false;\nfunction DefaultLoadingElement() {\n return jsx(\"div\", {\n children: \"Loading...\"\n });\n}\nvar defaultLoadScriptProps = {\n id: 'script-loader',\n version: 'weekly'\n};\nclass LoadScript extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"check\", /*#__PURE__*/createRef());\n _defineProperty(this, \"state\", {\n loaded: false\n });\n _defineProperty(this, \"cleanupCallback\", () => {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete window.google.maps;\n this.injectScript();\n });\n _defineProperty(this, \"isCleaningUp\", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var promiseCallback;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n promiseCallback = function _promiseCallback(resolve) {\n if (!cleaningUp) {\n resolve();\n } else {\n if (isBrowser) {\n var timer = window.setInterval(function interval() {\n if (!cleaningUp) {\n window.clearInterval(timer);\n resolve();\n }\n }, 1);\n }\n }\n return;\n };\n return _context.abrupt(\"return\", new Promise(promiseCallback));\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })));\n _defineProperty(this, \"cleanup\", () => {\n cleaningUp = true;\n var script = document.getElementById(this.props.id);\n if (script && script.parentNode) {\n script.parentNode.removeChild(script);\n }\n Array.prototype.slice.call(document.getElementsByTagName('script')).filter(function filter(script) {\n return typeof script.src === 'string' && script.src.includes('maps.googleapis');\n }).forEach(function forEach(script) {\n if (script.parentNode) {\n script.parentNode.removeChild(script);\n }\n });\n Array.prototype.slice.call(document.getElementsByTagName('link')).filter(function filter(link) {\n return link.href === 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Google+Sans';\n }).forEach(function forEach(link) {\n if (link.parentNode) {\n link.parentNode.removeChild(link);\n }\n });\n Array.prototype.slice.call(document.getElementsByTagName('style')).filter(function filter(style) {\n return style.innerText !== undefined && style.innerText.length > 0 && style.innerText.includes('.gm-');\n }).forEach(function forEach(style) {\n if (style.parentNode) {\n style.parentNode.removeChild(style);\n }\n });\n });\n _defineProperty(this, \"injectScript\", () => {\n if (this.props.preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n invariant(!!this.props.id, 'LoadScript requires \"id\" prop to be a string: %s', this.props.id);\n var injectScriptOptions = {\n id: this.props.id,\n nonce: this.props.nonce,\n url: makeLoadScriptUrl(this.props)\n };\n injectScript(injectScriptOptions).then(() => {\n if (this.props.onLoad) {\n this.props.onLoad();\n }\n this.setState(function setLoaded() {\n return {\n loaded: true\n };\n });\n return;\n }).catch(err => {\n if (this.props.onError) {\n this.props.onError(err);\n }\n console.error(\"\\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (\".concat(this.props.googleMapsApiKey || '-', \") or Client ID (\").concat(this.props.googleMapsClientId || '-', \") to \\n Otherwise it is a Network issue.\\n \"));\n });\n });\n }\n componentDidMount() {\n if (isBrowser) {\n if (window.google && window.google.maps && !cleaningUp) {\n console.error('google api is already presented');\n return;\n }\n this.isCleaningUp().then(this.injectScript).catch(function error(err) {\n console.error('Error at injecting script after cleaning up: ', err);\n });\n }\n }\n componentDidUpdate(prevProps) {\n if (this.props.libraries !== prevProps.libraries) {\n console.warn('Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables');\n }\n if (isBrowser && prevProps.language !== this.props.language) {\n this.cleanup();\n // TODO: refactor to use gDSFP maybe... wait for hooks refactoring.\n this.setState(function setLoaded() {\n return {\n loaded: false\n };\n }, this.cleanupCallback);\n }\n }\n componentWillUnmount() {\n if (isBrowser) {\n this.cleanup();\n var timeoutCallback = () => {\n if (!this.check.current) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete window.google;\n cleaningUp = false;\n }\n };\n window.setTimeout(timeoutCallback, 1);\n if (this.props.onUnmount) {\n this.props.onUnmount();\n }\n }\n }\n render() {\n return jsxs(Fragment, {\n children: [jsx(\"div\", {\n ref: this.check\n }), this.state.loaded ? this.props.children : this.props.loadingElement || jsx(DefaultLoadingElement, {})]\n });\n }\n}\n_defineProperty(LoadScript, \"defaultProps\", defaultLoadScriptProps);\nfunction _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (e.includes(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = _objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var s = Object.getOwnPropertySymbols(e);\n for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\n\n/* eslint-disable filenames/match-regex */\nvar previouslyLoadedUrl;\nfunction useLoadScript(_ref) {\n var _ref$id = _ref.id,\n id = _ref$id === void 0 ? defaultLoadScriptProps.id : _ref$id,\n _ref$version2 = _ref.version,\n version = _ref$version2 === void 0 ? defaultLoadScriptProps.version : _ref$version2,\n nonce = _ref.nonce,\n googleMapsApiKey = _ref.googleMapsApiKey,\n googleMapsClientId = _ref.googleMapsClientId,\n language = _ref.language,\n region = _ref.region,\n libraries = _ref.libraries,\n preventGoogleFontsLoading = _ref.preventGoogleFontsLoading,\n channel = _ref.channel,\n mapIds = _ref.mapIds,\n authReferrerPolicy = _ref.authReferrerPolicy;\n var isMounted = useRef(false);\n var _useState27 = useState(false),\n _useState28 = _slicedToArray(_useState27, 2),\n isLoaded = _useState28[0],\n setLoaded = _useState28[1];\n var _useState29 = useState(undefined),\n _useState30 = _slicedToArray(_useState29, 2),\n loadError = _useState30[0],\n setLoadError = _useState30[1];\n useEffect(function trackMountedState() {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n useEffect(function applyPreventGoogleFonts() {\n if (isBrowser && preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n }, [preventGoogleFontsLoading]);\n useEffect(function validateLoadedState() {\n if (isLoaded) {\n invariant(!!window.google, 'useLoadScript was marked as loaded, but window.google is not present. Something went wrong.');\n }\n }, [isLoaded]);\n var url = makeLoadScriptUrl({\n version,\n googleMapsApiKey,\n googleMapsClientId,\n language,\n region,\n libraries,\n channel,\n mapIds,\n authReferrerPolicy\n });\n useEffect(function loadScriptAndModifyLoadedState() {\n if (!isBrowser) {\n return;\n }\n function setLoadedIfMounted() {\n if (isMounted.current) {\n setLoaded(true);\n previouslyLoadedUrl = url;\n }\n }\n if (window.google && window.google.maps && previouslyLoadedUrl === url) {\n setLoadedIfMounted();\n return;\n }\n injectScript({\n id,\n url,\n nonce\n }).then(setLoadedIfMounted).catch(function handleInjectError(err) {\n if (isMounted.current) {\n setLoadError(err);\n }\n console.warn(\"\\n There has been an Error with loading Google Maps API script, please check that you provided correct google API key (\".concat(googleMapsApiKey || '-', \") or Client ID (\").concat(googleMapsClientId || '-', \")\\n Otherwise it is a Network issue.\\n \"));\n console.error(err);\n });\n }, [id, url, nonce]);\n var prevLibraries = useRef();\n useEffect(function checkPerformance() {\n if (prevLibraries.current && libraries !== prevLibraries.current) {\n console.warn('Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables');\n }\n prevLibraries.current = libraries;\n }, [libraries]);\n return {\n isLoaded,\n loadError,\n url\n };\n}\nvar _excluded$1 = [\"loadingElement\", \"onLoad\", \"onError\", \"onUnmount\", \"children\"];\nvar defaultLoadingElement = jsx(DefaultLoadingElement, {});\nfunction LoadScriptNext(_ref) {\n var loadingElement = _ref.loadingElement,\n onLoad = _ref.onLoad,\n onError = _ref.onError,\n onUnmount = _ref.onUnmount,\n children = _ref.children,\n hookOptions = _objectWithoutProperties(_ref, _excluded$1);\n var _useLoadScript = useLoadScript(hookOptions),\n isLoaded = _useLoadScript.isLoaded,\n loadError = _useLoadScript.loadError;\n useEffect(function handleOnLoad() {\n if (isLoaded && typeof onLoad === 'function') {\n onLoad();\n }\n }, [isLoaded, onLoad]);\n useEffect(function handleOnError() {\n if (loadError && typeof onError === 'function') {\n onError(loadError);\n }\n }, [loadError, onError]);\n useEffect(function handleOnUnmount() {\n return () => {\n if (onUnmount) {\n onUnmount();\n }\n };\n }, [onUnmount]);\n return isLoaded ? children : loadingElement || defaultLoadingElement;\n}\nvar LoadScriptNext$1 = /*#__PURE__*/memo(LoadScriptNext);\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nfunction __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, [])).next());\n });\n}\ntypeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\nfunction getDefaultExportFromCjs(x) {\n return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\n// do not edit .js files directly - edit src/index.jst\n\nvar fastDeepEqual$1 = function equal(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n return true;\n }\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n};\nvar isEqual = /*@__PURE__*/getDefaultExportFromCjs(fastDeepEqual$1);\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at.\n *\n * Http://www.apache.org/licenses/LICENSE-2.0.\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar DEFAULT_ID = \"__googleMapsScriptId\";\n/**\n * The status of the [[Loader]].\n */\nvar LoaderStatus;\n(function (LoaderStatus) {\n LoaderStatus[LoaderStatus[\"INITIALIZED\"] = 0] = \"INITIALIZED\";\n LoaderStatus[LoaderStatus[\"LOADING\"] = 1] = \"LOADING\";\n LoaderStatus[LoaderStatus[\"SUCCESS\"] = 2] = \"SUCCESS\";\n LoaderStatus[LoaderStatus[\"FAILURE\"] = 3] = \"FAILURE\";\n})(LoaderStatus || (LoaderStatus = {}));\n/**\n * [[Loader]] makes it easier to add Google Maps JavaScript API to your application\n * dynamically using\n * [Promises](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).\n * It works by dynamically creating and appending a script node to the the\n * document head and wrapping the callback function so as to return a promise.\n *\n * ```\n * const loader = new Loader({\n * apiKey: \"\",\n * version: \"weekly\",\n * libraries: [\"places\"]\n * });\n *\n * loader.load().then((google) => {\n * const map = new google.maps.Map(...)\n * })\n * ```\n */\nclass Loader {\n /**\n * Creates an instance of Loader using [[LoaderOptions]]. No defaults are set\n * using this library, instead the defaults are set by the Google Maps\n * JavaScript API server.\n *\n * ```\n * const loader = Loader({apiKey, version: 'weekly', libraries: ['places']});\n * ```\n */\n constructor(_ref) {\n var apiKey = _ref.apiKey,\n authReferrerPolicy = _ref.authReferrerPolicy,\n channel = _ref.channel,\n client = _ref.client,\n _ref$id2 = _ref.id,\n id = _ref$id2 === void 0 ? DEFAULT_ID : _ref$id2,\n language = _ref.language,\n _ref$libraries = _ref.libraries,\n libraries = _ref$libraries === void 0 ? [] : _ref$libraries,\n mapIds = _ref.mapIds,\n nonce = _ref.nonce,\n region = _ref.region,\n _ref$retries = _ref.retries,\n retries = _ref$retries === void 0 ? 3 : _ref$retries,\n _ref$url = _ref.url,\n url = _ref$url === void 0 ? \"https://maps.googleapis.com/maps/api/js\" : _ref$url,\n version = _ref.version;\n this.callbacks = [];\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.apiKey = apiKey;\n this.authReferrerPolicy = authReferrerPolicy;\n this.channel = channel;\n this.client = client;\n this.id = id || DEFAULT_ID; // Do not allow empty string\n this.language = language;\n this.libraries = libraries;\n this.mapIds = mapIds;\n this.nonce = nonce;\n this.region = region;\n this.retries = retries;\n this.url = url;\n this.version = version;\n if (Loader.instance) {\n if (!isEqual(this.options, Loader.instance.options)) {\n throw new Error(\"Loader must not be called again with different options. \".concat(JSON.stringify(this.options), \" !== \").concat(JSON.stringify(Loader.instance.options)));\n }\n return Loader.instance;\n }\n Loader.instance = this;\n }\n get options() {\n return {\n version: this.version,\n apiKey: this.apiKey,\n channel: this.channel,\n client: this.client,\n id: this.id,\n libraries: this.libraries,\n language: this.language,\n region: this.region,\n mapIds: this.mapIds,\n nonce: this.nonce,\n url: this.url,\n authReferrerPolicy: this.authReferrerPolicy\n };\n }\n get status() {\n if (this.errors.length) {\n return LoaderStatus.FAILURE;\n }\n if (this.done) {\n return LoaderStatus.SUCCESS;\n }\n if (this.loading) {\n return LoaderStatus.LOADING;\n }\n return LoaderStatus.INITIALIZED;\n }\n get failed() {\n return this.done && !this.loading && this.errors.length >= this.retries + 1;\n }\n /**\n * CreateUrl returns the Google Maps JavaScript API script url given the [[LoaderOptions]].\n *\n * @ignore\n * @deprecated\n */\n createUrl() {\n var url = this.url;\n url += \"?callback=__googleMapsCallback&loading=async\";\n if (this.apiKey) {\n url += \"&key=\".concat(this.apiKey);\n }\n if (this.channel) {\n url += \"&channel=\".concat(this.channel);\n }\n if (this.client) {\n url += \"&client=\".concat(this.client);\n }\n if (this.libraries.length > 0) {\n url += \"&libraries=\".concat(this.libraries.join(\",\"));\n }\n if (this.language) {\n url += \"&language=\".concat(this.language);\n }\n if (this.region) {\n url += \"®ion=\".concat(this.region);\n }\n if (this.version) {\n url += \"&v=\".concat(this.version);\n }\n if (this.mapIds) {\n url += \"&map_ids=\".concat(this.mapIds.join(\",\"));\n }\n if (this.authReferrerPolicy) {\n url += \"&auth_referrer_policy=\".concat(this.authReferrerPolicy);\n }\n return url;\n }\n deleteScript() {\n var script = document.getElementById(this.id);\n if (script) {\n script.remove();\n }\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n * @deprecated, use importLibrary() instead.\n */\n load() {\n return this.loadPromise();\n }\n /**\n * Load the Google Maps JavaScript API script and return a Promise.\n *\n * @ignore\n * @deprecated, use importLibrary() instead.\n */\n loadPromise() {\n return new Promise((resolve, reject) => {\n this.loadCallback(err => {\n if (!err) {\n resolve(window.google);\n } else {\n reject(err.error);\n }\n });\n });\n }\n importLibrary(name) {\n this.execute();\n return google.maps.importLibrary(name);\n }\n /**\n * Load the Google Maps JavaScript API script with a callback.\n * @deprecated, use importLibrary() instead.\n */\n loadCallback(fn) {\n this.callbacks.push(fn);\n this.execute();\n }\n /**\n * Set the script on document.\n */\n setScript() {\n var _a, _b;\n if (document.getElementById(this.id)) {\n // TODO wrap onerror callback for cases where the script was loaded elsewhere\n this.callback();\n return;\n }\n var params = {\n key: this.apiKey,\n channel: this.channel,\n client: this.client,\n libraries: this.libraries.length && this.libraries,\n v: this.version,\n mapIds: this.mapIds,\n language: this.language,\n region: this.region,\n authReferrerPolicy: this.authReferrerPolicy\n };\n // keep the URL minimal:\n Object.keys(params).forEach(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n key => !params[key] && delete params[key]);\n if (!((_b = (_a = window === null || window === void 0 ? void 0 : window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.importLibrary)) {\n // tweaked copy of https://developers.google.com/maps/documentation/javascript/load-maps-js-api#dynamic-library-import\n // which also sets the base url, the id, and the nonce\n /* eslint-disable */\n (g => {\n // @ts-ignore\n var h,\n a,\n k,\n p = \"The Google Maps JavaScript API\",\n c = \"google\",\n l = \"importLibrary\",\n q = \"__ib__\",\n m = document,\n b = window;\n // @ts-ignore\n b = b[c] || (b[c] = {});\n // @ts-ignore\n var d = b.maps || (b.maps = {}),\n r = new Set(),\n e = new URLSearchParams(),\n u = () =>\n // @ts-ignore\n h || (h = new Promise((f, n) => __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _a;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return a = m.createElement(\"script\");\n case 2:\n a.id = this.id;\n e.set(\"libraries\", [...r] + \"\");\n // @ts-ignore\n for (k in g) e.set(k.replace(/[A-Z]/g, t => \"_\" + t[0].toLowerCase()), g[k]);\n e.set(\"callback\", c + \".maps.\" + q);\n a.src = this.url + \"?\" + e;\n d[q] = f;\n a.onerror = () => h = n(Error(p + \" could not load.\"));\n // @ts-ignore\n a.nonce = this.nonce || ((_a = m.querySelector(\"script[nonce]\")) === null || _a === void 0 ? void 0 : _a.nonce) || \"\";\n m.head.append(a);\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }))));\n // @ts-ignore\n d[l] ? console.warn(p + \" only loads once. Ignoring:\", g) : d[l] = function (f) {\n for (var _len = arguments.length, n = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n n[_key - 1] = arguments[_key];\n }\n return r.add(f) && u().then(() => d[l](f, ...n));\n };\n })(params);\n /* eslint-enable */\n }\n // While most libraries populate the global namespace when loaded via bootstrap params,\n // this is not the case for \"marker\" when used with the inline bootstrap loader\n // (and maybe others in the future). So ensure there is an importLibrary for each:\n var libraryPromises = this.libraries.map(library => this.importLibrary(library));\n // ensure at least one library, to kick off loading...\n if (!libraryPromises.length) {\n libraryPromises.push(this.importLibrary(\"core\"));\n }\n Promise.all(libraryPromises).then(() => this.callback(), error => {\n var event = new ErrorEvent(\"error\", {\n error\n }); // for backwards compat\n this.loadErrorCallback(event);\n });\n }\n /**\n * Reset the loader state.\n */\n reset() {\n this.deleteScript();\n this.done = false;\n this.loading = false;\n this.errors = [];\n this.onerrorEvent = null;\n }\n resetIfRetryingFailed() {\n if (this.failed) {\n this.reset();\n }\n }\n loadErrorCallback(e) {\n this.errors.push(e);\n if (this.errors.length <= this.retries) {\n var delay = this.errors.length * Math.pow(2, this.errors.length);\n console.error(\"Failed to load Google Maps script, retrying in \".concat(delay, \" ms.\"));\n setTimeout(() => {\n this.deleteScript();\n this.setScript();\n }, delay);\n } else {\n this.onerrorEvent = e;\n this.callback();\n }\n }\n callback() {\n this.done = true;\n this.loading = false;\n this.callbacks.forEach(cb => {\n cb(this.onerrorEvent);\n });\n this.callbacks = [];\n }\n execute() {\n this.resetIfRetryingFailed();\n if (this.loading) {\n // do nothing but wait\n return;\n }\n if (this.done) {\n this.callback();\n } else {\n // short circuit and warn if google.maps is already loaded\n if (window.google && window.google.maps && window.google.maps.version) {\n console.warn(\"Google Maps already loaded outside @googlemaps/js-api-loader. \" + \"This may result in undesirable behavior as options and script parameters may not match.\");\n this.callback();\n return;\n }\n this.loading = true;\n this.setScript();\n }\n }\n}\nvar defaultLibraries = ['maps'];\nfunction useJsApiLoader(_ref) {\n var _ref$id3 = _ref.id,\n id = _ref$id3 === void 0 ? defaultLoadScriptProps.id : _ref$id3,\n _ref$version3 = _ref.version,\n version = _ref$version3 === void 0 ? defaultLoadScriptProps.version : _ref$version3,\n nonce = _ref.nonce,\n googleMapsApiKey = _ref.googleMapsApiKey,\n language = _ref.language,\n region = _ref.region,\n _ref$libraries2 = _ref.libraries,\n libraries = _ref$libraries2 === void 0 ? defaultLibraries : _ref$libraries2,\n preventGoogleFontsLoading = _ref.preventGoogleFontsLoading,\n mapIds = _ref.mapIds,\n authReferrerPolicy = _ref.authReferrerPolicy;\n var isMounted = useRef(false);\n var _useState31 = useState(false),\n _useState32 = _slicedToArray(_useState31, 2),\n isLoaded = _useState32[0],\n setLoaded = _useState32[1];\n var _useState33 = useState(undefined),\n _useState34 = _slicedToArray(_useState33, 2),\n loadError = _useState34[0],\n setLoadError = _useState34[1];\n useEffect(function trackMountedState() {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n var loader = useMemo(() => {\n return new Loader({\n id,\n apiKey: googleMapsApiKey,\n version,\n libraries,\n language: language || 'en',\n region: region || 'US',\n mapIds: mapIds || [],\n nonce: nonce || '',\n authReferrerPolicy: authReferrerPolicy || 'origin'\n });\n }, [id, googleMapsApiKey, version, libraries, language, region, mapIds, nonce, authReferrerPolicy]);\n useEffect(function effect() {\n if (isLoaded) {\n return;\n } else {\n loader.load().then(() => {\n if (isMounted.current) {\n setLoaded(true);\n }\n return;\n }).catch(error => {\n setLoadError(error);\n });\n }\n }, []);\n useEffect(() => {\n if (isBrowser && preventGoogleFontsLoading) {\n preventGoogleFonts();\n }\n }, [preventGoogleFontsLoading]);\n var prevLibraries = useRef();\n useEffect(() => {\n if (prevLibraries.current && libraries !== prevLibraries.current) {\n console.warn('Performance warning! LoadScript has been reloaded unintentionally! You should not pass `libraries` prop as new array. Please keep an array of libraries as static class property for Components and PureComponents, or just a const variable outside of component, or somewhere in config files or ENV variables');\n }\n prevLibraries.current = libraries;\n }, [libraries]);\n return {\n isLoaded,\n loadError\n };\n}\nfunction ownKeys$f(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$f(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$h = {};\nvar updaterMap$h = {\n options(instance, options) {\n instance.setOptions(options);\n }\n};\nfunction TrafficLayerFunctional(_ref) {\n var options = _ref.options,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState35 = useState(null),\n _useState36 = _slicedToArray(_useState35, 2),\n instance = _useState36[0],\n setInstance = _useState36[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n var trafficLayer = new google.maps.TrafficLayer(_objectSpread$f(_objectSpread$f({}, options), {}, {\n map\n }));\n setInstance(trafficLayer);\n if (onLoad) {\n onLoad(trafficLayer);\n }\n return () => {\n if (instance !== null) {\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar TrafficLayerF = /*#__PURE__*/memo(TrafficLayerFunctional);\nclass TrafficLayer extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n trafficLayer: null\n });\n _defineProperty(this, \"setTrafficLayerCallback\", () => {\n if (this.state.trafficLayer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.trafficLayer);\n }\n });\n _defineProperty(this, \"registeredEvents\", []);\n }\n componentDidMount() {\n var trafficLayer = new google.maps.TrafficLayer(_objectSpread$f(_objectSpread$f({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$h,\n eventMap: eventMap$h,\n prevProps: {},\n nextProps: this.props,\n instance: trafficLayer\n });\n this.setState(function setTrafficLayer() {\n return {\n trafficLayer\n };\n }, this.setTrafficLayerCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.trafficLayer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$h,\n eventMap: eventMap$h,\n prevProps,\n nextProps: this.props,\n instance: this.state.trafficLayer\n });\n }\n }\n componentWillUnmount() {\n if (this.state.trafficLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.trafficLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.trafficLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(TrafficLayer, \"contextType\", MapContext);\nfunction BicyclingLayerFunctional(_ref) {\n var onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState37 = useState(null),\n _useState38 = _slicedToArray(_useState37, 2),\n instance = _useState38[0],\n setInstance = _useState38[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n var bicyclingLayer = new google.maps.BicyclingLayer();\n setInstance(bicyclingLayer);\n bicyclingLayer.setMap(map);\n if (onLoad) {\n onLoad(bicyclingLayer);\n }\n return () => {\n if (bicyclingLayer !== null) {\n if (onUnmount) {\n onUnmount(bicyclingLayer);\n }\n bicyclingLayer.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar BicyclingLayerF = /*#__PURE__*/memo(BicyclingLayerFunctional);\nclass BicyclingLayer extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n bicyclingLayer: null\n });\n _defineProperty(this, \"setBicyclingLayerCallback\", () => {\n if (this.state.bicyclingLayer !== null) {\n this.state.bicyclingLayer.setMap(this.context);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.bicyclingLayer);\n }\n }\n });\n }\n componentDidMount() {\n var bicyclingLayer = new google.maps.BicyclingLayer();\n this.setState(() => {\n return {\n bicyclingLayer\n };\n }, this.setBicyclingLayerCallback);\n }\n componentWillUnmount() {\n if (this.state.bicyclingLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.bicyclingLayer);\n }\n this.state.bicyclingLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(BicyclingLayer, \"contextType\", MapContext);\nfunction TransitLayerFunctional(_ref) {\n var onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState39 = useState(null),\n _useState40 = _slicedToArray(_useState39, 2),\n instance = _useState40[0],\n setInstance = _useState40[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n var transitLayer = new google.maps.TransitLayer();\n setInstance(transitLayer);\n transitLayer.setMap(map);\n if (onLoad) {\n onLoad(transitLayer);\n }\n return () => {\n if (instance !== null) {\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar TransitLayerF = /*#__PURE__*/memo(TransitLayerFunctional);\nclass TransitLayer extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n transitLayer: null\n });\n _defineProperty(this, \"setTransitLayerCallback\", () => {\n if (this.state.transitLayer !== null) {\n this.state.transitLayer.setMap(this.context);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.transitLayer);\n }\n }\n });\n }\n componentDidMount() {\n var transitLayer = new google.maps.TransitLayer();\n this.setState(function setTransitLayer() {\n return {\n transitLayer\n };\n }, this.setTransitLayerCallback);\n }\n componentWillUnmount() {\n if (this.state.transitLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.transitLayer);\n }\n this.state.transitLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(TransitLayer, \"contextType\", MapContext);\nfunction ownKeys$e(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$e(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$g = {\n onCircleComplete: 'circlecomplete',\n onMarkerComplete: 'markercomplete',\n onOverlayComplete: 'overlaycomplete',\n onPolygonComplete: 'polygoncomplete',\n onPolylineComplete: 'polylinecomplete',\n onRectangleComplete: 'rectanglecomplete'\n};\nvar updaterMap$g = {\n drawingMode(instance, drawingMode) {\n instance.setDrawingMode(drawingMode);\n },\n options(instance, options) {\n instance.setOptions(options);\n }\n};\nfunction DrawingManagerFunctional(_ref) {\n var options = _ref.options,\n drawingMode = _ref.drawingMode,\n onCircleComplete = _ref.onCircleComplete,\n onMarkerComplete = _ref.onMarkerComplete,\n onOverlayComplete = _ref.onOverlayComplete,\n onPolygonComplete = _ref.onPolygonComplete,\n onPolylineComplete = _ref.onPolylineComplete,\n onRectangleComplete = _ref.onRectangleComplete,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState41 = useState(null),\n _useState42 = _slicedToArray(_useState41, 2),\n instance = _useState42[0],\n setInstance = _useState42[1];\n var _useState43 = useState(null),\n _useState44 = _slicedToArray(_useState43, 2),\n circlecompleteListener = _useState44[0],\n setCircleCompleteListener = _useState44[1];\n var _useState45 = useState(null),\n _useState46 = _slicedToArray(_useState45, 2),\n markercompleteListener = _useState46[0],\n setMarkerCompleteListener = _useState46[1];\n var _useState47 = useState(null),\n _useState48 = _slicedToArray(_useState47, 2),\n overlaycompleteListener = _useState48[0],\n setOverlayCompleteListener = _useState48[1];\n var _useState49 = useState(null),\n _useState50 = _slicedToArray(_useState49, 2),\n polygoncompleteListener = _useState50[0],\n setPolygonCompleteListener = _useState50[1];\n var _useState51 = useState(null),\n _useState52 = _slicedToArray(_useState51, 2),\n polylinecompleteListener = _useState52[0],\n setPolylineCompleteListener = _useState52[1];\n var _useState53 = useState(null),\n _useState54 = _slicedToArray(_useState53, 2),\n rectanglecompleteListener = _useState54[0],\n setRectangleCompleteListener = _useState54[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (instance !== null) {\n instance.setDrawingMode(drawingMode !== null && drawingMode !== void 0 ? drawingMode : null);\n }\n }, [instance, drawingMode]);\n useEffect(() => {\n if (instance && onCircleComplete) {\n if (circlecompleteListener !== null) {\n google.maps.event.removeListener(circlecompleteListener);\n }\n setCircleCompleteListener(google.maps.event.addListener(instance, 'circlecomplete', onCircleComplete));\n }\n }, [instance, onCircleComplete]);\n useEffect(() => {\n if (instance && onMarkerComplete) {\n if (markercompleteListener !== null) {\n google.maps.event.removeListener(markercompleteListener);\n }\n setMarkerCompleteListener(google.maps.event.addListener(instance, 'markercomplete', onMarkerComplete));\n }\n }, [instance, onMarkerComplete]);\n useEffect(() => {\n if (instance && onOverlayComplete) {\n if (overlaycompleteListener !== null) {\n google.maps.event.removeListener(overlaycompleteListener);\n }\n setOverlayCompleteListener(google.maps.event.addListener(instance, 'overlaycomplete', onOverlayComplete));\n }\n }, [instance, onOverlayComplete]);\n useEffect(() => {\n if (instance && onPolygonComplete) {\n if (polygoncompleteListener !== null) {\n google.maps.event.removeListener(polygoncompleteListener);\n }\n setPolygonCompleteListener(google.maps.event.addListener(instance, 'polygoncomplete', onPolygonComplete));\n }\n }, [instance, onPolygonComplete]);\n useEffect(() => {\n if (instance && onPolylineComplete) {\n if (polylinecompleteListener !== null) {\n google.maps.event.removeListener(polylinecompleteListener);\n }\n setPolylineCompleteListener(google.maps.event.addListener(instance, 'polylinecomplete', onPolylineComplete));\n }\n }, [instance, onPolylineComplete]);\n useEffect(() => {\n if (instance && onRectangleComplete) {\n if (rectanglecompleteListener !== null) {\n google.maps.event.removeListener(rectanglecompleteListener);\n }\n setRectangleCompleteListener(google.maps.event.addListener(instance, 'rectanglecomplete', onRectangleComplete));\n }\n }, [instance, onRectangleComplete]);\n useEffect(() => {\n invariant(!!google.maps.drawing, \"Did you include prop libraries={['drawing']} in the URL? %s\", google.maps.drawing);\n var drawingManager = new google.maps.drawing.DrawingManager(_objectSpread$e(_objectSpread$e({}, options), {}, {\n map\n }));\n if (drawingMode) {\n drawingManager.setDrawingMode(drawingMode);\n }\n if (onCircleComplete) {\n setCircleCompleteListener(google.maps.event.addListener(drawingManager, 'circlecomplete', onCircleComplete));\n }\n if (onMarkerComplete) {\n setMarkerCompleteListener(google.maps.event.addListener(drawingManager, 'markercomplete', onMarkerComplete));\n }\n if (onOverlayComplete) {\n setOverlayCompleteListener(google.maps.event.addListener(drawingManager, 'overlaycomplete', onOverlayComplete));\n }\n if (onPolygonComplete) {\n setPolygonCompleteListener(google.maps.event.addListener(drawingManager, 'polygoncomplete', onPolygonComplete));\n }\n if (onPolylineComplete) {\n setPolylineCompleteListener(google.maps.event.addListener(drawingManager, 'polylinecomplete', onPolylineComplete));\n }\n if (onRectangleComplete) {\n setRectangleCompleteListener(google.maps.event.addListener(drawingManager, 'rectanglecomplete', onRectangleComplete));\n }\n setInstance(drawingManager);\n if (onLoad) {\n onLoad(drawingManager);\n }\n return () => {\n if (instance !== null) {\n if (circlecompleteListener) {\n google.maps.event.removeListener(circlecompleteListener);\n }\n if (markercompleteListener) {\n google.maps.event.removeListener(markercompleteListener);\n }\n if (overlaycompleteListener) {\n google.maps.event.removeListener(overlaycompleteListener);\n }\n if (polygoncompleteListener) {\n google.maps.event.removeListener(polygoncompleteListener);\n }\n if (polylinecompleteListener) {\n google.maps.event.removeListener(polylinecompleteListener);\n }\n if (rectanglecompleteListener) {\n google.maps.event.removeListener(rectanglecompleteListener);\n }\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar DrawingManagerF = /*#__PURE__*/memo(DrawingManagerFunctional);\nclass DrawingManager extends PureComponent {\n constructor(props) {\n super(props);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n drawingManager: null\n });\n _defineProperty(this, \"setDrawingManagerCallback\", () => {\n if (this.state.drawingManager !== null && this.props.onLoad) {\n this.props.onLoad(this.state.drawingManager);\n }\n });\n invariant(!!google.maps.drawing, \"Did you include prop libraries={['drawing']} in the URL? %s\", google.maps.drawing);\n }\n componentDidMount() {\n var drawingManager = new google.maps.drawing.DrawingManager(_objectSpread$e(_objectSpread$e({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$g,\n eventMap: eventMap$g,\n prevProps: {},\n nextProps: this.props,\n instance: drawingManager\n });\n this.setState(function setDrawingManager() {\n return {\n drawingManager\n };\n }, this.setDrawingManagerCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.drawingManager !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$g,\n eventMap: eventMap$g,\n prevProps,\n nextProps: this.props,\n instance: this.state.drawingManager\n });\n }\n }\n componentWillUnmount() {\n if (this.state.drawingManager !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.drawingManager);\n }\n unregisterEvents(this.registeredEvents);\n this.state.drawingManager.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(DrawingManager, \"contextType\", MapContext);\nfunction ownKeys$d(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$d(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$f = {\n onAnimationChanged: 'animation_changed',\n onClick: 'click',\n onClickableChanged: 'clickable_changed',\n onCursorChanged: 'cursor_changed',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDraggableChanged: 'draggable_changed',\n onDragStart: 'dragstart',\n onFlatChanged: 'flat_changed',\n onIconChanged: 'icon_changed',\n onMouseDown: 'mousedown',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onPositionChanged: 'position_changed',\n onRightClick: 'rightclick',\n onShapeChanged: 'shape_changed',\n onTitleChanged: 'title_changed',\n onVisibleChanged: 'visible_changed',\n onZindexChanged: 'zindex_changed'\n};\nvar updaterMap$f = {\n animation(instance, animation) {\n instance.setAnimation(animation);\n },\n clickable(instance, clickable) {\n instance.setClickable(clickable);\n },\n cursor(instance, cursor) {\n instance.setCursor(cursor);\n },\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n icon(instance, icon) {\n instance.setIcon(icon);\n },\n label(instance, label) {\n instance.setLabel(label);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n opacity(instance, opacity) {\n instance.setOpacity(opacity);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n position(instance, position) {\n instance.setPosition(position);\n },\n shape(instance, shape) {\n instance.setShape(shape);\n },\n title(instance, title) {\n instance.setTitle(title);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n }\n};\nvar defaultOptions$5 = {};\nfunction MarkerFunctional(_ref) {\n var position = _ref.position,\n options = _ref.options,\n clusterer = _ref.clusterer,\n noClustererRedraw = _ref.noClustererRedraw,\n children = _ref.children,\n draggable = _ref.draggable,\n visible = _ref.visible,\n animation = _ref.animation,\n clickable = _ref.clickable,\n cursor = _ref.cursor,\n icon = _ref.icon,\n label = _ref.label,\n opacity = _ref.opacity,\n shape = _ref.shape,\n title = _ref.title,\n zIndex = _ref.zIndex,\n onClick = _ref.onClick,\n onDblClick = _ref.onDblClick,\n onDrag = _ref.onDrag,\n onDragEnd = _ref.onDragEnd,\n onDragStart = _ref.onDragStart,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseUp = _ref.onMouseUp,\n onMouseDown = _ref.onMouseDown,\n onRightClick = _ref.onRightClick,\n onClickableChanged = _ref.onClickableChanged,\n onCursorChanged = _ref.onCursorChanged,\n onAnimationChanged = _ref.onAnimationChanged,\n onDraggableChanged = _ref.onDraggableChanged,\n onFlatChanged = _ref.onFlatChanged,\n onIconChanged = _ref.onIconChanged,\n onPositionChanged = _ref.onPositionChanged,\n onShapeChanged = _ref.onShapeChanged,\n onTitleChanged = _ref.onTitleChanged,\n onVisibleChanged = _ref.onVisibleChanged,\n onZindexChanged = _ref.onZindexChanged,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState55 = useState(null),\n _useState56 = _slicedToArray(_useState55, 2),\n instance = _useState56[0],\n setInstance = _useState56[1];\n var _useState57 = useState(null),\n _useState58 = _slicedToArray(_useState57, 2),\n dblclickListener = _useState58[0],\n setDblclickListener = _useState58[1];\n var _useState59 = useState(null),\n _useState60 = _slicedToArray(_useState59, 2),\n dragendListener = _useState60[0],\n setDragendListener = _useState60[1];\n var _useState61 = useState(null),\n _useState62 = _slicedToArray(_useState61, 2),\n dragstartListener = _useState62[0],\n setDragstartListener = _useState62[1];\n var _useState63 = useState(null),\n _useState64 = _slicedToArray(_useState63, 2),\n mousedownListener = _useState64[0],\n setMousedownListener = _useState64[1];\n var _useState65 = useState(null),\n _useState66 = _slicedToArray(_useState65, 2),\n mouseoutListener = _useState66[0],\n setMouseoutListener = _useState66[1];\n var _useState67 = useState(null),\n _useState68 = _slicedToArray(_useState67, 2),\n mouseoverListener = _useState68[0],\n setMouseoverListener = _useState68[1];\n var _useState69 = useState(null),\n _useState70 = _slicedToArray(_useState69, 2),\n mouseupListener = _useState70[0],\n setMouseupListener = _useState70[1];\n var _useState71 = useState(null),\n _useState72 = _slicedToArray(_useState71, 2),\n rightclickListener = _useState72[0],\n setRightclickListener = _useState72[1];\n var _useState73 = useState(null),\n _useState74 = _slicedToArray(_useState73, 2),\n clickListener = _useState74[0],\n setClickListener = _useState74[1];\n var _useState75 = useState(null),\n _useState76 = _slicedToArray(_useState75, 2),\n dragListener = _useState76[0],\n setDragListener = _useState76[1];\n var _useState77 = useState(null),\n _useState78 = _slicedToArray(_useState77, 2),\n clickableChangedListener = _useState78[0],\n setClickableChangedListener = _useState78[1];\n var _useState79 = useState(null),\n _useState80 = _slicedToArray(_useState79, 2),\n cursorChangedListener = _useState80[0],\n setCursorChangedListener = _useState80[1];\n var _useState81 = useState(null),\n _useState82 = _slicedToArray(_useState81, 2),\n animationChangedListener = _useState82[0],\n setAnimationChangedListener = _useState82[1];\n var _useState83 = useState(null),\n _useState84 = _slicedToArray(_useState83, 2),\n draggableChangedListener = _useState84[0],\n setDraggableChangedListener = _useState84[1];\n var _useState85 = useState(null),\n _useState86 = _slicedToArray(_useState85, 2),\n flatChangedListener = _useState86[0],\n setFlatChangedListener = _useState86[1];\n var _useState87 = useState(null),\n _useState88 = _slicedToArray(_useState87, 2),\n iconChangedListener = _useState88[0],\n setIconChangedListener = _useState88[1];\n var _useState89 = useState(null),\n _useState90 = _slicedToArray(_useState89, 2),\n positionChangedListener = _useState90[0],\n setPositionChangedListener = _useState90[1];\n var _useState91 = useState(null),\n _useState92 = _slicedToArray(_useState91, 2),\n shapeChangedListener = _useState92[0],\n setShapeChangedListener = _useState92[1];\n var _useState93 = useState(null),\n _useState94 = _slicedToArray(_useState93, 2),\n titleChangedListener = _useState94[0],\n setTitleChangedListener = _useState94[1];\n var _useState95 = useState(null),\n _useState96 = _slicedToArray(_useState95, 2),\n visibleChangedListener = _useState96[0],\n setVisibleChangedListener = _useState96[1];\n var _useState97 = useState(null),\n _useState98 = _slicedToArray(_useState97, 2),\n zIndexChangedListener = _useState98[0],\n setZindexChangedListener = _useState98[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(() => {\n if (position && instance !== null) {\n instance.setPosition(position);\n }\n }, [instance, position]);\n useEffect(() => {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(() => {\n instance === null || instance === void 0 || instance.setAnimation(animation);\n }, [instance, animation]);\n useEffect(() => {\n if (instance && clickable !== undefined) {\n instance.setClickable(clickable);\n }\n }, [instance, clickable]);\n useEffect(() => {\n if (instance && cursor !== undefined) {\n instance.setCursor(cursor);\n }\n }, [instance, cursor]);\n useEffect(() => {\n if (instance && icon !== undefined) {\n instance.setIcon(icon);\n }\n }, [instance, icon]);\n useEffect(() => {\n if (instance && label !== undefined) {\n instance.setLabel(label);\n }\n }, [instance, label]);\n useEffect(() => {\n if (instance && opacity !== undefined) {\n instance.setOpacity(opacity);\n }\n }, [instance, opacity]);\n useEffect(() => {\n if (instance && shape !== undefined) {\n instance.setShape(shape);\n }\n }, [instance, shape]);\n useEffect(() => {\n if (instance && title !== undefined) {\n instance.setTitle(title);\n }\n }, [instance, title]);\n useEffect(() => {\n if (instance && zIndex !== undefined) {\n instance.setZIndex(zIndex);\n }\n }, [instance, zIndex]);\n useEffect(() => {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(() => {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(() => {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(() => {\n if (instance && onClickableChanged) {\n if (clickableChangedListener !== null) {\n google.maps.event.removeListener(clickableChangedListener);\n }\n setClickableChangedListener(google.maps.event.addListener(instance, 'clickable_changed', onClickableChanged));\n }\n }, [onClickableChanged]);\n useEffect(() => {\n if (instance && onCursorChanged) {\n if (cursorChangedListener !== null) {\n google.maps.event.removeListener(cursorChangedListener);\n }\n setCursorChangedListener(google.maps.event.addListener(instance, 'cursor_changed', onCursorChanged));\n }\n }, [onCursorChanged]);\n useEffect(() => {\n if (instance && onAnimationChanged) {\n if (animationChangedListener !== null) {\n google.maps.event.removeListener(animationChangedListener);\n }\n setAnimationChangedListener(google.maps.event.addListener(instance, 'animation_changed', onAnimationChanged));\n }\n }, [onAnimationChanged]);\n useEffect(() => {\n if (instance && onDraggableChanged) {\n if (draggableChangedListener !== null) {\n google.maps.event.removeListener(draggableChangedListener);\n }\n setDraggableChangedListener(google.maps.event.addListener(instance, 'draggable_changed', onDraggableChanged));\n }\n }, [onDraggableChanged]);\n useEffect(() => {\n if (instance && onFlatChanged) {\n if (flatChangedListener !== null) {\n google.maps.event.removeListener(flatChangedListener);\n }\n setFlatChangedListener(google.maps.event.addListener(instance, 'flat_changed', onFlatChanged));\n }\n }, [onFlatChanged]);\n useEffect(() => {\n if (instance && onIconChanged) {\n if (iconChangedListener !== null) {\n google.maps.event.removeListener(iconChangedListener);\n }\n setIconChangedListener(google.maps.event.addListener(instance, 'icon_changed', onIconChanged));\n }\n }, [onIconChanged]);\n useEffect(() => {\n if (instance && onPositionChanged) {\n if (positionChangedListener !== null) {\n google.maps.event.removeListener(positionChangedListener);\n }\n setPositionChangedListener(google.maps.event.addListener(instance, 'position_changed', onPositionChanged));\n }\n }, [onPositionChanged]);\n useEffect(() => {\n if (instance && onShapeChanged) {\n if (shapeChangedListener !== null) {\n google.maps.event.removeListener(shapeChangedListener);\n }\n setShapeChangedListener(google.maps.event.addListener(instance, 'shape_changed', onShapeChanged));\n }\n }, [onShapeChanged]);\n useEffect(() => {\n if (instance && onTitleChanged) {\n if (titleChangedListener !== null) {\n google.maps.event.removeListener(titleChangedListener);\n }\n setTitleChangedListener(google.maps.event.addListener(instance, 'title_changed', onTitleChanged));\n }\n }, [onTitleChanged]);\n useEffect(() => {\n if (instance && onVisibleChanged) {\n if (visibleChangedListener !== null) {\n google.maps.event.removeListener(visibleChangedListener);\n }\n setVisibleChangedListener(google.maps.event.addListener(instance, 'visible_changed', onVisibleChanged));\n }\n }, [onVisibleChanged]);\n useEffect(() => {\n if (instance && onZindexChanged) {\n if (zIndexChangedListener !== null) {\n google.maps.event.removeListener(zIndexChangedListener);\n }\n setZindexChangedListener(google.maps.event.addListener(instance, 'zindex_changed', onZindexChanged));\n }\n }, [onZindexChanged]);\n useEffect(() => {\n var markerOptions = _objectSpread$d(_objectSpread$d(_objectSpread$d({}, options || defaultOptions$5), clusterer ? defaultOptions$5 : {\n map\n }), {}, {\n position\n });\n var marker = new google.maps.Marker(markerOptions);\n if (clusterer) {\n clusterer.addMarker(marker, !!noClustererRedraw);\n } else {\n marker.setMap(map);\n }\n if (position) {\n marker.setPosition(position);\n }\n if (typeof visible !== 'undefined') {\n marker.setVisible(visible);\n }\n if (typeof draggable !== 'undefined') {\n marker.setDraggable(draggable);\n }\n if (typeof clickable !== 'undefined') {\n marker.setClickable(clickable);\n }\n if (typeof cursor === 'string') {\n marker.setCursor(cursor);\n }\n if (icon) {\n marker.setIcon(icon);\n }\n if (typeof label !== 'undefined') {\n marker.setLabel(label);\n }\n if (typeof opacity !== 'undefined') {\n marker.setOpacity(opacity);\n }\n if (shape) {\n marker.setShape(shape);\n }\n if (typeof title === 'string') {\n marker.setTitle(title);\n }\n if (typeof zIndex === 'number') {\n marker.setZIndex(zIndex);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(marker, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(marker, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(marker, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(marker, 'mousedown', onMouseDown));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(marker, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(marker, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(marker, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(marker, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(marker, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(marker, 'drag', onDrag));\n }\n if (onClickableChanged) {\n setClickableChangedListener(google.maps.event.addListener(marker, 'clickable_changed', onClickableChanged));\n }\n if (onCursorChanged) {\n setCursorChangedListener(google.maps.event.addListener(marker, 'cursor_changed', onCursorChanged));\n }\n if (onAnimationChanged) {\n setAnimationChangedListener(google.maps.event.addListener(marker, 'animation_changed', onAnimationChanged));\n }\n if (onDraggableChanged) {\n setDraggableChangedListener(google.maps.event.addListener(marker, 'draggable_changed', onDraggableChanged));\n }\n if (onFlatChanged) {\n setFlatChangedListener(google.maps.event.addListener(marker, 'flat_changed', onFlatChanged));\n }\n if (onIconChanged) {\n setIconChangedListener(google.maps.event.addListener(marker, 'icon_changed', onIconChanged));\n }\n if (onPositionChanged) {\n setPositionChangedListener(google.maps.event.addListener(marker, 'position_changed', onPositionChanged));\n }\n if (onShapeChanged) {\n setShapeChangedListener(google.maps.event.addListener(marker, 'shape_changed', onShapeChanged));\n }\n if (onTitleChanged) {\n setTitleChangedListener(google.maps.event.addListener(marker, 'title_changed', onTitleChanged));\n }\n if (onVisibleChanged) {\n setVisibleChangedListener(google.maps.event.addListener(marker, 'visible_changed', onVisibleChanged));\n }\n if (onZindexChanged) {\n setZindexChangedListener(google.maps.event.addListener(marker, 'zindex_changed', onZindexChanged));\n }\n setInstance(marker);\n if (onLoad) {\n onLoad(marker);\n }\n return () => {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (clickableChangedListener !== null) {\n google.maps.event.removeListener(clickableChangedListener);\n }\n if (cursorChangedListener !== null) {\n google.maps.event.removeListener(cursorChangedListener);\n }\n if (animationChangedListener !== null) {\n google.maps.event.removeListener(animationChangedListener);\n }\n if (draggableChangedListener !== null) {\n google.maps.event.removeListener(draggableChangedListener);\n }\n if (flatChangedListener !== null) {\n google.maps.event.removeListener(flatChangedListener);\n }\n if (iconChangedListener !== null) {\n google.maps.event.removeListener(iconChangedListener);\n }\n if (positionChangedListener !== null) {\n google.maps.event.removeListener(positionChangedListener);\n }\n if (titleChangedListener !== null) {\n google.maps.event.removeListener(titleChangedListener);\n }\n if (visibleChangedListener !== null) {\n google.maps.event.removeListener(visibleChangedListener);\n }\n if (zIndexChangedListener !== null) {\n google.maps.event.removeListener(zIndexChangedListener);\n }\n if (onUnmount) {\n onUnmount(marker);\n }\n if (clusterer) {\n clusterer.removeMarker(marker, !!noClustererRedraw);\n } else if (marker) {\n marker.setMap(null);\n }\n };\n }, []);\n var chx = useMemo(() => {\n return children ? Children.map(children, child => {\n if (! /*#__PURE__*/isValidElement(child)) {\n return child;\n }\n var elementChild = child;\n return /*#__PURE__*/cloneElement(elementChild, {\n anchor: instance\n });\n }) : null;\n }, [children, instance]);\n return jsx(Fragment, {\n children: chx\n }) || null;\n}\nvar MarkerF = /*#__PURE__*/memo(MarkerFunctional);\nclass Marker extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n }\n componentDidMount() {\n var _this = this;\n return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var markerOptions;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n markerOptions = _objectSpread$d(_objectSpread$d(_objectSpread$d({}, _this.props.options || defaultOptions$5), _this.props.clusterer ? defaultOptions$5 : {\n map: _this.context\n }), {}, {\n position: _this.props.position\n }); // Unfortunately we can't just do this in the contstructor, because the\n // `MapContext` might not be filled in yet.\n _this.marker = new google.maps.Marker(markerOptions);\n if (_this.props.clusterer) {\n _this.props.clusterer.addMarker(_this.marker, !!_this.props.noClustererRedraw);\n } else {\n _this.marker.setMap(_this.context);\n }\n _this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$f,\n eventMap: eventMap$f,\n prevProps: {},\n nextProps: _this.props,\n instance: _this.marker\n });\n if (_this.props.onLoad) {\n _this.props.onLoad(_this.marker);\n }\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }))();\n }\n componentDidUpdate(prevProps) {\n if (this.marker) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$f,\n eventMap: eventMap$f,\n prevProps,\n nextProps: this.props,\n instance: this.marker\n });\n }\n }\n componentWillUnmount() {\n if (!this.marker) {\n return;\n }\n if (this.props.onUnmount) {\n this.props.onUnmount(this.marker);\n }\n unregisterEvents(this.registeredEvents);\n if (this.props.clusterer) {\n this.props.clusterer.removeMarker(this.marker, !!this.props.noClustererRedraw);\n } else if (this.marker) {\n this.marker.setMap(null);\n }\n }\n render() {\n var children = this.props.children ? Children.map(this.props.children, child => {\n if (! /*#__PURE__*/isValidElement(child)) {\n return child;\n }\n var elementChild = child;\n return /*#__PURE__*/cloneElement(elementChild, {\n anchor: this.marker\n });\n }) : null;\n return children || null;\n }\n}\n_defineProperty(Marker, \"contextType\", MapContext);\nvar ClusterIcon = /** @class */function () {\n function ClusterIcon(cluster, styles) {\n cluster.getClusterer().extend(ClusterIcon, google.maps.OverlayView);\n this.cluster = cluster;\n this.clusterClassName = this.cluster.getClusterer().getClusterClass();\n this.className = this.clusterClassName;\n this.styles = styles;\n this.center = undefined;\n this.div = null;\n this.sums = null;\n this.visible = false;\n this.boundsChangedListener = null;\n this.url = '';\n this.height = 0;\n this.width = 0;\n this.anchorText = [0, 0];\n this.anchorIcon = [0, 0];\n this.textColor = 'black';\n this.textSize = 11;\n this.textDecoration = 'none';\n this.fontWeight = 'bold';\n this.fontStyle = 'normal';\n this.fontFamily = 'Arial,sans-serif';\n this.backgroundPosition = '0 0';\n this.cMouseDownInCluster = null;\n this.cDraggingMapByCluster = null;\n this.timeOut = null;\n this.setMap(cluster.getMap()); // Note: this causes onAdd to be called\n this.onBoundsChanged = this.onBoundsChanged.bind(this);\n this.onMouseDown = this.onMouseDown.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onMouseOver = this.onMouseOver.bind(this);\n this.onMouseOut = this.onMouseOut.bind(this);\n this.onAdd = this.onAdd.bind(this);\n this.onRemove = this.onRemove.bind(this);\n this.draw = this.draw.bind(this);\n this.hide = this.hide.bind(this);\n this.show = this.show.bind(this);\n this.useStyle = this.useStyle.bind(this);\n this.setCenter = this.setCenter.bind(this);\n this.getPosFromLatLng = this.getPosFromLatLng.bind(this);\n }\n ClusterIcon.prototype.onBoundsChanged = function () {\n this.cDraggingMapByCluster = this.cMouseDownInCluster;\n };\n ClusterIcon.prototype.onMouseDown = function () {\n this.cMouseDownInCluster = true;\n this.cDraggingMapByCluster = false;\n };\n ClusterIcon.prototype.onClick = function (event) {\n this.cMouseDownInCluster = false;\n if (!this.cDraggingMapByCluster) {\n var markerClusterer_1 = this.cluster.getClusterer();\n /**\n * This event is fired when a cluster marker is clicked.\n * @name MarkerClusterer#click\n * @param {Cluster} c The cluster that was clicked.\n * @event\n */\n google.maps.event.trigger(markerClusterer_1, 'click', this.cluster);\n google.maps.event.trigger(markerClusterer_1, 'clusterclick', this.cluster); // deprecated name\n // The default click handler follows. Disable it by setting\n // the zoomOnClick property to false.\n if (markerClusterer_1.getZoomOnClick()) {\n // Zoom into the cluster.\n var maxZoom_1 = markerClusterer_1.getMaxZoom();\n var bounds_1 = this.cluster.getBounds();\n var map = markerClusterer_1.getMap();\n if (map !== null && 'fitBounds' in map) {\n map.fitBounds(bounds_1);\n }\n // There is a fix for Issue 170 here:\n this.timeOut = window.setTimeout(function () {\n var map = markerClusterer_1.getMap();\n if (map !== null) {\n if ('fitBounds' in map) {\n map.fitBounds(bounds_1);\n }\n var zoom = map.getZoom() || 0;\n // Don't zoom beyond the max zoom level\n if (maxZoom_1 !== null && zoom > maxZoom_1) {\n map.setZoom(maxZoom_1 + 1);\n }\n }\n }, 100);\n }\n // Prevent event propagation to the map:\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n }\n };\n ClusterIcon.prototype.onMouseOver = function () {\n /**\n * This event is fired when the mouse moves over a cluster marker.\n * @name MarkerClusterer#mouseover\n * @param {Cluster} c The cluster that the mouse moved over.\n * @event\n */\n google.maps.event.trigger(this.cluster.getClusterer(), 'mouseover', this.cluster);\n };\n ClusterIcon.prototype.onMouseOut = function () {\n /**\n * This event is fired when the mouse moves out of a cluster marker.\n * @name MarkerClusterer#mouseout\n * @param {Cluster} c The cluster that the mouse moved out of.\n * @event\n */\n google.maps.event.trigger(this.cluster.getClusterer(), 'mouseout', this.cluster);\n };\n ClusterIcon.prototype.onAdd = function () {\n var _a;\n this.div = document.createElement('div');\n this.div.className = this.className;\n if (this.visible) {\n this.show();\n }\n (_a = this.getPanes()) === null || _a === void 0 ? void 0 : _a.overlayMouseTarget.appendChild(this.div);\n var map = this.getMap();\n if (map !== null) {\n // Fix for Issue 157\n this.boundsChangedListener = google.maps.event.addListener(map, 'bounds_changed', this.onBoundsChanged);\n this.div.addEventListener('mousedown', this.onMouseDown);\n this.div.addEventListener('click', this.onClick);\n this.div.addEventListener('mouseover', this.onMouseOver);\n this.div.addEventListener('mouseout', this.onMouseOut);\n }\n };\n ClusterIcon.prototype.onRemove = function () {\n if (this.div && this.div.parentNode) {\n this.hide();\n if (this.boundsChangedListener !== null) {\n google.maps.event.removeListener(this.boundsChangedListener);\n }\n this.div.removeEventListener('mousedown', this.onMouseDown);\n this.div.removeEventListener('click', this.onClick);\n this.div.removeEventListener('mouseover', this.onMouseOver);\n this.div.removeEventListener('mouseout', this.onMouseOut);\n this.div.parentNode.removeChild(this.div);\n if (this.timeOut !== null) {\n window.clearTimeout(this.timeOut);\n this.timeOut = null;\n }\n this.div = null;\n }\n };\n ClusterIcon.prototype.draw = function () {\n if (this.visible && this.div !== null && this.center) {\n var pos = this.getPosFromLatLng(this.center);\n this.div.style.top = pos !== null ? \"\".concat(pos.y, \"px\") : '0';\n this.div.style.left = pos !== null ? \"\".concat(pos.x, \"px\") : '0';\n }\n };\n ClusterIcon.prototype.hide = function () {\n if (this.div) {\n this.div.style.display = 'none';\n }\n this.visible = false;\n };\n ClusterIcon.prototype.show = function () {\n var _a, _b, _c, _d, _e, _f;\n if (this.div && this.center) {\n var divTitle = this.sums === null || typeof this.sums.title === 'undefined' || this.sums.title === '' ? this.cluster.getClusterer().getTitle() : this.sums.title;\n // NOTE: values must be specified in px units\n var bp = this.backgroundPosition.split(' ');\n var spriteH = parseInt(((_a = bp[0]) === null || _a === void 0 ? void 0 : _a.replace(/^\\s+|\\s+$/g, '')) || '0', 10);\n var spriteV = parseInt(((_b = bp[1]) === null || _b === void 0 ? void 0 : _b.replace(/^\\s+|\\s+$/g, '')) || '0', 10);\n var pos = this.getPosFromLatLng(this.center);\n this.div.className = this.className;\n this.div.setAttribute('style', \"cursor: pointer; position: absolute; top: \".concat(pos !== null ? \"\".concat(pos.y, \"px\") : '0', \"; left: \").concat(pos !== null ? \"\".concat(pos.x, \"px\") : '0', \"; width: \").concat(this.width, \"px; height: \").concat(this.height, \"px; \"));\n var img = document.createElement('img');\n img.alt = divTitle;\n img.src = this.url;\n img.width = this.width;\n img.height = this.height;\n img.setAttribute('style', \"position: absolute; top: \".concat(spriteV, \"px; left: \").concat(spriteH, \"px\"));\n if (!this.cluster.getClusterer().enableRetinaIcons) {\n img.style.clip = \"rect(-\".concat(spriteV, \"px, -\").concat(spriteH + this.width, \"px, -\").concat(spriteV + this.height, \", -\").concat(spriteH, \")\");\n }\n var textElm = document.createElement('div');\n textElm.setAttribute('style', \"position: absolute; top: \".concat(this.anchorText[0], \"px; left: \").concat(this.anchorText[1], \"px; color: \").concat(this.textColor, \"; font-size: \").concat(this.textSize, \"px; font-family: \").concat(this.fontFamily, \"; font-weight: \").concat(this.fontWeight, \"; fontStyle: \").concat(this.fontStyle, \"; text-decoration: \").concat(this.textDecoration, \"; text-align: center; width: \").concat(this.width, \"px; line-height: \").concat(this.height, \"px\"));\n if ((_c = this.sums) === null || _c === void 0 ? void 0 : _c.text) textElm.innerText = \"\".concat((_d = this.sums) === null || _d === void 0 ? void 0 : _d.text);\n if ((_e = this.sums) === null || _e === void 0 ? void 0 : _e.html) textElm.innerHTML = \"\".concat((_f = this.sums) === null || _f === void 0 ? void 0 : _f.html);\n this.div.innerHTML = '';\n this.div.appendChild(img);\n this.div.appendChild(textElm);\n this.div.title = divTitle;\n this.div.style.display = '';\n }\n this.visible = true;\n };\n ClusterIcon.prototype.useStyle = function (sums) {\n this.sums = sums;\n var styles = this.cluster.getClusterer().getStyles();\n var style = styles[Math.min(styles.length - 1, Math.max(0, sums.index - 1))];\n if (style) {\n this.url = style.url;\n this.height = style.height;\n this.width = style.width;\n if (style.className) {\n this.className = \"\".concat(this.clusterClassName, \" \").concat(style.className);\n }\n this.anchorText = style.anchorText || [0, 0];\n this.anchorIcon = style.anchorIcon || [this.height / 2, this.width / 2];\n this.textColor = style.textColor || 'black';\n this.textSize = style.textSize || 11;\n this.textDecoration = style.textDecoration || 'none';\n this.fontWeight = style.fontWeight || 'bold';\n this.fontStyle = style.fontStyle || 'normal';\n this.fontFamily = style.fontFamily || 'Arial,sans-serif';\n this.backgroundPosition = style.backgroundPosition || '0 0';\n }\n };\n ClusterIcon.prototype.setCenter = function (center) {\n this.center = center;\n };\n ClusterIcon.prototype.getPosFromLatLng = function (latlng) {\n var pos = this.getProjection().fromLatLngToDivPixel(latlng);\n if (pos !== null) {\n pos.x -= this.anchorIcon[1];\n pos.y -= this.anchorIcon[0];\n }\n return pos;\n };\n return ClusterIcon;\n}();\n\n/* global google */\nvar Cluster$1 = /** @class */function () {\n function Cluster(markerClusterer) {\n this.markerClusterer = markerClusterer;\n this.map = this.markerClusterer.getMap();\n this.gridSize = this.markerClusterer.getGridSize();\n this.minClusterSize = this.markerClusterer.getMinimumClusterSize();\n this.averageCenter = this.markerClusterer.getAverageCenter();\n this.markers = [];\n this.center = undefined;\n this.bounds = null;\n this.clusterIcon = new ClusterIcon(this, this.markerClusterer.getStyles());\n this.getSize = this.getSize.bind(this);\n this.getMarkers = this.getMarkers.bind(this);\n this.getCenter = this.getCenter.bind(this);\n this.getMap = this.getMap.bind(this);\n this.getClusterer = this.getClusterer.bind(this);\n this.getBounds = this.getBounds.bind(this);\n this.remove = this.remove.bind(this);\n this.addMarker = this.addMarker.bind(this);\n this.isMarkerInClusterBounds = this.isMarkerInClusterBounds.bind(this);\n this.calculateBounds = this.calculateBounds.bind(this);\n this.updateIcon = this.updateIcon.bind(this);\n this.isMarkerAlreadyAdded = this.isMarkerAlreadyAdded.bind(this);\n }\n Cluster.prototype.getSize = function () {\n return this.markers.length;\n };\n Cluster.prototype.getMarkers = function () {\n return this.markers;\n };\n Cluster.prototype.getCenter = function () {\n return this.center;\n };\n Cluster.prototype.getMap = function () {\n return this.map;\n };\n Cluster.prototype.getClusterer = function () {\n return this.markerClusterer;\n };\n Cluster.prototype.getBounds = function () {\n var bounds = new google.maps.LatLngBounds(this.center, this.center);\n var markers = this.getMarkers();\n for (var _i = 0, markers_1 = markers; _i < markers_1.length; _i++) {\n var marker = markers_1[_i];\n var position = marker.getPosition();\n if (position) {\n bounds.extend(position);\n }\n }\n return bounds;\n };\n Cluster.prototype.remove = function () {\n this.clusterIcon.setMap(null);\n this.markers = [];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.markers;\n };\n Cluster.prototype.addMarker = function (marker) {\n var _a;\n if (this.isMarkerAlreadyAdded(marker)) {\n return false;\n }\n if (!this.center) {\n var position = marker.getPosition();\n if (position) {\n this.center = position;\n this.calculateBounds();\n }\n } else {\n if (this.averageCenter) {\n var position = marker.getPosition();\n if (position) {\n var length_1 = this.markers.length + 1;\n this.center = new google.maps.LatLng((this.center.lat() * (length_1 - 1) + position.lat()) / length_1, (this.center.lng() * (length_1 - 1) + position.lng()) / length_1);\n this.calculateBounds();\n }\n }\n }\n marker.isAdded = true;\n this.markers.push(marker);\n var mCount = this.markers.length;\n var maxZoom = this.markerClusterer.getMaxZoom();\n var zoom = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom();\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n // Zoomed in past max zoom, so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map);\n }\n } else if (mCount < this.minClusterSize) {\n // Min cluster size not reached so show the marker.\n if (marker.getMap() !== this.map) {\n marker.setMap(this.map);\n }\n } else if (mCount === this.minClusterSize) {\n // Hide the markers that were showing.\n for (var _i = 0, _b = this.markers; _i < _b.length; _i++) {\n var markerElement = _b[_i];\n markerElement.setMap(null);\n }\n } else {\n marker.setMap(null);\n }\n return true;\n };\n Cluster.prototype.isMarkerInClusterBounds = function (marker) {\n if (this.bounds !== null) {\n var position = marker.getPosition();\n if (position) {\n return this.bounds.contains(position);\n }\n }\n return false;\n };\n Cluster.prototype.calculateBounds = function () {\n this.bounds = this.markerClusterer.getExtendedBounds(new google.maps.LatLngBounds(this.center, this.center));\n };\n Cluster.prototype.updateIcon = function () {\n var _a;\n var mCount = this.markers.length;\n var maxZoom = this.markerClusterer.getMaxZoom();\n var zoom = (_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom();\n if (maxZoom !== null && typeof zoom !== 'undefined' && zoom > maxZoom) {\n this.clusterIcon.hide();\n return;\n }\n if (mCount < this.minClusterSize) {\n // Min cluster size not yet reached.\n this.clusterIcon.hide();\n return;\n }\n if (this.center) {\n this.clusterIcon.setCenter(this.center);\n }\n this.clusterIcon.useStyle(this.markerClusterer.getCalculator()(this.markers, this.markerClusterer.getStyles().length));\n this.clusterIcon.show();\n };\n Cluster.prototype.isMarkerAlreadyAdded = function (marker) {\n if (this.markers.includes) {\n return this.markers.includes(marker);\n }\n for (var i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n return true;\n }\n }\n return false;\n };\n return Cluster;\n}();\n\n/* global google */\n/* eslint-disable filenames/match-regex */\n/**\n * Supports up to 9007199254740991 (Number.MAX_SAFE_INTEGER) markers\n * which is not a problem as max array length is 4294967296 (2**32)\n */\nfunction CALCULATOR(markers, numStyles) {\n var count = markers.length;\n var numberOfDigits = count.toString().length;\n var index = Math.min(numberOfDigits, numStyles);\n return {\n text: count.toString(),\n index: index,\n title: ''\n };\n}\nvar BATCH_SIZE = 2000;\nvar BATCH_SIZE_IE = 500;\nvar IMAGE_PATH = 'https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/m';\nvar IMAGE_EXTENSION = 'png';\nvar IMAGE_SIZES = [53, 56, 66, 78, 90];\nvar CLUSTERER_CLASS = 'cluster';\nvar Clusterer = /** @class */function () {\n function Clusterer(map, optMarkers, optOptions) {\n if (optMarkers === void 0) {\n optMarkers = [];\n }\n if (optOptions === void 0) {\n optOptions = {};\n }\n this.getMinimumClusterSize = this.getMinimumClusterSize.bind(this);\n this.setMinimumClusterSize = this.setMinimumClusterSize.bind(this);\n this.getEnableRetinaIcons = this.getEnableRetinaIcons.bind(this);\n this.setEnableRetinaIcons = this.setEnableRetinaIcons.bind(this);\n this.addToClosestCluster = this.addToClosestCluster.bind(this);\n this.getImageExtension = this.getImageExtension.bind(this);\n this.setImageExtension = this.setImageExtension.bind(this);\n this.getExtendedBounds = this.getExtendedBounds.bind(this);\n this.getAverageCenter = this.getAverageCenter.bind(this);\n this.setAverageCenter = this.setAverageCenter.bind(this);\n this.getTotalClusters = this.getTotalClusters.bind(this);\n this.fitMapToMarkers = this.fitMapToMarkers.bind(this);\n this.getIgnoreHidden = this.getIgnoreHidden.bind(this);\n this.setIgnoreHidden = this.setIgnoreHidden.bind(this);\n this.getClusterClass = this.getClusterClass.bind(this);\n this.setClusterClass = this.setClusterClass.bind(this);\n this.getTotalMarkers = this.getTotalMarkers.bind(this);\n this.getZoomOnClick = this.getZoomOnClick.bind(this);\n this.setZoomOnClick = this.setZoomOnClick.bind(this);\n this.getBatchSizeIE = this.getBatchSizeIE.bind(this);\n this.setBatchSizeIE = this.setBatchSizeIE.bind(this);\n this.createClusters = this.createClusters.bind(this);\n this.onZoomChanged = this.onZoomChanged.bind(this);\n this.getImageSizes = this.getImageSizes.bind(this);\n this.setImageSizes = this.setImageSizes.bind(this);\n this.getCalculator = this.getCalculator.bind(this);\n this.setCalculator = this.setCalculator.bind(this);\n this.removeMarkers = this.removeMarkers.bind(this);\n this.resetViewport = this.resetViewport.bind(this);\n this.getImagePath = this.getImagePath.bind(this);\n this.setImagePath = this.setImagePath.bind(this);\n this.pushMarkerTo = this.pushMarkerTo.bind(this);\n this.removeMarker = this.removeMarker.bind(this);\n this.clearMarkers = this.clearMarkers.bind(this);\n this.setupStyles = this.setupStyles.bind(this);\n this.getGridSize = this.getGridSize.bind(this);\n this.setGridSize = this.setGridSize.bind(this);\n this.getClusters = this.getClusters.bind(this);\n this.getMaxZoom = this.getMaxZoom.bind(this);\n this.setMaxZoom = this.setMaxZoom.bind(this);\n this.getMarkers = this.getMarkers.bind(this);\n this.addMarkers = this.addMarkers.bind(this);\n this.getStyles = this.getStyles.bind(this);\n this.setStyles = this.setStyles.bind(this);\n this.addMarker = this.addMarker.bind(this);\n this.onRemove = this.onRemove.bind(this);\n this.getTitle = this.getTitle.bind(this);\n this.setTitle = this.setTitle.bind(this);\n this.repaint = this.repaint.bind(this);\n this.onIdle = this.onIdle.bind(this);\n this.redraw = this.redraw.bind(this);\n this.onAdd = this.onAdd.bind(this);\n this.draw = this.draw.bind(this);\n this.extend = this.extend.bind(this);\n this.extend(Clusterer, google.maps.OverlayView);\n this.markers = [];\n this.clusters = [];\n this.listeners = [];\n this.activeMap = null;\n this.ready = false;\n this.gridSize = optOptions.gridSize || 60;\n this.minClusterSize = optOptions.minimumClusterSize || 2;\n this.maxZoom = optOptions.maxZoom || null;\n this.styles = optOptions.styles || [];\n this.title = optOptions.title || '';\n this.zoomOnClick = true;\n if (optOptions.zoomOnClick !== undefined) {\n this.zoomOnClick = optOptions.zoomOnClick;\n }\n this.averageCenter = false;\n if (optOptions.averageCenter !== undefined) {\n this.averageCenter = optOptions.averageCenter;\n }\n this.ignoreHidden = false;\n if (optOptions.ignoreHidden !== undefined) {\n this.ignoreHidden = optOptions.ignoreHidden;\n }\n this.enableRetinaIcons = false;\n if (optOptions.enableRetinaIcons !== undefined) {\n this.enableRetinaIcons = optOptions.enableRetinaIcons;\n }\n this.imagePath = optOptions.imagePath || IMAGE_PATH;\n this.imageExtension = optOptions.imageExtension || IMAGE_EXTENSION;\n this.imageSizes = optOptions.imageSizes || IMAGE_SIZES;\n this.calculator = optOptions.calculator || CALCULATOR;\n this.batchSize = optOptions.batchSize || BATCH_SIZE;\n this.batchSizeIE = optOptions.batchSizeIE || BATCH_SIZE_IE;\n this.clusterClass = optOptions.clusterClass || CLUSTERER_CLASS;\n if (navigator.userAgent.toLowerCase().indexOf('msie') !== -1) {\n // Try to avoid IE timeout when processing a huge number of markers:\n this.batchSize = this.batchSizeIE;\n }\n this.timerRefStatic = null;\n this.setupStyles();\n this.addMarkers(optMarkers, true);\n this.setMap(map); // Note: this causes onAdd to be called\n }\n Clusterer.prototype.onZoomChanged = function () {\n var _a, _b;\n this.resetViewport(false);\n // Workaround for this Google bug: when map is at level 0 and \"-\" of\n // zoom slider is clicked, a \"zoom_changed\" event is fired even though\n // the map doesn't zoom out any further. In this situation, no \"idle\"\n // event is triggered so the cluster markers that have been removed\n // do not get redrawn. Same goes for a zoom in at maxZoom.\n if (((_a = this.getMap()) === null || _a === void 0 ? void 0 : _a.getZoom()) === (this.get('minZoom') || 0) || ((_b = this.getMap()) === null || _b === void 0 ? void 0 : _b.getZoom()) === this.get('maxZoom')) {\n google.maps.event.trigger(this, 'idle');\n }\n };\n Clusterer.prototype.onIdle = function () {\n this.redraw();\n };\n Clusterer.prototype.onAdd = function () {\n var map = this.getMap();\n this.activeMap = map;\n this.ready = true;\n this.repaint();\n if (map !== null) {\n // Add the map event listeners\n this.listeners = [google.maps.event.addListener(map, 'zoom_changed', this.onZoomChanged), google.maps.event.addListener(map, 'idle', this.onIdle)];\n }\n };\n Clusterer.prototype.onRemove = function () {\n // Put all the managed markers back on the map:\n for (var _i = 0, _a = this.markers; _i < _a.length; _i++) {\n var marker = _a[_i];\n if (marker.getMap() !== this.activeMap) {\n marker.setMap(this.activeMap);\n }\n }\n // Remove all clusters:\n for (var _b = 0, _c = this.clusters; _b < _c.length; _b++) {\n var cluster = _c[_b];\n cluster.remove();\n }\n this.clusters = [];\n // Remove map event listeners:\n for (var _d = 0, _e = this.listeners; _d < _e.length; _d++) {\n var listener = _e[_d];\n google.maps.event.removeListener(listener);\n }\n this.listeners = [];\n this.activeMap = null;\n this.ready = false;\n };\n Clusterer.prototype.draw = function () {\n return;\n };\n Clusterer.prototype.getMap = function () {\n return null;\n };\n Clusterer.prototype.getPanes = function () {\n return null;\n };\n Clusterer.prototype.getProjection = function () {\n return {\n fromContainerPixelToLatLng: function fromContainerPixelToLatLng() {\n return null;\n },\n fromDivPixelToLatLng: function fromDivPixelToLatLng() {\n return null;\n },\n fromLatLngToContainerPixel: function fromLatLngToContainerPixel() {\n return null;\n },\n fromLatLngToDivPixel: function fromLatLngToDivPixel() {\n return null;\n },\n getVisibleRegion: function getVisibleRegion() {\n return null;\n },\n getWorldWidth: function getWorldWidth() {\n return 0;\n }\n };\n };\n Clusterer.prototype.setMap = function () {\n return;\n };\n Clusterer.prototype.addListener = function () {\n return {\n remove: function remove() {\n return;\n }\n };\n };\n Clusterer.prototype.bindTo = function () {\n return;\n };\n Clusterer.prototype.get = function () {\n return;\n };\n Clusterer.prototype.notify = function () {\n return;\n };\n Clusterer.prototype.set = function () {\n return;\n };\n Clusterer.prototype.setValues = function () {\n return;\n };\n Clusterer.prototype.unbind = function () {\n return;\n };\n Clusterer.prototype.unbindAll = function () {\n return;\n };\n Clusterer.prototype.setupStyles = function () {\n if (this.styles.length > 0) {\n return;\n }\n for (var i = 0; i < this.imageSizes.length; i++) {\n this.styles.push({\n url: \"\".concat(this.imagePath + (i + 1), \".\").concat(this.imageExtension),\n height: this.imageSizes[i] || 0,\n width: this.imageSizes[i] || 0\n });\n }\n };\n Clusterer.prototype.fitMapToMarkers = function () {\n var markers = this.getMarkers();\n var bounds = new google.maps.LatLngBounds();\n for (var _i = 0, markers_1 = markers; _i < markers_1.length; _i++) {\n var marker = markers_1[_i];\n var position = marker.getPosition();\n if (position) {\n bounds.extend(position);\n }\n }\n var map = this.getMap();\n if (map !== null && 'fitBounds' in map) {\n map.fitBounds(bounds);\n }\n };\n Clusterer.prototype.getGridSize = function () {\n return this.gridSize;\n };\n Clusterer.prototype.setGridSize = function (gridSize) {\n this.gridSize = gridSize;\n };\n Clusterer.prototype.getMinimumClusterSize = function () {\n return this.minClusterSize;\n };\n Clusterer.prototype.setMinimumClusterSize = function (minimumClusterSize) {\n this.minClusterSize = minimumClusterSize;\n };\n Clusterer.prototype.getMaxZoom = function () {\n return this.maxZoom;\n };\n Clusterer.prototype.setMaxZoom = function (maxZoom) {\n this.maxZoom = maxZoom;\n };\n Clusterer.prototype.getStyles = function () {\n return this.styles;\n };\n Clusterer.prototype.setStyles = function (styles) {\n this.styles = styles;\n };\n Clusterer.prototype.getTitle = function () {\n return this.title;\n };\n Clusterer.prototype.setTitle = function (title) {\n this.title = title;\n };\n Clusterer.prototype.getZoomOnClick = function () {\n return this.zoomOnClick;\n };\n Clusterer.prototype.setZoomOnClick = function (zoomOnClick) {\n this.zoomOnClick = zoomOnClick;\n };\n Clusterer.prototype.getAverageCenter = function () {\n return this.averageCenter;\n };\n Clusterer.prototype.setAverageCenter = function (averageCenter) {\n this.averageCenter = averageCenter;\n };\n Clusterer.prototype.getIgnoreHidden = function () {\n return this.ignoreHidden;\n };\n Clusterer.prototype.setIgnoreHidden = function (ignoreHidden) {\n this.ignoreHidden = ignoreHidden;\n };\n Clusterer.prototype.getEnableRetinaIcons = function () {\n return this.enableRetinaIcons;\n };\n Clusterer.prototype.setEnableRetinaIcons = function (enableRetinaIcons) {\n this.enableRetinaIcons = enableRetinaIcons;\n };\n Clusterer.prototype.getImageExtension = function () {\n return this.imageExtension;\n };\n Clusterer.prototype.setImageExtension = function (imageExtension) {\n this.imageExtension = imageExtension;\n };\n Clusterer.prototype.getImagePath = function () {\n return this.imagePath;\n };\n Clusterer.prototype.setImagePath = function (imagePath) {\n this.imagePath = imagePath;\n };\n Clusterer.prototype.getImageSizes = function () {\n return this.imageSizes;\n };\n Clusterer.prototype.setImageSizes = function (imageSizes) {\n this.imageSizes = imageSizes;\n };\n Clusterer.prototype.getCalculator = function () {\n return this.calculator;\n };\n Clusterer.prototype.setCalculator = function (calculator) {\n this.calculator = calculator;\n };\n Clusterer.prototype.getBatchSizeIE = function () {\n return this.batchSizeIE;\n };\n Clusterer.prototype.setBatchSizeIE = function (batchSizeIE) {\n this.batchSizeIE = batchSizeIE;\n };\n Clusterer.prototype.getClusterClass = function () {\n return this.clusterClass;\n };\n Clusterer.prototype.setClusterClass = function (clusterClass) {\n this.clusterClass = clusterClass;\n };\n Clusterer.prototype.getMarkers = function () {\n return this.markers;\n };\n Clusterer.prototype.getTotalMarkers = function () {\n return this.markers.length;\n };\n Clusterer.prototype.getClusters = function () {\n return this.clusters;\n };\n Clusterer.prototype.getTotalClusters = function () {\n return this.clusters.length;\n };\n Clusterer.prototype.addMarker = function (marker, optNoDraw) {\n this.pushMarkerTo(marker);\n if (!optNoDraw) {\n this.redraw();\n }\n };\n Clusterer.prototype.addMarkers = function (markers, optNoDraw) {\n for (var key in markers) {\n if (Object.prototype.hasOwnProperty.call(markers, key)) {\n var marker = markers[key];\n if (marker) {\n this.pushMarkerTo(marker);\n }\n }\n }\n if (!optNoDraw) {\n this.redraw();\n }\n };\n Clusterer.prototype.pushMarkerTo = function (marker) {\n var _this = this;\n // If the marker is draggable add a listener so we can update the clusters on the dragend:\n if (marker.getDraggable()) {\n google.maps.event.addListener(marker, 'dragend', function () {\n if (_this.ready) {\n marker.isAdded = false;\n _this.repaint();\n }\n });\n }\n marker.isAdded = false;\n this.markers.push(marker);\n };\n Clusterer.prototype.removeMarker_ = function (marker) {\n var index = -1;\n if (this.markers.indexOf) {\n index = this.markers.indexOf(marker);\n } else {\n for (var i = 0; i < this.markers.length; i++) {\n if (marker === this.markers[i]) {\n index = i;\n break;\n }\n }\n }\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n marker.setMap(null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n return true;\n };\n Clusterer.prototype.removeMarker = function (marker, optNoDraw) {\n var removed = this.removeMarker_(marker);\n if (!optNoDraw && removed) {\n this.repaint();\n }\n return removed;\n };\n Clusterer.prototype.removeMarkers = function (markers, optNoDraw) {\n var removed = false;\n for (var _i = 0, markers_2 = markers; _i < markers_2.length; _i++) {\n var marker = markers_2[_i];\n removed = removed || this.removeMarker_(marker);\n }\n if (!optNoDraw && removed) {\n this.repaint();\n }\n return removed;\n };\n Clusterer.prototype.clearMarkers = function () {\n this.resetViewport(true);\n this.markers = [];\n };\n Clusterer.prototype.repaint = function () {\n var oldClusters = this.clusters.slice();\n this.clusters = [];\n this.resetViewport(false);\n this.redraw();\n // Remove the old clusters.\n // Do it in a timeout to prevent blinking effect.\n setTimeout(function timeout() {\n for (var _i = 0, oldClusters_1 = oldClusters; _i < oldClusters_1.length; _i++) {\n var oldCluster = oldClusters_1[_i];\n oldCluster.remove();\n }\n }, 0);\n };\n Clusterer.prototype.getExtendedBounds = function (bounds) {\n var projection = this.getProjection();\n // Convert the points to pixels and the extend out by the grid size.\n var trPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getNorthEast().lat(), bounds.getNorthEast().lng()));\n if (trPix !== null) {\n trPix.x += this.gridSize;\n trPix.y -= this.gridSize;\n }\n var blPix = projection.fromLatLngToDivPixel(\n // Turn the bounds into latlng.\n new google.maps.LatLng(bounds.getSouthWest().lat(), bounds.getSouthWest().lng()));\n if (blPix !== null) {\n blPix.x -= this.gridSize;\n blPix.y += this.gridSize;\n }\n // Extend the bounds to contain the new bounds.\n if (trPix !== null) {\n // Convert the pixel points back to LatLng nw\n var point1 = projection.fromDivPixelToLatLng(trPix);\n if (point1 !== null) {\n bounds.extend(point1);\n }\n }\n if (blPix !== null) {\n // Convert the pixel points back to LatLng sw\n var point2 = projection.fromDivPixelToLatLng(blPix);\n if (point2 !== null) {\n bounds.extend(point2);\n }\n }\n return bounds;\n };\n Clusterer.prototype.redraw = function () {\n // Redraws all the clusters.\n this.createClusters(0);\n };\n Clusterer.prototype.resetViewport = function (optHide) {\n // Remove all the clusters\n for (var _i = 0, _a = this.clusters; _i < _a.length; _i++) {\n var cluster = _a[_i];\n cluster.remove();\n }\n this.clusters = [];\n // Reset the markers to not be added and to be removed from the map.\n for (var _b = 0, _c = this.markers; _b < _c.length; _b++) {\n var marker = _c[_b];\n marker.isAdded = false;\n if (optHide) {\n marker.setMap(null);\n }\n }\n };\n Clusterer.prototype.distanceBetweenPoints = function (p1, p2) {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat() - p1.lat()) * Math.PI / 180;\n var dLon = (p2.lng() - p1.lng()) * Math.PI / 180;\n var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(p1.lat() * Math.PI / 180) * Math.cos(p2.lat() * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2);\n return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)));\n };\n Clusterer.prototype.isMarkerInBounds = function (marker, bounds) {\n var position = marker.getPosition();\n if (position) {\n return bounds.contains(position);\n }\n return false;\n };\n Clusterer.prototype.addToClosestCluster = function (marker) {\n var cluster;\n var distance = 40000; // Some large number\n var clusterToAddTo = null;\n for (var _i = 0, _a = this.clusters; _i < _a.length; _i++) {\n var clusterElement = _a[_i];\n cluster = clusterElement;\n var center = cluster.getCenter();\n var position = marker.getPosition();\n if (center && position) {\n var d = this.distanceBetweenPoints(center, position);\n if (d < distance) {\n distance = d;\n clusterToAddTo = cluster;\n }\n }\n }\n if (clusterToAddTo && clusterToAddTo.isMarkerInClusterBounds(marker)) {\n clusterToAddTo.addMarker(marker);\n } else {\n cluster = new Cluster$1(this);\n cluster.addMarker(marker);\n this.clusters.push(cluster);\n }\n };\n Clusterer.prototype.createClusters = function (iFirst) {\n var _this = this;\n if (!this.ready) {\n return;\n }\n // Cancel previous batch processing if we're working on the first batch:\n if (iFirst === 0) {\n /**\n * This event is fired when the Clusterer begins\n * clustering markers.\n * @name Clusterer#clusteringbegin\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringbegin', this);\n if (this.timerRefStatic !== null) {\n window.clearTimeout(this.timerRefStatic);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n delete this.timerRefStatic;\n }\n }\n var map = this.getMap();\n var bounds = map !== null && 'getBounds' in map ? map.getBounds() : null;\n var zoom = (map === null || map === void 0 ? void 0 : map.getZoom()) || 0;\n // Get our current map view bounds.\n // Create a new bounds object so we don't affect the map.\n //\n // See Comments 9 & 11 on Issue 3651 relating to this workaround for a Google Maps bug:\n var mapBounds = zoom > 3 ? new google.maps.LatLngBounds(bounds === null || bounds === void 0 ? void 0 : bounds.getSouthWest(), bounds === null || bounds === void 0 ? void 0 : bounds.getNorthEast()) : new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472, -178.48388434375), new google.maps.LatLng(-85.08136444384544, 178.00048865625));\n var extendedMapBounds = this.getExtendedBounds(mapBounds);\n var iLast = Math.min(iFirst + this.batchSize, this.markers.length);\n for (var i = iFirst; i < iLast; i++) {\n var marker = this.markers[i];\n if (marker && !marker.isAdded && this.isMarkerInBounds(marker, extendedMapBounds) && (!this.ignoreHidden || this.ignoreHidden && marker.getVisible())) {\n this.addToClosestCluster(marker);\n }\n }\n if (iLast < this.markers.length) {\n this.timerRefStatic = window.setTimeout(function () {\n _this.createClusters(iLast);\n }, 0);\n } else {\n this.timerRefStatic = null;\n /**\n * This event is fired when the Clusterer stops\n * clustering markers.\n * @name Clusterer#clusteringend\n * @param {Clusterer} mc The Clusterer whose markers are being clustered.\n * @event\n */\n google.maps.event.trigger(this, 'clusteringend', this);\n for (var _i = 0, _a = this.clusters; _i < _a.length; _i++) {\n var cluster = _a[_i];\n cluster.updateIcon();\n }\n }\n };\n Clusterer.prototype.extend = function (obj1, obj2) {\n return function applyExtend(object) {\n for (var property in object.prototype) {\n // eslint-disable-next-line @typescript-eslint/ban-types\n var prop = property;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.prototype[prop] = object.prototype[prop];\n }\n return this;\n }.apply(obj1, [obj2]);\n };\n return Clusterer;\n}();\nfunction ownKeys$c(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$c(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$e = {\n onClick: 'click',\n onClusteringBegin: 'clusteringbegin',\n onClusteringEnd: 'clusteringend',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover'\n};\nvar updaterMap$e = {\n averageCenter(instance, averageCenter) {\n instance.setAverageCenter(averageCenter);\n },\n batchSizeIE(instance, batchSizeIE) {\n instance.setBatchSizeIE(batchSizeIE);\n },\n calculator(instance, calculator) {\n instance.setCalculator(calculator);\n },\n clusterClass(instance, clusterClass) {\n instance.setClusterClass(clusterClass);\n },\n enableRetinaIcons(instance, enableRetinaIcons) {\n instance.setEnableRetinaIcons(enableRetinaIcons);\n },\n gridSize(instance, gridSize) {\n instance.setGridSize(gridSize);\n },\n ignoreHidden(instance, ignoreHidden) {\n instance.setIgnoreHidden(ignoreHidden);\n },\n imageExtension(instance, imageExtension) {\n instance.setImageExtension(imageExtension);\n },\n imagePath(instance, imagePath) {\n instance.setImagePath(imagePath);\n },\n imageSizes(instance, imageSizes) {\n instance.setImageSizes(imageSizes);\n },\n maxZoom(instance, maxZoom) {\n instance.setMaxZoom(maxZoom);\n },\n minimumClusterSize(instance, minimumClusterSize) {\n instance.setMinimumClusterSize(minimumClusterSize);\n },\n styles(instance, styles) {\n instance.setStyles(styles);\n },\n title(instance, title) {\n instance.setTitle(title);\n },\n zoomOnClick(instance, zoomOnClick) {\n instance.setZoomOnClick(zoomOnClick);\n }\n};\nvar defaultOptions$4 = {};\nfunction MarkerClustererFunctional(props) {\n var children = props.children,\n options = props.options,\n averageCenter = props.averageCenter,\n batchSizeIE = props.batchSizeIE,\n calculator = props.calculator,\n clusterClass = props.clusterClass,\n enableRetinaIcons = props.enableRetinaIcons,\n gridSize = props.gridSize,\n ignoreHidden = props.ignoreHidden,\n imageExtension = props.imageExtension,\n imagePath = props.imagePath,\n imageSizes = props.imageSizes,\n maxZoom = props.maxZoom,\n minimumClusterSize = props.minimumClusterSize,\n styles = props.styles,\n title = props.title,\n zoomOnClick = props.zoomOnClick,\n onClick = props.onClick,\n onClusteringBegin = props.onClusteringBegin,\n onClusteringEnd = props.onClusteringEnd,\n onMouseOver = props.onMouseOver,\n onMouseOut = props.onMouseOut,\n onLoad = props.onLoad,\n onUnmount = props.onUnmount;\n var _useState99 = useState(null),\n _useState100 = _slicedToArray(_useState99, 2),\n instance = _useState100[0],\n setInstance = _useState100[1];\n var map = useContext(MapContext);\n var _useState101 = useState(null),\n _useState102 = _slicedToArray(_useState101, 2),\n clickListener = _useState102[0],\n setClickListener = _useState102[1];\n var _useState103 = useState(null),\n _useState104 = _slicedToArray(_useState103, 2),\n clusteringBeginListener = _useState104[0],\n setClusteringBeginListener = _useState104[1];\n var _useState105 = useState(null),\n _useState106 = _slicedToArray(_useState105, 2),\n clusteringEndListener = _useState106[0],\n setClusteringEndListener = _useState106[1];\n var _useState107 = useState(null),\n _useState108 = _slicedToArray(_useState107, 2),\n mouseoutListener = _useState108[0],\n setMouseoutListener = _useState108[1];\n var _useState109 = useState(null),\n _useState110 = _slicedToArray(_useState109, 2),\n mouseoverListener = _useState110[0],\n setMouseoverListener = _useState110[1];\n useEffect(() => {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, eventMap$e.onMouseOut, onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, eventMap$e.onMouseOver, onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, eventMap$e.onClick, onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onClusteringBegin) {\n if (clusteringBeginListener !== null) {\n google.maps.event.removeListener(clusteringBeginListener);\n }\n setClusteringBeginListener(google.maps.event.addListener(instance, eventMap$e.onClusteringBegin, onClusteringBegin));\n }\n }, [onClusteringBegin]);\n useEffect(() => {\n if (instance && onClusteringEnd) {\n if (clusteringEndListener !== null) {\n google.maps.event.removeListener(clusteringEndListener);\n }\n setClusteringBeginListener(google.maps.event.addListener(instance, eventMap$e.onClusteringEnd, onClusteringEnd));\n }\n }, [onClusteringEnd]);\n useEffect(() => {\n if (typeof averageCenter !== 'undefined' && instance !== null) {\n updaterMap$e.averageCenter(instance, averageCenter);\n }\n }, [instance, averageCenter]);\n useEffect(() => {\n if (typeof batchSizeIE !== 'undefined' && instance !== null) {\n updaterMap$e.batchSizeIE(instance, batchSizeIE);\n }\n }, [instance, batchSizeIE]);\n useEffect(() => {\n if (typeof calculator !== 'undefined' && instance !== null) {\n updaterMap$e.calculator(instance, calculator);\n }\n }, [instance, calculator]);\n useEffect(() => {\n if (typeof clusterClass !== 'undefined' && instance !== null) {\n updaterMap$e.clusterClass(instance, clusterClass);\n }\n }, [instance, clusterClass]);\n useEffect(() => {\n if (typeof enableRetinaIcons !== 'undefined' && instance !== null) {\n updaterMap$e.enableRetinaIcons(instance, enableRetinaIcons);\n }\n }, [instance, enableRetinaIcons]);\n useEffect(() => {\n if (typeof gridSize !== 'undefined' && instance !== null) {\n updaterMap$e.gridSize(instance, gridSize);\n }\n }, [instance, gridSize]);\n useEffect(() => {\n if (typeof ignoreHidden !== 'undefined' && instance !== null) {\n updaterMap$e.ignoreHidden(instance, ignoreHidden);\n }\n }, [instance, ignoreHidden]);\n useEffect(() => {\n if (typeof imageExtension !== 'undefined' && instance !== null) {\n updaterMap$e.imageExtension(instance, imageExtension);\n }\n }, [instance, imageExtension]);\n useEffect(() => {\n if (typeof imagePath !== 'undefined' && instance !== null) {\n updaterMap$e.imagePath(instance, imagePath);\n }\n }, [instance, imagePath]);\n useEffect(() => {\n if (typeof imageSizes !== 'undefined' && instance !== null) {\n updaterMap$e.imageSizes(instance, imageSizes);\n }\n }, [instance, imageSizes]);\n useEffect(() => {\n if (typeof maxZoom !== 'undefined' && instance !== null) {\n updaterMap$e.maxZoom(instance, maxZoom);\n }\n }, [instance, maxZoom]);\n useEffect(() => {\n if (typeof minimumClusterSize !== 'undefined' && instance !== null) {\n updaterMap$e.minimumClusterSize(instance, minimumClusterSize);\n }\n }, [instance, minimumClusterSize]);\n useEffect(() => {\n if (typeof styles !== 'undefined' && instance !== null) {\n updaterMap$e.styles(instance, styles);\n }\n }, [instance, styles]);\n useEffect(() => {\n if (typeof title !== 'undefined' && instance !== null) {\n updaterMap$e.title(instance, title);\n }\n }, [instance, title]);\n useEffect(() => {\n if (typeof zoomOnClick !== 'undefined' && instance !== null) {\n updaterMap$e.zoomOnClick(instance, zoomOnClick);\n }\n }, [instance, zoomOnClick]);\n useEffect(() => {\n if (!map) return;\n var clustererOptions = _objectSpread$c({}, options || defaultOptions$4);\n var clusterer = new Clusterer(map, [], clustererOptions);\n if (averageCenter) {\n updaterMap$e.averageCenter(clusterer, averageCenter);\n }\n if (batchSizeIE) {\n updaterMap$e.batchSizeIE(clusterer, batchSizeIE);\n }\n if (calculator) {\n updaterMap$e.calculator(clusterer, calculator);\n }\n if (clusterClass) {\n updaterMap$e.clusterClass(clusterer, clusterClass);\n }\n if (enableRetinaIcons) {\n updaterMap$e.enableRetinaIcons(clusterer, enableRetinaIcons);\n }\n if (gridSize) {\n updaterMap$e.gridSize(clusterer, gridSize);\n }\n if (ignoreHidden) {\n updaterMap$e.ignoreHidden(clusterer, ignoreHidden);\n }\n if (imageExtension) {\n updaterMap$e.imageExtension(clusterer, imageExtension);\n }\n if (imagePath) {\n updaterMap$e.imagePath(clusterer, imagePath);\n }\n if (imageSizes) {\n updaterMap$e.imageSizes(clusterer, imageSizes);\n }\n if (maxZoom) {\n updaterMap$e.maxZoom(clusterer, maxZoom);\n }\n if (minimumClusterSize) {\n updaterMap$e.minimumClusterSize(clusterer, minimumClusterSize);\n }\n if (styles) {\n updaterMap$e.styles(clusterer, styles);\n }\n if (title) {\n updaterMap$e.title(clusterer, title);\n }\n if (zoomOnClick) {\n updaterMap$e.zoomOnClick(clusterer, zoomOnClick);\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(clusterer, eventMap$e.onMouseOut, onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(clusterer, eventMap$e.onMouseOver, onMouseOver));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(clusterer, eventMap$e.onClick, onClick));\n }\n if (onClusteringBegin) {\n setClusteringBeginListener(google.maps.event.addListener(clusterer, eventMap$e.onClusteringBegin, onClusteringBegin));\n }\n if (onClusteringEnd) {\n setClusteringEndListener(google.maps.event.addListener(clusterer, eventMap$e.onClusteringEnd, onClusteringEnd));\n }\n setInstance(clusterer);\n if (onLoad) {\n onLoad(clusterer);\n }\n return () => {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (clusteringBeginListener !== null) {\n google.maps.event.removeListener(clusteringBeginListener);\n }\n if (clusteringEndListener !== null) {\n google.maps.event.removeListener(clusteringEndListener);\n }\n if (onUnmount) {\n onUnmount(clusterer);\n }\n };\n }, []);\n return instance !== null ? children(instance) || null : null;\n}\nvar MarkerClustererF = /*#__PURE__*/memo(MarkerClustererFunctional);\nclass ClustererComponent extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n markerClusterer: null\n });\n _defineProperty(this, \"setClustererCallback\", () => {\n if (this.state.markerClusterer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.markerClusterer);\n }\n });\n }\n componentDidMount() {\n if (this.context) {\n var markerClusterer = new Clusterer(this.context, [], this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$e,\n eventMap: eventMap$e,\n prevProps: {},\n nextProps: this.props,\n instance: markerClusterer\n });\n this.setState(() => {\n return {\n markerClusterer\n };\n }, this.setClustererCallback);\n }\n }\n componentDidUpdate(prevProps) {\n if (this.state.markerClusterer) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$e,\n eventMap: eventMap$e,\n prevProps,\n nextProps: this.props,\n instance: this.state.markerClusterer\n });\n }\n }\n componentWillUnmount() {\n if (this.state.markerClusterer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.markerClusterer);\n }\n unregisterEvents(this.registeredEvents);\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.state.markerClusterer.setMap(null);\n }\n }\n render() {\n return this.state.markerClusterer !== null ? this.props.children(this.state.markerClusterer) : null;\n }\n}\n_defineProperty(ClustererComponent, \"contextType\", MapContext);\n\n// This handler prevents an event in the InfoBox from being passed on to the map.\nfunction cancelHandler(event) {\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n}\nvar InfoBox = /** @class */function () {\n function InfoBox(options) {\n if (options === void 0) {\n options = {};\n }\n this.getCloseClickHandler = this.getCloseClickHandler.bind(this);\n this.closeClickHandler = this.closeClickHandler.bind(this);\n this.createInfoBoxDiv = this.createInfoBoxDiv.bind(this);\n this.addClickHandler = this.addClickHandler.bind(this);\n this.getCloseBoxImg = this.getCloseBoxImg.bind(this);\n this.getBoxWidths = this.getBoxWidths.bind(this);\n this.setBoxStyle = this.setBoxStyle.bind(this);\n this.setPosition = this.setPosition.bind(this);\n this.getPosition = this.getPosition.bind(this);\n this.setOptions = this.setOptions.bind(this);\n this.setContent = this.setContent.bind(this);\n this.setVisible = this.setVisible.bind(this);\n this.getContent = this.getContent.bind(this);\n this.getVisible = this.getVisible.bind(this);\n this.setZIndex = this.setZIndex.bind(this);\n this.getZIndex = this.getZIndex.bind(this);\n this.onRemove = this.onRemove.bind(this);\n this.panBox = this.panBox.bind(this);\n this.extend = this.extend.bind(this);\n this.close = this.close.bind(this);\n this.draw = this.draw.bind(this);\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n this.open = this.open.bind(this);\n this.extend(InfoBox, google.maps.OverlayView);\n // Standard options (in common with google.maps.InfoWindow):\n this.content = options.content || '';\n this.disableAutoPan = options.disableAutoPan || false;\n this.maxWidth = options.maxWidth || 0;\n this.pixelOffset = options.pixelOffset || new google.maps.Size(0, 0);\n this.position = options.position || new google.maps.LatLng(0, 0);\n this.zIndex = options.zIndex || null;\n // Additional options (unique to InfoBox):\n this.boxClass = options.boxClass || 'infoBox';\n this.boxStyle = options.boxStyle || {};\n this.closeBoxMargin = options.closeBoxMargin || '2px';\n this.closeBoxURL = options.closeBoxURL || 'http://www.google.com/intl/en_us/mapfiles/close.gif';\n if (options.closeBoxURL === '') {\n this.closeBoxURL = '';\n }\n this.infoBoxClearance = options.infoBoxClearance || new google.maps.Size(1, 1);\n if (typeof options.visible === 'undefined') {\n if (typeof options.isHidden === 'undefined') {\n options.visible = true;\n } else {\n options.visible = !options.isHidden;\n }\n }\n this.isHidden = !options.visible;\n this.alignBottom = options.alignBottom || false;\n this.pane = options.pane || 'floatPane';\n this.enableEventPropagation = options.enableEventPropagation || false;\n this.div = null;\n this.closeListener = null;\n this.moveListener = null;\n this.mapListener = null;\n this.contextListener = null;\n this.eventListeners = null;\n this.fixedWidthSet = null;\n }\n InfoBox.prototype.createInfoBoxDiv = function () {\n var _this = this;\n // This handler ignores the current event in the InfoBox and conditionally prevents\n // the event from being passed on to the map. It is used for the contextmenu event.\n var ignoreHandler = function ignoreHandler(event) {\n event.returnValue = false;\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (!_this.enableEventPropagation) {\n cancelHandler(event);\n }\n };\n if (!this.div) {\n this.div = document.createElement('div');\n this.setBoxStyle();\n if (typeof this.content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + this.content;\n } else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(this.content);\n }\n var panes = this.getPanes();\n if (panes !== null) {\n panes[this.pane].appendChild(this.div); // Add the InfoBox div to the DOM\n }\n this.addClickHandler();\n if (this.div.style.width) {\n this.fixedWidthSet = true;\n } else {\n if (this.maxWidth !== 0 && this.div.offsetWidth > this.maxWidth) {\n this.div.style.width = this.maxWidth + 'px';\n this.fixedWidthSet = true;\n } else {\n // The following code is needed to overcome problems with MSIE\n var bw = this.getBoxWidths();\n this.div.style.width = this.div.offsetWidth - bw.left - bw.right + 'px';\n this.fixedWidthSet = false;\n }\n }\n this.panBox(this.disableAutoPan);\n if (!this.enableEventPropagation) {\n this.eventListeners = [];\n // Cancel event propagation.\n // Note: mousemove not included (to resolve Issue 152)\n var events = ['mousedown', 'mouseover', 'mouseout', 'mouseup', 'click', 'dblclick', 'touchstart', 'touchend', 'touchmove'];\n for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {\n var event_1 = events_1[_i];\n this.eventListeners.push(google.maps.event.addListener(this.div, event_1, cancelHandler));\n }\n // Workaround for Google bug that causes the cursor to change to a pointer\n // when the mouse moves over a marker underneath InfoBox.\n this.eventListeners.push(google.maps.event.addListener(this.div, 'mouseover', function () {\n if (_this.div) {\n _this.div.style.cursor = 'default';\n }\n }));\n }\n this.contextListener = google.maps.event.addListener(this.div, 'contextmenu', ignoreHandler);\n /**\n * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.\n * @name InfoBox#domready\n * @event\n */\n google.maps.event.trigger(this, 'domready');\n }\n };\n InfoBox.prototype.getCloseBoxImg = function () {\n var img = '';\n if (this.closeBoxURL !== '') {\n img = '\"\"';\n\";\n }\n return img;\n };\n InfoBox.prototype.addClickHandler = function () {\n this.closeListener = this.div && this.div.firstChild && this.closeBoxURL !== '' ? google.maps.event.addListener(this.div.firstChild, 'click', this.getCloseClickHandler()) : null;\n };\n InfoBox.prototype.closeClickHandler = function (event) {\n // 1.0.3 fix: Always prevent propagation of a close box click to the map:\n event.cancelBubble = true;\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n /**\n * This event is fired when the InfoBox's close box is clicked.\n * @name InfoBox#closeclick\n * @event\n */\n google.maps.event.trigger(this, 'closeclick');\n this.close();\n };\n InfoBox.prototype.getCloseClickHandler = function () {\n return this.closeClickHandler;\n };\n InfoBox.prototype.panBox = function (disablePan) {\n if (this.div && !disablePan) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var map = this.getMap();\n // Only pan if attached to map, not panorama\n if (map instanceof google.maps.Map) {\n var xOffset = 0;\n var yOffset = 0;\n var bounds = map.getBounds();\n if (bounds && !bounds.contains(this.position)) {\n // Marker not in visible area of map, so set center\n // of map to the marker position first.\n map.setCenter(this.position);\n }\n var mapDiv = map.getDiv();\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var mapWidth = mapDiv.offsetWidth;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var mapHeight = mapDiv.offsetHeight;\n var iwOffsetX = this.pixelOffset.width;\n var iwOffsetY = this.pixelOffset.height;\n var iwWidth = this.div.offsetWidth;\n var iwHeight = this.div.offsetHeight;\n var padX = this.infoBoxClearance.width;\n var padY = this.infoBoxClearance.height;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var projection = this.getProjection();\n var pixPosition = projection.fromLatLngToContainerPixel(this.position);\n if (pixPosition !== null) {\n if (pixPosition.x < -iwOffsetX + padX) {\n xOffset = pixPosition.x + iwOffsetX - padX;\n } else if (pixPosition.x + iwWidth + iwOffsetX + padX > mapWidth) {\n xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;\n }\n if (this.alignBottom) {\n if (pixPosition.y < -iwOffsetY + padY + iwHeight) {\n yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;\n } else if (pixPosition.y + iwOffsetY + padY > mapHeight) {\n yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;\n }\n } else {\n if (pixPosition.y < -iwOffsetY + padY) {\n yOffset = pixPosition.y + iwOffsetY - padY;\n } else if (pixPosition.y + iwHeight + iwOffsetY + padY > mapHeight) {\n yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;\n }\n }\n }\n if (!(xOffset === 0 && yOffset === 0)) {\n // Move the map to the shifted center.\n map.panBy(xOffset, yOffset);\n }\n }\n }\n };\n InfoBox.prototype.setBoxStyle = function () {\n if (this.div) {\n // Apply style values from the style sheet defined in the boxClass parameter:\n this.div.className = this.boxClass;\n // Clear existing inline style values:\n this.div.style.cssText = '';\n // Apply style values defined in the boxStyle parameter:\n var boxStyle = this.boxStyle;\n for (var i in boxStyle) {\n if (Object.prototype.hasOwnProperty.call(boxStyle, i)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.div.style[i] = boxStyle[i];\n }\n }\n // Fix for iOS disappearing InfoBox problem\n // See http://stackoverflow.com/questions/9229535/google-maps-markers-disappear-at-certain-zoom-level-only-on-iphone-ipad\n this.div.style.webkitTransform = 'translateZ(0)';\n // Fix up opacity style for benefit of MSIE\n if (typeof this.div.style.opacity !== 'undefined' && this.div.style.opacity !== '') {\n // See http://www.quirksmode.org/css/opacity.html\n var opacity = parseFloat(this.div.style.opacity || '');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.div.style.msFilter = '\"progid:DXImageTransform.Microsoft.Alpha(Opacity=' + opacity * 100 + ')\"';\n this.div.style.filter = 'alpha(opacity=' + opacity * 100 + ')';\n }\n // Apply required styles\n this.div.style.position = 'absolute';\n this.div.style.visibility = 'hidden';\n if (this.zIndex !== null) {\n this.div.style.zIndex = this.zIndex + '';\n }\n if (!this.div.style.overflow) {\n this.div.style.overflow = 'auto';\n }\n }\n };\n InfoBox.prototype.getBoxWidths = function () {\n var bw = {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0\n };\n if (!this.div) {\n return bw;\n }\n if (document.defaultView) {\n var ownerDocument = this.div.ownerDocument;\n var computedStyle = ownerDocument && ownerDocument.defaultView ? ownerDocument.defaultView.getComputedStyle(this.div, '') : null;\n if (computedStyle) {\n // The computed styles are always in pixel units (good!)\n bw.top = parseInt(computedStyle.borderTopWidth || '', 10) || 0;\n bw.bottom = parseInt(computedStyle.borderBottomWidth || '', 10) || 0;\n bw.left = parseInt(computedStyle.borderLeftWidth || '', 10) || 0;\n bw.right = parseInt(computedStyle.borderRightWidth || '', 10) || 0;\n }\n } else if (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n document.documentElement.currentStyle // MSIE\n ) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var currentStyle = this.div.currentStyle;\n if (currentStyle) {\n // The current styles may not be in pixel units, but assume they are (bad!)\n bw.top = parseInt(currentStyle.borderTopWidth || '', 10) || 0;\n bw.bottom = parseInt(currentStyle.borderBottomWidth || '', 10) || 0;\n bw.left = parseInt(currentStyle.borderLeftWidth || '', 10) || 0;\n bw.right = parseInt(currentStyle.borderRightWidth || '', 10) || 0;\n }\n }\n return bw;\n };\n InfoBox.prototype.onRemove = function () {\n if (this.div && this.div.parentNode) {\n this.div.parentNode.removeChild(this.div);\n this.div = null;\n }\n };\n InfoBox.prototype.draw = function () {\n this.createInfoBoxDiv();\n if (this.div) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var projection = this.getProjection();\n var pixPosition = projection.fromLatLngToDivPixel(this.position);\n if (pixPosition !== null) {\n this.div.style.left = pixPosition.x + this.pixelOffset.width + 'px';\n if (this.alignBottom) {\n this.div.style.bottom = -(pixPosition.y + this.pixelOffset.height) + 'px';\n } else {\n this.div.style.top = pixPosition.y + this.pixelOffset.height + 'px';\n }\n }\n if (this.isHidden) {\n this.div.style.visibility = 'hidden';\n } else {\n this.div.style.visibility = 'visible';\n }\n }\n };\n InfoBox.prototype.setOptions = function (options) {\n if (options === void 0) {\n options = {};\n }\n if (typeof options.boxClass !== 'undefined') {\n // Must be first\n this.boxClass = options.boxClass;\n this.setBoxStyle();\n }\n if (typeof options.boxStyle !== 'undefined') {\n // Must be second\n this.boxStyle = options.boxStyle;\n this.setBoxStyle();\n }\n if (typeof options.content !== 'undefined') {\n this.setContent(options.content);\n }\n if (typeof options.disableAutoPan !== 'undefined') {\n this.disableAutoPan = options.disableAutoPan;\n }\n if (typeof options.maxWidth !== 'undefined') {\n this.maxWidth = options.maxWidth;\n }\n if (typeof options.pixelOffset !== 'undefined') {\n this.pixelOffset = options.pixelOffset;\n }\n if (typeof options.alignBottom !== 'undefined') {\n this.alignBottom = options.alignBottom;\n }\n if (typeof options.position !== 'undefined') {\n this.setPosition(options.position);\n }\n if (typeof options.zIndex !== 'undefined') {\n this.setZIndex(options.zIndex);\n }\n if (typeof options.closeBoxMargin !== 'undefined') {\n this.closeBoxMargin = options.closeBoxMargin;\n }\n if (typeof options.closeBoxURL !== 'undefined') {\n this.closeBoxURL = options.closeBoxURL;\n }\n if (typeof options.infoBoxClearance !== 'undefined') {\n this.infoBoxClearance = options.infoBoxClearance;\n }\n if (typeof options.isHidden !== 'undefined') {\n this.isHidden = options.isHidden;\n }\n if (typeof options.visible !== 'undefined') {\n this.isHidden = !options.visible;\n }\n if (typeof options.enableEventPropagation !== 'undefined') {\n this.enableEventPropagation = options.enableEventPropagation;\n }\n if (this.div) {\n this.draw();\n }\n };\n InfoBox.prototype.setContent = function (content) {\n this.content = content;\n if (this.div) {\n if (this.closeListener) {\n google.maps.event.removeListener(this.closeListener);\n this.closeListener = null;\n }\n // Odd code required to make things work with MSIE.\n if (!this.fixedWidthSet) {\n this.div.style.width = '';\n }\n if (typeof content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + content;\n } else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(content);\n }\n // Perverse code required to make things work with MSIE.\n // (Ensures the close box does, in fact, float to the right.)\n if (!this.fixedWidthSet) {\n this.div.style.width = this.div.offsetWidth + 'px';\n if (typeof content === 'string') {\n this.div.innerHTML = this.getCloseBoxImg() + content;\n } else {\n this.div.innerHTML = this.getCloseBoxImg();\n this.div.appendChild(content);\n }\n }\n this.addClickHandler();\n }\n /**\n * This event is fired when the content of the InfoBox changes.\n * @name InfoBox#content_changed\n * @event\n */\n google.maps.event.trigger(this, 'content_changed');\n };\n InfoBox.prototype.setPosition = function (latLng) {\n this.position = latLng;\n if (this.div) {\n this.draw();\n }\n /**\n * This event is fired when the position of the InfoBox changes.\n * @name InfoBox#position_changed\n * @event\n */\n google.maps.event.trigger(this, 'position_changed');\n };\n InfoBox.prototype.setVisible = function (isVisible) {\n this.isHidden = !isVisible;\n if (this.div) {\n this.div.style.visibility = this.isHidden ? 'hidden' : 'visible';\n }\n };\n InfoBox.prototype.setZIndex = function (index) {\n this.zIndex = index;\n if (this.div) {\n this.div.style.zIndex = index + '';\n }\n /**\n * This event is fired when the zIndex of the InfoBox changes.\n * @name InfoBox#zindex_changed\n * @event\n */\n google.maps.event.trigger(this, 'zindex_changed');\n };\n InfoBox.prototype.getContent = function () {\n return this.content;\n };\n InfoBox.prototype.getPosition = function () {\n return this.position;\n };\n InfoBox.prototype.getZIndex = function () {\n return this.zIndex;\n };\n InfoBox.prototype.getVisible = function () {\n var map = this.getMap();\n return typeof map === 'undefined' || map === null ? false : !this.isHidden;\n };\n InfoBox.prototype.show = function () {\n this.isHidden = false;\n if (this.div) {\n this.div.style.visibility = 'visible';\n }\n };\n InfoBox.prototype.hide = function () {\n this.isHidden = true;\n if (this.div) {\n this.div.style.visibility = 'hidden';\n }\n };\n InfoBox.prototype.open = function (map, anchor) {\n var _this = this;\n if (anchor) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.position = anchor.getPosition();\n this.moveListener = google.maps.event.addListener(anchor, 'position_changed', function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n var position = anchor.getPosition();\n _this.setPosition(position);\n });\n this.mapListener = google.maps.event.addListener(anchor, 'map_changed', function () {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n _this.setMap(anchor.map);\n });\n }\n this.setMap(map);\n if (this.div) {\n this.panBox();\n }\n };\n InfoBox.prototype.close = function () {\n if (this.closeListener) {\n google.maps.event.removeListener(this.closeListener);\n this.closeListener = null;\n }\n if (this.eventListeners) {\n for (var _i = 0, _a = this.eventListeners; _i < _a.length; _i++) {\n var eventListener = _a[_i];\n google.maps.event.removeListener(eventListener);\n }\n this.eventListeners = null;\n }\n if (this.moveListener) {\n google.maps.event.removeListener(this.moveListener);\n this.moveListener = null;\n }\n if (this.mapListener) {\n google.maps.event.removeListener(this.mapListener);\n this.mapListener = null;\n }\n if (this.contextListener) {\n google.maps.event.removeListener(this.contextListener);\n this.contextListener = null;\n }\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.setMap(null);\n };\n InfoBox.prototype.extend = function (obj1, obj2) {\n return function applyExtend(object) {\n for (var property in object.prototype) {\n if (!Object.prototype.hasOwnProperty.call(this, property)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.prototype[property] = object.prototype[property];\n }\n }\n return this;\n }.apply(obj1, [obj2]);\n };\n return InfoBox;\n}();\nvar _excluded = [\"position\"],\n _excluded2 = [\"position\"];\nfunction ownKeys$b(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$b(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$d = {\n onCloseClick: 'closeclick',\n onContentChanged: 'content_changed',\n onDomReady: 'domready',\n onPositionChanged: 'position_changed',\n onZindexChanged: 'zindex_changed'\n};\nvar updaterMap$d = {\n options(instance, options) {\n instance.setOptions(options);\n },\n position(instance, position) {\n if (position instanceof google.maps.LatLng) {\n instance.setPosition(position);\n } else {\n instance.setPosition(new google.maps.LatLng(position.lat, position.lng));\n }\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n }\n};\nvar defaultOptions$3 = {};\nfunction InfoBoxFunctional(_ref) {\n var children = _ref.children,\n anchor = _ref.anchor,\n options = _ref.options,\n position = _ref.position,\n zIndex = _ref.zIndex,\n onCloseClick = _ref.onCloseClick,\n onDomReady = _ref.onDomReady,\n onContentChanged = _ref.onContentChanged,\n onPositionChanged = _ref.onPositionChanged,\n onZindexChanged = _ref.onZindexChanged,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState111 = useState(null),\n _useState112 = _slicedToArray(_useState111, 2),\n instance = _useState112[0],\n setInstance = _useState112[1];\n var _useState113 = useState(null),\n _useState114 = _slicedToArray(_useState113, 2),\n closeClickListener = _useState114[0],\n setCloseClickListener = _useState114[1];\n var _useState115 = useState(null),\n _useState116 = _slicedToArray(_useState115, 2),\n domReadyClickListener = _useState116[0],\n setDomReadyClickListener = _useState116[1];\n var _useState117 = useState(null),\n _useState118 = _slicedToArray(_useState117, 2),\n contentChangedClickListener = _useState118[0],\n setContentChangedClickListener = _useState118[1];\n var _useState119 = useState(null),\n _useState120 = _slicedToArray(_useState119, 2),\n positionChangedClickListener = _useState120[0],\n setPositionChangedClickListener = _useState120[1];\n var _useState121 = useState(null),\n _useState122 = _slicedToArray(_useState121, 2),\n zIndexChangedClickListener = _useState122[0],\n setZindexChangedClickListener = _useState122[1];\n var containerElementRef = useRef(null);\n // Order does matter\n useEffect(() => {\n if (map && instance !== null) {\n instance.close();\n if (anchor) {\n instance.open(map, anchor);\n } else if (instance.getPosition()) {\n instance.open(map);\n }\n }\n }, [map, instance, anchor]);\n useEffect(() => {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (position && instance !== null) {\n var positionLatLng = position instanceof google.maps.LatLng ? position :\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n new google.maps.LatLng(position.lat, position.lng);\n instance.setPosition(positionLatLng);\n }\n }, [position]);\n useEffect(() => {\n if (typeof zIndex === 'number' && instance !== null) {\n instance.setZIndex(zIndex);\n }\n }, [zIndex]);\n useEffect(() => {\n if (instance && onCloseClick) {\n if (closeClickListener !== null) {\n google.maps.event.removeListener(closeClickListener);\n }\n setCloseClickListener(google.maps.event.addListener(instance, 'closeclick', onCloseClick));\n }\n }, [onCloseClick]);\n useEffect(() => {\n if (instance && onDomReady) {\n if (domReadyClickListener !== null) {\n google.maps.event.removeListener(domReadyClickListener);\n }\n setDomReadyClickListener(google.maps.event.addListener(instance, 'domready', onDomReady));\n }\n }, [onDomReady]);\n useEffect(() => {\n if (instance && onContentChanged) {\n if (contentChangedClickListener !== null) {\n google.maps.event.removeListener(contentChangedClickListener);\n }\n setContentChangedClickListener(google.maps.event.addListener(instance, 'content_changed', onContentChanged));\n }\n }, [onContentChanged]);\n useEffect(() => {\n if (instance && onPositionChanged) {\n if (positionChangedClickListener !== null) {\n google.maps.event.removeListener(positionChangedClickListener);\n }\n setPositionChangedClickListener(google.maps.event.addListener(instance, 'position_changed', onPositionChanged));\n }\n }, [onPositionChanged]);\n useEffect(() => {\n if (instance && onZindexChanged) {\n if (zIndexChangedClickListener !== null) {\n google.maps.event.removeListener(zIndexChangedClickListener);\n }\n setZindexChangedClickListener(google.maps.event.addListener(instance, 'zindex_changed', onZindexChanged));\n }\n }, [onZindexChanged]);\n useEffect(() => {\n if (map) {\n var _ref2 = options || defaultOptions$3,\n _position = _ref2.position,\n infoBoxOptions = _objectWithoutProperties(_ref2, _excluded);\n var positionLatLng;\n if (_position && !(_position instanceof google.maps.LatLng)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n positionLatLng = new google.maps.LatLng(_position.lat, _position.lng);\n }\n var infoBox = new InfoBox(_objectSpread$b(_objectSpread$b({}, infoBoxOptions), positionLatLng ? {\n position: positionLatLng\n } : {}));\n containerElementRef.current = document.createElement('div');\n setInstance(infoBox);\n if (onCloseClick) {\n setCloseClickListener(google.maps.event.addListener(infoBox, 'closeclick', onCloseClick));\n }\n if (onDomReady) {\n setDomReadyClickListener(google.maps.event.addListener(infoBox, 'domready', onDomReady));\n }\n if (onContentChanged) {\n setContentChangedClickListener(google.maps.event.addListener(infoBox, 'content_changed', onContentChanged));\n }\n if (onPositionChanged) {\n setPositionChangedClickListener(google.maps.event.addListener(infoBox, 'position_changed', onPositionChanged));\n }\n if (onZindexChanged) {\n setZindexChangedClickListener(google.maps.event.addListener(infoBox, 'zindex_changed', onZindexChanged));\n }\n infoBox.setContent(containerElementRef.current);\n if (anchor) {\n infoBox.open(map, anchor);\n } else if (infoBox.getPosition()) {\n infoBox.open(map);\n } else {\n invariant(false, 'You must provide either an anchor or a position prop for .');\n }\n if (onLoad) {\n onLoad(infoBox);\n }\n }\n return () => {\n if (instance !== null) {\n if (closeClickListener) {\n google.maps.event.removeListener(closeClickListener);\n }\n if (contentChangedClickListener) {\n google.maps.event.removeListener(contentChangedClickListener);\n }\n if (domReadyClickListener) {\n google.maps.event.removeListener(domReadyClickListener);\n }\n if (positionChangedClickListener) {\n google.maps.event.removeListener(positionChangedClickListener);\n }\n if (zIndexChangedClickListener) {\n google.maps.event.removeListener(zIndexChangedClickListener);\n }\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.close();\n }\n };\n }, []);\n return containerElementRef.current ? /*#__PURE__*/createPortal(Children.only(children), containerElementRef.current) : null;\n}\nvar InfoBoxF = /*#__PURE__*/memo(InfoBoxFunctional);\nclass InfoBoxComponent extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"containerElement\", null);\n _defineProperty(this, \"state\", {\n infoBox: null\n });\n _defineProperty(this, \"open\", (infoBox, anchor) => {\n if (anchor) {\n if (this.context !== null) {\n infoBox.open(this.context, anchor);\n }\n } else if (infoBox.getPosition()) {\n if (this.context !== null) {\n infoBox.open(this.context);\n }\n } else {\n invariant(false, 'You must provide either an anchor or a position prop for .');\n }\n });\n _defineProperty(this, \"setInfoBoxCallback\", () => {\n if (this.state.infoBox !== null && this.containerElement !== null) {\n this.state.infoBox.setContent(this.containerElement);\n this.open(this.state.infoBox, this.props.anchor);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.infoBox);\n }\n }\n });\n }\n componentDidMount() {\n var _ref3 = this.props.options || {},\n position = _ref3.position,\n infoBoxOptions = _objectWithoutProperties(_ref3, _excluded2);\n var positionLatLng;\n if (position && !(position instanceof google.maps.LatLng)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n positionLatLng = new google.maps.LatLng(position.lat, position.lng);\n }\n var infoBox = new InfoBox(_objectSpread$b(_objectSpread$b({}, infoBoxOptions), positionLatLng ? {\n position: positionLatLng\n } : {}));\n this.containerElement = document.createElement('div');\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$d,\n eventMap: eventMap$d,\n prevProps: {},\n nextProps: this.props,\n instance: infoBox\n });\n this.setState({\n infoBox\n }, this.setInfoBoxCallback);\n }\n componentDidUpdate(prevProps) {\n var infoBox = this.state.infoBox;\n if (infoBox !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$d,\n eventMap: eventMap$d,\n prevProps,\n nextProps: this.props,\n instance: infoBox\n });\n }\n }\n componentWillUnmount() {\n var onUnmount = this.props.onUnmount;\n var infoBox = this.state.infoBox;\n if (infoBox !== null) {\n if (onUnmount) {\n onUnmount(infoBox);\n }\n unregisterEvents(this.registeredEvents);\n infoBox.close();\n }\n }\n render() {\n return this.containerElement ? /*#__PURE__*/createPortal(Children.only(this.props.children), this.containerElement) : null;\n }\n}\n_defineProperty(InfoBoxComponent, \"contextType\", MapContext);\nvar fastDeepEqual;\nvar hasRequiredFastDeepEqual;\nfunction requireFastDeepEqual() {\n if (hasRequiredFastDeepEqual) return fastDeepEqual;\n hasRequiredFastDeepEqual = 1;\n\n // do not edit .js files directly - edit src/index.jst\n\n fastDeepEqual = function equal(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n return true;\n }\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n };\n return fastDeepEqual;\n}\nvar fastDeepEqualExports = requireFastDeepEqual();\nvar equal = /*@__PURE__*/getDefaultExportFromCjs$1(fastDeepEqualExports);\nvar ARRAY_TYPES = [Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array];\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nvar VERSION = 1; // serialized format version\nvar HEADER_SIZE = 8;\nclass KDBush {\n /**\n * Creates an index from raw `ArrayBuffer` data.\n * @param {ArrayBuffer} data\n */\n static from(data) {\n if (!(data instanceof ArrayBuffer)) {\n throw new Error('Data must be an instance of ArrayBuffer.');\n }\n var _Uint8Array = new Uint8Array(data, 0, 2),\n _Uint8Array2 = _slicedToArray(_Uint8Array, 2),\n magic = _Uint8Array2[0],\n versionAndType = _Uint8Array2[1];\n if (magic !== 0xdb) {\n throw new Error('Data does not appear to be in a KDBush format.');\n }\n var version = versionAndType >> 4;\n if (version !== VERSION) {\n throw new Error(\"Got v\".concat(version, \" data when expected v\").concat(VERSION, \".\"));\n }\n var ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n if (!ArrayType) {\n throw new Error('Unrecognized array type.');\n }\n var _Uint16Array = new Uint16Array(data, 2, 1),\n _Uint16Array2 = _slicedToArray(_Uint16Array, 1),\n nodeSize = _Uint16Array2[0];\n var _Uint32Array = new Uint32Array(data, 4, 1),\n _Uint32Array2 = _slicedToArray(_Uint32Array, 1),\n numItems = _Uint32Array2[0];\n return new KDBush(numItems, nodeSize, ArrayType, data);\n }\n\n /**\n * Creates an index that will hold a given number of items.\n * @param {number} numItems\n * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n * @param {ArrayBuffer} [data] (For internal use only)\n */\n constructor(numItems) {\n var nodeSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 64;\n var ArrayType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Float64Array;\n var data = arguments.length > 3 ? arguments[3] : undefined;\n if (isNaN(numItems) || numItems < 0) throw new Error(\"Unpexpected numItems value: \".concat(numItems, \".\"));\n this.numItems = +numItems;\n this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n this.ArrayType = ArrayType;\n this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n var arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n var coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n var idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n var padCoords = (8 - idsByteSize % 8) % 8;\n if (arrayTypeIndex < 0) {\n throw new Error(\"Unexpected typed array class: \".concat(ArrayType, \".\"));\n }\n if (data && data instanceof ArrayBuffer) {\n // reconstruct an index from a buffer\n this.data = data;\n this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n this._pos = numItems * 2;\n this._finished = true;\n } else {\n // initialize a new index\n this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n this._pos = 0;\n this._finished = false;\n\n // set header\n new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]);\n new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n new Uint32Array(this.data, 4, 1)[0] = numItems;\n }\n }\n\n /**\n * Add a point to the index.\n * @param {number} x\n * @param {number} y\n * @returns {number} An incremental index associated with the added item (starting from `0`).\n */\n add(x, y) {\n var index = this._pos >> 1;\n this.ids[index] = index;\n this.coords[this._pos++] = x;\n this.coords[this._pos++] = y;\n return index;\n }\n\n /**\n * Perform indexing of the added points.\n */\n finish() {\n var numAdded = this._pos >> 1;\n if (numAdded !== this.numItems) {\n throw new Error(\"Added \".concat(numAdded, \" items when expected \").concat(this.numItems, \".\"));\n }\n // kd-sort both arrays for efficient search\n sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n this._finished = true;\n return this;\n }\n\n /**\n * Search the index for items within a given bounding box.\n * @param {number} minX\n * @param {number} minY\n * @param {number} maxX\n * @param {number} maxY\n * @returns {number[]} An array of indices correponding to the found items.\n */\n range(minX, minY, maxX, maxY) {\n if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n var ids = this.ids,\n coords = this.coords,\n nodeSize = this.nodeSize;\n var stack = [0, ids.length - 1, 0];\n var result = [];\n\n // recursively search for items in range in the kd-sorted arrays\n while (stack.length) {\n var axis = stack.pop() || 0;\n var right = stack.pop() || 0;\n var left = stack.pop() || 0;\n\n // if we reached \"tree node\", search linearly\n if (right - left <= nodeSize) {\n for (var i = left; i <= right; i++) {\n var _x = coords[2 * i];\n var _y = coords[2 * i + 1];\n if (_x >= minX && _x <= maxX && _y >= minY && _y <= maxY) result.push(ids[i]);\n }\n continue;\n }\n\n // otherwise find the middle index\n var m = left + right >> 1;\n\n // include the middle item if it's in range\n var x = coords[2 * m];\n var y = coords[2 * m + 1];\n if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n // queue search in halves that intersect the query\n if (axis === 0 ? minX <= x : minY <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(1 - axis);\n }\n if (axis === 0 ? maxX >= x : maxY >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(1 - axis);\n }\n }\n return result;\n }\n\n /**\n * Search the index for items within a given radius.\n * @param {number} qx\n * @param {number} qy\n * @param {number} r Query radius.\n * @returns {number[]} An array of indices correponding to the found items.\n */\n within(qx, qy, r) {\n if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n var ids = this.ids,\n coords = this.coords,\n nodeSize = this.nodeSize;\n var stack = [0, ids.length - 1, 0];\n var result = [];\n var r2 = r * r;\n\n // recursively search for items within radius in the kd-sorted arrays\n while (stack.length) {\n var axis = stack.pop() || 0;\n var right = stack.pop() || 0;\n var left = stack.pop() || 0;\n\n // if we reached \"tree node\", search linearly\n if (right - left <= nodeSize) {\n for (var i = left; i <= right; i++) {\n if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n }\n continue;\n }\n\n // otherwise find the middle index\n var m = left + right >> 1;\n\n // include the middle item if it's in range\n var x = coords[2 * m];\n var y = coords[2 * m + 1];\n if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n // queue search in halves that intersect the query\n if (axis === 0 ? qx - r <= x : qy - r <= y) {\n stack.push(left);\n stack.push(m - 1);\n stack.push(1 - axis);\n }\n if (axis === 0 ? qx + r >= x : qy + r >= y) {\n stack.push(m + 1);\n stack.push(right);\n stack.push(1 - axis);\n }\n }\n return result;\n }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType} coords\n * @param {number} nodeSize\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction sort(ids, coords, nodeSize, left, right, axis) {\n if (right - left <= nodeSize) return;\n var m = left + right >> 1; // middle index\n\n // sort ids and coords around the middle index so that the halves lie\n // either left/right or top/bottom correspondingly (taking turns)\n select(ids, coords, m, left, right, axis);\n\n // recursively kd-sort first half and second half on the opposite axis\n sort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n sort(ids, coords, nodeSize, m + 1, right, 1 - axis);\n}\n\n/**\n * Custom Floyd-Rivest selection algorithm: sort ids and coords so that\n * [left..k-1] items are smaller than k-th item (on either x or y axis)\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType} coords\n * @param {number} k\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction select(ids, coords, k, left, right, axis) {\n while (right > left) {\n if (right - left > 600) {\n var n = right - left + 1;\n var m = k - left + 1;\n var z = Math.log(n);\n var s = 0.5 * Math.exp(2 * z / 3);\n var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n select(ids, coords, k, newLeft, newRight, axis);\n }\n var t = coords[2 * k + axis];\n var i = left;\n var j = right;\n swapItem(ids, coords, left, k);\n if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n while (i < j) {\n swapItem(ids, coords, i, j);\n i++;\n j--;\n while (coords[2 * i + axis] < t) i++;\n while (coords[2 * j + axis] > t) j--;\n }\n if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);else {\n j++;\n swapItem(ids, coords, j, right);\n }\n if (j <= k) left = j + 1;\n if (k <= j) right = j - 1;\n }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType} coords\n * @param {number} i\n * @param {number} j\n */\nfunction swapItem(ids, coords, i, j) {\n swap(ids, i, j);\n swap(coords, 2 * i, 2 * j);\n swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\n/**\n * @param {InstanceType} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n var tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n}\n\n/**\n * @param {number} ax\n * @param {number} ay\n * @param {number} bx\n * @param {number} by\n */\nfunction sqDist(ax, ay, bx, by) {\n var dx = ax - bx;\n var dy = ay - by;\n return dx * dx + dy * dy;\n}\nvar defaultOptions$2 = {\n minZoom: 0,\n // min zoom to generate clusters on\n maxZoom: 16,\n // max zoom level to cluster the points on\n minPoints: 2,\n // minimum points to form a cluster\n radius: 40,\n // cluster radius in pixels\n extent: 512,\n // tile extent (radius is calculated relative to it)\n nodeSize: 64,\n // size of the KD-tree leaf node, affects performance\n log: false,\n // whether to log timing info\n\n // whether to generate numeric ids for input features (in vector tiles)\n generateId: false,\n // a reduce function for calculating custom cluster properties\n reduce: null,\n // (accumulated, props) => { accumulated.sum += props.sum; }\n\n // properties to use for individual points when running the reducer\n map: props => props // props => ({sum: props.my_value})\n};\nvar fround = Math.fround || (tmp => x => {\n tmp[0] = +x;\n return tmp[0];\n})(new Float32Array(1));\nvar OFFSET_ZOOM = 2;\nvar OFFSET_ID = 3;\nvar OFFSET_PARENT = 4;\nvar OFFSET_NUM = 5;\nvar OFFSET_PROP = 6;\nclass Supercluster {\n constructor(options) {\n this.options = Object.assign(Object.create(defaultOptions$2), options);\n this.trees = new Array(this.options.maxZoom + 1);\n this.stride = this.options.reduce ? 7 : 6;\n this.clusterProps = [];\n }\n load(points) {\n var _this$options = this.options,\n log = _this$options.log,\n minZoom = _this$options.minZoom,\n maxZoom = _this$options.maxZoom;\n if (log) console.time('total time');\n var timerId = \"prepare \".concat(points.length, \" points\");\n if (log) console.time(timerId);\n this.points = points;\n\n // generate a cluster object for each point and index input points into a KD-tree\n var data = [];\n for (var i = 0; i < points.length; i++) {\n var p = points[i];\n if (!p.geometry) continue;\n var _p$geometry$coordinat = _slicedToArray(p.geometry.coordinates, 2),\n lng = _p$geometry$coordinat[0],\n lat = _p$geometry$coordinat[1];\n var x = fround(lngX(lng));\n var y = fround(latY(lat));\n // store internal point/cluster data in flat numeric arrays for performance\n data.push(x, y,\n // projected point coordinates\n Infinity,\n // the last zoom the point was processed at\n i,\n // index of the source feature in the original input array\n -1,\n // parent cluster id\n 1 // number of points in a cluster\n );\n if (this.options.reduce) data.push(0); // noop\n }\n var tree = this.trees[maxZoom + 1] = this._createTree(data);\n if (log) console.timeEnd(timerId);\n\n // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n // results in a cluster hierarchy across zoom levels\n for (var z = maxZoom; z >= minZoom; z--) {\n var now = +Date.now();\n\n // create a new set of clusters for the zoom and index them with a KD-tree\n tree = this.trees[z] = this._createTree(this._cluster(tree, z));\n if (log) console.log('z%d: %d clusters in %dms', z, tree.numItems, +Date.now() - now);\n }\n if (log) console.timeEnd('total time');\n return this;\n }\n getClusters(bbox, zoom) {\n var minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n var minLat = Math.max(-90, Math.min(90, bbox[1]));\n var maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n var maxLat = Math.max(-90, Math.min(90, bbox[3]));\n if (bbox[2] - bbox[0] >= 360) {\n minLng = -180;\n maxLng = 180;\n } else if (minLng > maxLng) {\n var easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n var westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n return easternHem.concat(westernHem);\n }\n var tree = this.trees[this._limitZoom(zoom)];\n var ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n var data = tree.data;\n var clusters = [];\n for (var id of ids) {\n var k = this.stride * id;\n clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n }\n return clusters;\n }\n getChildren(clusterId) {\n var originId = this._getOriginId(clusterId);\n var originZoom = this._getOriginZoom(clusterId);\n var errorMsg = 'No cluster with the specified id.';\n var tree = this.trees[originZoom];\n if (!tree) throw new Error(errorMsg);\n var data = tree.data;\n if (originId * this.stride >= data.length) throw new Error(errorMsg);\n var r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n var x = data[originId * this.stride];\n var y = data[originId * this.stride + 1];\n var ids = tree.within(x, y, r);\n var children = [];\n for (var id of ids) {\n var k = id * this.stride;\n if (data[k + OFFSET_PARENT] === clusterId) {\n children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n }\n }\n if (children.length === 0) throw new Error(errorMsg);\n return children;\n }\n getLeaves(clusterId, limit, offset) {\n limit = limit || 10;\n offset = offset || 0;\n var leaves = [];\n this._appendLeaves(leaves, clusterId, limit, offset, 0);\n return leaves;\n }\n getTile(z, x, y) {\n var tree = this.trees[this._limitZoom(z)];\n var z2 = Math.pow(2, z);\n var _this$options2 = this.options,\n extent = _this$options2.extent,\n radius = _this$options2.radius;\n var p = radius / extent;\n var top = (y - p) / z2;\n var bottom = (y + 1 + p) / z2;\n var tile = {\n features: []\n };\n this._addTileFeatures(tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom), tree.data, x, y, z2, tile);\n if (x === 0) {\n this._addTileFeatures(tree.range(1 - p / z2, top, 1, bottom), tree.data, z2, y, z2, tile);\n }\n if (x === z2 - 1) {\n this._addTileFeatures(tree.range(0, top, p / z2, bottom), tree.data, -1, y, z2, tile);\n }\n return tile.features.length ? tile : null;\n }\n getClusterExpansionZoom(clusterId) {\n var expansionZoom = this._getOriginZoom(clusterId) - 1;\n while (expansionZoom <= this.options.maxZoom) {\n var children = this.getChildren(clusterId);\n expansionZoom++;\n if (children.length !== 1) break;\n clusterId = children[0].properties.cluster_id;\n }\n return expansionZoom;\n }\n _appendLeaves(result, clusterId, limit, offset, skipped) {\n var children = this.getChildren(clusterId);\n for (var child of children) {\n var props = child.properties;\n if (props && props.cluster) {\n if (skipped + props.point_count <= offset) {\n // skip the whole cluster\n skipped += props.point_count;\n } else {\n // enter the cluster\n skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);\n // exit the cluster\n }\n } else if (skipped < offset) {\n // skip a single point\n skipped++;\n } else {\n // add a single point\n result.push(child);\n }\n if (result.length === limit) break;\n }\n return skipped;\n }\n _createTree(data) {\n var tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);\n for (var i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]);\n tree.finish();\n tree.data = data;\n return tree;\n }\n _addTileFeatures(ids, data, x, y, z2, tile) {\n for (var i of ids) {\n var k = i * this.stride;\n var isCluster = data[k + OFFSET_NUM] > 1;\n var tags = void 0,\n px = void 0,\n py = void 0;\n if (isCluster) {\n tags = getClusterProperties(data, k, this.clusterProps);\n px = data[k];\n py = data[k + 1];\n } else {\n var p = this.points[data[k + OFFSET_ID]];\n tags = p.properties;\n var _p$geometry$coordinat2 = _slicedToArray(p.geometry.coordinates, 2),\n lng = _p$geometry$coordinat2[0],\n lat = _p$geometry$coordinat2[1];\n px = lngX(lng);\n py = latY(lat);\n }\n var f = {\n type: 1,\n geometry: [[Math.round(this.options.extent * (px * z2 - x)), Math.round(this.options.extent * (py * z2 - y))]],\n tags\n };\n\n // assign id\n var id = void 0;\n if (isCluster || this.options.generateId) {\n // optionally generate id for points\n id = data[k + OFFSET_ID];\n } else {\n // keep id if already assigned\n id = this.points[data[k + OFFSET_ID]].id;\n }\n if (id !== undefined) f.id = id;\n tile.features.push(f);\n }\n }\n _limitZoom(z) {\n return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n }\n _cluster(tree, zoom) {\n var _this$options3 = this.options,\n radius = _this$options3.radius,\n extent = _this$options3.extent,\n reduce = _this$options3.reduce,\n minPoints = _this$options3.minPoints;\n var r = radius / (extent * Math.pow(2, zoom));\n var data = tree.data;\n var nextData = [];\n var stride = this.stride;\n\n // loop through each point\n for (var i = 0; i < data.length; i += stride) {\n // if we've already visited the point at this zoom level, skip it\n if (data[i + OFFSET_ZOOM] <= zoom) continue;\n data[i + OFFSET_ZOOM] = zoom;\n\n // find all nearby points\n var x = data[i];\n var y = data[i + 1];\n var neighborIds = tree.within(data[i], data[i + 1], r);\n var numPointsOrigin = data[i + OFFSET_NUM];\n var numPoints = numPointsOrigin;\n\n // count the number of points in a potential cluster\n for (var neighborId of neighborIds) {\n var k = neighborId * stride;\n // filter out neighbors that are already processed\n if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];\n }\n\n // if there were neighbors to merge, and there are enough points to form a cluster\n if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n var wx = x * numPointsOrigin;\n var wy = y * numPointsOrigin;\n var clusterProperties = void 0;\n var clusterPropIndex = -1;\n\n // encode both zoom and point index on which the cluster originated -- offset by total length of features\n var id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length;\n for (var _neighborId of neighborIds) {\n var _k = _neighborId * stride;\n if (data[_k + OFFSET_ZOOM] <= zoom) continue;\n data[_k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice)\n\n var numPoints2 = data[_k + OFFSET_NUM];\n wx += data[_k] * numPoints2; // accumulate coordinates for calculating weighted center\n wy += data[_k + 1] * numPoints2;\n data[_k + OFFSET_PARENT] = id;\n if (reduce) {\n if (!clusterProperties) {\n clusterProperties = this._map(data, i, true);\n clusterPropIndex = this.clusterProps.length;\n this.clusterProps.push(clusterProperties);\n }\n reduce(clusterProperties, this._map(data, _k));\n }\n }\n data[i + OFFSET_PARENT] = id;\n nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n if (reduce) nextData.push(clusterPropIndex);\n } else {\n // left points as unclustered\n for (var j = 0; j < stride; j++) nextData.push(data[i + j]);\n if (numPoints > 1) {\n for (var _neighborId2 of neighborIds) {\n var _k2 = _neighborId2 * stride;\n if (data[_k2 + OFFSET_ZOOM] <= zoom) continue;\n data[_k2 + OFFSET_ZOOM] = zoom;\n for (var _j = 0; _j < stride; _j++) nextData.push(data[_k2 + _j]);\n }\n }\n }\n }\n return nextData;\n }\n\n // get index of the point from which the cluster originated\n _getOriginId(clusterId) {\n return clusterId - this.points.length >> 5;\n }\n\n // get zoom of the point from which the cluster originated\n _getOriginZoom(clusterId) {\n return (clusterId - this.points.length) % 32;\n }\n _map(data, i, clone) {\n if (data[i + OFFSET_NUM] > 1) {\n var props = this.clusterProps[data[i + OFFSET_PROP]];\n return clone ? Object.assign({}, props) : props;\n }\n var original = this.points[data[i + OFFSET_ID]].properties;\n var result = this.options.map(original);\n return clone && result === original ? Object.assign({}, result) : result;\n }\n}\nfunction getClusterJSON(data, i, clusterProps) {\n return {\n type: 'Feature',\n id: data[i + OFFSET_ID],\n properties: getClusterProperties(data, i, clusterProps),\n geometry: {\n type: 'Point',\n coordinates: [xLng(data[i]), yLat(data[i + 1])]\n }\n };\n}\nfunction getClusterProperties(data, i, clusterProps) {\n var count = data[i + OFFSET_NUM];\n var abbrev = count >= 10000 ? \"\".concat(Math.round(count / 1000), \"k\") : count >= 1000 ? \"\".concat(Math.round(count / 100) / 10, \"k\") : count;\n var propIndex = data[i + OFFSET_PROP];\n var properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);\n return Object.assign(properties, {\n cluster: true,\n cluster_id: data[i + OFFSET_ID],\n point_count: count,\n point_count_abbreviated: abbrev\n });\n}\n\n// longitude/latitude to spherical mercator in [0..1] range\nfunction lngX(lng) {\n return lng / 360 + 0.5;\n}\nfunction latY(lat) {\n var sin = Math.sin(lat * Math.PI / 180);\n var y = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n return y < 0 ? 0 : y > 1 ? 1 : y;\n}\n\n// spherical mercator to longitude/latitude\nfunction xLng(x) {\n return (x - 0.5) * 360;\n}\nfunction yLat(y) {\n var y2 = (180 - y * 360) * Math.PI / 180;\n return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\nfunction __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\n\n/**\n * Copyright 2023 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * util class that creates a common set of convenience functions to wrap\n * shared behavior of Advanced Markers and Markers.\n */\nclass MarkerUtils {\n static isAdvancedMarkerAvailable(map) {\n return google.maps.marker && map.getMapCapabilities().isAdvancedMarkersAvailable === true;\n }\n static isAdvancedMarker(marker) {\n return google.maps.marker && marker instanceof google.maps.marker.AdvancedMarkerElement;\n }\n static setMap(marker, map) {\n if (this.isAdvancedMarker(marker)) {\n marker.map = map;\n } else {\n marker.setMap(map);\n }\n }\n static getPosition(marker) {\n // SuperClusterAlgorithm.calculate expects a LatLng instance so we fake it for Adv Markers\n if (this.isAdvancedMarker(marker)) {\n if (marker.position) {\n if (marker.position instanceof google.maps.LatLng) {\n return marker.position;\n }\n // since we can't cast to LatLngLiteral for reasons =(\n if (marker.position.lat && marker.position.lng) {\n return new google.maps.LatLng(marker.position.lat, marker.position.lng);\n }\n }\n return new google.maps.LatLng(null);\n }\n return marker.getPosition();\n }\n static getVisible(marker) {\n if (this.isAdvancedMarker(marker)) {\n /**\n * Always return true for Advanced Markers because the clusterer\n * uses getVisible as a way to count legacy markers not as an actual\n * indicator of visibility for some reason. Even when markers are hidden\n * Marker.getVisible returns `true` and this is used to set the marker count\n * on the cluster. See the behavior of Cluster.count\n */\n return true;\n }\n return marker.getVisible();\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nclass Cluster {\n constructor(_ref) {\n var markers = _ref.markers,\n position = _ref.position;\n this.markers = markers;\n if (position) {\n if (position instanceof google.maps.LatLng) {\n this._position = position;\n } else {\n this._position = new google.maps.LatLng(position);\n }\n }\n }\n get bounds() {\n if (this.markers.length === 0 && !this._position) {\n return;\n }\n var bounds = new google.maps.LatLngBounds(this._position, this._position);\n for (var marker of this.markers) {\n bounds.extend(MarkerUtils.getPosition(marker));\n }\n return bounds;\n }\n get position() {\n return this._position || this.bounds.getCenter();\n }\n /**\n * Get the count of **visible** markers.\n */\n get count() {\n return this.markers.filter(m => MarkerUtils.getVisible(m)).length;\n }\n /**\n * Add a marker to the cluster.\n */\n push(marker) {\n this.markers.push(marker);\n }\n /**\n * Cleanup references and remove marker from map.\n */\n delete() {\n if (this.marker) {\n MarkerUtils.setMap(this.marker, null);\n this.marker = undefined;\n }\n this.markers.length = 0;\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Returns the markers visible in a padded map viewport\n *\n * @param map\n * @param mapCanvasProjection\n * @param markers The list of marker to filter\n * @param viewportPaddingPixels The padding in pixel\n * @returns The list of markers in the padded viewport\n */\nvar filterMarkersToPaddedViewport = (map, mapCanvasProjection, markers, viewportPaddingPixels) => {\n var extendedMapBounds = extendBoundsToPaddedViewport(map.getBounds(), mapCanvasProjection, viewportPaddingPixels);\n return markers.filter(marker => extendedMapBounds.contains(MarkerUtils.getPosition(marker)));\n};\n/**\n * Extends a bounds by a number of pixels in each direction\n */\nvar extendBoundsToPaddedViewport = (bounds, projection, numPixels) => {\n var _latLngBoundsToPixelB = latLngBoundsToPixelBounds(bounds, projection),\n northEast = _latLngBoundsToPixelB.northEast,\n southWest = _latLngBoundsToPixelB.southWest;\n var extendedPixelBounds = extendPixelBounds({\n northEast,\n southWest\n }, numPixels);\n return pixelBoundsToLatLngBounds(extendedPixelBounds, projection);\n};\n/**\n * Gets the extended bounds as a bbox [westLng, southLat, eastLng, northLat]\n */\nvar getPaddedViewport = (bounds, projection, pixels) => {\n var extended = extendBoundsToPaddedViewport(bounds, projection, pixels);\n var ne = extended.getNorthEast();\n var sw = extended.getSouthWest();\n return [sw.lng(), sw.lat(), ne.lng(), ne.lat()];\n};\n/**\n * Returns the distance between 2 positions.\n *\n * @hidden\n */\nvar distanceBetweenPoints = (p1, p2) => {\n var R = 6371; // Radius of the Earth in km\n var dLat = (p2.lat - p1.lat) * Math.PI / 180;\n var dLon = (p2.lng - p1.lng) * Math.PI / 180;\n var sinDLat = Math.sin(dLat / 2);\n var sinDLon = Math.sin(dLon / 2);\n var a = sinDLat * sinDLat + Math.cos(p1.lat * Math.PI / 180) * Math.cos(p2.lat * Math.PI / 180) * sinDLon * sinDLon;\n var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n return R * c;\n};\n/**\n * Converts a LatLng bound to pixels.\n *\n * @hidden\n */\nvar latLngBoundsToPixelBounds = (bounds, projection) => {\n return {\n northEast: projection.fromLatLngToDivPixel(bounds.getNorthEast()),\n southWest: projection.fromLatLngToDivPixel(bounds.getSouthWest())\n };\n};\n/**\n * Extends a pixel bounds by numPixels in all directions.\n *\n * @hidden\n */\nvar extendPixelBounds = (_ref2, numPixels) => {\n var northEast = _ref2.northEast,\n southWest = _ref2.southWest;\n northEast.x += numPixels;\n northEast.y -= numPixels;\n southWest.x -= numPixels;\n southWest.y += numPixels;\n return {\n northEast,\n southWest\n };\n};\n/**\n * @hidden\n */\nvar pixelBoundsToLatLngBounds = (_ref3, projection) => {\n var northEast = _ref3.northEast,\n southWest = _ref3.southWest;\n var sw = projection.fromDivPixelToLatLng(southWest);\n var ne = projection.fromDivPixelToLatLng(northEast);\n return new google.maps.LatLngBounds(sw, ne);\n};\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @hidden\n */\nclass AbstractAlgorithm {\n constructor(_ref4) {\n var _ref4$maxZoom = _ref4.maxZoom,\n maxZoom = _ref4$maxZoom === void 0 ? 16 : _ref4$maxZoom;\n this.maxZoom = maxZoom;\n }\n /**\n * Helper function to bypass clustering based upon some map state such as\n * zoom, number of markers, etc.\n *\n * ```typescript\n * cluster({markers, map}: AlgorithmInput): Cluster[] {\n * if (shouldBypassClustering(map)) {\n * return this.noop({markers})\n * }\n * }\n * ```\n */\n noop(_ref5) {\n var markers = _ref5.markers;\n return noop$1(markers);\n }\n}\n/**\n * Abstract viewport algorithm proves a class to filter markers by a padded\n * viewport. This is a common optimization.\n *\n * @hidden\n */\nclass AbstractViewportAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var _a$viewportPadding = _a.viewportPadding,\n viewportPadding = _a$viewportPadding === void 0 ? 60 : _a$viewportPadding,\n options = __rest(_a, [\"viewportPadding\"]);\n super(options);\n this.viewportPadding = 60;\n this.viewportPadding = viewportPadding;\n }\n calculate(_ref6) {\n var markers = _ref6.markers,\n map = _ref6.map,\n mapCanvasProjection = _ref6.mapCanvasProjection;\n if (map.getZoom() >= this.maxZoom) {\n return {\n clusters: this.noop({\n markers\n }),\n changed: false\n };\n }\n return {\n clusters: this.cluster({\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\n map,\n mapCanvasProjection\n })\n };\n }\n}\n/**\n * @hidden\n */\nvar noop$1 = markers => {\n var clusters = markers.map(marker => new Cluster({\n position: MarkerUtils.getPosition(marker),\n markers: [marker]\n }));\n return clusters;\n};\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * The default Grid algorithm historically used in Google Maps marker\n * clustering.\n *\n * The Grid algorithm does not implement caching and markers may flash as the\n * viewport changes. Instead use {@link SuperClusterAlgorithm}.\n */\nclass GridAlgorithm extends AbstractViewportAlgorithm {\n constructor(_a) {\n var _a$maxDistance = _a.maxDistance,\n maxDistance = _a$maxDistance === void 0 ? 40000 : _a$maxDistance,\n _a$gridSize = _a.gridSize,\n gridSize = _a$gridSize === void 0 ? 40 : _a$gridSize,\n options = __rest(_a, [\"maxDistance\", \"gridSize\"]);\n super(options);\n this.clusters = [];\n this.state = {\n zoom: -1\n };\n this.maxDistance = maxDistance;\n this.gridSize = gridSize;\n }\n calculate(_ref7) {\n var markers = _ref7.markers,\n map = _ref7.map,\n mapCanvasProjection = _ref7.mapCanvasProjection;\n var state = {\n zoom: map.getZoom()\n };\n var changed = false;\n if (this.state.zoom >= this.maxZoom && state.zoom >= this.maxZoom) ;else {\n changed = !equal(this.state, state);\n }\n this.state = state;\n if (map.getZoom() >= this.maxZoom) {\n return {\n clusters: this.noop({\n markers\n }),\n changed\n };\n }\n return {\n clusters: this.cluster({\n markers: filterMarkersToPaddedViewport(map, mapCanvasProjection, markers, this.viewportPadding),\n map,\n mapCanvasProjection\n })\n };\n }\n cluster(_ref8) {\n var markers = _ref8.markers,\n map = _ref8.map,\n mapCanvasProjection = _ref8.mapCanvasProjection;\n this.clusters = [];\n markers.forEach(marker => {\n this.addToClosestCluster(marker, map, mapCanvasProjection);\n });\n return this.clusters;\n }\n addToClosestCluster(marker, map, projection) {\n var maxDistance = this.maxDistance; // Some large number\n var cluster = null;\n for (var i = 0; i < this.clusters.length; i++) {\n var candidate = this.clusters[i];\n var distance = distanceBetweenPoints(candidate.bounds.getCenter().toJSON(), MarkerUtils.getPosition(marker).toJSON());\n if (distance < maxDistance) {\n maxDistance = distance;\n cluster = candidate;\n }\n }\n if (cluster && extendBoundsToPaddedViewport(cluster.bounds, projection, this.gridSize).contains(MarkerUtils.getPosition(marker))) {\n cluster.push(marker);\n } else {\n var _cluster = new Cluster({\n markers: [marker]\n });\n this.clusters.push(_cluster);\n }\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Noop algorithm does not generate any clusters or filter markers by the an extended viewport.\n */\nclass NoopAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var options = __rest(_a, []);\n super(options);\n }\n calculate(_ref9) {\n var markers = _ref9.markers,\n map = _ref9.map,\n mapCanvasProjection = _ref9.mapCanvasProjection;\n return {\n clusters: this.cluster({\n markers,\n map,\n mapCanvasProjection\n }),\n changed: false\n };\n }\n cluster(input) {\n return this.noop(input);\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\nclass SuperClusterAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var maxZoom = _a.maxZoom,\n _a$radius = _a.radius,\n radius = _a$radius === void 0 ? 60 : _a$radius,\n options = __rest(_a, [\"maxZoom\", \"radius\"]);\n super({\n maxZoom\n });\n this.state = {\n zoom: -1\n };\n this.superCluster = new Supercluster(Object.assign({\n maxZoom: this.maxZoom,\n radius\n }, options));\n }\n calculate(input) {\n var changed = false;\n var state = {\n zoom: input.map.getZoom()\n };\n if (!equal(input.markers, this.markers)) {\n changed = true;\n // TODO use proxy to avoid copy?\n this.markers = [...input.markers];\n var points = this.markers.map(marker => {\n var position = MarkerUtils.getPosition(marker);\n var coordinates = [position.lng(), position.lat()];\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates\n },\n properties: {\n marker\n }\n };\n });\n this.superCluster.load(points);\n }\n if (!changed) {\n if (this.state.zoom <= this.maxZoom || state.zoom <= this.maxZoom) {\n changed = !equal(this.state, state);\n }\n }\n this.state = state;\n if (changed) {\n this.clusters = this.cluster(input);\n }\n return {\n clusters: this.clusters,\n changed\n };\n }\n cluster(_ref10) {\n var map = _ref10.map;\n return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(map.getZoom())).map(feature => this.transformCluster(feature));\n }\n transformCluster(_ref11) {\n var _ref11$geometry$coord = _slicedToArray(_ref11.geometry.coordinates, 2),\n lng = _ref11$geometry$coord[0],\n lat = _ref11$geometry$coord[1],\n properties = _ref11.properties;\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster.getLeaves(properties.cluster_id, Infinity).map(leaf => leaf.properties.marker),\n position: {\n lat,\n lng\n }\n });\n }\n var marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: MarkerUtils.getPosition(marker)\n });\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\nclass SuperClusterViewportAlgorithm extends AbstractViewportAlgorithm {\n constructor(_a) {\n var maxZoom = _a.maxZoom,\n _a$radius2 = _a.radius,\n radius = _a$radius2 === void 0 ? 60 : _a$radius2,\n _a$viewportPadding2 = _a.viewportPadding,\n viewportPadding = _a$viewportPadding2 === void 0 ? 60 : _a$viewportPadding2,\n options = __rest(_a, [\"maxZoom\", \"radius\", \"viewportPadding\"]);\n super({\n maxZoom,\n viewportPadding\n });\n this.superCluster = new Supercluster(Object.assign({\n maxZoom: this.maxZoom,\n radius\n }, options));\n this.state = {\n zoom: -1,\n view: [0, 0, 0, 0]\n };\n }\n calculate(input) {\n var state = {\n zoom: Math.round(input.map.getZoom()),\n view: getPaddedViewport(input.map.getBounds(), input.mapCanvasProjection, this.viewportPadding)\n };\n var changed = !equal(this.state, state);\n if (!equal(input.markers, this.markers)) {\n changed = true;\n // TODO use proxy to avoid copy?\n this.markers = [...input.markers];\n var points = this.markers.map(marker => {\n var position = MarkerUtils.getPosition(marker);\n var coordinates = [position.lng(), position.lat()];\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates\n },\n properties: {\n marker\n }\n };\n });\n this.superCluster.load(points);\n }\n if (changed) {\n this.clusters = this.cluster(input);\n this.state = state;\n }\n return {\n clusters: this.clusters,\n changed\n };\n }\n cluster(_ref12) {\n var map = _ref12.map,\n mapCanvasProjection = _ref12.mapCanvasProjection;\n /* recalculate new state because we can't use the cached version. */\n var state = {\n zoom: Math.round(map.getZoom()),\n view: getPaddedViewport(map.getBounds(), mapCanvasProjection, this.viewportPadding)\n };\n return this.superCluster.getClusters(state.view, state.zoom).map(feature => this.transformCluster(feature));\n }\n transformCluster(_ref13) {\n var _ref13$geometry$coord = _slicedToArray(_ref13.geometry.coordinates, 2),\n lng = _ref13$geometry$coord[0],\n lat = _ref13$geometry$coord[1],\n properties = _ref13.properties;\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster.getLeaves(properties.cluster_id, Infinity).map(leaf => leaf.properties.marker),\n position: {\n lat,\n lng\n }\n });\n }\n var marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: MarkerUtils.getPosition(marker)\n });\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.\n */\nclass ClusterStats {\n constructor(markers, clusters) {\n this.markers = {\n sum: markers.length\n };\n var clusterMarkerCounts = clusters.map(a => a.count);\n var clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);\n this.clusters = {\n count: clusters.length,\n markers: {\n mean: clusterMarkerSum / clusters.length,\n sum: clusterMarkerSum,\n min: Math.min(...clusterMarkerCounts),\n max: Math.max(...clusterMarkerCounts)\n }\n };\n }\n}\nclass DefaultRenderer {\n /**\n * The default render function for the library used by {@link MarkerClusterer}.\n *\n * Currently set to use the following:\n *\n * ```typescript\n * // change color if this cluster has more markers than the mean cluster\n * const color =\n * count > Math.max(10, stats.clusters.markers.mean)\n * ? \"#ff0000\"\n * : \"#0000ff\";\n *\n * // create svg url with fill color\n * const svg = window.btoa(`\n * \n * \n * \n * \n * \n * `);\n *\n * // create marker using svg icon\n * return new google.maps.Marker({\n * position,\n * icon: {\n * url: `data:image/svg+xml;base64,${svg}`,\n * scaledSize: new google.maps.Size(45, 45),\n * },\n * label: {\n * text: String(count),\n * color: \"rgba(255,255,255,0.9)\",\n * fontSize: \"12px\",\n * },\n * // adjust zIndex to be above other markers\n * zIndex: 1000 + count,\n * });\n * ```\n */\n render(_ref14, stats, map) {\n var count = _ref14.count,\n position = _ref14.position;\n // change color if this cluster has more markers than the mean cluster\n var color = count > Math.max(10, stats.clusters.markers.mean) ? \"#ff0000\" : \"#0000ff\";\n // create svg literal with fill color\n var svg = \"\\n\\n\\n\\n\").concat(count, \"\\n\");\n var title = \"Cluster of \".concat(count, \" markers\"),\n // adjust zIndex to be above other markers\n zIndex = Number(google.maps.Marker.MAX_ZINDEX) + count;\n if (MarkerUtils.isAdvancedMarkerAvailable(map)) {\n // create cluster SVG element\n var parser = new DOMParser();\n var svgEl = parser.parseFromString(svg, \"image/svg+xml\").documentElement;\n svgEl.setAttribute(\"transform\", \"translate(0 25)\");\n var _clusterOptions = {\n map,\n position,\n zIndex,\n title,\n content: svgEl\n };\n return new google.maps.marker.AdvancedMarkerElement(_clusterOptions);\n }\n var clusterOptions = {\n position,\n zIndex,\n title,\n icon: {\n url: \"data:image/svg+xml;base64,\".concat(btoa(svg)),\n anchor: new google.maps.Point(25, 25)\n }\n };\n return new google.maps.Marker(clusterOptions);\n }\n}\n\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * Extends an object's prototype by another's.\n *\n * @param type1 The Type to be extended.\n * @param type2 The Type to extend with.\n * @ignore\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction extend(type1, type2) {\n /* istanbul ignore next */\n // eslint-disable-next-line prefer-const\n for (var property in type2.prototype) {\n type1.prototype[property] = type2.prototype[property];\n }\n}\n/**\n * @ignore\n */\nclass OverlayViewSafe {\n constructor() {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n extend(OverlayViewSafe, google.maps.OverlayView);\n }\n}\n\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar MarkerClustererEvents;\n(function (MarkerClustererEvents) {\n MarkerClustererEvents[\"CLUSTERING_BEGIN\"] = \"clusteringbegin\";\n MarkerClustererEvents[\"CLUSTERING_END\"] = \"clusteringend\";\n MarkerClustererEvents[\"CLUSTER_CLICK\"] = \"click\";\n})(MarkerClustererEvents || (MarkerClustererEvents = {}));\nvar defaultOnClusterClickHandler = (_, cluster, map) => {\n map.fitBounds(cluster.bounds);\n};\n/**\n * MarkerClusterer creates and manages per-zoom-level clusters for large amounts\n * of markers. See {@link MarkerClustererOptions} for more details.\n *\n */\nclass MarkerClusterer extends OverlayViewSafe {\n constructor(_ref15) {\n var map = _ref15.map,\n _ref15$markers = _ref15.markers,\n markers = _ref15$markers === void 0 ? [] : _ref15$markers,\n _ref15$algorithmOptio = _ref15.algorithmOptions,\n algorithmOptions = _ref15$algorithmOptio === void 0 ? {} : _ref15$algorithmOptio,\n _ref15$algorithm = _ref15.algorithm,\n algorithm = _ref15$algorithm === void 0 ? new SuperClusterAlgorithm(algorithmOptions) : _ref15$algorithm,\n _ref15$renderer = _ref15.renderer,\n renderer = _ref15$renderer === void 0 ? new DefaultRenderer() : _ref15$renderer,\n _ref15$onClusterClick = _ref15.onClusterClick,\n onClusterClick = _ref15$onClusterClick === void 0 ? defaultOnClusterClickHandler : _ref15$onClusterClick;\n super();\n this.markers = [...markers];\n this.clusters = [];\n this.algorithm = algorithm;\n this.renderer = renderer;\n this.onClusterClick = onClusterClick;\n if (map) {\n this.setMap(map);\n }\n }\n addMarker(marker, noDraw) {\n if (this.markers.includes(marker)) {\n return;\n }\n this.markers.push(marker);\n if (!noDraw) {\n this.render();\n }\n }\n addMarkers(markers, noDraw) {\n markers.forEach(marker => {\n this.addMarker(marker, true);\n });\n if (!noDraw) {\n this.render();\n }\n }\n removeMarker(marker, noDraw) {\n var index = this.markers.indexOf(marker);\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n MarkerUtils.setMap(marker, null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n if (!noDraw) {\n this.render();\n }\n return true;\n }\n removeMarkers(markers, noDraw) {\n var removed = false;\n markers.forEach(marker => {\n removed = this.removeMarker(marker, true) || removed;\n });\n if (removed && !noDraw) {\n this.render();\n }\n return removed;\n }\n clearMarkers(noDraw) {\n this.markers.length = 0;\n if (!noDraw) {\n this.render();\n }\n }\n /**\n * Recalculates and draws all the marker clusters.\n */\n render() {\n var map = this.getMap();\n if (map instanceof google.maps.Map && map.getProjection()) {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);\n var _this$algorithm$calcu = this.algorithm.calculate({\n markers: this.markers,\n map,\n mapCanvasProjection: this.getProjection()\n }),\n clusters = _this$algorithm$calcu.clusters,\n changed = _this$algorithm$calcu.changed;\n // Allow algorithms to return flag on whether the clusters/markers have changed.\n if (changed || changed == undefined) {\n // Accumulate the markers of the clusters composed of a single marker.\n // Those clusters directly use the marker.\n // Clusters with more than one markers use a group marker generated by a renderer.\n var singleMarker = new Set();\n for (var cluster of clusters) {\n if (cluster.markers.length == 1) {\n singleMarker.add(cluster.markers[0]);\n }\n }\n var groupMarkers = [];\n // Iterate the clusters that are currently rendered.\n for (var _cluster2 of this.clusters) {\n if (_cluster2.marker == null) {\n continue;\n }\n if (_cluster2.markers.length == 1) {\n if (!singleMarker.has(_cluster2.marker)) {\n // The marker:\n // - was previously rendered because it is from a cluster with 1 marker,\n // - should no more be rendered as it is not in singleMarker.\n MarkerUtils.setMap(_cluster2.marker, null);\n }\n } else {\n // Delay the removal of old group markers to avoid flickering.\n groupMarkers.push(_cluster2.marker);\n }\n }\n this.clusters = clusters;\n this.renderClusters();\n // Delayed removal of the markers of the former groups.\n requestAnimationFrame(() => groupMarkers.forEach(marker => MarkerUtils.setMap(marker, null)));\n }\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);\n }\n }\n onAdd() {\n this.idleListener = this.getMap().addListener(\"idle\", this.render.bind(this));\n this.render();\n }\n onRemove() {\n google.maps.event.removeListener(this.idleListener);\n this.reset();\n }\n reset() {\n this.markers.forEach(marker => MarkerUtils.setMap(marker, null));\n this.clusters.forEach(cluster => cluster.delete());\n this.clusters = [];\n }\n renderClusters() {\n // Generate stats to pass to renderers.\n var stats = new ClusterStats(this.markers, this.clusters);\n var map = this.getMap();\n this.clusters.forEach(cluster => {\n if (cluster.markers.length === 1) {\n cluster.marker = cluster.markers[0];\n } else {\n // Generate the marker to represent the group.\n cluster.marker = this.renderer.render(cluster, stats, map);\n // Make sure all individual markers are removed from the map.\n cluster.markers.forEach(marker => MarkerUtils.setMap(marker, null));\n if (this.onClusterClick) {\n cluster.marker.addListener(\"click\", /* istanbul ignore next */\n event => {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);\n this.onClusterClick(event, cluster, map);\n });\n }\n }\n MarkerUtils.setMap(cluster.marker, map);\n });\n }\n}\nvar index_esm = /*#__PURE__*/Object.freeze({\n __proto__: null,\n AbstractAlgorithm: AbstractAlgorithm,\n AbstractViewportAlgorithm: AbstractViewportAlgorithm,\n Cluster: Cluster,\n ClusterStats: ClusterStats,\n DefaultRenderer: DefaultRenderer,\n GridAlgorithm: GridAlgorithm,\n MarkerClusterer: MarkerClusterer,\n get MarkerClustererEvents() {\n return MarkerClustererEvents;\n },\n MarkerUtils: MarkerUtils,\n NoopAlgorithm: NoopAlgorithm,\n SuperClusterAlgorithm: SuperClusterAlgorithm,\n SuperClusterViewportAlgorithm: SuperClusterViewportAlgorithm,\n defaultOnClusterClickHandler: defaultOnClusterClickHandler,\n distanceBetweenPoints: distanceBetweenPoints,\n extendBoundsToPaddedViewport: extendBoundsToPaddedViewport,\n extendPixelBounds: extendPixelBounds,\n filterMarkersToPaddedViewport: filterMarkersToPaddedViewport,\n getPaddedViewport: getPaddedViewport,\n noop: noop$1,\n pixelBoundsToLatLngBounds: pixelBoundsToLatLngBounds\n});\nfunction ownKeys$a(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$a(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction useGoogleMarkerClusterer(options) {\n var map = useGoogleMap();\n var _useState123 = useState(null),\n _useState124 = _slicedToArray(_useState123, 2),\n markerClusterer = _useState124[0],\n setMarkerClusterer = _useState124[1];\n useEffect(() => {\n if (map && markerClusterer === null) {\n var markerCluster = new MarkerClusterer(_objectSpread$a(_objectSpread$a({}, options), {}, {\n map\n }));\n setMarkerClusterer(markerCluster);\n }\n }, [map]);\n return markerClusterer;\n}\n/** Wrapper around [@googlemaps/markerclusterer](https://github.com/googlemaps/js-markerclusterer)\n *\n * Accepts {@link MarkerClustererOptionsSubset} which is a subset of {@link MarkerClustererOptions}\n */\nfunction GoogleMarkerClusterer(_ref) {\n var children = _ref.children,\n options = _ref.options;\n var markerClusterer = useGoogleMarkerClusterer(options);\n return markerClusterer !== null ? children(markerClusterer) : null;\n}\nvar GoogleMarkerClusterer$1 = /*#__PURE__*/memo(GoogleMarkerClusterer);\nvar eventMap$c = {\n onCloseClick: 'closeclick',\n onContentChanged: 'content_changed',\n onDomReady: 'domready',\n onPositionChanged: 'position_changed',\n onZindexChanged: 'zindex_changed'\n};\nvar updaterMap$c = {\n options(instance, options) {\n instance.setOptions(options);\n },\n position(instance, position) {\n instance.setPosition(position);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n }\n};\nfunction InfoWindowFunctional(_ref) {\n var children = _ref.children,\n anchor = _ref.anchor,\n options = _ref.options,\n position = _ref.position,\n zIndex = _ref.zIndex,\n onCloseClick = _ref.onCloseClick,\n onDomReady = _ref.onDomReady,\n onContentChanged = _ref.onContentChanged,\n onPositionChanged = _ref.onPositionChanged,\n onZindexChanged = _ref.onZindexChanged,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState125 = useState(null),\n _useState126 = _slicedToArray(_useState125, 2),\n instance = _useState126[0],\n setInstance = _useState126[1];\n var _useState127 = useState(null),\n _useState128 = _slicedToArray(_useState127, 2),\n closeclickListener = _useState128[0],\n setCloseClickListener = _useState128[1];\n var _useState129 = useState(null),\n _useState130 = _slicedToArray(_useState129, 2),\n domreadyclickListener = _useState130[0],\n setDomReadyClickListener = _useState130[1];\n var _useState131 = useState(null),\n _useState132 = _slicedToArray(_useState131, 2),\n contentchangedclickListener = _useState132[0],\n setContentChangedClickListener = _useState132[1];\n var _useState133 = useState(null),\n _useState134 = _slicedToArray(_useState133, 2),\n positionchangedclickListener = _useState134[0],\n setPositionChangedClickListener = _useState134[1];\n var _useState135 = useState(null),\n _useState136 = _slicedToArray(_useState135, 2),\n zindexchangedclickListener = _useState136[0],\n setZindexChangedClickListener = _useState136[1];\n var containerElementRef = useRef(null);\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.close();\n if (anchor) {\n instance.open(map, anchor);\n } else if (instance.getPosition()) {\n instance.open(map);\n }\n }\n }, [map, instance, anchor]);\n useEffect(() => {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (position && instance !== null) {\n instance.setPosition(position);\n }\n }, [position]);\n useEffect(() => {\n if (typeof zIndex === 'number' && instance !== null) {\n instance.setZIndex(zIndex);\n }\n }, [zIndex]);\n useEffect(() => {\n if (instance && onCloseClick) {\n if (closeclickListener !== null) {\n google.maps.event.removeListener(closeclickListener);\n }\n setCloseClickListener(google.maps.event.addListener(instance, 'closeclick', onCloseClick));\n }\n }, [onCloseClick]);\n useEffect(() => {\n if (instance && onDomReady) {\n if (domreadyclickListener !== null) {\n google.maps.event.removeListener(domreadyclickListener);\n }\n setDomReadyClickListener(google.maps.event.addListener(instance, 'domready', onDomReady));\n }\n }, [onDomReady]);\n useEffect(() => {\n if (instance && onContentChanged) {\n if (contentchangedclickListener !== null) {\n google.maps.event.removeListener(contentchangedclickListener);\n }\n setContentChangedClickListener(google.maps.event.addListener(instance, 'content_changed', onContentChanged));\n }\n }, [onContentChanged]);\n useEffect(() => {\n if (instance && onPositionChanged) {\n if (positionchangedclickListener !== null) {\n google.maps.event.removeListener(positionchangedclickListener);\n }\n setPositionChangedClickListener(google.maps.event.addListener(instance, 'position_changed', onPositionChanged));\n }\n }, [onPositionChanged]);\n useEffect(() => {\n if (instance && onZindexChanged) {\n if (zindexchangedclickListener !== null) {\n google.maps.event.removeListener(zindexchangedclickListener);\n }\n setZindexChangedClickListener(google.maps.event.addListener(instance, 'zindex_changed', onZindexChanged));\n }\n }, [onZindexChanged]);\n useEffect(() => {\n var infoWindow = new google.maps.InfoWindow(options);\n setInstance(infoWindow);\n containerElementRef.current = document.createElement('div');\n if (onCloseClick) {\n setCloseClickListener(google.maps.event.addListener(infoWindow, 'closeclick', onCloseClick));\n }\n if (onDomReady) {\n setDomReadyClickListener(google.maps.event.addListener(infoWindow, 'domready', onDomReady));\n }\n if (onContentChanged) {\n setContentChangedClickListener(google.maps.event.addListener(infoWindow, 'content_changed', onContentChanged));\n }\n if (onPositionChanged) {\n setPositionChangedClickListener(google.maps.event.addListener(infoWindow, 'position_changed', onPositionChanged));\n }\n if (onZindexChanged) {\n setZindexChangedClickListener(google.maps.event.addListener(infoWindow, 'zindex_changed', onZindexChanged));\n }\n infoWindow.setContent(containerElementRef.current);\n if (position) {\n infoWindow.setPosition(position);\n }\n if (zIndex) {\n infoWindow.setZIndex(zIndex);\n }\n if (anchor) {\n infoWindow.open(map, anchor);\n } else if (infoWindow.getPosition()) {\n infoWindow.open(map);\n } else {\n invariant(false, \"You must provide either an anchor (typically render it inside a ) or a position props for .\");\n }\n if (onLoad) {\n onLoad(infoWindow);\n }\n return () => {\n if (closeclickListener) {\n google.maps.event.removeListener(closeclickListener);\n }\n if (contentchangedclickListener) {\n google.maps.event.removeListener(contentchangedclickListener);\n }\n if (domreadyclickListener) {\n google.maps.event.removeListener(domreadyclickListener);\n }\n if (positionchangedclickListener) {\n google.maps.event.removeListener(positionchangedclickListener);\n }\n if (zindexchangedclickListener) {\n google.maps.event.removeListener(zindexchangedclickListener);\n }\n if (onUnmount) {\n onUnmount(infoWindow);\n }\n infoWindow.close();\n };\n }, []);\n return containerElementRef.current ? /*#__PURE__*/createPortal(Children.only(children), containerElementRef.current) : null;\n}\nvar InfoWindowF = /*#__PURE__*/memo(InfoWindowFunctional);\nclass InfoWindow extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"containerElement\", null);\n _defineProperty(this, \"state\", {\n infoWindow: null\n });\n _defineProperty(this, \"open\", (infoWindow, anchor) => {\n if (anchor) {\n infoWindow.open(this.context, anchor);\n } else if (infoWindow.getPosition()) {\n infoWindow.open(this.context);\n } else {\n invariant(false, \"You must provide either an anchor (typically render it inside a ) or a position props for .\");\n }\n });\n _defineProperty(this, \"setInfoWindowCallback\", () => {\n if (this.state.infoWindow !== null && this.containerElement !== null) {\n this.state.infoWindow.setContent(this.containerElement);\n this.open(this.state.infoWindow, this.props.anchor);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.infoWindow);\n }\n }\n });\n }\n componentDidMount() {\n var infoWindow = new google.maps.InfoWindow(this.props.options);\n this.containerElement = document.createElement('div');\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$c,\n eventMap: eventMap$c,\n prevProps: {},\n nextProps: this.props,\n instance: infoWindow\n });\n this.setState(() => {\n return {\n infoWindow\n };\n }, this.setInfoWindowCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.infoWindow !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$c,\n eventMap: eventMap$c,\n prevProps,\n nextProps: this.props,\n instance: this.state.infoWindow\n });\n }\n }\n componentWillUnmount() {\n if (this.state.infoWindow !== null) {\n unregisterEvents(this.registeredEvents);\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.infoWindow);\n }\n this.state.infoWindow.close();\n }\n }\n render() {\n return this.containerElement ? /*#__PURE__*/createPortal(Children.only(this.props.children), this.containerElement) : null;\n }\n}\n_defineProperty(InfoWindow, \"contextType\", MapContext);\nfunction ownKeys$9(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$9(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$b = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick'\n};\nvar updaterMap$b = {\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n path(instance, path) {\n instance.setPath(path);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n }\n};\nvar defaultOptions$1 = {};\nfunction PolylineFunctional(_ref) {\n var options = _ref.options,\n draggable = _ref.draggable,\n editable = _ref.editable,\n visible = _ref.visible,\n path = _ref.path,\n onDblClick = _ref.onDblClick,\n onDragEnd = _ref.onDragEnd,\n onDragStart = _ref.onDragStart,\n onMouseDown = _ref.onMouseDown,\n onMouseMove = _ref.onMouseMove,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseUp = _ref.onMouseUp,\n onRightClick = _ref.onRightClick,\n onClick = _ref.onClick,\n onDrag = _ref.onDrag,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState137 = useState(null),\n _useState138 = _slicedToArray(_useState137, 2),\n instance = _useState138[0],\n setInstance = _useState138[1];\n var _useState139 = useState(null),\n _useState140 = _slicedToArray(_useState139, 2),\n dblclickListener = _useState140[0],\n setDblclickListener = _useState140[1];\n var _useState141 = useState(null),\n _useState142 = _slicedToArray(_useState141, 2),\n dragendListener = _useState142[0],\n setDragendListener = _useState142[1];\n var _useState143 = useState(null),\n _useState144 = _slicedToArray(_useState143, 2),\n dragstartListener = _useState144[0],\n setDragstartListener = _useState144[1];\n var _useState145 = useState(null),\n _useState146 = _slicedToArray(_useState145, 2),\n mousedownListener = _useState146[0],\n setMousedownListener = _useState146[1];\n var _useState147 = useState(null),\n _useState148 = _slicedToArray(_useState147, 2),\n mousemoveListener = _useState148[0],\n setMousemoveListener = _useState148[1];\n var _useState149 = useState(null),\n _useState150 = _slicedToArray(_useState149, 2),\n mouseoutListener = _useState150[0],\n setMouseoutListener = _useState150[1];\n var _useState151 = useState(null),\n _useState152 = _slicedToArray(_useState151, 2),\n mouseoverListener = _useState152[0],\n setMouseoverListener = _useState152[1];\n var _useState153 = useState(null),\n _useState154 = _slicedToArray(_useState153, 2),\n mouseupListener = _useState154[0],\n setMouseupListener = _useState154[1];\n var _useState155 = useState(null),\n _useState156 = _slicedToArray(_useState155, 2),\n rightclickListener = _useState156[0],\n setRightclickListener = _useState156[1];\n var _useState157 = useState(null),\n _useState158 = _slicedToArray(_useState157, 2),\n clickListener = _useState158[0],\n setClickListener = _useState158[1];\n var _useState159 = useState(null),\n _useState160 = _slicedToArray(_useState159, 2),\n dragListener = _useState160[0],\n setDragListener = _useState160[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(() => {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(() => {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(() => {\n if (typeof path !== 'undefined' && instance !== null) {\n instance.setPath(path);\n }\n }, [instance, path]);\n useEffect(() => {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(() => {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(() => {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(() => {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(() => {\n var polyline = new google.maps.Polyline(_objectSpread$9(_objectSpread$9({}, options || defaultOptions$1), {}, {\n map\n }));\n if (path) {\n polyline.setPath(path);\n }\n if (typeof visible !== 'undefined') {\n polyline.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n polyline.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n polyline.setDraggable(draggable);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(polyline, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(polyline, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(polyline, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(polyline, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(polyline, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(polyline, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(polyline, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(polyline, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(polyline, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(polyline, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(polyline, 'drag', onDrag));\n }\n setInstance(polyline);\n if (onLoad) {\n onLoad(polyline);\n }\n return () => {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (onUnmount) {\n onUnmount(polyline);\n }\n polyline.setMap(null);\n };\n }, []);\n return null;\n}\nvar PolylineF = /*#__PURE__*/memo(PolylineFunctional);\nclass Polyline extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n polyline: null\n });\n _defineProperty(this, \"setPolylineCallback\", () => {\n if (this.state.polyline !== null && this.props.onLoad) {\n this.props.onLoad(this.state.polyline);\n }\n });\n }\n componentDidMount() {\n var polyline = new google.maps.Polyline(_objectSpread$9(_objectSpread$9({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$b,\n eventMap: eventMap$b,\n prevProps: {},\n nextProps: this.props,\n instance: polyline\n });\n this.setState(function setPolyline() {\n return {\n polyline\n };\n }, this.setPolylineCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.polyline !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$b,\n eventMap: eventMap$b,\n prevProps,\n nextProps: this.props,\n instance: this.state.polyline\n });\n }\n }\n componentWillUnmount() {\n if (this.state.polyline === null) {\n return;\n }\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.polyline);\n }\n unregisterEvents(this.registeredEvents);\n this.state.polyline.setMap(null);\n }\n render() {\n return null;\n }\n}\n_defineProperty(Polyline, \"contextType\", MapContext);\nfunction ownKeys$8(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$8(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$a = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick'\n};\nvar updaterMap$a = {\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n path(instance, path) {\n instance.setPath(path);\n },\n paths(instance, paths) {\n instance.setPaths(paths);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n }\n};\nfunction PolygonFunctional(_ref) {\n var options = _ref.options,\n draggable = _ref.draggable,\n editable = _ref.editable,\n visible = _ref.visible,\n path = _ref.path,\n paths = _ref.paths,\n onDblClick = _ref.onDblClick,\n onDragEnd = _ref.onDragEnd,\n onDragStart = _ref.onDragStart,\n onMouseDown = _ref.onMouseDown,\n onMouseMove = _ref.onMouseMove,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseUp = _ref.onMouseUp,\n onRightClick = _ref.onRightClick,\n onClick = _ref.onClick,\n onDrag = _ref.onDrag,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount,\n onEdit = _ref.onEdit;\n var map = useContext(MapContext);\n var _useState161 = useState(null),\n _useState162 = _slicedToArray(_useState161, 2),\n instance = _useState162[0],\n setInstance = _useState162[1];\n var _useState163 = useState(null),\n _useState164 = _slicedToArray(_useState163, 2),\n dblclickListener = _useState164[0],\n setDblclickListener = _useState164[1];\n var _useState165 = useState(null),\n _useState166 = _slicedToArray(_useState165, 2),\n dragendListener = _useState166[0],\n setDragendListener = _useState166[1];\n var _useState167 = useState(null),\n _useState168 = _slicedToArray(_useState167, 2),\n dragstartListener = _useState168[0],\n setDragstartListener = _useState168[1];\n var _useState169 = useState(null),\n _useState170 = _slicedToArray(_useState169, 2),\n mousedownListener = _useState170[0],\n setMousedownListener = _useState170[1];\n var _useState171 = useState(null),\n _useState172 = _slicedToArray(_useState171, 2),\n mousemoveListener = _useState172[0],\n setMousemoveListener = _useState172[1];\n var _useState173 = useState(null),\n _useState174 = _slicedToArray(_useState173, 2),\n mouseoutListener = _useState174[0],\n setMouseoutListener = _useState174[1];\n var _useState175 = useState(null),\n _useState176 = _slicedToArray(_useState175, 2),\n mouseoverListener = _useState176[0],\n setMouseoverListener = _useState176[1];\n var _useState177 = useState(null),\n _useState178 = _slicedToArray(_useState177, 2),\n mouseupListener = _useState178[0],\n setMouseupListener = _useState178[1];\n var _useState179 = useState(null),\n _useState180 = _slicedToArray(_useState179, 2),\n rightclickListener = _useState180[0],\n setRightclickListener = _useState180[1];\n var _useState181 = useState(null),\n _useState182 = _slicedToArray(_useState181, 2),\n clickListener = _useState182[0],\n setClickListener = _useState182[1];\n var _useState183 = useState(null),\n _useState184 = _slicedToArray(_useState183, 2),\n dragListener = _useState184[0],\n setDragListener = _useState184[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(() => {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(() => {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(() => {\n if (typeof path !== 'undefined' && instance !== null) {\n instance.setPath(path);\n }\n }, [instance, path]);\n useEffect(() => {\n if (typeof paths !== 'undefined' && instance !== null) {\n instance.setPaths(paths);\n }\n }, [instance, paths]);\n useEffect(() => {\n if (instance && typeof onDblClick === 'function') {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (!instance) {\n return;\n }\n google.maps.event.addListener(instance.getPath(), 'insert_at', () => {\n onEdit === null || onEdit === void 0 || onEdit(instance);\n });\n google.maps.event.addListener(instance.getPath(), 'set_at', () => {\n onEdit === null || onEdit === void 0 || onEdit(instance);\n });\n google.maps.event.addListener(instance.getPath(), 'remove_at', () => {\n onEdit === null || onEdit === void 0 || onEdit(instance);\n });\n }, [instance, onEdit]);\n useEffect(() => {\n if (instance && typeof onDragEnd === 'function') {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(() => {\n if (instance && typeof onDragStart === 'function') {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(() => {\n if (instance && typeof onMouseDown === 'function') {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (instance && typeof onMouseMove === 'function') {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(() => {\n if (instance && typeof onMouseOut === 'function') {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && typeof onMouseOver === 'function') {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && typeof onMouseUp === 'function') {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (instance && typeof onRightClick === 'function') {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (instance && typeof onClick === 'function') {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && typeof onDrag === 'function') {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(() => {\n var polygon = new google.maps.Polygon(_objectSpread$8(_objectSpread$8({}, options), {}, {\n map\n }));\n if (path) {\n polygon.setPath(path);\n }\n if (paths) {\n polygon.setPaths(paths);\n }\n if (typeof visible !== 'undefined') {\n polygon.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n polygon.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n polygon.setDraggable(draggable);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(polygon, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(polygon, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(polygon, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(polygon, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(polygon, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(polygon, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(polygon, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(polygon, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(polygon, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(polygon, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(polygon, 'drag', onDrag));\n }\n setInstance(polygon);\n if (onLoad) {\n onLoad(polygon);\n }\n return () => {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (onUnmount) {\n onUnmount(polygon);\n }\n polygon.setMap(null);\n };\n }, []);\n return null;\n}\nvar PolygonF = /*#__PURE__*/memo(PolygonFunctional);\nclass Polygon extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n }\n componentDidMount() {\n var polygonOptions = this.props.options || {};\n this.polygon = new google.maps.Polygon(polygonOptions);\n this.polygon.setMap(this.context);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$a,\n eventMap: eventMap$a,\n prevProps: {},\n nextProps: this.props,\n instance: this.polygon\n });\n if (this.props.onLoad) {\n this.props.onLoad(this.polygon);\n }\n }\n componentDidUpdate(prevProps) {\n if (this.polygon) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$a,\n eventMap: eventMap$a,\n prevProps,\n nextProps: this.props,\n instance: this.polygon\n });\n }\n }\n componentWillUnmount() {\n if (this.polygon) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.polygon);\n }\n unregisterEvents(this.registeredEvents);\n if (this.polygon) {\n this.polygon.setMap(null);\n }\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(Polygon, \"contextType\", MapContext);\nfunction ownKeys$7(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$7(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$9 = {\n onBoundsChanged: 'bounds_changed',\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick'\n};\nvar updaterMap$9 = {\n bounds(instance, bounds) {\n instance.setBounds(bounds);\n },\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n }\n};\nfunction RectangleFunctional(_ref) {\n var options = _ref.options,\n bounds = _ref.bounds,\n draggable = _ref.draggable,\n editable = _ref.editable,\n visible = _ref.visible,\n onDblClick = _ref.onDblClick,\n onDragEnd = _ref.onDragEnd,\n onDragStart = _ref.onDragStart,\n onMouseDown = _ref.onMouseDown,\n onMouseMove = _ref.onMouseMove,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseUp = _ref.onMouseUp,\n onRightClick = _ref.onRightClick,\n onClick = _ref.onClick,\n onDrag = _ref.onDrag,\n onBoundsChanged = _ref.onBoundsChanged,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState185 = useState(null),\n _useState186 = _slicedToArray(_useState185, 2),\n instance = _useState186[0],\n setInstance = _useState186[1];\n var _useState187 = useState(null),\n _useState188 = _slicedToArray(_useState187, 2),\n dblclickListener = _useState188[0],\n setDblclickListener = _useState188[1];\n var _useState189 = useState(null),\n _useState190 = _slicedToArray(_useState189, 2),\n dragendListener = _useState190[0],\n setDragendListener = _useState190[1];\n var _useState191 = useState(null),\n _useState192 = _slicedToArray(_useState191, 2),\n dragstartListener = _useState192[0],\n setDragstartListener = _useState192[1];\n var _useState193 = useState(null),\n _useState194 = _slicedToArray(_useState193, 2),\n mousedownListener = _useState194[0],\n setMousedownListener = _useState194[1];\n var _useState195 = useState(null),\n _useState196 = _slicedToArray(_useState195, 2),\n mousemoveListener = _useState196[0],\n setMousemoveListener = _useState196[1];\n var _useState197 = useState(null),\n _useState198 = _slicedToArray(_useState197, 2),\n mouseoutListener = _useState198[0],\n setMouseoutListener = _useState198[1];\n var _useState199 = useState(null),\n _useState200 = _slicedToArray(_useState199, 2),\n mouseoverListener = _useState200[0],\n setMouseoverListener = _useState200[1];\n var _useState201 = useState(null),\n _useState202 = _slicedToArray(_useState201, 2),\n mouseupListener = _useState202[0],\n setMouseupListener = _useState202[1];\n var _useState203 = useState(null),\n _useState204 = _slicedToArray(_useState203, 2),\n rightClickListener = _useState204[0],\n setRightClickListener = _useState204[1];\n var _useState205 = useState(null),\n _useState206 = _slicedToArray(_useState205, 2),\n clickListener = _useState206[0],\n setClickListener = _useState206[1];\n var _useState207 = useState(null),\n _useState208 = _slicedToArray(_useState207, 2),\n dragListener = _useState208[0],\n setDragListener = _useState208[1];\n var _useState209 = useState(null),\n _useState210 = _slicedToArray(_useState209, 2),\n boundsChangedListener = _useState210[0],\n setBoundsChangedListener = _useState210[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(() => {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(() => {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(() => {\n if (typeof bounds !== 'undefined' && instance !== null) {\n instance.setBounds(bounds);\n }\n }, [instance, bounds]);\n useEffect(() => {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(() => {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(() => {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(() => {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (instance && onRightClick) {\n if (rightClickListener !== null) {\n google.maps.event.removeListener(rightClickListener);\n }\n setRightClickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(() => {\n if (instance && onBoundsChanged) {\n if (boundsChangedListener !== null) {\n google.maps.event.removeListener(boundsChangedListener);\n }\n setBoundsChangedListener(google.maps.event.addListener(instance, 'bounds_changed', onBoundsChanged));\n }\n }, [onBoundsChanged]);\n useEffect(() => {\n var rectangle = new google.maps.Rectangle(_objectSpread$7(_objectSpread$7({}, options), {}, {\n map\n }));\n if (typeof visible !== 'undefined') {\n rectangle.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n rectangle.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n rectangle.setDraggable(draggable);\n }\n if (typeof bounds !== 'undefined') {\n rectangle.setBounds(bounds);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(rectangle, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(rectangle, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(rectangle, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(rectangle, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(rectangle, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(rectangle, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(rectangle, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(rectangle, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightClickListener(google.maps.event.addListener(rectangle, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(rectangle, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(rectangle, 'drag', onDrag));\n }\n if (onBoundsChanged) {\n setBoundsChangedListener(google.maps.event.addListener(rectangle, 'bounds_changed', onBoundsChanged));\n }\n setInstance(rectangle);\n if (onLoad) {\n onLoad(rectangle);\n }\n return () => {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightClickListener !== null) {\n google.maps.event.removeListener(rightClickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n if (boundsChangedListener !== null) {\n google.maps.event.removeListener(boundsChangedListener);\n }\n if (onUnmount) {\n onUnmount(rectangle);\n }\n rectangle.setMap(null);\n };\n }, []);\n return null;\n}\nvar RectangleF = /*#__PURE__*/memo(RectangleFunctional);\nclass Rectangle extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n rectangle: null\n });\n _defineProperty(this, \"setRectangleCallback\", () => {\n if (this.state.rectangle !== null && this.props.onLoad) {\n this.props.onLoad(this.state.rectangle);\n }\n });\n }\n componentDidMount() {\n var rectangle = new google.maps.Rectangle(_objectSpread$7(_objectSpread$7({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$9,\n eventMap: eventMap$9,\n prevProps: {},\n nextProps: this.props,\n instance: rectangle\n });\n this.setState(function setRectangle() {\n return {\n rectangle\n };\n }, this.setRectangleCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.rectangle !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$9,\n eventMap: eventMap$9,\n prevProps,\n nextProps: this.props,\n instance: this.state.rectangle\n });\n }\n }\n componentWillUnmount() {\n if (this.state.rectangle !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.rectangle);\n }\n unregisterEvents(this.registeredEvents);\n this.state.rectangle.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(Rectangle, \"contextType\", MapContext);\nfunction ownKeys$6(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$6(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$8 = {\n onCenterChanged: 'center_changed',\n onRadiusChanged: 'radius_changed',\n onClick: 'click',\n onDblClick: 'dblclick',\n onDrag: 'drag',\n onDragEnd: 'dragend',\n onDragStart: 'dragstart',\n onMouseDown: 'mousedown',\n onMouseMove: 'mousemove',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick'\n};\nvar updaterMap$8 = {\n center(instance, center) {\n instance.setCenter(center);\n },\n draggable(instance, draggable) {\n instance.setDraggable(draggable);\n },\n editable(instance, editable) {\n instance.setEditable(editable);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n radius(instance, radius) {\n instance.setRadius(radius);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n }\n};\nvar defaultOptions = {};\nfunction CircleFunctional(_ref) {\n var options = _ref.options,\n center = _ref.center,\n radius = _ref.radius,\n draggable = _ref.draggable,\n editable = _ref.editable,\n visible = _ref.visible,\n onDblClick = _ref.onDblClick,\n onDragEnd = _ref.onDragEnd,\n onDragStart = _ref.onDragStart,\n onMouseDown = _ref.onMouseDown,\n onMouseMove = _ref.onMouseMove,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseUp = _ref.onMouseUp,\n onRightClick = _ref.onRightClick,\n onClick = _ref.onClick,\n onDrag = _ref.onDrag,\n onCenterChanged = _ref.onCenterChanged,\n onRadiusChanged = _ref.onRadiusChanged,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState211 = useState(null),\n _useState212 = _slicedToArray(_useState211, 2),\n instance = _useState212[0],\n setInstance = _useState212[1];\n var _useState213 = useState(null),\n _useState214 = _slicedToArray(_useState213, 2),\n dblclickListener = _useState214[0],\n setDblclickListener = _useState214[1];\n var _useState215 = useState(null),\n _useState216 = _slicedToArray(_useState215, 2),\n dragendListener = _useState216[0],\n setDragendListener = _useState216[1];\n var _useState217 = useState(null),\n _useState218 = _slicedToArray(_useState217, 2),\n dragstartListener = _useState218[0],\n setDragstartListener = _useState218[1];\n var _useState219 = useState(null),\n _useState220 = _slicedToArray(_useState219, 2),\n mousedownListener = _useState220[0],\n setMousedownListener = _useState220[1];\n var _useState221 = useState(null),\n _useState222 = _slicedToArray(_useState221, 2),\n mousemoveListener = _useState222[0],\n setMousemoveListener = _useState222[1];\n var _useState223 = useState(null),\n _useState224 = _slicedToArray(_useState223, 2),\n mouseoutListener = _useState224[0],\n setMouseoutListener = _useState224[1];\n var _useState225 = useState(null),\n _useState226 = _slicedToArray(_useState225, 2),\n mouseoverListener = _useState226[0],\n setMouseoverListener = _useState226[1];\n var _useState227 = useState(null),\n _useState228 = _slicedToArray(_useState227, 2),\n mouseupListener = _useState228[0],\n setMouseupListener = _useState228[1];\n var _useState229 = useState(null),\n _useState230 = _slicedToArray(_useState229, 2),\n rightclickListener = _useState230[0],\n setRightclickListener = _useState230[1];\n var _useState231 = useState(null),\n _useState232 = _slicedToArray(_useState231, 2),\n clickListener = _useState232[0],\n setClickListener = _useState232[1];\n var _useState233 = useState(null),\n _useState234 = _slicedToArray(_useState233, 2),\n dragListener = _useState234[0],\n setDragListener = _useState234[1];\n var _useState235 = useState(null),\n _useState236 = _slicedToArray(_useState235, 2),\n centerChangedListener = _useState236[0],\n setCenterChangedListener = _useState236[1];\n var _useState237 = useState(null),\n _useState238 = _slicedToArray(_useState237, 2),\n radiusChangedListener = _useState238[0],\n setRadiusChangedListener = _useState238[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (typeof options !== 'undefined' && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n if (typeof draggable !== 'undefined' && instance !== null) {\n instance.setDraggable(draggable);\n }\n }, [instance, draggable]);\n useEffect(() => {\n if (typeof editable !== 'undefined' && instance !== null) {\n instance.setEditable(editable);\n }\n }, [instance, editable]);\n useEffect(() => {\n if (typeof visible !== 'undefined' && instance !== null) {\n instance.setVisible(visible);\n }\n }, [instance, visible]);\n useEffect(() => {\n if (typeof radius === 'number' && instance !== null) {\n instance.setRadius(radius);\n }\n }, [instance, radius]);\n useEffect(() => {\n if (typeof center !== 'undefined' && instance !== null) {\n instance.setCenter(center);\n }\n }, [instance, center]);\n useEffect(() => {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (instance && onDragEnd) {\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n setDragendListener(google.maps.event.addListener(instance, 'dragend', onDragEnd));\n }\n }, [onDragEnd]);\n useEffect(() => {\n if (instance && onDragStart) {\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n setDragstartListener(google.maps.event.addListener(instance, 'dragstart', onDragStart));\n }\n }, [onDragStart]);\n useEffect(() => {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(() => {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onDrag) {\n if (dragListener !== null) {\n google.maps.event.removeListener(dragListener);\n }\n setDragListener(google.maps.event.addListener(instance, 'drag', onDrag));\n }\n }, [onDrag]);\n useEffect(() => {\n if (instance && onCenterChanged) {\n if (centerChangedListener !== null) {\n google.maps.event.removeListener(centerChangedListener);\n }\n setCenterChangedListener(google.maps.event.addListener(instance, 'center_changed', onCenterChanged));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onRadiusChanged) {\n if (radiusChangedListener !== null) {\n google.maps.event.removeListener(radiusChangedListener);\n }\n setRadiusChangedListener(google.maps.event.addListener(instance, 'radius_changed', onRadiusChanged));\n }\n }, [onRadiusChanged]);\n useEffect(() => {\n var circle = new google.maps.Circle(_objectSpread$6(_objectSpread$6({}, options || defaultOptions), {}, {\n map\n }));\n if (typeof radius === 'number') {\n circle.setRadius(radius);\n }\n if (typeof center !== 'undefined') {\n circle.setCenter(center);\n }\n if (typeof radius === 'number') {\n circle.setRadius(radius);\n }\n if (typeof visible !== 'undefined') {\n circle.setVisible(visible);\n }\n if (typeof editable !== 'undefined') {\n circle.setEditable(editable);\n }\n if (typeof draggable !== 'undefined') {\n circle.setDraggable(draggable);\n }\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(circle, 'dblclick', onDblClick));\n }\n if (onDragEnd) {\n setDragendListener(google.maps.event.addListener(circle, 'dragend', onDragEnd));\n }\n if (onDragStart) {\n setDragstartListener(google.maps.event.addListener(circle, 'dragstart', onDragStart));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(circle, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(circle, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(circle, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(circle, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(circle, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(circle, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(circle, 'click', onClick));\n }\n if (onDrag) {\n setDragListener(google.maps.event.addListener(circle, 'drag', onDrag));\n }\n if (onCenterChanged) {\n setCenterChangedListener(google.maps.event.addListener(circle, 'center_changed', onCenterChanged));\n }\n if (onRadiusChanged) {\n setRadiusChangedListener(google.maps.event.addListener(circle, 'radius_changed', onRadiusChanged));\n }\n setInstance(circle);\n if (onLoad) {\n onLoad(circle);\n }\n return () => {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (dragendListener !== null) {\n google.maps.event.removeListener(dragendListener);\n }\n if (dragstartListener !== null) {\n google.maps.event.removeListener(dragstartListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (centerChangedListener !== null) {\n google.maps.event.removeListener(centerChangedListener);\n }\n if (radiusChangedListener !== null) {\n google.maps.event.removeListener(radiusChangedListener);\n }\n if (onUnmount) {\n onUnmount(circle);\n }\n circle.setMap(null);\n };\n }, []);\n return null;\n}\nvar CircleF = /*#__PURE__*/memo(CircleFunctional);\nclass Circle extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n circle: null\n });\n _defineProperty(this, \"setCircleCallback\", () => {\n if (this.state.circle !== null && this.props.onLoad) {\n this.props.onLoad(this.state.circle);\n }\n });\n }\n componentDidMount() {\n var circle = new google.maps.Circle(_objectSpread$6(_objectSpread$6({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$8,\n eventMap: eventMap$8,\n prevProps: {},\n nextProps: this.props,\n instance: circle\n });\n this.setState(function setCircle() {\n return {\n circle\n };\n }, this.setCircleCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.circle !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$8,\n eventMap: eventMap$8,\n prevProps,\n nextProps: this.props,\n instance: this.state.circle\n });\n }\n }\n componentWillUnmount() {\n if (this.state.circle !== null) {\n var _this$state$circle;\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.circle);\n }\n unregisterEvents(this.registeredEvents);\n (_this$state$circle = this.state.circle) === null || _this$state$circle === void 0 || _this$state$circle.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(Circle, \"contextType\", MapContext);\nfunction ownKeys$5(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$5(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$7 = {\n onClick: 'click',\n onDblClick: 'dblclick',\n onMouseDown: 'mousedown',\n onMouseOut: 'mouseout',\n onMouseOver: 'mouseover',\n onMouseUp: 'mouseup',\n onRightClick: 'rightclick',\n onAddFeature: 'addfeature',\n onRemoveFeature: 'removefeature',\n onRemoveProperty: 'removeproperty',\n onSetGeometry: 'setgeometry',\n onSetProperty: 'setproperty'\n};\nvar updaterMap$7 = {\n add(instance, feature) {\n instance.add(feature);\n },\n addgeojson(instance, geojson, options) {\n instance.addGeoJson(geojson, options);\n },\n contains(instance, feature) {\n instance.contains(feature);\n },\n foreach(instance, callback) {\n instance.forEach(callback);\n },\n loadgeojson(instance, url, options, callback) {\n instance.loadGeoJson(url, options, callback);\n },\n overridestyle(instance, feature, style) {\n instance.overrideStyle(feature, style);\n },\n remove(instance, feature) {\n instance.remove(feature);\n },\n revertstyle(instance, feature) {\n instance.revertStyle(feature);\n },\n controlposition(instance, controlPosition) {\n instance.setControlPosition(controlPosition);\n },\n controls(instance, controls) {\n instance.setControls(controls);\n },\n drawingmode(instance, mode) {\n instance.setDrawingMode(mode);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n style(instance, style) {\n instance.setStyle(style);\n },\n togeojson(instance, callback) {\n instance.toGeoJson(callback);\n }\n};\nfunction DataFunctional(_ref) {\n var options = _ref.options,\n onClick = _ref.onClick,\n onDblClick = _ref.onDblClick,\n onMouseDown = _ref.onMouseDown,\n onMouseMove = _ref.onMouseMove,\n onMouseOut = _ref.onMouseOut,\n onMouseOver = _ref.onMouseOver,\n onMouseUp = _ref.onMouseUp,\n onRightClick = _ref.onRightClick,\n onAddFeature = _ref.onAddFeature,\n onRemoveFeature = _ref.onRemoveFeature,\n onRemoveProperty = _ref.onRemoveProperty,\n onSetGeometry = _ref.onSetGeometry,\n onSetProperty = _ref.onSetProperty,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount;\n var map = useContext(MapContext);\n var _useState239 = useState(null),\n _useState240 = _slicedToArray(_useState239, 2),\n instance = _useState240[0],\n setInstance = _useState240[1];\n var _useState241 = useState(null),\n _useState242 = _slicedToArray(_useState241, 2),\n dblclickListener = _useState242[0],\n setDblclickListener = _useState242[1];\n var _useState243 = useState(null),\n _useState244 = _slicedToArray(_useState243, 2),\n mousedownListener = _useState244[0],\n setMousedownListener = _useState244[1];\n var _useState245 = useState(null),\n _useState246 = _slicedToArray(_useState245, 2),\n mousemoveListener = _useState246[0],\n setMousemoveListener = _useState246[1];\n var _useState247 = useState(null),\n _useState248 = _slicedToArray(_useState247, 2),\n mouseoutListener = _useState248[0],\n setMouseoutListener = _useState248[1];\n var _useState249 = useState(null),\n _useState250 = _slicedToArray(_useState249, 2),\n mouseoverListener = _useState250[0],\n setMouseoverListener = _useState250[1];\n var _useState251 = useState(null),\n _useState252 = _slicedToArray(_useState251, 2),\n mouseupListener = _useState252[0],\n setMouseupListener = _useState252[1];\n var _useState253 = useState(null),\n _useState254 = _slicedToArray(_useState253, 2),\n rightclickListener = _useState254[0],\n setRightclickListener = _useState254[1];\n var _useState255 = useState(null),\n _useState256 = _slicedToArray(_useState255, 2),\n clickListener = _useState256[0],\n setClickListener = _useState256[1];\n var _useState257 = useState(null),\n _useState258 = _slicedToArray(_useState257, 2),\n addFeatureListener = _useState258[0],\n setAddFeatureListener = _useState258[1];\n var _useState259 = useState(null),\n _useState260 = _slicedToArray(_useState259, 2),\n removeFeatureListener = _useState260[0],\n setRemoveFeatureListener = _useState260[1];\n var _useState261 = useState(null),\n _useState262 = _slicedToArray(_useState261, 2),\n removePropertyListener = _useState262[0],\n setRemovePropertyListener = _useState262[1];\n var _useState263 = useState(null),\n _useState264 = _slicedToArray(_useState263, 2),\n setGeometryListener = _useState264[0],\n setSetGeometryListener = _useState264[1];\n var _useState265 = useState(null),\n _useState266 = _slicedToArray(_useState265, 2),\n setPropertyListener = _useState266[0],\n setSetPropertyListener = _useState266[1];\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (instance && onDblClick) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n setDblclickListener(google.maps.event.addListener(instance, 'dblclick', onDblClick));\n }\n }, [onDblClick]);\n useEffect(() => {\n if (instance && onMouseDown) {\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n setMousedownListener(google.maps.event.addListener(instance, 'mousedown', onMouseDown));\n }\n }, [onMouseDown]);\n useEffect(() => {\n if (instance && onMouseMove) {\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n setMousemoveListener(google.maps.event.addListener(instance, 'mousemove', onMouseMove));\n }\n }, [onMouseMove]);\n useEffect(() => {\n if (instance && onMouseOut) {\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n setMouseoutListener(google.maps.event.addListener(instance, 'mouseout', onMouseOut));\n }\n }, [onMouseOut]);\n useEffect(() => {\n if (instance && onMouseOver) {\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n setMouseoverListener(google.maps.event.addListener(instance, 'mouseover', onMouseOver));\n }\n }, [onMouseOver]);\n useEffect(() => {\n if (instance && onMouseUp) {\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n setMouseupListener(google.maps.event.addListener(instance, 'mouseup', onMouseUp));\n }\n }, [onMouseUp]);\n useEffect(() => {\n if (instance && onRightClick) {\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n setRightclickListener(google.maps.event.addListener(instance, 'rightclick', onRightClick));\n }\n }, [onRightClick]);\n useEffect(() => {\n if (instance && onClick) {\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n setClickListener(google.maps.event.addListener(instance, 'click', onClick));\n }\n }, [onClick]);\n useEffect(() => {\n if (instance && onAddFeature) {\n if (addFeatureListener !== null) {\n google.maps.event.removeListener(addFeatureListener);\n }\n setAddFeatureListener(google.maps.event.addListener(instance, 'addfeature', onAddFeature));\n }\n }, [onAddFeature]);\n useEffect(() => {\n if (instance && onRemoveFeature) {\n if (removeFeatureListener !== null) {\n google.maps.event.removeListener(removeFeatureListener);\n }\n setRemoveFeatureListener(google.maps.event.addListener(instance, 'removefeature', onRemoveFeature));\n }\n }, [onRemoveFeature]);\n useEffect(() => {\n if (instance && onRemoveProperty) {\n if (removePropertyListener !== null) {\n google.maps.event.removeListener(removePropertyListener);\n }\n setRemovePropertyListener(google.maps.event.addListener(instance, 'removeproperty', onRemoveProperty));\n }\n }, [onRemoveProperty]);\n useEffect(() => {\n if (instance && onSetGeometry) {\n if (setGeometryListener !== null) {\n google.maps.event.removeListener(setGeometryListener);\n }\n setSetGeometryListener(google.maps.event.addListener(instance, 'setgeometry', onSetGeometry));\n }\n }, [onSetGeometry]);\n useEffect(() => {\n if (instance && onSetProperty) {\n if (setPropertyListener !== null) {\n google.maps.event.removeListener(setPropertyListener);\n }\n setSetPropertyListener(google.maps.event.addListener(instance, 'setproperty', onSetProperty));\n }\n }, [onSetProperty]);\n useEffect(() => {\n if (map !== null) {\n var data = new google.maps.Data(_objectSpread$5(_objectSpread$5({}, options), {}, {\n map\n }));\n if (onDblClick) {\n setDblclickListener(google.maps.event.addListener(data, 'dblclick', onDblClick));\n }\n if (onMouseDown) {\n setMousedownListener(google.maps.event.addListener(data, 'mousedown', onMouseDown));\n }\n if (onMouseMove) {\n setMousemoveListener(google.maps.event.addListener(data, 'mousemove', onMouseMove));\n }\n if (onMouseOut) {\n setMouseoutListener(google.maps.event.addListener(data, 'mouseout', onMouseOut));\n }\n if (onMouseOver) {\n setMouseoverListener(google.maps.event.addListener(data, 'mouseover', onMouseOver));\n }\n if (onMouseUp) {\n setMouseupListener(google.maps.event.addListener(data, 'mouseup', onMouseUp));\n }\n if (onRightClick) {\n setRightclickListener(google.maps.event.addListener(data, 'rightclick', onRightClick));\n }\n if (onClick) {\n setClickListener(google.maps.event.addListener(data, 'click', onClick));\n }\n if (onAddFeature) {\n setAddFeatureListener(google.maps.event.addListener(data, 'addfeature', onAddFeature));\n }\n if (onRemoveFeature) {\n setRemoveFeatureListener(google.maps.event.addListener(data, 'removefeature', onRemoveFeature));\n }\n if (onRemoveProperty) {\n setRemovePropertyListener(google.maps.event.addListener(data, 'removeproperty', onRemoveProperty));\n }\n if (onSetGeometry) {\n setSetGeometryListener(google.maps.event.addListener(data, 'setgeometry', onSetGeometry));\n }\n if (onSetProperty) {\n setSetPropertyListener(google.maps.event.addListener(data, 'setproperty', onSetProperty));\n }\n setInstance(data);\n if (onLoad) {\n onLoad(data);\n }\n }\n return () => {\n if (instance) {\n if (dblclickListener !== null) {\n google.maps.event.removeListener(dblclickListener);\n }\n if (mousedownListener !== null) {\n google.maps.event.removeListener(mousedownListener);\n }\n if (mousemoveListener !== null) {\n google.maps.event.removeListener(mousemoveListener);\n }\n if (mouseoutListener !== null) {\n google.maps.event.removeListener(mouseoutListener);\n }\n if (mouseoverListener !== null) {\n google.maps.event.removeListener(mouseoverListener);\n }\n if (mouseupListener !== null) {\n google.maps.event.removeListener(mouseupListener);\n }\n if (rightclickListener !== null) {\n google.maps.event.removeListener(rightclickListener);\n }\n if (clickListener !== null) {\n google.maps.event.removeListener(clickListener);\n }\n if (addFeatureListener !== null) {\n google.maps.event.removeListener(addFeatureListener);\n }\n if (removeFeatureListener !== null) {\n google.maps.event.removeListener(removeFeatureListener);\n }\n if (removePropertyListener !== null) {\n google.maps.event.removeListener(removePropertyListener);\n }\n if (setGeometryListener !== null) {\n google.maps.event.removeListener(setGeometryListener);\n }\n if (setPropertyListener !== null) {\n google.maps.event.removeListener(setPropertyListener);\n }\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar DataF = /*#__PURE__*/memo(DataFunctional);\nclass Data extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n data: null\n });\n _defineProperty(this, \"setDataCallback\", () => {\n if (this.state.data !== null && this.props.onLoad) {\n this.props.onLoad(this.state.data);\n }\n });\n }\n componentDidMount() {\n if (this.context !== null) {\n var data = new google.maps.Data(_objectSpread$5(_objectSpread$5({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$7,\n eventMap: eventMap$7,\n prevProps: {},\n nextProps: this.props,\n instance: data\n });\n this.setState(() => {\n return {\n data\n };\n }, this.setDataCallback);\n }\n }\n componentDidUpdate(prevProps) {\n if (this.state.data !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$7,\n eventMap: eventMap$7,\n prevProps,\n nextProps: this.props,\n instance: this.state.data\n });\n }\n }\n componentWillUnmount() {\n if (this.state.data !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.data);\n }\n unregisterEvents(this.registeredEvents);\n if (this.state.data) {\n this.state.data.setMap(null);\n }\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(Data, \"contextType\", MapContext);\nfunction ownKeys$4(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$4(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$6 = {\n onClick: 'click',\n onDefaultViewportChanged: 'defaultviewport_changed',\n onStatusChanged: 'status_changed'\n};\nvar updaterMap$6 = {\n options(instance, options) {\n instance.setOptions(options);\n },\n url(instance, url) {\n instance.setUrl(url);\n },\n zIndex(instance, zIndex) {\n instance.setZIndex(zIndex);\n }\n};\nclass KmlLayer extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n kmlLayer: null\n });\n _defineProperty(this, \"setKmlLayerCallback\", () => {\n if (this.state.kmlLayer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.kmlLayer);\n }\n });\n }\n componentDidMount() {\n var kmlLayer = new google.maps.KmlLayer(_objectSpread$4(_objectSpread$4({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$6,\n eventMap: eventMap$6,\n prevProps: {},\n nextProps: this.props,\n instance: kmlLayer\n });\n this.setState(function setLmlLayer() {\n return {\n kmlLayer\n };\n }, this.setKmlLayerCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.kmlLayer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$6,\n eventMap: eventMap$6,\n prevProps,\n nextProps: this.props,\n instance: this.state.kmlLayer\n });\n }\n }\n componentWillUnmount() {\n if (this.state.kmlLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.kmlLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.kmlLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(KmlLayer, \"contextType\", MapContext);\nfunction getOffsetOverride(containerElement, getPixelPositionOffset) {\n return typeof getPixelPositionOffset === 'function' ? getPixelPositionOffset(containerElement.offsetWidth, containerElement.offsetHeight) : {\n x: 0,\n y: 0\n };\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createLatLng(inst, Type) {\n return new Type(inst.lat, inst.lng);\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction createLatLngBounds(inst, Type) {\n return new Type(new google.maps.LatLng(inst.ne.lat, inst.ne.lng), new google.maps.LatLng(inst.sw.lat, inst.sw.lng));\n}\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction ensureOfType(inst,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfactory\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n return inst instanceof type ? inst : factory(inst, type);\n}\nfunction ensureOfTypeBounds(inst,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype,\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfactory\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n return inst instanceof type ? inst : factory(inst, type);\n}\nfunction getLayoutStylesByBounds(mapCanvasProjection, offset, bounds) {\n var ne = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(bounds.getNorthEast());\n var sw = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(bounds.getSouthWest());\n if (ne && sw) {\n return {\n left: \"\".concat(sw.x + offset.x, \"px\"),\n top: \"\".concat(ne.y + offset.y, \"px\"),\n width: \"\".concat(ne.x - sw.x - offset.x, \"px\"),\n height: \"\".concat(sw.y - ne.y - offset.y, \"px\")\n };\n }\n return {\n left: '-9999px',\n top: '-9999px'\n };\n}\nfunction getLayoutStylesByPosition(mapCanvasProjection, offset, position) {\n var point = mapCanvasProjection && mapCanvasProjection.fromLatLngToDivPixel(position);\n if (point) {\n var x = point.x,\n y = point.y;\n return {\n left: \"\".concat(x + offset.x, \"px\"),\n top: \"\".concat(y + offset.y, \"px\")\n };\n }\n return {\n left: '-9999px',\n top: '-9999px'\n };\n}\nfunction getLayoutStyles(mapCanvasProjection, offset, bounds, position) {\n return bounds !== undefined ? getLayoutStylesByBounds(mapCanvasProjection, offset, ensureOfTypeBounds(bounds, google.maps.LatLngBounds, createLatLngBounds)) : getLayoutStylesByPosition(mapCanvasProjection, offset, ensureOfType(position, google.maps.LatLng, createLatLng));\n}\nfunction arePositionsEqual(currentPosition, previousPosition) {\n return currentPosition.left === previousPosition.left && currentPosition.top === previousPosition.top && currentPosition.width === previousPosition.height && currentPosition.height === previousPosition.height;\n}\nfunction ownKeys$3(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$3(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction createOverlay(container, pane, position, bounds, getPixelPositionOffset) {\n class Overlay extends google.maps.OverlayView {\n constructor(container, pane, position, bounds) {\n super();\n this.container = container;\n this.pane = pane;\n this.position = position;\n this.bounds = bounds;\n }\n onAdd() {\n var _this$getPanes;\n var pane = (_this$getPanes = this.getPanes()) === null || _this$getPanes === void 0 ? void 0 : _this$getPanes[this.pane];\n pane === null || pane === void 0 || pane.appendChild(this.container);\n }\n draw() {\n var projection = this.getProjection();\n var offset = _objectSpread$3({}, this.container ? getOffsetOverride(this.container, getPixelPositionOffset) : {\n x: 0,\n y: 0\n });\n var layoutStyles = getLayoutStyles(projection, offset, this.bounds, this.position);\n for (var _ref16 of Object.entries(layoutStyles)) {\n var _ref17 = _slicedToArray(_ref16, 2);\n var key = _ref17[0];\n var value = _ref17[1];\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n this.container.style[key] = value;\n }\n }\n onRemove() {\n if (this.container.parentNode !== null) {\n this.container.parentNode.removeChild(this.container);\n }\n }\n }\n return new Overlay(container, pane, position, bounds);\n}\nfunction ownKeys$2(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nfunction convertToLatLngString(latLngLike) {\n if (!latLngLike) {\n return '';\n }\n var latLng = latLngLike instanceof google.maps.LatLng ? latLngLike : new google.maps.LatLng(latLngLike.lat, latLngLike.lng);\n return latLng + '';\n}\nfunction convertToLatLngBoundsString(latLngBoundsLike) {\n if (!latLngBoundsLike) {\n return '';\n }\n var latLngBounds = latLngBoundsLike instanceof google.maps.LatLngBounds ? latLngBoundsLike : new google.maps.LatLngBounds(new google.maps.LatLng(latLngBoundsLike.south, latLngBoundsLike.east), new google.maps.LatLng(latLngBoundsLike.north, latLngBoundsLike.west));\n return latLngBounds + '';\n}\nvar FLOAT_PANE = \"floatPane\";\nvar MAP_PANE = \"mapPane\";\nvar MARKER_LAYER = \"markerLayer\";\nvar OVERLAY_LAYER = \"overlayLayer\";\nvar OVERLAY_MOUSE_TARGET = \"overlayMouseTarget\";\nfunction OverlayViewFunctional(_ref) {\n var position = _ref.position,\n bounds = _ref.bounds,\n mapPaneName = _ref.mapPaneName,\n zIndex = _ref.zIndex,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount,\n getPixelPositionOffset = _ref.getPixelPositionOffset,\n children = _ref.children;\n var map = useContext(MapContext);\n var container = useMemo(() => {\n var div = document.createElement('div');\n div.style.position = 'absolute';\n return div;\n }, []);\n var overlay = useMemo(() => {\n return createOverlay(container, mapPaneName, position, bounds, getPixelPositionOffset);\n }, [container, mapPaneName, position, bounds]);\n useEffect(() => {\n onLoad === null || onLoad === void 0 || onLoad(overlay);\n overlay === null || overlay === void 0 || overlay.setMap(map);\n return () => {\n onUnmount === null || onUnmount === void 0 || onUnmount(overlay);\n overlay === null || overlay === void 0 || overlay.setMap(null);\n };\n }, [map, overlay]);\n // to move the container to the foreground and background\n useEffect(() => {\n container.style.zIndex = \"\".concat(zIndex);\n }, [zIndex, container]);\n return /*#__PURE__*/ReactDOM.createPortal(children, container);\n}\nvar OverlayViewF = /*#__PURE__*/memo(OverlayViewFunctional);\nclass OverlayView extends PureComponent {\n constructor(props) {\n super(props);\n _defineProperty(this, \"state\", {\n paneEl: null,\n containerStyle: {\n // set initial position\n position: 'absolute'\n }\n });\n _defineProperty(this, \"updatePane\", () => {\n var mapPaneName = this.props.mapPaneName;\n // https://developers.google.com/maps/documentation/javascript/3.exp/reference#MapPanes\n var mapPanes = this.overlayView.getPanes();\n invariant(!!mapPaneName, \"OverlayView requires props.mapPaneName but got %s\", mapPaneName);\n if (mapPanes) {\n this.setState({\n paneEl: mapPanes[mapPaneName]\n });\n } else {\n this.setState({\n paneEl: null\n });\n }\n });\n _defineProperty(this, \"onAdd\", () => {\n var _this$props$onLoad, _this$props;\n this.updatePane();\n (_this$props$onLoad = (_this$props = this.props).onLoad) === null || _this$props$onLoad === void 0 || _this$props$onLoad.call(_this$props, this.overlayView);\n });\n _defineProperty(this, \"onPositionElement\", () => {\n var mapCanvasProjection = this.overlayView.getProjection();\n var offset = _objectSpread$2({\n x: 0,\n y: 0\n }, this.containerRef.current ? getOffsetOverride(this.containerRef.current, this.props.getPixelPositionOffset) : {});\n var layoutStyles = getLayoutStyles(mapCanvasProjection, offset, this.props.bounds, this.props.position);\n if (!arePositionsEqual(layoutStyles, {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n left: this.state.containerStyle.left,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n top: this.state.containerStyle.top,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n width: this.state.containerStyle.width,\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n height: this.state.containerStyle.height\n })) {\n var _layoutStyles$top, _layoutStyles$left, _layoutStyles$width, _layoutStyles$height;\n this.setState({\n containerStyle: {\n top: (_layoutStyles$top = layoutStyles.top) !== null && _layoutStyles$top !== void 0 ? _layoutStyles$top : 0,\n left: (_layoutStyles$left = layoutStyles.left) !== null && _layoutStyles$left !== void 0 ? _layoutStyles$left : 0,\n width: (_layoutStyles$width = layoutStyles.width) !== null && _layoutStyles$width !== void 0 ? _layoutStyles$width : 0,\n height: (_layoutStyles$height = layoutStyles.height) !== null && _layoutStyles$height !== void 0 ? _layoutStyles$height : 0,\n position: 'absolute'\n }\n });\n }\n });\n _defineProperty(this, \"draw\", () => {\n this.onPositionElement();\n });\n _defineProperty(this, \"onRemove\", () => {\n var _this$props$onUnmount, _this$props2;\n this.setState(() => ({\n paneEl: null\n }));\n (_this$props$onUnmount = (_this$props2 = this.props).onUnmount) === null || _this$props$onUnmount === void 0 || _this$props$onUnmount.call(_this$props2, this.overlayView);\n });\n this.containerRef = /*#__PURE__*/createRef();\n // You must implement three methods: onAdd(), draw(), and onRemove().\n var overlayView = new google.maps.OverlayView();\n overlayView.onAdd = this.onAdd;\n overlayView.draw = this.draw;\n overlayView.onRemove = this.onRemove;\n this.overlayView = overlayView;\n }\n componentDidMount() {\n this.overlayView.setMap(this.context);\n }\n componentDidUpdate(prevProps) {\n var prevPositionString = convertToLatLngString(prevProps.position);\n var positionString = convertToLatLngString(this.props.position);\n var prevBoundsString = convertToLatLngBoundsString(prevProps.bounds);\n var boundsString = convertToLatLngBoundsString(this.props.bounds);\n if (prevPositionString !== positionString || prevBoundsString !== boundsString) {\n this.overlayView.draw();\n }\n if (prevProps.mapPaneName !== this.props.mapPaneName) {\n this.updatePane();\n }\n }\n componentWillUnmount() {\n this.overlayView.setMap(null);\n }\n render() {\n var paneEl = this.state.paneEl;\n if (paneEl) {\n return /*#__PURE__*/ReactDOM.createPortal(jsx(\"div\", {\n ref: this.containerRef,\n style: this.state.containerStyle,\n children: Children.only(this.props.children)\n }), paneEl);\n } else {\n return null;\n }\n }\n}\n_defineProperty(OverlayView, \"FLOAT_PANE\", \"floatPane\");\n_defineProperty(OverlayView, \"MAP_PANE\", \"mapPane\");\n_defineProperty(OverlayView, \"MARKER_LAYER\", \"markerLayer\");\n_defineProperty(OverlayView, \"OVERLAY_LAYER\", \"overlayLayer\");\n_defineProperty(OverlayView, \"OVERLAY_MOUSE_TARGET\", \"overlayMouseTarget\");\n_defineProperty(OverlayView, \"contextType\", MapContext);\nfunction noop() {\n return;\n}\nfunction ownKeys$1(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread$1(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$5 = {\n onDblClick: 'dblclick',\n onClick: 'click'\n};\nvar updaterMap$5 = {\n opacity(instance, opacity) {\n instance.setOpacity(opacity);\n }\n};\nfunction GroundOverlayFunctional(_ref) {\n var url = _ref.url,\n bounds = _ref.bounds,\n options = _ref.options,\n visible = _ref.visible;\n var map = useContext(MapContext);\n var imageBounds = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.south, bounds.west), new google.maps.LatLng(bounds.north, bounds.east));\n var groundOverlay = useMemo(() => {\n return new google.maps.GroundOverlay(url, imageBounds, options);\n }, []);\n useEffect(() => {\n if (groundOverlay !== null) {\n groundOverlay.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (typeof url !== 'undefined' && groundOverlay !== null) {\n groundOverlay.set('url', url);\n groundOverlay.setMap(map);\n }\n }, [groundOverlay, url]);\n useEffect(() => {\n if (typeof visible !== 'undefined' && groundOverlay !== null) {\n groundOverlay.setOpacity(visible ? 1 : 0);\n }\n }, [groundOverlay, visible]);\n useEffect(() => {\n var newBounds = new google.maps.LatLngBounds(new google.maps.LatLng(bounds.south, bounds.west), new google.maps.LatLng(bounds.north, bounds.east));\n if (typeof bounds !== 'undefined' && groundOverlay !== null) {\n groundOverlay.set('bounds', newBounds);\n groundOverlay.setMap(map);\n }\n }, [groundOverlay, bounds]);\n return null;\n}\nvar GroundOverlayF = /*#__PURE__*/memo(GroundOverlayFunctional);\nclass GroundOverlay extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n groundOverlay: null\n });\n _defineProperty(this, \"setGroundOverlayCallback\", () => {\n if (this.state.groundOverlay !== null && this.props.onLoad) {\n this.props.onLoad(this.state.groundOverlay);\n }\n });\n }\n componentDidMount() {\n invariant(!!this.props.url || !!this.props.bounds, \"For GroundOverlay, url and bounds are passed in to constructor and are immutable after instantiated. This is the behavior of Google Maps JavaScript API v3 ( See https://developers.google.com/maps/documentation/javascript/reference#GroundOverlay) Hence, use the corresponding two props provided by `react-google-maps-api`, url and bounds. In some cases, you'll need the GroundOverlay component to reflect the changes of url and bounds. You can leverage the React's key property to remount the component. Typically, just `key={url}` would serve your need. See https://github.com/tomchentw/react-google-maps/issues/655\");\n var groundOverlay = new google.maps.GroundOverlay(this.props.url, this.props.bounds, _objectSpread$1(_objectSpread$1({}, this.props.options), {}, {\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$5,\n eventMap: eventMap$5,\n prevProps: {},\n nextProps: this.props,\n instance: groundOverlay\n });\n this.setState(function setGroundOverlay() {\n return {\n groundOverlay\n };\n }, this.setGroundOverlayCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.groundOverlay !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$5,\n eventMap: eventMap$5,\n prevProps,\n nextProps: this.props,\n instance: this.state.groundOverlay\n });\n }\n }\n componentWillUnmount() {\n if (this.state.groundOverlay) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.groundOverlay);\n }\n this.state.groundOverlay.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(GroundOverlay, \"defaultProps\", {\n onLoad: noop\n});\n_defineProperty(GroundOverlay, \"contextType\", MapContext);\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n _defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nvar eventMap$4 = {};\nvar updaterMap$4 = {\n data(instance, data) {\n instance.setData(data);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n }\n};\nfunction HeatmapLayerFunctional(_ref) {\n var data = _ref.data,\n onLoad = _ref.onLoad,\n onUnmount = _ref.onUnmount,\n options = _ref.options;\n var map = useContext(MapContext);\n var _useState267 = useState(null),\n _useState268 = _slicedToArray(_useState267, 2),\n instance = _useState268[0],\n setInstance = _useState268[1];\n useEffect(() => {\n if (!google.maps.visualization) {\n invariant(!!google.maps.visualization, 'Did you include prop libraries={[\"visualization\"]} in useJsApiScript? %s', google.maps.visualization);\n }\n }, []);\n useEffect(() => {\n invariant(!!data, 'data property is required in HeatmapLayer %s', data);\n }, [data]);\n // Order does matter\n useEffect(() => {\n if (instance !== null) {\n instance.setMap(map);\n }\n }, [map]);\n useEffect(() => {\n if (options && instance !== null) {\n instance.setOptions(options);\n }\n }, [instance, options]);\n useEffect(() => {\n var heatmapLayer = new google.maps.visualization.HeatmapLayer(_objectSpread(_objectSpread({}, options), {}, {\n data,\n map\n }));\n setInstance(heatmapLayer);\n if (onLoad) {\n onLoad(heatmapLayer);\n }\n return () => {\n if (instance !== null) {\n if (onUnmount) {\n onUnmount(instance);\n }\n instance.setMap(null);\n }\n };\n }, []);\n return null;\n}\nvar HeatmapLayerF = /*#__PURE__*/memo(HeatmapLayerFunctional);\nclass HeatmapLayer extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n heatmapLayer: null\n });\n _defineProperty(this, \"setHeatmapLayerCallback\", () => {\n if (this.state.heatmapLayer !== null && this.props.onLoad) {\n this.props.onLoad(this.state.heatmapLayer);\n }\n });\n }\n componentDidMount() {\n invariant(!!google.maps.visualization, 'Did you include prop libraries={[\"visualization\"]} to ? %s', google.maps.visualization);\n invariant(!!this.props.data, 'data property is required in HeatmapLayer %s', this.props.data);\n var heatmapLayer = new google.maps.visualization.HeatmapLayer(_objectSpread(_objectSpread({}, this.props.options), {}, {\n data: this.props.data,\n map: this.context\n }));\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$4,\n eventMap: eventMap$4,\n prevProps: {},\n nextProps: this.props,\n instance: heatmapLayer\n });\n this.setState(function setHeatmapLayer() {\n return {\n heatmapLayer\n };\n }, this.setHeatmapLayerCallback);\n }\n componentDidUpdate(prevProps) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$4,\n eventMap: eventMap$4,\n prevProps,\n nextProps: this.props,\n instance: this.state.heatmapLayer\n });\n }\n componentWillUnmount() {\n if (this.state.heatmapLayer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.heatmapLayer);\n }\n unregisterEvents(this.registeredEvents);\n this.state.heatmapLayer.setMap(null);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(HeatmapLayer, \"contextType\", MapContext);\nvar eventMap$3 = {\n onCloseClick: 'closeclick',\n onPanoChanged: 'pano_changed',\n onPositionChanged: 'position_changed',\n onPovChanged: 'pov_changed',\n onResize: 'resize',\n onStatusChanged: 'status_changed',\n onVisibleChanged: 'visible_changed',\n onZoomChanged: 'zoom_changed'\n};\nvar updaterMap$3 = {\n register(instance, provider, options) {\n instance.registerPanoProvider(provider, options);\n },\n links(instance, links) {\n instance.setLinks(links);\n },\n motionTracking(instance, motionTracking) {\n instance.setMotionTracking(motionTracking);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n pano(instance, pano) {\n instance.setPano(pano);\n },\n position(instance, position) {\n instance.setPosition(position);\n },\n pov(instance, pov) {\n instance.setPov(pov);\n },\n visible(instance, visible) {\n instance.setVisible(visible);\n },\n zoom(instance, zoom) {\n instance.setZoom(zoom);\n }\n};\nclass StreetViewPanorama extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n streetViewPanorama: null\n });\n _defineProperty(this, \"setStreetViewPanoramaCallback\", () => {\n if (this.state.streetViewPanorama !== null && this.props.onLoad) {\n this.props.onLoad(this.state.streetViewPanorama);\n }\n });\n }\n componentDidMount() {\n var _this$context$getStre, _this$context;\n var streetViewPanorama = (_this$context$getStre = (_this$context = this.context) === null || _this$context === void 0 ? void 0 : _this$context.getStreetView()) !== null && _this$context$getStre !== void 0 ? _this$context$getStre : null;\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$3,\n eventMap: eventMap$3,\n prevProps: {},\n nextProps: this.props,\n instance: streetViewPanorama\n });\n this.setState(() => {\n return {\n streetViewPanorama\n };\n }, this.setStreetViewPanoramaCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.streetViewPanorama !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$3,\n eventMap: eventMap$3,\n prevProps,\n nextProps: this.props,\n instance: this.state.streetViewPanorama\n });\n }\n }\n componentWillUnmount() {\n if (this.state.streetViewPanorama !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.streetViewPanorama);\n }\n unregisterEvents(this.registeredEvents);\n this.state.streetViewPanorama.setVisible(false);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(StreetViewPanorama, \"contextType\", MapContext);\nclass StreetViewService extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n streetViewService: null\n });\n _defineProperty(this, \"setStreetViewServiceCallback\", () => {\n if (this.state.streetViewService !== null && this.props.onLoad) {\n this.props.onLoad(this.state.streetViewService);\n }\n });\n }\n componentDidMount() {\n var streetViewService = new google.maps.StreetViewService();\n this.setState(function setStreetViewService() {\n return {\n streetViewService\n };\n }, this.setStreetViewServiceCallback);\n }\n componentWillUnmount() {\n if (this.state.streetViewService !== null && this.props.onUnmount) {\n this.props.onUnmount(this.state.streetViewService);\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(StreetViewService, \"contextType\", MapContext);\nclass DirectionsService extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n directionsService: null\n });\n _defineProperty(this, \"setDirectionsServiceCallback\", () => {\n if (this.state.directionsService !== null && this.props.onLoad) {\n this.props.onLoad(this.state.directionsService);\n }\n });\n }\n componentDidMount() {\n invariant(!!this.props.options, 'DirectionsService expected options object as parameter, but got %s', this.props.options);\n var directionsService = new google.maps.DirectionsService();\n this.setState(function setDirectionsService() {\n return {\n directionsService\n };\n }, this.setDirectionsServiceCallback);\n }\n componentDidUpdate() {\n if (this.state.directionsService !== null) {\n this.state.directionsService.route(this.props.options, this.props.callback);\n }\n }\n componentWillUnmount() {\n if (this.state.directionsService !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.directionsService);\n }\n }\n }\n render() {\n return null;\n }\n}\nvar eventMap$2 = {\n onDirectionsChanged: 'directions_changed'\n};\nvar updaterMap$2 = {\n directions(instance, directions) {\n instance.setDirections(directions);\n },\n map(instance, map) {\n instance.setMap(map);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n panel(instance, panel) {\n instance.setPanel(panel);\n },\n routeIndex(instance, routeIndex) {\n instance.setRouteIndex(routeIndex);\n }\n};\nclass DirectionsRenderer extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"state\", {\n directionsRenderer: null\n });\n _defineProperty(this, \"setDirectionsRendererCallback\", () => {\n if (this.state.directionsRenderer !== null) {\n this.state.directionsRenderer.setMap(this.context);\n if (this.props.onLoad) {\n this.props.onLoad(this.state.directionsRenderer);\n }\n }\n });\n }\n componentDidMount() {\n var directionsRenderer = new google.maps.DirectionsRenderer(this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$2,\n eventMap: eventMap$2,\n prevProps: {},\n nextProps: this.props,\n instance: directionsRenderer\n });\n this.setState(function setDirectionsRenderer() {\n return {\n directionsRenderer\n };\n }, this.setDirectionsRendererCallback);\n }\n componentDidUpdate(prevProps) {\n if (this.state.directionsRenderer !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$2,\n eventMap: eventMap$2,\n prevProps,\n nextProps: this.props,\n instance: this.state.directionsRenderer\n });\n }\n }\n componentWillUnmount() {\n if (this.state.directionsRenderer !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.directionsRenderer);\n }\n unregisterEvents(this.registeredEvents);\n if (this.state.directionsRenderer) {\n this.state.directionsRenderer.setMap(null);\n }\n }\n }\n render() {\n return null;\n }\n}\n_defineProperty(DirectionsRenderer, \"contextType\", MapContext);\nclass DistanceMatrixService extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"state\", {\n distanceMatrixService: null\n });\n _defineProperty(this, \"setDistanceMatrixServiceCallback\", () => {\n if (this.state.distanceMatrixService !== null && this.props.onLoad) {\n this.props.onLoad(this.state.distanceMatrixService);\n }\n });\n }\n componentDidMount() {\n invariant(!!this.props.options, 'DistanceMatrixService expected options object as parameter, but go %s', this.props.options);\n var distanceMatrixService = new google.maps.DistanceMatrixService();\n this.setState(function setDistanceMatrixService() {\n return {\n distanceMatrixService\n };\n }, this.setDistanceMatrixServiceCallback);\n }\n componentDidUpdate() {\n if (this.state.distanceMatrixService !== null) {\n this.state.distanceMatrixService.getDistanceMatrix(this.props.options, this.props.callback);\n }\n }\n componentWillUnmount() {\n if (this.state.distanceMatrixService !== null && this.props.onUnmount) {\n this.props.onUnmount(this.state.distanceMatrixService);\n }\n }\n render() {\n return null;\n }\n}\nvar eventMap$1 = {\n onPlacesChanged: 'places_changed'\n};\nvar updaterMap$1 = {\n bounds(instance, bounds) {\n instance.setBounds(bounds);\n }\n};\nclass StandaloneSearchBox extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"containerElement\", /*#__PURE__*/createRef());\n _defineProperty(this, \"state\", {\n searchBox: null\n });\n _defineProperty(this, \"setSearchBoxCallback\", () => {\n if (this.state.searchBox !== null && this.props.onLoad) {\n this.props.onLoad(this.state.searchBox);\n }\n });\n }\n componentDidMount() {\n invariant(!!google.maps.places, 'You need to provide libraries={[\"places\"]} prop to component %s', google.maps.places);\n if (this.containerElement !== null && this.containerElement.current !== null) {\n var input = this.containerElement.current.querySelector('input');\n if (input !== null) {\n var searchBox = new google.maps.places.SearchBox(input, this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$1,\n eventMap: eventMap$1,\n prevProps: {},\n nextProps: this.props,\n instance: searchBox\n });\n this.setState(function setSearchBox() {\n return {\n searchBox\n };\n }, this.setSearchBoxCallback);\n }\n }\n }\n componentDidUpdate(prevProps) {\n if (this.state.searchBox !== null) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap: updaterMap$1,\n eventMap: eventMap$1,\n prevProps,\n nextProps: this.props,\n instance: this.state.searchBox\n });\n }\n }\n componentWillUnmount() {\n if (this.state.searchBox !== null) {\n if (this.props.onUnmount) {\n this.props.onUnmount(this.state.searchBox);\n }\n unregisterEvents(this.registeredEvents);\n }\n }\n render() {\n return jsx(\"div\", {\n ref: this.containerElement,\n children: Children.only(this.props.children)\n });\n }\n}\n_defineProperty(StandaloneSearchBox, \"contextType\", MapContext);\nvar eventMap = {\n onPlaceChanged: 'place_changed'\n};\nvar updaterMap = {\n bounds(instance, bounds) {\n instance.setBounds(bounds);\n },\n restrictions(instance, restrictions) {\n instance.setComponentRestrictions(restrictions);\n },\n fields(instance, fields) {\n instance.setFields(fields);\n },\n options(instance, options) {\n instance.setOptions(options);\n },\n types(instance, types) {\n instance.setTypes(types);\n }\n};\nclass Autocomplete extends PureComponent {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"registeredEvents\", []);\n _defineProperty(this, \"containerElement\", /*#__PURE__*/createRef());\n _defineProperty(this, \"state\", {\n autocomplete: null\n });\n _defineProperty(this, \"setAutocompleteCallback\", () => {\n if (this.state.autocomplete !== null && this.props.onLoad) {\n this.props.onLoad(this.state.autocomplete);\n }\n });\n }\n componentDidMount() {\n var _this$containerElemen;\n invariant(!!google.maps.places, 'You need to provide libraries={[\"places\"]} prop to component %s', google.maps.places);\n // TODO: why current could be equal null?\n var input = (_this$containerElemen = this.containerElement.current) === null || _this$containerElemen === void 0 ? void 0 : _this$containerElemen.querySelector('input');\n if (input) {\n var autocomplete = new google.maps.places.Autocomplete(input, this.props.options);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap,\n eventMap,\n prevProps: {},\n nextProps: this.props,\n instance: autocomplete\n });\n this.setState(() => {\n return {\n autocomplete\n };\n }, this.setAutocompleteCallback);\n }\n }\n componentDidUpdate(prevProps) {\n unregisterEvents(this.registeredEvents);\n this.registeredEvents = applyUpdatersToPropsAndRegisterEvents({\n updaterMap,\n eventMap,\n prevProps,\n nextProps: this.props,\n instance: this.state.autocomplete\n });\n }\n componentWillUnmount() {\n if (this.state.autocomplete !== null) {\n unregisterEvents(this.registeredEvents);\n }\n }\n render() {\n return jsx(\"div\", {\n ref: this.containerElement,\n className: this.props.className,\n children: Children.only(this.props.children)\n });\n }\n}\n_defineProperty(Autocomplete, \"defaultProps\", {\n className: ''\n});\n_defineProperty(Autocomplete, \"contextType\", MapContext);\nexport { Autocomplete, BicyclingLayer, BicyclingLayerF, Circle, CircleF, Data, DataF, DirectionsRenderer, DirectionsService, DistanceMatrixService, DrawingManager, DrawingManagerF, FLOAT_PANE, GoogleMap, index_esm as GoogleMapsMarkerClusterer, GoogleMarkerClusterer$1 as GoogleMarkerClusterer, GroundOverlay, GroundOverlayF, HeatmapLayer, HeatmapLayerF, InfoBoxComponent as InfoBox, InfoBoxF, InfoWindow, InfoWindowF, KmlLayer, LoadScript, LoadScriptNext$1 as LoadScriptNext, MAP_PANE, MARKER_LAYER, MapContext, Marker, ClustererComponent as MarkerClusterer, MarkerClustererF, MarkerF, OVERLAY_LAYER, OVERLAY_MOUSE_TARGET, OverlayView, OverlayViewF, Polygon, PolygonF, Polyline, PolylineF, Rectangle, RectangleF, StandaloneSearchBox, StreetViewPanorama, StreetViewService, TrafficLayer, TrafficLayerF, TransitLayer, TransitLayerF, useGoogleMap, useJsApiLoader, useLoadScript };","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n var keys = getOwnPropertyNames(sourceComponent);\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n return targetComponent;\n}\nmodule.exports = hoistNonReactStatics;","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\nfunction toObject(val) {\n if (val === null || val === undefined) {\n throw new TypeError('Object.assign cannot be called with null or undefined');\n }\n return Object(val);\n}\nfunction shouldUseNative() {\n try {\n if (!Object.assign) {\n return false;\n }\n\n // Detect buggy property enumeration order in older V8 versions.\n\n // https://bugs.chromium.org/p/v8/issues/detail?id=4118\n var test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n test1[5] = 'de';\n if (Object.getOwnPropertyNames(test1)[0] === '5') {\n return false;\n }\n\n // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n var test2 = {};\n for (var i = 0; i < 10; i++) {\n test2['_' + String.fromCharCode(i)] = i;\n }\n var order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n return test2[n];\n });\n if (order2.join('') !== '0123456789') {\n return false;\n }\n\n // https://bugs.chromium.org/p/v8/issues/detail?id=3056\n var test3 = {};\n 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n test3[letter] = letter;\n });\n if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {\n return false;\n }\n return true;\n } catch (err) {\n // We don't expect any of the above to throw, but better to be safe.\n return false;\n }\n}\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n var from;\n var to = toObject(target);\n var symbols;\n for (var s = 1; s < arguments.length; s++) {\n from = Object(arguments[s]);\n for (var key in from) {\n if (hasOwnProperty.call(from, key)) {\n to[key] = from[key];\n }\n }\n if (getOwnPropertySymbols) {\n symbols = getOwnPropertySymbols(from);\n for (var i = 0; i < symbols.length; i++) {\n if (propIsEnumerable.call(from, symbols[i])) {\n to[symbols[i]] = from[symbols[i]];\n }\n }\n }\n }\n return to;\n};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar printWarning = function () {};\nif (process.env.NODE_ENV !== 'production') {\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n var has = require('./lib/has');\n printWarning = function (text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {/**/}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n var stack = getStack ? getStack() : '';\n printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function () {\n if (process.env.NODE_ENV !== 'production') {\n loggedTypeFailures = {};\n }\n};\nmodule.exports = checkPropTypes;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactIs = require('react-is');\nvar assign = require('object-assign');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar has = require('./lib/has');\nvar checkPropTypes = require('./checkPropTypes');\nvar printWarning = function () {};\nif (process.env.NODE_ENV !== 'production') {\n printWarning = function (text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\nfunction emptyFunctionThatReturnsNull() {\n return null;\n}\nmodule.exports = function (isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bigint: createPrimitiveTypeChecker('bigint'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n elementType: createElementTypeTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message, data) {\n this.message = message;\n this.data = data && typeof data === 'object' ? data : {};\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');\n err.name = 'Invariant Violation';\n throw err;\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (!manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3) {\n printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n return chainedCheckType;\n }\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), {\n expectedType: expectedType\n });\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunctionThatReturnsNull);\n }\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createElementTypeTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!ReactIs.isValidElementType(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n if (process.env.NODE_ENV !== 'production') {\n if (arguments.length > 1) {\n printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');\n } else {\n printWarning('Invalid argument supplied to oneOf, expected an array.');\n }\n }\n return emptyFunctionThatReturnsNull;\n }\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {\n var type = getPreciseType(value);\n if (type === 'symbol') {\n return String(value);\n }\n return value;\n });\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (has(propValue, key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunctionThatReturnsNull;\n }\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');\n return emptyFunctionThatReturnsNull;\n }\n }\n function validate(props, propName, componentName, location, propFullName) {\n var expectedTypes = [];\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);\n if (checkerResult == null) {\n return null;\n }\n if (checkerResult.data && has(checkerResult.data, 'expectedType')) {\n expectedTypes.push(checkerResult.data.expectedType);\n }\n }\n var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function invalidValidatorError(componentName, location, propFullName, key, type) {\n return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');\n }\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (has(shapeTypes, key) && typeof checker !== 'function') {\n return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));\n }\n if (!checker) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n return true;\n default:\n return false;\n }\n }\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // falsy value can't be a Symbol\n if (!propValue) {\n return false;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;\n ReactPropTypes.PropTypes = ReactPropTypes;\n return ReactPropTypes;\n};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var ReactIs = require('react-is');\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(ReactIs.isElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\nmodule.exports = ReactPropTypesSecret;","module.exports = Function.call.bind(Object.prototype.hasOwnProperty);","function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n return target;\n}\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\nimport { Component, createElement, forwardRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nvar SCRIPT_MAP = {}; // A counter used to generate a unique id for each component that uses the function\n\nvar idCount = 0;\nexport default function makeAsyncScript(getScriptURL, options) {\n options = options || {};\n return function wrapWithAsyncScript(WrappedComponent) {\n var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n var AsyncScriptLoader = /*#__PURE__*/\n function (_Component) {\n _inheritsLoose(AsyncScriptLoader, _Component);\n function AsyncScriptLoader(props, context) {\n var _this;\n _this = _Component.call(this, props, context) || this;\n _this.state = {};\n _this.__scriptURL = \"\";\n return _this;\n }\n var _proto = AsyncScriptLoader.prototype;\n _proto.asyncScriptLoaderGetScriptLoaderID = function asyncScriptLoaderGetScriptLoaderID() {\n if (!this.__scriptLoaderID) {\n this.__scriptLoaderID = \"async-script-loader-\" + idCount++;\n }\n return this.__scriptLoaderID;\n };\n _proto.setupScriptURL = function setupScriptURL() {\n this.__scriptURL = typeof getScriptURL === \"function\" ? getScriptURL() : getScriptURL;\n return this.__scriptURL;\n };\n _proto.asyncScriptLoaderHandleLoad = function asyncScriptLoaderHandleLoad(state) {\n var _this2 = this;\n\n // use reacts setState callback to fire props.asyncScriptOnLoad with new state/entry\n this.setState(state, function () {\n return _this2.props.asyncScriptOnLoad && _this2.props.asyncScriptOnLoad(_this2.state);\n });\n };\n _proto.asyncScriptLoaderTriggerOnScriptLoaded = function asyncScriptLoaderTriggerOnScriptLoaded() {\n var mapEntry = SCRIPT_MAP[this.__scriptURL];\n if (!mapEntry || !mapEntry.loaded) {\n throw new Error(\"Script is not loaded.\");\n }\n for (var obsKey in mapEntry.observers) {\n mapEntry.observers[obsKey](mapEntry);\n }\n delete window[options.callbackName];\n };\n _proto.componentDidMount = function componentDidMount() {\n var _this3 = this;\n var scriptURL = this.setupScriptURL();\n var key = this.asyncScriptLoaderGetScriptLoaderID();\n var _options = options,\n globalName = _options.globalName,\n callbackName = _options.callbackName,\n scriptId = _options.scriptId; // check if global object already attached to window\n\n if (globalName && typeof window[globalName] !== \"undefined\") {\n SCRIPT_MAP[scriptURL] = {\n loaded: true,\n observers: {}\n };\n } // check if script loading already\n\n if (SCRIPT_MAP[scriptURL]) {\n var entry = SCRIPT_MAP[scriptURL]; // if loaded or errored then \"finish\"\n\n if (entry && (entry.loaded || entry.errored)) {\n this.asyncScriptLoaderHandleLoad(entry);\n return;\n } // if still loading then callback to observer queue\n\n entry.observers[key] = function (entry) {\n return _this3.asyncScriptLoaderHandleLoad(entry);\n };\n return;\n }\n /*\n * hasn't started loading\n * start the \"magic\"\n * setup script to load and observers\n */\n\n var observers = {};\n observers[key] = function (entry) {\n return _this3.asyncScriptLoaderHandleLoad(entry);\n };\n SCRIPT_MAP[scriptURL] = {\n loaded: false,\n observers: observers\n };\n var script = document.createElement(\"script\");\n script.src = scriptURL;\n script.async = true;\n for (var attribute in options.attributes) {\n script.setAttribute(attribute, options.attributes[attribute]);\n }\n if (scriptId) {\n script.id = scriptId;\n }\n var callObserverFuncAndRemoveObserver = function callObserverFuncAndRemoveObserver(func) {\n if (SCRIPT_MAP[scriptURL]) {\n var mapEntry = SCRIPT_MAP[scriptURL];\n var observersMap = mapEntry.observers;\n for (var obsKey in observersMap) {\n if (func(observersMap[obsKey])) {\n delete observersMap[obsKey];\n }\n }\n }\n };\n if (callbackName && typeof window !== \"undefined\") {\n window[callbackName] = function () {\n return _this3.asyncScriptLoaderTriggerOnScriptLoaded();\n };\n }\n script.onload = function () {\n var mapEntry = SCRIPT_MAP[scriptURL];\n if (mapEntry) {\n mapEntry.loaded = true;\n callObserverFuncAndRemoveObserver(function (observer) {\n if (callbackName) {\n return false;\n }\n observer(mapEntry);\n return true;\n });\n }\n };\n script.onerror = function () {\n var mapEntry = SCRIPT_MAP[scriptURL];\n if (mapEntry) {\n mapEntry.errored = true;\n callObserverFuncAndRemoveObserver(function (observer) {\n observer(mapEntry);\n return true;\n });\n }\n };\n document.body.appendChild(script);\n };\n _proto.componentWillUnmount = function componentWillUnmount() {\n // Remove tag script\n var scriptURL = this.__scriptURL;\n if (options.removeOnUnmount === true) {\n var allScripts = document.getElementsByTagName(\"script\");\n for (var i = 0; i < allScripts.length; i += 1) {\n if (allScripts[i].src.indexOf(scriptURL) > -1) {\n if (allScripts[i].parentNode) {\n allScripts[i].parentNode.removeChild(allScripts[i]);\n }\n }\n }\n } // Clean the observer entry\n\n var mapEntry = SCRIPT_MAP[scriptURL];\n if (mapEntry) {\n delete mapEntry.observers[this.asyncScriptLoaderGetScriptLoaderID()];\n if (options.removeOnUnmount === true) {\n delete SCRIPT_MAP[scriptURL];\n }\n }\n };\n _proto.render = function render() {\n var globalName = options.globalName; // remove asyncScriptOnLoad from childProps\n\n var _this$props = this.props,\n asyncScriptOnLoad = _this$props.asyncScriptOnLoad,\n forwardedRef = _this$props.forwardedRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"asyncScriptOnLoad\", \"forwardedRef\"]); // eslint-disable-line no-unused-vars\n\n if (globalName && typeof window !== \"undefined\") {\n childProps[globalName] = typeof window[globalName] !== \"undefined\" ? window[globalName] : undefined;\n }\n childProps.ref = forwardedRef;\n return /*#__PURE__*/createElement(WrappedComponent, childProps);\n };\n return AsyncScriptLoader;\n }(Component); // Note the second param \"ref\" provided by React.forwardRef.\n // We can pass it along to AsyncScriptLoader as a regular prop, e.g. \"forwardedRef\"\n // And it can then be attached to the Component.\n\n var ForwardedComponent = /*#__PURE__*/forwardRef(function (props, ref) {\n return /*#__PURE__*/createElement(AsyncScriptLoader, _extends({}, props, {\n forwardedRef: ref\n }));\n });\n ForwardedComponent.displayName = \"AsyncScriptLoader(\" + wrappedComponentName + \")\";\n ForwardedComponent.propTypes = {\n asyncScriptOnLoad: PropTypes.func\n };\n return hoistStatics(ForwardedComponent, WrappedComponent);\n };\n}","/** @license React v17.0.2\n * react-dom-server.browser.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function () {\n 'use strict';\n\n var React = require('react');\n var _assign = require('object-assign');\n\n // Do not require this module directly! Use normal `invariant` calls with\n // template literal strings. The messages will be replaced with error codes\n // during build.\n function formatProdErrorMessage(code) {\n var url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;\n for (var i = 1; i < arguments.length; i++) {\n url += '&args[]=' + encodeURIComponent(arguments[i]);\n }\n return \"Minified React error #\" + code + \"; visit \" + url + \" for the full message or \" + 'use the non-minified dev environment for full errors and additional ' + 'helpful warnings.';\n }\n\n // TODO: this is special because it gets imported during build.\n var ReactVersion = '17.0.2';\n var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\n // by calls to these methods by a Babel plugin.\n //\n // In PROD (or in packages without access to React internals),\n // they are left as they are instead.\n\n function warn(format) {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n printWarning('warn', format, args);\n }\n }\n function error(format) {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n printWarning('error', format, args);\n }\n }\n function printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n }\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n }\n\n // ATTENTION\n // When adding new symbols to this file,\n // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n // The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n // nor polyfill, then a plain number is used for performance.\n var REACT_ELEMENT_TYPE = 0xeac7;\n var REACT_PORTAL_TYPE = 0xeaca;\n var REACT_FRAGMENT_TYPE = 0xeacb;\n var REACT_STRICT_MODE_TYPE = 0xeacc;\n var REACT_PROFILER_TYPE = 0xead2;\n var REACT_PROVIDER_TYPE = 0xeacd;\n var REACT_CONTEXT_TYPE = 0xeace;\n var REACT_FORWARD_REF_TYPE = 0xead0;\n var REACT_SUSPENSE_TYPE = 0xead1;\n var REACT_SUSPENSE_LIST_TYPE = 0xead8;\n var REACT_MEMO_TYPE = 0xead3;\n var REACT_LAZY_TYPE = 0xead4;\n var REACT_BLOCK_TYPE = 0xead9;\n var REACT_SERVER_BLOCK_TYPE = 0xeada;\n var REACT_FUNDAMENTAL_TYPE = 0xead5;\n var REACT_SCOPE_TYPE = 0xead7;\n var REACT_OPAQUE_ID_TYPE = 0xeae0;\n var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;\n var REACT_OFFSCREEN_TYPE = 0xeae2;\n var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;\n if (typeof Symbol === 'function' && Symbol.for) {\n var symbolFor = Symbol.for;\n REACT_ELEMENT_TYPE = symbolFor('react.element');\n REACT_PORTAL_TYPE = symbolFor('react.portal');\n REACT_FRAGMENT_TYPE = symbolFor('react.fragment');\n REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');\n REACT_PROFILER_TYPE = symbolFor('react.profiler');\n REACT_PROVIDER_TYPE = symbolFor('react.provider');\n REACT_CONTEXT_TYPE = symbolFor('react.context');\n REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');\n REACT_SUSPENSE_TYPE = symbolFor('react.suspense');\n REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');\n REACT_MEMO_TYPE = symbolFor('react.memo');\n REACT_LAZY_TYPE = symbolFor('react.lazy');\n REACT_BLOCK_TYPE = symbolFor('react.block');\n REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');\n REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');\n REACT_SCOPE_TYPE = symbolFor('react.scope');\n REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');\n REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');\n REACT_OFFSCREEN_TYPE = symbolFor('react.offscreen');\n REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');\n }\n function getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n }\n function getContextName(type) {\n return type.displayName || 'Context';\n }\n function getComponentName(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n if (typeof type === 'string') {\n return type;\n }\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n case REACT_PORTAL_TYPE:\n return 'Portal';\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n case REACT_BLOCK_TYPE:\n return getComponentName(type._render);\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n try {\n return getComponentName(init(payload));\n } catch (x) {\n return null;\n }\n }\n }\n }\n return null;\n }\n\n // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.\n\n var enableSuspenseServerRenderer = false;\n\n // Helpers to patch console.logs to avoid logging during side-effect free\n // replaying on render function. This currently only patches the object\n // lazily which won't cover if the log function was extracted eagerly.\n // We could also eagerly patch the method.\n var disabledDepth = 0;\n var prevLog;\n var prevInfo;\n var prevWarn;\n var prevError;\n var prevGroup;\n var prevGroupCollapsed;\n var prevGroupEnd;\n function disabledLog() {}\n disabledLog.__reactDisabledLog = true;\n function disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n disabledDepth++;\n }\n }\n function reenableLogs() {\n {\n disabledDepth--;\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: _assign({}, props, {\n value: prevLog\n }),\n info: _assign({}, props, {\n value: prevInfo\n }),\n warn: _assign({}, props, {\n value: prevWarn\n }),\n error: _assign({}, props, {\n value: prevError\n }),\n group: _assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: _assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: _assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n }\n var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\n var prefix;\n function describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n return '\\n' + prefix + name;\n }\n }\n var reentry = false;\n var componentFrameCache;\n {\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n }\n function describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if (!fn || reentry) {\n return '';\n }\n {\n var frame = componentFrameCache.get(fn);\n if (frame !== undefined) {\n return frame;\n }\n }\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at ');\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n break;\n }\n }\n }\n } finally {\n reentry = false;\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n return syntheticFrame;\n }\n function describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n }\n function shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n }\n function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n if (type == null) {\n return '';\n }\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n case REACT_BLOCK_TYPE:\n return describeFunctionComponentFrame(type._render);\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n return '';\n }\n var loggedTypeFailures = {};\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n function setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n }\n function checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n setCurrentlyValidatingElement(null);\n }\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n error('Failed %s type: %s', location, error$1.message);\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n }\n var didWarnAboutInvalidateContextType;\n {\n didWarnAboutInvalidateContextType = new Set();\n }\n var emptyObject = {};\n {\n Object.freeze(emptyObject);\n }\n function maskContext(type, context) {\n var contextTypes = type.contextTypes;\n if (!contextTypes) {\n return emptyObject;\n }\n var maskedContext = {};\n for (var contextName in contextTypes) {\n maskedContext[contextName] = context[contextName];\n }\n return maskedContext;\n }\n function checkContextTypes(typeSpecs, values, location) {\n {\n checkPropTypes(typeSpecs, values, location, 'Component');\n }\n }\n function validateContextBounds(context, threadID) {\n // If we don't have enough slots in this context to store this threadID,\n // fill it in without leaving any holes to ensure that the VM optimizes\n // this as non-holey index properties.\n // (Note: If `react` package is < 16.6, _threadCount is undefined.)\n for (var i = context._threadCount | 0; i <= threadID; i++) {\n // We assume that this is the same as the defaultValue which might not be\n // true if we're rendering inside a secondary renderer but they are\n // secondary because these use cases are very rare.\n context[i] = context._currentValue2;\n context._threadCount = i + 1;\n }\n }\n function processContext(type, context, threadID, isClass) {\n if (isClass) {\n var contextType = type.contextType;\n {\n if ('contextType' in type) {\n var isValid =\n // Allow null for conditional declaration\n contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a \n\n if (!isValid && !didWarnAboutInvalidateContextType.has(type)) {\n didWarnAboutInvalidateContextType.add(type);\n var addendum = '';\n if (contextType === undefined) {\n addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.';\n } else if (typeof contextType !== 'object') {\n addendum = ' However, it is set to a ' + typeof contextType + '.';\n } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) {\n addendum = ' Did you accidentally pass the Context.Provider instead?';\n } else if (contextType._context !== undefined) {\n // \n addendum = ' Did you accidentally pass the Context.Consumer instead?';\n } else {\n addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.';\n }\n error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentName(type) || 'Component', addendum);\n }\n }\n }\n if (typeof contextType === 'object' && contextType !== null) {\n validateContextBounds(contextType, threadID);\n return contextType[threadID];\n }\n {\n var maskedContext = maskContext(type, context);\n {\n if (type.contextTypes) {\n checkContextTypes(type.contextTypes, maskedContext, 'context');\n }\n }\n return maskedContext;\n }\n } else {\n {\n var _maskedContext = maskContext(type, context);\n {\n if (type.contextTypes) {\n checkContextTypes(type.contextTypes, _maskedContext, 'context');\n }\n }\n return _maskedContext;\n }\n }\n }\n var nextAvailableThreadIDs = new Uint16Array(16);\n for (var i = 0; i < 15; i++) {\n nextAvailableThreadIDs[i] = i + 1;\n }\n nextAvailableThreadIDs[15] = 0;\n function growThreadCountAndReturnNextAvailable() {\n var oldArray = nextAvailableThreadIDs;\n var oldSize = oldArray.length;\n var newSize = oldSize * 2;\n if (!(newSize <= 0x10000)) {\n {\n throw Error(\"Maximum number of concurrent React renderers exceeded. This can happen if you are not properly destroying the Readable provided by React. Ensure that you call .destroy() on it if you no longer want to read from it, and did not read to the end. If you use .pipe() this should be automatic.\");\n }\n }\n var newArray = new Uint16Array(newSize);\n newArray.set(oldArray);\n nextAvailableThreadIDs = newArray;\n nextAvailableThreadIDs[0] = oldSize + 1;\n for (var _i = oldSize; _i < newSize - 1; _i++) {\n nextAvailableThreadIDs[_i] = _i + 1;\n }\n nextAvailableThreadIDs[newSize - 1] = 0;\n return oldSize;\n }\n function allocThreadID() {\n var nextID = nextAvailableThreadIDs[0];\n if (nextID === 0) {\n return growThreadCountAndReturnNextAvailable();\n }\n nextAvailableThreadIDs[0] = nextAvailableThreadIDs[nextID];\n return nextID;\n }\n function freeThreadID(id) {\n nextAvailableThreadIDs[id] = nextAvailableThreadIDs[0];\n nextAvailableThreadIDs[0] = id;\n }\n\n // A reserved attribute.\n // It is handled by React separately and shouldn't be written to the DOM.\n var RESERVED = 0; // A simple string attribute.\n // Attributes that aren't in the filter are presumed to have this type.\n\n var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n // \"enumerated\" attributes with \"true\" and \"false\" as possible values.\n // When true, it should be set to a \"true\" string.\n // When false, it should be set to a \"false\" string.\n\n var BOOLEANISH_STRING = 2; // A real boolean attribute.\n // When true, it should be present (set either to an empty string or its name).\n // When false, it should be omitted.\n\n var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n // When true, it should be present (set either to an empty string or its name).\n // When false, it should be omitted.\n // For any other value, should be present with that value.\n\n var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n // When falsy, it should be removed.\n\n var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n // When falsy, it should be removed.\n\n var POSITIVE_NUMERIC = 6;\n\n /* eslint-disable max-len */\n var ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n /* eslint-enable max-len */\n\n var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n var ROOT_ATTRIBUTE_NAME = 'data-reactroot';\n var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n var illegalAttributeNameCache = {};\n var validatedAttributeNameCache = {};\n function isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n illegalAttributeNameCache[attributeName] = true;\n {\n error('Invalid attribute name: `%s`', attributeName);\n }\n return false;\n }\n function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n if (isCustomComponentTag) {\n return false;\n }\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n return false;\n }\n function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n switch (typeof value) {\n case 'function': // $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n // eslint-disable-line\n return true;\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n default:\n return false;\n }\n }\n function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n if (isCustomComponentTag) {\n return false;\n }\n if (propertyInfo !== null) {\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n case OVERLOADED_BOOLEAN:\n return value === false;\n case NUMERIC:\n return isNaN(value);\n case POSITIVE_NUMERIC:\n return isNaN(value) || value < 1;\n }\n }\n return false;\n }\n function getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n }\n function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n this.removeEmptyString = removeEmptyString;\n } // When adding attributes to this list, be sure to also add them to\n // the `possibleStandardNames` module to ensure casing and incorrect\n // name warnings.\n\n var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\n var reservedProps = ['children', 'dangerouslySetInnerHTML',\n // TODO: This prevents the assignment of defaultValue to regular\n // elements (not just inputs). Now that ReactDOMInput assigns to the\n // defaultValue property -- do we need this?\n 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'];\n reservedProps.forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false,\n // mustUseProperty\n name,\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // A few React string attributes have a different name.\n // This is a mapping from React prop names to the attribute names.\n\n [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false,\n // mustUseProperty\n attributeName,\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n // In React, we let users pass `true` and `false` even though technically\n // these aren't boolean attributes (they are coerced to strings).\n\n ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,\n // mustUseProperty\n name.toLowerCase(),\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n // In React, we let users pass `true` and `false` even though technically\n // these aren't boolean attributes (they are coerced to strings).\n // Since these are SVG attributes, their attribute names are case-sensitive.\n\n ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false,\n // mustUseProperty\n name,\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are HTML boolean attributes.\n\n ['allowFullScreen', 'async',\n // Note: there is a special case that prevents it from being written to the DOM\n // on the client side because the browsers are inconsistent. Instead we call focus().\n 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless',\n // Microdata\n 'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false,\n // mustUseProperty\n name.toLowerCase(),\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are the few React props that we set as DOM properties\n // rather than attributes. These are all booleans.\n\n ['checked',\n // Note: `option.selected` is not updated if `select.multiple` is\n // disabled with `removeAttribute`. We have special logic for handling this.\n 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true,\n // mustUseProperty\n name,\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are HTML attributes that are \"overloaded booleans\": they behave like\n // booleans, but can also accept a string value.\n\n ['capture', 'download' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false,\n // mustUseProperty\n name,\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are HTML attributes that must be positive numbers.\n\n ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false,\n // mustUseProperty\n name,\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These are HTML attributes that must be numbers.\n\n ['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false,\n // mustUseProperty\n name.toLowerCase(),\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n });\n var CAMELIZE = /[\\-\\:]([a-z])/g;\n var capitalize = function (token) {\n return token[1].toUpperCase();\n }; // This is a list of all SVG attributes that need special casing, namespacing,\n // or boolean value assignment. Regular attributes that just accept strings\n // and have the same names are omitted, just like in the HTML attribute filter.\n // Some of these attributes can be hard to find. This list was created by\n // scraping the MDN documentation.\n\n ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false,\n // mustUseProperty\n attributeName, null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // String SVG attributes with the xlink namespace.\n\n ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false,\n // mustUseProperty\n attributeName, 'http://www.w3.org/1999/xlink', false,\n // sanitizeURL\n false);\n }); // String SVG attributes with the xml namespace.\n\n ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list,\n // you'll need to set attributeName to name.toLowerCase()\n // instead in the assignment below.\n ].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false,\n // mustUseProperty\n attributeName, 'http://www.w3.org/XML/1998/namespace', false,\n // sanitizeURL\n false);\n }); // These attribute exists both in HTML and SVG.\n // The attribute name is case-sensitive in SVG so we can't just use\n // the React name like we do for attributes that exist only in HTML.\n\n ['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false,\n // mustUseProperty\n attributeName.toLowerCase(),\n // attributeName\n null,\n // attributeNamespace\n false,\n // sanitizeURL\n false);\n }); // These attributes accept URLs. These must not allow javascript: URLS.\n // These will also need to accept Trusted Types object in the future.\n\n var xlinkHref = 'xlinkHref';\n properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false,\n // mustUseProperty\n 'xlink:href', 'http://www.w3.org/1999/xlink', true,\n // sanitizeURL\n false);\n ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false,\n // mustUseProperty\n attributeName.toLowerCase(),\n // attributeName\n null,\n // attributeNamespace\n true,\n // sanitizeURL\n true);\n });\n\n // and any newline or tab are filtered out as if they're not part of the URL.\n // https://url.spec.whatwg.org/#url-parsing\n // Tab or newline are defined as \\r\\n\\t:\n // https://infra.spec.whatwg.org/#ascii-tab-or-newline\n // A C0 control is a code point in the range \\u0000 NULL to \\u001F\n // INFORMATION SEPARATOR ONE, inclusive:\n // https://infra.spec.whatwg.org/#c0-control-or-space\n\n /* eslint-disable max-len */\n\n var isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\n var didWarn = false;\n function sanitizeURL(url) {\n {\n if (!didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n }\n }\n\n // code copied and modified from escape-html\n\n /**\n * Module variables.\n * @private\n */\n var matchHtmlRegExp = /[\"'&<>]/;\n /**\n * Escapes special characters and HTML entities in a given html string.\n *\n * @param {string} string HTML string to escape for later insertion\n * @return {string}\n * @public\n */\n\n function escapeHtml(string) {\n var str = '' + string;\n var match = matchHtmlRegExp.exec(str);\n if (!match) {\n return str;\n }\n var escape;\n var html = '';\n var index;\n var lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n // \"\n escape = '"';\n break;\n case 38:\n // &\n escape = '&';\n break;\n case 39:\n // '\n escape = '''; // modified from escape-html; used to be '''\n\n break;\n case 60:\n // <\n escape = '<';\n break;\n case 62:\n // >\n escape = '>';\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escape;\n }\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n } // end code copied and modified from escape-html\n\n /**\n * Escapes text to prevent scripting attacks.\n *\n * @param {*} text Text value to escape.\n * @return {string} An escaped string.\n */\n\n function escapeTextForBrowser(text) {\n if (typeof text === 'boolean' || typeof text === 'number') {\n // this shortcircuit helps perf for types that we know will never have\n // special characters, especially given that this function is used often\n // for numeric dom ids.\n return '' + text;\n }\n return escapeHtml(text);\n }\n\n /**\n * Escapes attribute value to prevent scripting attacks.\n *\n * @param {*} value Value to escape.\n * @return {string} An escaped string.\n */\n\n function quoteAttributeValueForBrowser(value) {\n return '\"' + escapeTextForBrowser(value) + '\"';\n }\n function createMarkupForRoot() {\n return ROOT_ATTRIBUTE_NAME + '=\"\"';\n }\n /**\n * Creates markup for a property.\n *\n * @param {string} name\n * @param {*} value\n * @return {?string} Markup string, or null if the property was invalid.\n */\n\n function createMarkupForProperty(name, value) {\n var propertyInfo = getPropertyInfo(name);\n if (name !== 'style' && shouldIgnoreAttribute(name, propertyInfo, false)) {\n return '';\n }\n if (shouldRemoveAttribute(name, value, propertyInfo, false)) {\n return '';\n }\n if (propertyInfo !== null) {\n var attributeName = propertyInfo.attributeName;\n var type = propertyInfo.type;\n if (type === BOOLEAN || type === OVERLOADED_BOOLEAN && value === true) {\n return attributeName + '=\"\"';\n } else {\n if (propertyInfo.sanitizeURL) {\n value = '' + value;\n sanitizeURL(value);\n }\n return attributeName + '=' + quoteAttributeValueForBrowser(value);\n }\n } else if (isAttributeNameSafe(name)) {\n return name + '=' + quoteAttributeValueForBrowser(value);\n }\n return '';\n }\n /**\n * Creates markup for a custom property.\n *\n * @param {string} name\n * @param {*} value\n * @return {string} Markup string, or empty string if the property was invalid.\n */\n\n function createMarkupForCustomAttribute(name, value) {\n if (!isAttributeNameSafe(name) || value == null) {\n return '';\n }\n return name + '=' + quoteAttributeValueForBrowser(value);\n }\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n function is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n }\n var objectIs = typeof Object.is === 'function' ? Object.is : is;\n var currentlyRenderingComponent = null;\n var firstWorkInProgressHook = null;\n var workInProgressHook = null; // Whether the work-in-progress hook is a re-rendered hook\n\n var isReRender = false; // Whether an update was scheduled during the currently executing render pass.\n\n var didScheduleRenderPhaseUpdate = false; // Lazily created map of render-phase updates\n\n var renderPhaseUpdates = null; // Counter to prevent infinite loops.\n\n var numberOfReRenders = 0;\n var RE_RENDER_LIMIT = 25;\n var isInHookUserCodeInDev = false; // In DEV, this is the name of the currently executing primitive hook\n\n var currentHookNameInDev;\n function resolveCurrentlyRenderingComponent() {\n if (!(currentlyRenderingComponent !== null)) {\n {\n throw Error(\"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.\");\n }\n }\n {\n if (isInHookUserCodeInDev) {\n error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks');\n }\n }\n return currentlyRenderingComponent;\n }\n function areHookInputsEqual(nextDeps, prevDeps) {\n if (prevDeps === null) {\n {\n error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev);\n }\n return false;\n }\n {\n // Don't bother comparing lengths in prod because these arrays should be\n // passed inline.\n if (nextDeps.length !== prevDeps.length) {\n error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\\n\\n' + 'Previous: %s\\n' + 'Incoming: %s', currentHookNameInDev, \"[\" + nextDeps.join(', ') + \"]\", \"[\" + prevDeps.join(', ') + \"]\");\n }\n }\n for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) {\n if (objectIs(nextDeps[i], prevDeps[i])) {\n continue;\n }\n return false;\n }\n return true;\n }\n function createHook() {\n if (numberOfReRenders > 0) {\n {\n {\n throw Error(\"Rendered more hooks than during the previous render\");\n }\n }\n }\n return {\n memoizedState: null,\n queue: null,\n next: null\n };\n }\n function createWorkInProgressHook() {\n if (workInProgressHook === null) {\n // This is the first hook in the list\n if (firstWorkInProgressHook === null) {\n isReRender = false;\n firstWorkInProgressHook = workInProgressHook = createHook();\n } else {\n // There's already a work-in-progress. Reuse it.\n isReRender = true;\n workInProgressHook = firstWorkInProgressHook;\n }\n } else {\n if (workInProgressHook.next === null) {\n isReRender = false; // Append to the end of the list\n\n workInProgressHook = workInProgressHook.next = createHook();\n } else {\n // There's already a work-in-progress. Reuse it.\n isReRender = true;\n workInProgressHook = workInProgressHook.next;\n }\n }\n return workInProgressHook;\n }\n function prepareToUseHooks(componentIdentity) {\n currentlyRenderingComponent = componentIdentity;\n {\n isInHookUserCodeInDev = false;\n } // The following should have already been reset\n // didScheduleRenderPhaseUpdate = false;\n // firstWorkInProgressHook = null;\n // numberOfReRenders = 0;\n // renderPhaseUpdates = null;\n // workInProgressHook = null;\n }\n function finishHooks(Component, props, children, refOrContext) {\n // This must be called after every function component to prevent hooks from\n // being used in classes.\n while (didScheduleRenderPhaseUpdate) {\n // Updates were scheduled during the render phase. They are stored in\n // the `renderPhaseUpdates` map. Call the component again, reusing the\n // work-in-progress hooks and applying the additional updates on top. Keep\n // restarting until no more updates are scheduled.\n didScheduleRenderPhaseUpdate = false;\n numberOfReRenders += 1; // Start over from the beginning of the list\n\n workInProgressHook = null;\n children = Component(props, refOrContext);\n }\n resetHooksState();\n return children;\n } // Reset the internal hooks state if an error occurs while rendering a component\n\n function resetHooksState() {\n {\n isInHookUserCodeInDev = false;\n }\n currentlyRenderingComponent = null;\n didScheduleRenderPhaseUpdate = false;\n firstWorkInProgressHook = null;\n numberOfReRenders = 0;\n renderPhaseUpdates = null;\n workInProgressHook = null;\n }\n function readContext(context, observedBits) {\n var threadID = currentPartialRenderer.threadID;\n validateContextBounds(context, threadID);\n {\n if (isInHookUserCodeInDev) {\n error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().');\n }\n }\n return context[threadID];\n }\n function useContext(context, observedBits) {\n {\n currentHookNameInDev = 'useContext';\n }\n resolveCurrentlyRenderingComponent();\n var threadID = currentPartialRenderer.threadID;\n validateContextBounds(context, threadID);\n return context[threadID];\n }\n function basicStateReducer(state, action) {\n // $FlowFixMe: Flow doesn't like mixed types\n return typeof action === 'function' ? action(state) : action;\n }\n function useState(initialState) {\n {\n currentHookNameInDev = 'useState';\n }\n return useReducer(basicStateReducer,\n // useReducer has a special case to support lazy useState initializers\n initialState);\n }\n function useReducer(reducer, initialArg, init) {\n {\n if (reducer !== basicStateReducer) {\n currentHookNameInDev = 'useReducer';\n }\n }\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n if (isReRender) {\n // This is a re-render. Apply the new render phase updates to the previous\n // current hook.\n var queue = workInProgressHook.queue;\n var dispatch = queue.dispatch;\n if (renderPhaseUpdates !== null) {\n // Render phase updates are stored in a map of queue -> linked list\n var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);\n if (firstRenderPhaseUpdate !== undefined) {\n renderPhaseUpdates.delete(queue);\n var newState = workInProgressHook.memoizedState;\n var update = firstRenderPhaseUpdate;\n do {\n // Process this render phase update. We don't have to check the\n // priority because it will always be the same as the current\n // render's.\n var action = update.action;\n {\n isInHookUserCodeInDev = true;\n }\n newState = reducer(newState, action);\n {\n isInHookUserCodeInDev = false;\n }\n update = update.next;\n } while (update !== null);\n workInProgressHook.memoizedState = newState;\n return [newState, dispatch];\n }\n }\n return [workInProgressHook.memoizedState, dispatch];\n } else {\n {\n isInHookUserCodeInDev = true;\n }\n var initialState;\n if (reducer === basicStateReducer) {\n // Special case for `useState`.\n initialState = typeof initialArg === 'function' ? initialArg() : initialArg;\n } else {\n initialState = init !== undefined ? init(initialArg) : initialArg;\n }\n {\n isInHookUserCodeInDev = false;\n }\n workInProgressHook.memoizedState = initialState;\n var _queue = workInProgressHook.queue = {\n last: null,\n dispatch: null\n };\n var _dispatch = _queue.dispatch = dispatchAction.bind(null, currentlyRenderingComponent, _queue);\n return [workInProgressHook.memoizedState, _dispatch];\n }\n }\n function useMemo(nextCreate, deps) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var nextDeps = deps === undefined ? null : deps;\n if (workInProgressHook !== null) {\n var prevState = workInProgressHook.memoizedState;\n if (prevState !== null) {\n if (nextDeps !== null) {\n var prevDeps = prevState[1];\n if (areHookInputsEqual(nextDeps, prevDeps)) {\n return prevState[0];\n }\n }\n }\n }\n {\n isInHookUserCodeInDev = true;\n }\n var nextValue = nextCreate();\n {\n isInHookUserCodeInDev = false;\n }\n workInProgressHook.memoizedState = [nextValue, nextDeps];\n return nextValue;\n }\n function useRef(initialValue) {\n currentlyRenderingComponent = resolveCurrentlyRenderingComponent();\n workInProgressHook = createWorkInProgressHook();\n var previousRef = workInProgressHook.memoizedState;\n if (previousRef === null) {\n var ref = {\n current: initialValue\n };\n {\n Object.seal(ref);\n }\n workInProgressHook.memoizedState = ref;\n return ref;\n } else {\n return previousRef;\n }\n }\n function useLayoutEffect(create, inputs) {\n {\n currentHookNameInDev = 'useLayoutEffect';\n error('useLayoutEffect does nothing on the server, because its effect cannot ' + \"be encoded into the server renderer's output format. This will lead \" + 'to a mismatch between the initial, non-hydrated UI and the intended ' + 'UI. To avoid this, useLayoutEffect should only be used in ' + 'components that render exclusively on the client. ' + 'See https://reactjs.org/link/uselayouteffect-ssr for common fixes.');\n }\n }\n function dispatchAction(componentIdentity, queue, action) {\n if (!(numberOfReRenders < RE_RENDER_LIMIT)) {\n {\n throw Error(\"Too many re-renders. React limits the number of renders to prevent an infinite loop.\");\n }\n }\n if (componentIdentity === currentlyRenderingComponent) {\n // This is a render phase update. Stash it in a lazily-created map of\n // queue -> linked list of updates. After this render pass, we'll restart\n // and apply the stashed updates on top of the work-in-progress hook.\n didScheduleRenderPhaseUpdate = true;\n var update = {\n action: action,\n next: null\n };\n if (renderPhaseUpdates === null) {\n renderPhaseUpdates = new Map();\n }\n var firstRenderPhaseUpdate = renderPhaseUpdates.get(queue);\n if (firstRenderPhaseUpdate === undefined) {\n renderPhaseUpdates.set(queue, update);\n } else {\n // Append the update to the end of the list.\n var lastRenderPhaseUpdate = firstRenderPhaseUpdate;\n while (lastRenderPhaseUpdate.next !== null) {\n lastRenderPhaseUpdate = lastRenderPhaseUpdate.next;\n }\n lastRenderPhaseUpdate.next = update;\n }\n }\n }\n function useCallback(callback, deps) {\n return useMemo(function () {\n return callback;\n }, deps);\n } // TODO Decide on how to implement this hook for server rendering.\n // If a mutation occurs during render, consider triggering a Suspense boundary\n // and falling back to client rendering.\n\n function useMutableSource(source, getSnapshot, subscribe) {\n resolveCurrentlyRenderingComponent();\n return getSnapshot(source._source);\n }\n function useDeferredValue(value) {\n resolveCurrentlyRenderingComponent();\n return value;\n }\n function useTransition() {\n resolveCurrentlyRenderingComponent();\n var startTransition = function (callback) {\n callback();\n };\n return [startTransition, false];\n }\n function useOpaqueIdentifier() {\n return (currentPartialRenderer.identifierPrefix || '') + 'R:' + (currentPartialRenderer.uniqueID++).toString(36);\n }\n function noop() {}\n var currentPartialRenderer = null;\n function setCurrentPartialRenderer(renderer) {\n currentPartialRenderer = renderer;\n }\n var Dispatcher = {\n readContext: readContext,\n useContext: useContext,\n useMemo: useMemo,\n useReducer: useReducer,\n useRef: useRef,\n useState: useState,\n useLayoutEffect: useLayoutEffect,\n useCallback: useCallback,\n // useImperativeHandle is not run in the server environment\n useImperativeHandle: noop,\n // Effects are not run in the server environment.\n useEffect: noop,\n // Debugging effect\n useDebugValue: noop,\n useDeferredValue: useDeferredValue,\n useTransition: useTransition,\n useOpaqueIdentifier: useOpaqueIdentifier,\n // Subscriptions are not setup in a server environment.\n useMutableSource: useMutableSource\n };\n var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n var SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n var Namespaces = {\n html: HTML_NAMESPACE,\n mathml: MATH_NAMESPACE,\n svg: SVG_NAMESPACE\n }; // Assumes there is no parent namespace.\n\n function getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n case 'math':\n return MATH_NAMESPACE;\n default:\n return HTML_NAMESPACE;\n }\n }\n function getChildNamespace(parentNamespace, type) {\n if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) {\n // No (or default) parent namespace: potential entry point.\n return getIntrinsicNamespace(type);\n }\n if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n // We're leaving SVG.\n return HTML_NAMESPACE;\n } // By default, pass namespace below.\n\n return parentNamespace;\n }\n var hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n };\n function checkControlledValueProps(tagName, props) {\n {\n if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) {\n error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) {\n error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n }\n }\n\n // For HTML, certain tags should omit their close tag. We keep a list for\n // those special-case tags.\n var omittedCloseTags = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n };\n\n // `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\n var voidElementTags = _assign({\n menuitem: true\n }, omittedCloseTags);\n var HTML = '__html';\n function assertValidProps(tag, props) {\n if (!props) {\n return;\n } // Note the use of `==` which checks for null or undefined.\n\n if (voidElementTags[tag]) {\n if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n {\n throw Error(tag + \" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\");\n }\n }\n }\n if (props.dangerouslySetInnerHTML != null) {\n if (!(props.children == null)) {\n {\n throw Error(\"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\");\n }\n }\n if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML in props.dangerouslySetInnerHTML)) {\n {\n throw Error(\"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://reactjs.org/link/dangerously-set-inner-html for more information.\");\n }\n }\n }\n {\n if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) {\n error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.');\n }\n }\n if (!(props.style == null || typeof props.style === 'object')) {\n {\n throw Error(\"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\");\n }\n }\n }\n\n /**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\n var isUnitlessNumber = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridArea: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n };\n /**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\n\n function prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n }\n /**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\n\n var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n // infinite loop, because it iterates over the newly added props too.\n\n Object.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n });\n\n /**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\n function dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n if (isEmpty) {\n return '';\n }\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n return ('' + value).trim();\n }\n var uppercasePattern = /([A-Z])/g;\n var msPattern = /^ms-/;\n /**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\n\n function hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n }\n function isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return typeof props.is === 'string';\n }\n switch (tagName) {\n // These are reserved SVG and MathML elements.\n // We don't mind this list too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n default:\n return true;\n }\n }\n var warnValidStyle = function () {};\n {\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern$1 = /^-ms-/;\n var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n\n var badStyleValueWithSemicolonPattern = /;\\s*$/;\n var warnedStyleNames = {};\n var warnedStyleValues = {};\n var warnedForNaNValue = false;\n var warnedForInfinityValue = false;\n var camelize = function (string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n var warnHyphenatedStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n warnedStyleNames[name] = true;\n error('Unsupported style property %s. Did you mean %s?', name,\n // As Andi Smith suggests\n // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n // is converted to lowercase `ms`.\n camelize(name.replace(msPattern$1, 'ms-')));\n };\n var warnBadVendoredStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n warnedStyleNames[name] = true;\n error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n };\n var warnStyleValueWithSemicolon = function (name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n warnedStyleValues[value] = true;\n error(\"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n var warnStyleValueIsNaN = function (name, value) {\n if (warnedForNaNValue) {\n return;\n }\n warnedForNaNValue = true;\n error('`NaN` is an invalid value for the `%s` css style property.', name);\n };\n var warnStyleValueIsInfinity = function (name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n warnedForInfinityValue = true;\n error('`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n warnValidStyle = function (name, value) {\n if (name.indexOf('-') > -1) {\n warnHyphenatedStyleName(name);\n } else if (badVendoredStyleNamePattern.test(name)) {\n warnBadVendoredStyleName(name);\n } else if (badStyleValueWithSemicolonPattern.test(value)) {\n warnStyleValueWithSemicolon(name, value);\n }\n if (typeof value === 'number') {\n if (isNaN(value)) {\n warnStyleValueIsNaN(name, value);\n } else if (!isFinite(value)) {\n warnStyleValueIsInfinity(name, value);\n }\n }\n };\n }\n var warnValidStyle$1 = warnValidStyle;\n var ariaProperties = {\n 'aria-current': 0,\n // state\n 'aria-details': 0,\n 'aria-disabled': 0,\n // state\n 'aria-hidden': 0,\n // state\n 'aria-invalid': 0,\n // state\n 'aria-keyshortcuts': 0,\n 'aria-label': 0,\n 'aria-roledescription': 0,\n // Widget Attributes\n 'aria-autocomplete': 0,\n 'aria-checked': 0,\n 'aria-expanded': 0,\n 'aria-haspopup': 0,\n 'aria-level': 0,\n 'aria-modal': 0,\n 'aria-multiline': 0,\n 'aria-multiselectable': 0,\n 'aria-orientation': 0,\n 'aria-placeholder': 0,\n 'aria-pressed': 0,\n 'aria-readonly': 0,\n 'aria-required': 0,\n 'aria-selected': 0,\n 'aria-sort': 0,\n 'aria-valuemax': 0,\n 'aria-valuemin': 0,\n 'aria-valuenow': 0,\n 'aria-valuetext': 0,\n // Live Region Attributes\n 'aria-atomic': 0,\n 'aria-busy': 0,\n 'aria-live': 0,\n 'aria-relevant': 0,\n // Drag-and-Drop Attributes\n 'aria-dropeffect': 0,\n 'aria-grabbed': 0,\n // Relationship Attributes\n 'aria-activedescendant': 0,\n 'aria-colcount': 0,\n 'aria-colindex': 0,\n 'aria-colspan': 0,\n 'aria-controls': 0,\n 'aria-describedby': 0,\n 'aria-errormessage': 0,\n 'aria-flowto': 0,\n 'aria-labelledby': 0,\n 'aria-owns': 0,\n 'aria-posinset': 0,\n 'aria-rowcount': 0,\n 'aria-rowindex': 0,\n 'aria-rowspan': 0,\n 'aria-setsize': 0\n };\n var warnedProperties = {};\n var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n var hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n function validateProperty(tagName, name) {\n {\n if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {\n return true;\n }\n if (rARIACamel.test(name)) {\n var ariaName = 'aria-' + name.slice(4).toLowerCase();\n var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (correctName == null) {\n error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n warnedProperties[name] = true;\n return true;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n if (name !== correctName) {\n error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);\n warnedProperties[name] = true;\n return true;\n }\n }\n if (rARIA.test(name)) {\n var lowerCasedName = name.toLowerCase();\n var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (standardName == null) {\n warnedProperties[name] = true;\n return false;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n if (name !== standardName) {\n error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties[name] = true;\n return true;\n }\n }\n }\n return true;\n }\n function warnInvalidARIAProps(type, props) {\n {\n var invalidProps = [];\n for (var key in props) {\n var isValid = validateProperty(type, key);\n if (!isValid) {\n invalidProps.push(key);\n }\n }\n var unknownPropString = invalidProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n if (invalidProps.length === 1) {\n error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type);\n }\n }\n }\n function validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n warnInvalidARIAProps(type, props);\n }\n var didWarnValueNull = false;\n function validateProperties$1(type, props) {\n {\n if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n return;\n }\n if (props != null && props.value === null && !didWarnValueNull) {\n didWarnValueNull = true;\n if (type === 'select' && props.multiple) {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);\n } else {\n error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);\n }\n }\n }\n }\n\n // When adding attributes to the HTML or SVG allowed attribute list, be sure to\n // also add them to this module to ensure casing and incorrect name\n // warnings.\n var possibleStandardNames = {\n // HTML\n accept: 'accept',\n acceptcharset: 'acceptCharset',\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n action: 'action',\n allowfullscreen: 'allowFullScreen',\n alt: 'alt',\n as: 'as',\n async: 'async',\n autocapitalize: 'autoCapitalize',\n autocomplete: 'autoComplete',\n autocorrect: 'autoCorrect',\n autofocus: 'autoFocus',\n autoplay: 'autoPlay',\n autosave: 'autoSave',\n capture: 'capture',\n cellpadding: 'cellPadding',\n cellspacing: 'cellSpacing',\n challenge: 'challenge',\n charset: 'charSet',\n checked: 'checked',\n children: 'children',\n cite: 'cite',\n class: 'className',\n classid: 'classID',\n classname: 'className',\n cols: 'cols',\n colspan: 'colSpan',\n content: 'content',\n contenteditable: 'contentEditable',\n contextmenu: 'contextMenu',\n controls: 'controls',\n controlslist: 'controlsList',\n coords: 'coords',\n crossorigin: 'crossOrigin',\n dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n data: 'data',\n datetime: 'dateTime',\n default: 'default',\n defaultchecked: 'defaultChecked',\n defaultvalue: 'defaultValue',\n defer: 'defer',\n dir: 'dir',\n disabled: 'disabled',\n disablepictureinpicture: 'disablePictureInPicture',\n disableremoteplayback: 'disableRemotePlayback',\n download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\n enterkeyhint: 'enterKeyHint',\n for: 'htmlFor',\n form: 'form',\n formmethod: 'formMethod',\n formaction: 'formAction',\n formenctype: 'formEncType',\n formnovalidate: 'formNoValidate',\n formtarget: 'formTarget',\n frameborder: 'frameBorder',\n headers: 'headers',\n height: 'height',\n hidden: 'hidden',\n high: 'high',\n href: 'href',\n hreflang: 'hrefLang',\n htmlfor: 'htmlFor',\n httpequiv: 'httpEquiv',\n 'http-equiv': 'httpEquiv',\n icon: 'icon',\n id: 'id',\n innerhtml: 'innerHTML',\n inputmode: 'inputMode',\n integrity: 'integrity',\n is: 'is',\n itemid: 'itemID',\n itemprop: 'itemProp',\n itemref: 'itemRef',\n itemscope: 'itemScope',\n itemtype: 'itemType',\n keyparams: 'keyParams',\n keytype: 'keyType',\n kind: 'kind',\n label: 'label',\n lang: 'lang',\n list: 'list',\n loop: 'loop',\n low: 'low',\n manifest: 'manifest',\n marginwidth: 'marginWidth',\n marginheight: 'marginHeight',\n max: 'max',\n maxlength: 'maxLength',\n media: 'media',\n mediagroup: 'mediaGroup',\n method: 'method',\n min: 'min',\n minlength: 'minLength',\n multiple: 'multiple',\n muted: 'muted',\n name: 'name',\n nomodule: 'noModule',\n nonce: 'nonce',\n novalidate: 'noValidate',\n open: 'open',\n optimum: 'optimum',\n pattern: 'pattern',\n placeholder: 'placeholder',\n playsinline: 'playsInline',\n poster: 'poster',\n preload: 'preload',\n profile: 'profile',\n radiogroup: 'radioGroup',\n readonly: 'readOnly',\n referrerpolicy: 'referrerPolicy',\n rel: 'rel',\n required: 'required',\n reversed: 'reversed',\n role: 'role',\n rows: 'rows',\n rowspan: 'rowSpan',\n sandbox: 'sandbox',\n scope: 'scope',\n scoped: 'scoped',\n scrolling: 'scrolling',\n seamless: 'seamless',\n selected: 'selected',\n shape: 'shape',\n size: 'size',\n sizes: 'sizes',\n span: 'span',\n spellcheck: 'spellCheck',\n src: 'src',\n srcdoc: 'srcDoc',\n srclang: 'srcLang',\n srcset: 'srcSet',\n start: 'start',\n step: 'step',\n style: 'style',\n summary: 'summary',\n tabindex: 'tabIndex',\n target: 'target',\n title: 'title',\n type: 'type',\n usemap: 'useMap',\n value: 'value',\n width: 'width',\n wmode: 'wmode',\n wrap: 'wrap',\n // SVG\n about: 'about',\n accentheight: 'accentHeight',\n 'accent-height': 'accentHeight',\n accumulate: 'accumulate',\n additive: 'additive',\n alignmentbaseline: 'alignmentBaseline',\n 'alignment-baseline': 'alignmentBaseline',\n allowreorder: 'allowReorder',\n alphabetic: 'alphabetic',\n amplitude: 'amplitude',\n arabicform: 'arabicForm',\n 'arabic-form': 'arabicForm',\n ascent: 'ascent',\n attributename: 'attributeName',\n attributetype: 'attributeType',\n autoreverse: 'autoReverse',\n azimuth: 'azimuth',\n basefrequency: 'baseFrequency',\n baselineshift: 'baselineShift',\n 'baseline-shift': 'baselineShift',\n baseprofile: 'baseProfile',\n bbox: 'bbox',\n begin: 'begin',\n bias: 'bias',\n by: 'by',\n calcmode: 'calcMode',\n capheight: 'capHeight',\n 'cap-height': 'capHeight',\n clip: 'clip',\n clippath: 'clipPath',\n 'clip-path': 'clipPath',\n clippathunits: 'clipPathUnits',\n cliprule: 'clipRule',\n 'clip-rule': 'clipRule',\n color: 'color',\n colorinterpolation: 'colorInterpolation',\n 'color-interpolation': 'colorInterpolation',\n colorinterpolationfilters: 'colorInterpolationFilters',\n 'color-interpolation-filters': 'colorInterpolationFilters',\n colorprofile: 'colorProfile',\n 'color-profile': 'colorProfile',\n colorrendering: 'colorRendering',\n 'color-rendering': 'colorRendering',\n contentscripttype: 'contentScriptType',\n contentstyletype: 'contentStyleType',\n cursor: 'cursor',\n cx: 'cx',\n cy: 'cy',\n d: 'd',\n datatype: 'datatype',\n decelerate: 'decelerate',\n descent: 'descent',\n diffuseconstant: 'diffuseConstant',\n direction: 'direction',\n display: 'display',\n divisor: 'divisor',\n dominantbaseline: 'dominantBaseline',\n 'dominant-baseline': 'dominantBaseline',\n dur: 'dur',\n dx: 'dx',\n dy: 'dy',\n edgemode: 'edgeMode',\n elevation: 'elevation',\n enablebackground: 'enableBackground',\n 'enable-background': 'enableBackground',\n end: 'end',\n exponent: 'exponent',\n externalresourcesrequired: 'externalResourcesRequired',\n fill: 'fill',\n fillopacity: 'fillOpacity',\n 'fill-opacity': 'fillOpacity',\n fillrule: 'fillRule',\n 'fill-rule': 'fillRule',\n filter: 'filter',\n filterres: 'filterRes',\n filterunits: 'filterUnits',\n floodopacity: 'floodOpacity',\n 'flood-opacity': 'floodOpacity',\n floodcolor: 'floodColor',\n 'flood-color': 'floodColor',\n focusable: 'focusable',\n fontfamily: 'fontFamily',\n 'font-family': 'fontFamily',\n fontsize: 'fontSize',\n 'font-size': 'fontSize',\n fontsizeadjust: 'fontSizeAdjust',\n 'font-size-adjust': 'fontSizeAdjust',\n fontstretch: 'fontStretch',\n 'font-stretch': 'fontStretch',\n fontstyle: 'fontStyle',\n 'font-style': 'fontStyle',\n fontvariant: 'fontVariant',\n 'font-variant': 'fontVariant',\n fontweight: 'fontWeight',\n 'font-weight': 'fontWeight',\n format: 'format',\n from: 'from',\n fx: 'fx',\n fy: 'fy',\n g1: 'g1',\n g2: 'g2',\n glyphname: 'glyphName',\n 'glyph-name': 'glyphName',\n glyphorientationhorizontal: 'glyphOrientationHorizontal',\n 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n glyphorientationvertical: 'glyphOrientationVertical',\n 'glyph-orientation-vertical': 'glyphOrientationVertical',\n glyphref: 'glyphRef',\n gradienttransform: 'gradientTransform',\n gradientunits: 'gradientUnits',\n hanging: 'hanging',\n horizadvx: 'horizAdvX',\n 'horiz-adv-x': 'horizAdvX',\n horizoriginx: 'horizOriginX',\n 'horiz-origin-x': 'horizOriginX',\n ideographic: 'ideographic',\n imagerendering: 'imageRendering',\n 'image-rendering': 'imageRendering',\n in2: 'in2',\n in: 'in',\n inlist: 'inlist',\n intercept: 'intercept',\n k1: 'k1',\n k2: 'k2',\n k3: 'k3',\n k4: 'k4',\n k: 'k',\n kernelmatrix: 'kernelMatrix',\n kernelunitlength: 'kernelUnitLength',\n kerning: 'kerning',\n keypoints: 'keyPoints',\n keysplines: 'keySplines',\n keytimes: 'keyTimes',\n lengthadjust: 'lengthAdjust',\n letterspacing: 'letterSpacing',\n 'letter-spacing': 'letterSpacing',\n lightingcolor: 'lightingColor',\n 'lighting-color': 'lightingColor',\n limitingconeangle: 'limitingConeAngle',\n local: 'local',\n markerend: 'markerEnd',\n 'marker-end': 'markerEnd',\n markerheight: 'markerHeight',\n markermid: 'markerMid',\n 'marker-mid': 'markerMid',\n markerstart: 'markerStart',\n 'marker-start': 'markerStart',\n markerunits: 'markerUnits',\n markerwidth: 'markerWidth',\n mask: 'mask',\n maskcontentunits: 'maskContentUnits',\n maskunits: 'maskUnits',\n mathematical: 'mathematical',\n mode: 'mode',\n numoctaves: 'numOctaves',\n offset: 'offset',\n opacity: 'opacity',\n operator: 'operator',\n order: 'order',\n orient: 'orient',\n orientation: 'orientation',\n origin: 'origin',\n overflow: 'overflow',\n overlineposition: 'overlinePosition',\n 'overline-position': 'overlinePosition',\n overlinethickness: 'overlineThickness',\n 'overline-thickness': 'overlineThickness',\n paintorder: 'paintOrder',\n 'paint-order': 'paintOrder',\n panose1: 'panose1',\n 'panose-1': 'panose1',\n pathlength: 'pathLength',\n patterncontentunits: 'patternContentUnits',\n patterntransform: 'patternTransform',\n patternunits: 'patternUnits',\n pointerevents: 'pointerEvents',\n 'pointer-events': 'pointerEvents',\n points: 'points',\n pointsatx: 'pointsAtX',\n pointsaty: 'pointsAtY',\n pointsatz: 'pointsAtZ',\n prefix: 'prefix',\n preservealpha: 'preserveAlpha',\n preserveaspectratio: 'preserveAspectRatio',\n primitiveunits: 'primitiveUnits',\n property: 'property',\n r: 'r',\n radius: 'radius',\n refx: 'refX',\n refy: 'refY',\n renderingintent: 'renderingIntent',\n 'rendering-intent': 'renderingIntent',\n repeatcount: 'repeatCount',\n repeatdur: 'repeatDur',\n requiredextensions: 'requiredExtensions',\n requiredfeatures: 'requiredFeatures',\n resource: 'resource',\n restart: 'restart',\n result: 'result',\n results: 'results',\n rotate: 'rotate',\n rx: 'rx',\n ry: 'ry',\n scale: 'scale',\n security: 'security',\n seed: 'seed',\n shaperendering: 'shapeRendering',\n 'shape-rendering': 'shapeRendering',\n slope: 'slope',\n spacing: 'spacing',\n specularconstant: 'specularConstant',\n specularexponent: 'specularExponent',\n speed: 'speed',\n spreadmethod: 'spreadMethod',\n startoffset: 'startOffset',\n stddeviation: 'stdDeviation',\n stemh: 'stemh',\n stemv: 'stemv',\n stitchtiles: 'stitchTiles',\n stopcolor: 'stopColor',\n 'stop-color': 'stopColor',\n stopopacity: 'stopOpacity',\n 'stop-opacity': 'stopOpacity',\n strikethroughposition: 'strikethroughPosition',\n 'strikethrough-position': 'strikethroughPosition',\n strikethroughthickness: 'strikethroughThickness',\n 'strikethrough-thickness': 'strikethroughThickness',\n string: 'string',\n stroke: 'stroke',\n strokedasharray: 'strokeDasharray',\n 'stroke-dasharray': 'strokeDasharray',\n strokedashoffset: 'strokeDashoffset',\n 'stroke-dashoffset': 'strokeDashoffset',\n strokelinecap: 'strokeLinecap',\n 'stroke-linecap': 'strokeLinecap',\n strokelinejoin: 'strokeLinejoin',\n 'stroke-linejoin': 'strokeLinejoin',\n strokemiterlimit: 'strokeMiterlimit',\n 'stroke-miterlimit': 'strokeMiterlimit',\n strokewidth: 'strokeWidth',\n 'stroke-width': 'strokeWidth',\n strokeopacity: 'strokeOpacity',\n 'stroke-opacity': 'strokeOpacity',\n suppresscontenteditablewarning: 'suppressContentEditableWarning',\n suppresshydrationwarning: 'suppressHydrationWarning',\n surfacescale: 'surfaceScale',\n systemlanguage: 'systemLanguage',\n tablevalues: 'tableValues',\n targetx: 'targetX',\n targety: 'targetY',\n textanchor: 'textAnchor',\n 'text-anchor': 'textAnchor',\n textdecoration: 'textDecoration',\n 'text-decoration': 'textDecoration',\n textlength: 'textLength',\n textrendering: 'textRendering',\n 'text-rendering': 'textRendering',\n to: 'to',\n transform: 'transform',\n typeof: 'typeof',\n u1: 'u1',\n u2: 'u2',\n underlineposition: 'underlinePosition',\n 'underline-position': 'underlinePosition',\n underlinethickness: 'underlineThickness',\n 'underline-thickness': 'underlineThickness',\n unicode: 'unicode',\n unicodebidi: 'unicodeBidi',\n 'unicode-bidi': 'unicodeBidi',\n unicoderange: 'unicodeRange',\n 'unicode-range': 'unicodeRange',\n unitsperem: 'unitsPerEm',\n 'units-per-em': 'unitsPerEm',\n unselectable: 'unselectable',\n valphabetic: 'vAlphabetic',\n 'v-alphabetic': 'vAlphabetic',\n values: 'values',\n vectoreffect: 'vectorEffect',\n 'vector-effect': 'vectorEffect',\n version: 'version',\n vertadvy: 'vertAdvY',\n 'vert-adv-y': 'vertAdvY',\n vertoriginx: 'vertOriginX',\n 'vert-origin-x': 'vertOriginX',\n vertoriginy: 'vertOriginY',\n 'vert-origin-y': 'vertOriginY',\n vhanging: 'vHanging',\n 'v-hanging': 'vHanging',\n videographic: 'vIdeographic',\n 'v-ideographic': 'vIdeographic',\n viewbox: 'viewBox',\n viewtarget: 'viewTarget',\n visibility: 'visibility',\n vmathematical: 'vMathematical',\n 'v-mathematical': 'vMathematical',\n vocab: 'vocab',\n widths: 'widths',\n wordspacing: 'wordSpacing',\n 'word-spacing': 'wordSpacing',\n writingmode: 'writingMode',\n 'writing-mode': 'writingMode',\n x1: 'x1',\n x2: 'x2',\n x: 'x',\n xchannelselector: 'xChannelSelector',\n xheight: 'xHeight',\n 'x-height': 'xHeight',\n xlinkactuate: 'xlinkActuate',\n 'xlink:actuate': 'xlinkActuate',\n xlinkarcrole: 'xlinkArcrole',\n 'xlink:arcrole': 'xlinkArcrole',\n xlinkhref: 'xlinkHref',\n 'xlink:href': 'xlinkHref',\n xlinkrole: 'xlinkRole',\n 'xlink:role': 'xlinkRole',\n xlinkshow: 'xlinkShow',\n 'xlink:show': 'xlinkShow',\n xlinktitle: 'xlinkTitle',\n 'xlink:title': 'xlinkTitle',\n xlinktype: 'xlinkType',\n 'xlink:type': 'xlinkType',\n xmlbase: 'xmlBase',\n 'xml:base': 'xmlBase',\n xmllang: 'xmlLang',\n 'xml:lang': 'xmlLang',\n xmlns: 'xmlns',\n 'xml:space': 'xmlSpace',\n xmlnsxlink: 'xmlnsXlink',\n 'xmlns:xlink': 'xmlnsXlink',\n xmlspace: 'xmlSpace',\n y1: 'y1',\n y2: 'y2',\n y: 'y',\n ychannelselector: 'yChannelSelector',\n z: 'z',\n zoomandpan: 'zoomAndPan'\n };\n var validateProperty$1 = function () {};\n {\n var warnedProperties$1 = {};\n var _hasOwnProperty = Object.prototype.hasOwnProperty;\n var EVENT_NAME_REGEX = /^on./;\n var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n validateProperty$1 = function (tagName, name, value, eventRegistry) {\n if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n return true;\n }\n var lowerCasedName = name.toLowerCase();\n if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n warnedProperties$1[name] = true;\n return true;\n } // We can't rely on the event system being injected on the server.\n\n if (eventRegistry != null) {\n var registrationNameDependencies = eventRegistry.registrationNameDependencies,\n possibleRegistrationNames = eventRegistry.possibleRegistrationNames;\n if (registrationNameDependencies.hasOwnProperty(name)) {\n return true;\n }\n var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n if (registrationName != null) {\n error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);\n warnedProperties$1[name] = true;\n return true;\n }\n if (EVENT_NAME_REGEX.test(name)) {\n error('Unknown event handler property `%s`. It will be ignored.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (EVENT_NAME_REGEX.test(name)) {\n // If no event plugins have been injected, we are in a server environment.\n // So we can't tell if the event name is correct for sure, but we can filter\n // out known bad ones like `onclick`. We can't suggest a specific replacement though.\n if (INVALID_EVENT_NAME_REGEX.test(name)) {\n error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);\n }\n warnedProperties$1[name] = true;\n return true;\n } // Let the ARIA attribute hook validate ARIA attributes\n\n if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n return true;\n }\n if (lowerCasedName === 'innerhtml') {\n error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n warnedProperties$1[name] = true;\n return true;\n }\n if (lowerCasedName === 'aria') {\n error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n warnedProperties$1[name] = true;\n return true;\n }\n if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);\n warnedProperties$1[name] = true;\n return true;\n }\n if (typeof value === 'number' && isNaN(value)) {\n error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n var propertyInfo = getPropertyInfo(name);\n var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n\n if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n var standardName = possibleStandardNames[lowerCasedName];\n if (standardName !== name) {\n error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (!isReserved && name !== lowerCasedName) {\n // Unknown attributes should have lowercase casing since that's how they\n // will be cased anyway with server rendering.\n error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n warnedProperties$1[name] = true;\n return true;\n }\n if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n if (value) {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.', value, name, name, value, name);\n } else {\n error('Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n }\n warnedProperties$1[name] = true;\n return true;\n } // Now that we've validated casing, do not validate\n // data types for reserved props\n\n if (isReserved) {\n return true;\n } // Warn when a known attribute is a bad type\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n warnedProperties$1[name] = true;\n return false;\n } // Warn when passing the strings 'false' or 'true' into a boolean prop\n\n if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \"false\".', name, value);\n warnedProperties$1[name] = true;\n return true;\n }\n return true;\n };\n }\n var warnUnknownProperties = function (type, props, eventRegistry) {\n {\n var unknownProps = [];\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], eventRegistry);\n if (!isValid) {\n unknownProps.push(key);\n }\n }\n var unknownPropString = unknownProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n if (unknownProps.length === 1) {\n error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n } else if (unknownProps.length > 1) {\n error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type);\n }\n }\n };\n function validateProperties$2(type, props, eventRegistry) {\n if (isCustomComponent(type, props)) {\n return;\n }\n warnUnknownProperties(type, props, eventRegistry);\n }\n var toArray = React.Children.toArray; // This is only used in DEV.\n // Each entry is `this.stack` from a currently executing renderer instance.\n // (There may be more than one because ReactDOMServer is reentrant).\n // Each stack is an array of frames which may contain nested stacks of elements.\n\n var currentDebugStacks = [];\n var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\n var ReactDebugCurrentFrame$1;\n var prevGetCurrentStackImpl = null;\n var getCurrentServerStackImpl = function () {\n return '';\n };\n var describeStackFrame = function (element) {\n return '';\n };\n var validatePropertiesInDevelopment = function (type, props) {};\n var pushCurrentDebugStack = function (stack) {};\n var pushElementToDebugStack = function (element) {};\n var popCurrentDebugStack = function () {};\n var hasWarnedAboutUsingContextAsConsumer = false;\n {\n ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n validatePropertiesInDevelopment = function (type, props) {\n validateProperties(type, props);\n validateProperties$1(type, props);\n validateProperties$2(type, props, null);\n };\n describeStackFrame = function (element) {\n return describeUnknownElementTypeFrameInDEV(element.type, element._source, null);\n };\n pushCurrentDebugStack = function (stack) {\n currentDebugStacks.push(stack);\n if (currentDebugStacks.length === 1) {\n // We are entering a server renderer.\n // Remember the previous (e.g. client) global stack implementation.\n prevGetCurrentStackImpl = ReactDebugCurrentFrame$1.getCurrentStack;\n ReactDebugCurrentFrame$1.getCurrentStack = getCurrentServerStackImpl;\n }\n };\n pushElementToDebugStack = function (element) {\n // For the innermost executing ReactDOMServer call,\n var stack = currentDebugStacks[currentDebugStacks.length - 1]; // Take the innermost executing frame (e.g. ),\n\n var frame = stack[stack.length - 1]; // and record that it has one more element associated with it.\n\n frame.debugElementStack.push(element); // We only need this because we tail-optimize single-element\n // children and directly handle them in an inner loop instead of\n // creating separate frames for them.\n };\n popCurrentDebugStack = function () {\n currentDebugStacks.pop();\n if (currentDebugStacks.length === 0) {\n // We are exiting the server renderer.\n // Restore the previous (e.g. client) global stack implementation.\n ReactDebugCurrentFrame$1.getCurrentStack = prevGetCurrentStackImpl;\n prevGetCurrentStackImpl = null;\n }\n };\n getCurrentServerStackImpl = function () {\n if (currentDebugStacks.length === 0) {\n // Nothing is currently rendering.\n return '';\n } // ReactDOMServer is reentrant so there may be multiple calls at the same time.\n // Take the frames from the innermost call which is the last in the array.\n\n var frames = currentDebugStacks[currentDebugStacks.length - 1];\n var stack = ''; // Go through every frame in the stack from the innermost one.\n\n for (var i = frames.length - 1; i >= 0; i--) {\n var frame = frames[i]; // Every frame might have more than one debug element stack entry associated with it.\n // This is because single-child nesting doesn't create materialized frames.\n // Instead it would push them through `pushElementToDebugStack()`.\n\n var debugElementStack = frame.debugElementStack;\n for (var ii = debugElementStack.length - 1; ii >= 0; ii--) {\n stack += describeStackFrame(debugElementStack[ii]);\n }\n }\n return stack;\n };\n }\n var didWarnDefaultInputValue = false;\n var didWarnDefaultChecked = false;\n var didWarnDefaultSelectValue = false;\n var didWarnDefaultTextareaValue = false;\n var didWarnInvalidOptionChildren = false;\n var didWarnAboutNoopUpdateForComponent = {};\n var didWarnAboutBadClass = {};\n var didWarnAboutModulePatternComponent = {};\n var didWarnAboutDeprecatedWillMount = {};\n var didWarnAboutUndefinedDerivedState = {};\n var didWarnAboutUninitializedState = {};\n var valuePropNames = ['value', 'defaultValue'];\n var newlineEatingTags = {\n listing: true,\n pre: true,\n textarea: true\n }; // We accept any tag to be rendered but since this gets injected into arbitrary\n // HTML, we want to make sure that it's a safe tag.\n // http://www.w3.org/TR/REC-xml/#NT-Name\n\n var VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_\\.\\-\\d]*$/; // Simplified subset\n\n var validatedTagCache = {};\n function validateDangerousTag(tag) {\n if (!validatedTagCache.hasOwnProperty(tag)) {\n if (!VALID_TAG_REGEX.test(tag)) {\n {\n throw Error(\"Invalid tag: \" + tag);\n }\n }\n validatedTagCache[tag] = true;\n }\n }\n var styleNameCache = {};\n var processStyleName = function (styleName) {\n if (styleNameCache.hasOwnProperty(styleName)) {\n return styleNameCache[styleName];\n }\n var result = hyphenateStyleName(styleName);\n styleNameCache[styleName] = result;\n return result;\n };\n function createMarkupForStyles(styles) {\n var serialized = '';\n var delimiter = '';\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n var isCustomProperty = styleName.indexOf('--') === 0;\n var styleValue = styles[styleName];\n {\n if (!isCustomProperty) {\n warnValidStyle$1(styleName, styleValue);\n }\n }\n if (styleValue != null) {\n serialized += delimiter + (isCustomProperty ? styleName : processStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n return serialized || null;\n }\n function warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && getComponentName(_constructor) || 'ReactClass';\n var warningKey = componentName + '.' + callerName;\n if (didWarnAboutNoopUpdateForComponent[warningKey]) {\n return;\n }\n error('%s(...): Can only update a mounting component. ' + 'This usually means you called %s() outside componentWillMount() on the server. ' + 'This is a no-op.\\n\\nPlease check the code for the %s component.', callerName, callerName, componentName);\n didWarnAboutNoopUpdateForComponent[warningKey] = true;\n }\n }\n function shouldConstruct$1(Component) {\n return Component.prototype && Component.prototype.isReactComponent;\n }\n function getNonChildrenInnerMarkup(props) {\n var innerHTML = props.dangerouslySetInnerHTML;\n if (innerHTML != null) {\n if (innerHTML.__html != null) {\n return innerHTML.__html;\n }\n } else {\n var content = props.children;\n if (typeof content === 'string' || typeof content === 'number') {\n return escapeTextForBrowser(content);\n }\n }\n return null;\n }\n function flattenTopLevelChildren(children) {\n if (!React.isValidElement(children)) {\n return toArray(children);\n }\n var element = children;\n if (element.type !== REACT_FRAGMENT_TYPE) {\n return [element];\n }\n var fragmentChildren = element.props.children;\n if (!React.isValidElement(fragmentChildren)) {\n return toArray(fragmentChildren);\n }\n var fragmentChildElement = fragmentChildren;\n return [fragmentChildElement];\n }\n function flattenOptionChildren(children) {\n if (children === undefined || children === null) {\n return children;\n }\n var content = ''; // Flatten children and warn if they aren't strings or numbers;\n // invalid types are ignored.\n\n React.Children.forEach(children, function (child) {\n if (child == null) {\n return;\n }\n content += child;\n {\n if (!didWarnInvalidOptionChildren && typeof child !== 'string' && typeof child !== 'number') {\n didWarnInvalidOptionChildren = true;\n error('Only strings and numbers are supported as