();\n const [pagePath, setPagePath] = useState();\n const [requestId, setRequestId] = useState();\n const [resendCount, setResendCount] = useState(0);\n const [shouldEnable, setShouldEnable] = useState(false);\n\n const setResendEmailData = (rawData: string | null) => {\n try {\n const parsedData = JSON.parse(rawData || '{}');\n setCloudId(parsedData.cloudId);\n setCloudName(decodeURIComponent(parsedData.cloudName || ''));\n setEmail(decodeURIComponent(parsedData.email || ''));\n setPrimaryProduct(decodeURIComponent(parsedData.primaryProduct || ''));\n setPagePath(parsedData.pagePath);\n setRequestId(parsedData.requestId);\n setResendCount(parsedData.resendCount || 0);\n setShouldEnable(isValidData(parsedData));\n } catch (e) {\n setCloudId(undefined);\n setCloudName(undefined);\n setEmail(undefined);\n setPrimaryProduct(undefined);\n setPagePath(undefined);\n setRequestId(undefined);\n setResendCount(0);\n setShouldEnable(false);\n }\n };\n\n const isValidData = (data: ResendEmailData): boolean => {\n return Boolean(\n data.cloudId &&\n data.cloudName &&\n data.email &&\n data.pagePath &&\n data.requestId &&\n data.primaryProduct\n );\n };\n\n const incrementCount = () => {\n setResendCount(resendCount + 1);\n };\n\n useEffect(() => {\n const rawData = sessionStorage.getItem('r.e.d');\n\n if (rawData) {\n try {\n setResendEmailData(atob(rawData));\n } catch {\n setResendEmailData(null);\n }\n }\n }, []);\n\n // update all data in sessionStorage whenever it changes.\n useEffect(() => {\n const data: ResendEmailData = {\n cloudId,\n cloudName: encodeURIComponent(cloudName || ''),\n email: encodeURIComponent(email || ''),\n pagePath,\n requestId,\n resendCount,\n shouldEnable,\n primaryProduct\n };\n if (isValidData(data)) {\n sessionStorage.setItem('r.e.d', btoa(JSON.stringify(data)));\n }\n }, [\n cloudId,\n cloudName,\n email,\n pagePath,\n requestId,\n resendCount,\n primaryProduct\n ]);\n\n return [\n {\n cloudId,\n cloudName,\n email,\n pagePath,\n requestId,\n resendCount,\n shouldEnable,\n primaryProduct\n },\n incrementCount\n ];\n};\n\nexport default useResendEmailData;\n","import { defineMessages } from 'react-intl';\n\nconst ID_PREFIX = 'WacSignupForm.';\nexport const messages = defineMessages({\n buttonText: {\n id: `${ID_PREFIX}submitCouponLabel`,\n defaultMessage: 'Agree'\n },\n startButtonText: {\n id: `${ID_PREFIX}submitN2ELabel`,\n defaultMessage: 'Agree and Start now'\n },\n devopsButtonText: {\n id: `${ID_PREFIX}devopsButtonText`,\n defaultMessage: 'Sign up'\n },\n devopsStartButtonText: {\n id: `${ID_PREFIX}devopsStartButtonText`,\n defaultMessage: 'Sign up'\n },\n submitProcessingLabel: {\n id: `${ID_PREFIX}submitProcessingLabel`,\n defaultMessage: 'Starting...'\n },\n defaultWelcomeMessage: {\n id: `${ID_PREFIX}signupFormGreeting`,\n defaultMessage: 'Create your account'\n },\n personalizedWelcomeMessage: {\n id: `${ID_PREFIX}signupFormPersonalizedGreeting`,\n defaultMessage: 'Welcome back, {username}'\n },\n noCard: {\n id: `${ID_PREFIX}signupFormPostContent`,\n defaultMessage: 'NO CREDIT CARD REQUIRED'\n },\n eula: {\n id: `${ID_PREFIX}cloudEulaText`,\n defaultMessage:\n \"By clicking below, you agree to the Atlassian Cloud Terms of Service and Privacy Policy.
\"\n },\n eulaCompass: {\n id: `${ID_PREFIX}eulaCompass`,\n defaultMessage:\n \"By signing up for this Early Access Program (“EAP”), you agree to the Atlassian Cloud Terms of Service (“TOS”) and acknowledge the Atlassian Privacy Policy
\"\n },\n eulaCompassTooltip: {\n id: `${ID_PREFIX}eulaCompassTooltip`,\n defaultMessage:\n 'The EAP products are considered “Beta Versions”, as set forth in Section 14 of the TOS and are subject to applicable terms, conditions, and disclaimers. Atlassian will use the information you provide on this sign-up form to contact you about the EAP program, including updates to the program, feedback requests, and offers.
'\n },\n marketingConsent: {\n id: `${ID_PREFIX}marketingCommunicationsCheckboxSignupText`,\n defaultMessage: `Yes! I would like to receive promotional emails including product news, events and more from Atlassian and its affiliates.`\n },\n newSite: {\n id: `${ID_PREFIX}informMessageStartNewSiteSimplified`,\n defaultMessage: 'Start a new site'\n },\n createNewSite: {\n id: `${ID_PREFIX}createNewSite`,\n defaultMessage: 'Create a new site'\n },\n existingSite: {\n id: `${ID_PREFIX}existingSite`,\n defaultMessage: 'Use an existing site'\n },\n differentAcountSignin: {\n id: `${ID_PREFIX}informEmailLoggedInMsg`,\n defaultMessage:\n 'Sign in with a different Atlassian account
'\n },\n useDifferentAccountSignin: {\n id: `${ID_PREFIX}useDifferentAccountSignin`,\n defaultMessage:\n 'Use a different Atlassian account
'\n },\n developerMode: {\n id: `${ID_PREFIX}informMessageDeveloperWarning`,\n defaultMessage:\n 'You are signing up for a free development instance of Atlassian Cloud.
Free development instances are intended to be used for development and testing purposes only and has the usage limits noted below. Atlassian does not offer support for free development instances and reserves the right to delete such instances at any time without notice. Atlassian monitors the usage of such development instances and may cancel any instance being used in an unauthorized or unintended manner.
- Jira Software, Jira Core: 5 users free
- Jira Service Desk: 1 agent free
- Confluence: 5 users free
'\n },\n invalidMigrationSource: {\n id: `${ID_PREFIX}invalidMigrationSource`,\n defaultMessage:\n 'Invalid trial activation
It looks we weren\\'t able to activate your extended trial.
Check with the site administrator, or login to my.atlassian.com to confirm your activation link is complete and correct, and that you have an eligible server or data center license.
'\n },\n claimedMigrationSource: {\n id: `${ID_PREFIX}claimedMigrationSource`,\n defaultMessage:\n 'Your extended trial has already been activated
It looks like someone has already activated this trial.
Log in to my.atlassian.com or contact your site administrator for more information.
'\n },\n selectSite: {\n id: `${ID_PREFIX}selectSite`,\n defaultMessage: 'Select a site'\n },\n selectAccount: {\n id: `${ID_PREFIX}selectAccount`,\n defaultMessage: 'Select an account'\n },\n yourSite: {\n id: `${ID_PREFIX}siteNameN2ELabel`,\n defaultMessage: 'Your site'\n },\n siteNameLabel: {\n id: `${ID_PREFIX}siteNameLabel`,\n defaultMessage: 'Site name'\n },\n siteNameOptional: {\n id: `${ID_PREFIX}siteNameOptional`,\n defaultMessage: 'Site name (optional)'\n },\n siteNameOptionalMessageN2N: {\n id: `${ID_PREFIX}siteNameOptionalMessageN2N`,\n defaultMessage: `Don't worry, you can change this later.`\n },\n siteNameOptionalMessageN2E: {\n id: `${ID_PREFIX}siteNameOptionalMessageN2E`,\n defaultMessage: `Choose an existing site below, or create a new one.`\n },\n siteNameSuite: {\n id: `${ID_PREFIX}siteNameSuiteLabel`,\n defaultMessage: 'Name your suite'\n },\n siteNameSuiteDescription: {\n id: `${ID_PREFIX}siteNameSuiteDescriptionLabel`,\n defaultMessage: '* We’ll use this to name your site and workspaces'\n },\n email: {\n id: `${ID_PREFIX}emailLabel`,\n defaultMessage: 'Work email'\n },\n password: {\n id: `${ID_PREFIX}passwordLabel`,\n defaultMessage: 'Password'\n },\n firstName: {\n id: `${ID_PREFIX}firstNameLabel`,\n defaultMessage: 'First name'\n },\n lastName: {\n id: `${ID_PREFIX}lastNameLabel`,\n defaultMessage: 'Last name'\n },\n fullNameLabel: {\n id: `${ID_PREFIX}fullNameLabel`,\n defaultMessage: 'Full name'\n },\n gdprMessage: {\n id: `${ID_PREFIX}gdprMessage`,\n defaultMessage:\n 'Select the data center region to store your Opsgenie specific product data:'\n },\n errorValidationMessage: {\n id: `${ID_PREFIX}errorValidationMessage`,\n defaultMessage: 'Please review the highlighted fields below and try again.'\n },\n errorDomainLengthMinMsg: {\n id: `${ID_PREFIX}errorDomainLengthMinMsg`,\n defaultMessage:\n 'Your site name must be 3 or more lowercase letters and/or numbers. Hyphens are ok if they’re in the middle.'\n },\n errorDomainLengthMinMsgDeferredSiteName: {\n id: `${ID_PREFIX}errorDomainLengthMinMsgDeferredSiteName`,\n defaultMessage:\n 'Must be at least three characters (numerals or lowercase letters only). Can’t start or end with a hyphen (-).'\n },\n errorDomainLengthMaxMsg: {\n id: `${ID_PREFIX}errorDomainLengthMaxMsg`,\n defaultMessage:\n \"That's a bit too long — try something 50 characters or less.\"\n },\n errorDomainTakenMsg: {\n id: `${ID_PREFIX}errorDomainTakenMsg`,\n defaultMessage: 'This site is already taken.'\n },\n errorDomainTakenMsgDeferredSiteName: {\n id: `${ID_PREFIX}errorDomainTakenMsgDeferredSiteName`,\n defaultMessage: 'This site name is already taken.'\n },\n errorDomainIsAnnualMsg: {\n id: `${ID_PREFIX}errorDomainIsAnnualMsg`,\n defaultMessage:\n 'The Free plan is not yet available for annual subscriptions. Please select a site on a monthly subscription.'\n },\n errorFirstNameMsg: {\n id: `${ID_PREFIX}errorFirstNameMsg`,\n defaultMessage: 'Please enter your first name'\n },\n errorLastNameMsg: {\n id: `${ID_PREFIX}gdprMessage`,\n defaultMessage: 'Please enter your last name'\n },\n errorEmailInvalidMsg: {\n id: `${ID_PREFIX}errorEmailInvalidMsg`,\n defaultMessage: 'Please enter a valid email address'\n },\n errorEmailInUseMsg: {\n id: `${ID_PREFIX}errorEmailInUseMsg`,\n defaultMessage: `Oops, an Atlassian account with this email already exists. If you are the owner of this account, please login to continue.`\n },\n errorEmailInUseLoginToContinueMsg: {\n id: `${ID_PREFIX}errorEmailInUseLoginToContinueMsg`,\n defaultMessage: 'log in to continue'\n },\n errorPasswordMinMsg: {\n id: `${ID_PREFIX}errorPasswordMinMsg`,\n defaultMessage: 'Password must be at least 8 characters long'\n },\n errorCaptchaMsg: {\n id: `${ID_PREFIX}errorCaptchaMsg`,\n defaultMessage: 'Error with captcha verification'\n },\n warningTimeoutPending: {\n id: `${ID_PREFIX}warningTimeoutPending`,\n defaultMessage: 'Something went wrong. Wait a few minutes, then try again.'\n },\n warningNetworkError: {\n id: `${ID_PREFIX}warningNetworkError`,\n defaultMessage: 'Something went wrong. Please try again.'\n },\n errorTimeout: {\n id: `${ID_PREFIX}errorTimeout`,\n defaultMessage:\n 'It\\'s taking longer than expected to get you started. Please check your inbox to see if the order has completed successfully, or contact us.'\n },\n aaidMismatch: {\n id: `${ID_PREFIX}aaidMismatch`,\n defaultMessage:\n 'Something went wrong. Please refresh your page, then try again.'\n },\n helpTooltipText: {\n id: `${ID_PREFIX}helpTooltipText`,\n defaultMessage:\n 'Must be at least 3 lowercase characters, numbers and letters only.'\n },\n deferredSiteNameTooltipText: {\n id: `${ID_PREFIX}deferredSiteNameTooltipText`,\n defaultMessage:\n 'Your site name is the URL used to find your site, so try something your team will easily recognize.'\n },\n reCaptchaLegal: {\n id: `${ID_PREFIX}reCaptchaLegal`,\n defaultMessage:\n 'This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.'\n },\n infoBoxModal: {\n id: `${ID_PREFIX}infoBoxModal`,\n defaultMessage:\n 'A site is the unique URL where you access your Atlassian products–Confluence, Jira Software, Jira Service Desk, or Jira Core.
You access Bitbucket Cloud account on bitbucket.org.'\n },\n infoBoxModalCta: {\n id: `${ID_PREFIX}infoBoxModalCta`,\n defaultMessage: 'Understand site and Bitbucket Cloud account'\n },\n infoBoxDefault: {\n id: `${ID_PREFIX}infoBoxDefault`,\n defaultMessage: ' '\n },\n infoBoxSite: {\n id: `${ID_PREFIX}infoBoxSite`,\n defaultMessage:\n \"You already have a site with other Atlassian products in which Jira Software will be added to. We'll create a new Bitbucket Cloud account for you using the same name.\"\n },\n infoBoxSiteJsw: {\n id: `${ID_PREFIX}infoBoxSiteJsw`,\n defaultMessage:\n 'Select an existing site below and we’ll create a new Bitbucket Cloud account for you using the same name.'\n },\n infoBoxBb: {\n id: `${ID_PREFIX}infoBoxBb`,\n defaultMessage:\n \"You already have a Bitbucket Cloud account. Create a new site for Jira Software and they'll be automatically integrated.\"\n },\n infoBoxSiteBb: {\n id: `${ID_PREFIX}infoBoxSiteBb`,\n defaultMessage:\n 'You already have a site with other Atlassian products in which Jira Software will be added to. You also have a Bitbucket Cloud account. They will be automatically integrated.'\n },\n jswTrialNotice: {\n id: `${ID_PREFIX}jswTrialNotice`,\n defaultMessage:\n \"You'll get a 1-month free trial of Jira Software for this site.\"\n },\n jsmConfluenceNotice: {\n id: `${ID_PREFIX}jsmConfluenceNotice`,\n defaultMessage:\n 'We recommend you add Jira Service Management to an existing Confluence site now since there will be no way to link them afterwards.'\n },\n yourBitbucketAccount: {\n id: `${ID_PREFIX}yourBitbucketAccount`,\n defaultMessage: 'Your Bitbucket Cloud account'\n },\n bitbucketAccountDuplicate: {\n id: `${ID_PREFIX}bitbucketAccountDuplicate`,\n defaultMessage:\n 'Check this box if you prefer a new account with the same name as the site below.'\n },\n dropdownWithJiraSoftware: {\n id: `${ID_PREFIX}dropdownWithJiraSoftware`,\n defaultMessage: 'Sites with Jira Software:'\n },\n dropdownWithoutJiraSoftware: {\n id: `${ID_PREFIX}dropdownWithoutJiraSoftware`,\n defaultMessage: 'Sites without Jira Software:'\n },\n dropdownWithRecommended: {\n id: `${ID_PREFIX}dropdownWithRecommended`,\n defaultMessage: 'RECOMMENDED SITES'\n },\n dropdownWithoutRecommended: {\n id: `${ID_PREFIX}dropdownWithoutRecommended`,\n defaultMessage: 'OTHER SITES'\n },\n nameError: {\n id: `${ID_PREFIX}nameError`,\n defaultMessage: 'Invalid name pattern.'\n },\n errorNameLength: {\n id: `${ID_PREFIX}errorNameLength`,\n defaultMessage: 'Full name must not be greater than 255 characters'\n },\n siteAdminManageError: {\n id: `${ID_PREFIX}siteAdminManageError`,\n defaultMessage:\n 'You do not have permission to manage this site. For further support, contact the site’s administrator.'\n },\n freeBreachInfoBoxConsiderTrial: {\n id: `${ID_PREFIX}freeBreachInfoBoxConsiderTrial`,\n defaultMessage: 'Consider a Standard trial'\n },\n freeBreachInfoBoxCopy: {\n id: `${ID_PREFIX}freeBreachInfoBoxCopy`,\n defaultMessage:\n \"This site is eligible for a 30-day trial of a Standard plan, with full-feature access for 5,000 users or agents.
A trial lets your team use everything together. If you start a new site, it won't be integrated with your other products.
\"\n },\n freeBreachInfoBoxStartTrialCta: {\n id: `${ID_PREFIX}freeBreachInfoBoxStartTrialCta`,\n defaultMessage: 'Start a 30-day trial'\n },\n freeBreachLimitExceededError: {\n id: `${ID_PREFIX}freeBreachLimitExceededError`,\n defaultMessage: 'This site has more users than Free allows.'\n },\n devopsCarouselEndTextOne: {\n id: `${ID_PREFIX}devopsCarouselEndTextOne`,\n defaultMessage:\n 'Check your inbox for useful information and guides to help you get started.'\n },\n devopsCarouselEndTextTwo: {\n id: `${ID_PREFIX}devopsCarouselEndTextTwo`,\n defaultMessage:\n 'Easily switch to other Atlassian Products directly from the navigation bar.'\n },\n devopsCarouselEndTextThree: {\n id: `${ID_PREFIX}devopsCarouselEndTextThree`,\n defaultMessage:\n 'Add your teammates to plan, track and release great software together.'\n },\n devopsCarouselButton: {\n id: `${ID_PREFIX}devopsCarouselButton`,\n defaultMessage: 'Go to {product}'\n },\n devopsCarouselEndHeading: {\n id: `${ID_PREFIX}devopsCarouselEndHeading`,\n defaultMessage: \"You're all set up!\"\n },\n devopsSignedInWelcomeMessage: {\n id: `${ID_PREFIX}devopsSignedInWelcomeMessage`,\n defaultMessage: \"Let's set up your DevOps suite\"\n },\n siteNameSuiteDescriptionDevops: {\n id: `${ID_PREFIX}siteNameSuiteDescriptionDevops`,\n defaultMessage: '* We’ll use this to name your suite and workspaces'\n },\n errorDomainTakenMsgDevops: {\n id: `${ID_PREFIX}errorDomainTakenMsgDevops`,\n defaultMessage: 'This suite is already taken.'\n },\n errorDomainLengthMinMsgDevops: {\n id: `${ID_PREFIX}errorDomainLengthMinMsgDevops`,\n defaultMessage:\n 'Your suite name must be 3 or more lowercase letters and/or numbers. Hyphens are ok if they’re in the middle.'\n },\n eulaDevops: {\n id: `${ID_PREFIX}eulaDevops`,\n defaultMessage:\n \"By signing up, you agree to the Atlassian Cloud Terms of Service and Privacy Policy.
\"\n },\n helpTooltipTextDevops: {\n id: `${ID_PREFIX}helpTooltipTextDevops`,\n defaultMessage:\n 'Choose a name for the sites and workspaces that will make up your suite. Most teams use their company or organization.'\n },\n opsgenieDataStorageInfoBoxCopy: {\n id: `${ID_PREFIX}opsgenieDataStorageInfoBoxCopy`,\n defaultMessage:\n 'Some of your data is automatically stored in the US. Learn more
'\n },\n heading: {\n id: `${ID_PREFIX}signupOfferingIncludesFeaturesSignupFormHeading`,\n defaultMessage: 'Start now'\n },\n subheading: {\n id: `${ID_PREFIX}signupOfferingIncludesFeaturesSignupFormSubheading`,\n defaultMessage: ''\n },\n greeting: {\n id: `${ID_PREFIX}signupFormPersonalizedGreeting`,\n defaultMessage: 'Welcome back, {username}'\n },\n cloudStandard: {\n id: `${ID_PREFIX}cloudStandard`,\n defaultMessage: 'Cloud Standard'\n },\n cloudPremium: {\n id: `${ID_PREFIX}cloudPremium`,\n defaultMessage: 'Cloud Premium'\n },\n cloudFree: {\n id: `${ID_PREFIX}cloudFree`,\n defaultMessage: 'Cloud Free'\n },\n ssoCheck: {\n id: `${ID_PREFIX}errorSsoInUse`,\n defaultMessage:\n 'You must use single sign-on to access your account and continue signing up for your product. Login to continue.'\n },\n localeError: {\n id: `${ID_PREFIX}localeError`,\n defaultMessage: 'We stand with Ukraine'\n },\n localeErrorMessage: {\n id: `${ID_PREFIX}localeErrorMessage`,\n defaultMessage:\n 'Following the Russian invasion of Ukraine, we are pausing the sale of new software in Russia and Belarus.'\n },\n localeErrorButton: {\n id: `${ID_PREFIX}localeErrorButton`,\n defaultMessage: 'Learn more'\n }\n});\n\nexport const getTranslatableError = (\n error: string,\n isDevops?: boolean,\n isDeferredSiteName?: boolean\n) => {\n switch (error) {\n case 'Please enter a valid email address':\n return messages.errorEmailInvalidMsg;\n case 'Password must be at least 8 characters':\n return messages.errorPasswordMinMsg;\n case 'Your site name must be at least 3 characters long. Use only lowercase letters and numbers.':\n if (isDevops) {\n return messages.errorDomainLengthMinMsgDevops;\n } else if (isDeferredSiteName) {\n return messages.errorDomainLengthMinMsgDeferredSiteName;\n } else {\n return messages.errorDomainLengthMinMsg;\n }\n case 'Site name is unavailable':\n if (isDevops) {\n return messages.errorDomainTakenMsgDevops;\n } else if (isDeferredSiteName) {\n return messages.errorDomainTakenMsgDeferredSiteName;\n } else {\n return messages.errorDomainTakenMsg;\n }\n case 'An Atlassian account exists for this email address':\n return messages.errorEmailInUseMsg;\n case 'warningTimeoutPending':\n return messages.warningTimeoutPending;\n case 'errorTimeout':\n return messages.errorTimeout;\n case 'accountIdMisMatch':\n return messages.aaidMismatch;\n default:\n return { defaultMessage: error, id: `${ID_PREFIX}errorFallThrough` };\n }\n};\n","export const sanitizeLastName = (lastName: string | null): string => {\n return lastName || '.';\n};\n","export const checkReferrer = (page: string): boolean => {\n return document.referrer.includes(page);\n};\n","function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.delete(r),n.add(t)):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0),n)}function h(){n(2)}function y(n){return null==n||\"object\"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return\"production\"===process.env.NODE_ENV||U||n(0),U}function j(n,r){r&&(b(\"Patches\"),n.u=[],n.s=[],n.v=r)}function O(n){g(n),n.p.forEach(S),n.p=null}function g(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.O=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b(\"ES5\").S(e,r,o),o?(i[Q].P&&(O(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b(\"Patches\").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b(\"Patches\").R(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s){if(\"production\"!==process.env.NODE_ENV&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function R(n,r,t){var e=s(r)?b(\"MapSet\").N(r,t):v(r)?b(\"MapSet\").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b(\"ES5\").J(r,t);return(t?t.A:_()).p.push(e),e}function D(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b(\"ES5\").K(u)))return u.t;u.I=!0,e=F(r,c),u.I=!1}else e=F(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function N(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return\"production\"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];\"production\"!==process.env.NODE_ENV&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e1?t-1:0),o=1;o1?t-1:0),o=1;o=0;e--){var i=t[e];if(0===i.path.length&&\"replace\"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b(\"Patches\").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);export default fn;export{un as Immer,pn as applyPatches,K as castDraft,$ as castImmutable,ln as createDraft,D as current,J as enableAllPlugins,N as enableES5,C as enableMapSet,T as enablePatches,dn as finishDraft,d as freeze,L as immerable,r as isDraft,t as isDraftable,H as nothing,e as original,fn as produce,cn as produceWithPatches,sn as setAutoFreeze,vn as setUseProxies};\n//# sourceMappingURL=immer.esm.js.map\n","import defineProperty from \"./defineProperty.js\";\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nexport default function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}","import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';\n\n/**\n * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js\n *\n * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes\n * during build.\n * @param {number} code\n */\nfunction formatProdErrorMessage(code) {\n return \"Minified Redux error #\" + code + \"; visit https://redux.js.org/Errors?code=\" + code + \" for the full message or \" + 'use the non-minified dev environment for full errors. ';\n}\n\n// Inlined version of the `symbol-observable` polyfill\nvar $$observable = (function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n})();\n\n/**\n * These are private action types reserved by Redux.\n * For any unknown actions, you must return the current state.\n * If the current state is undefined, you must return the initial state.\n * Do not reference these action types directly in your code.\n */\nvar randomString = function randomString() {\n return Math.random().toString(36).substring(7).split('').join('.');\n};\n\nvar ActionTypes = {\n INIT: \"@@redux/INIT\" + randomString(),\n REPLACE: \"@@redux/REPLACE\" + randomString(),\n PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {\n return \"@@redux/PROBE_UNKNOWN_ACTION\" + randomString();\n }\n};\n\n/**\n * @param {any} obj The object to inspect.\n * @returns {boolean} True if the argument appears to be a plain object.\n */\nfunction isPlainObject(obj) {\n if (typeof obj !== 'object' || obj === null) return false;\n var proto = obj;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(obj) === proto;\n}\n\n// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of\nfunction miniKindOf(val) {\n if (val === void 0) return 'undefined';\n if (val === null) return 'null';\n var type = typeof val;\n\n switch (type) {\n case 'boolean':\n case 'string':\n case 'number':\n case 'symbol':\n case 'function':\n {\n return type;\n }\n }\n\n if (Array.isArray(val)) return 'array';\n if (isDate(val)) return 'date';\n if (isError(val)) return 'error';\n var constructorName = ctorName(val);\n\n switch (constructorName) {\n case 'Symbol':\n case 'Promise':\n case 'WeakMap':\n case 'WeakSet':\n case 'Map':\n case 'Set':\n return constructorName;\n } // other\n\n\n return type.slice(8, -1).toLowerCase().replace(/\\s/g, '');\n}\n\nfunction ctorName(val) {\n return typeof val.constructor === 'function' ? val.constructor.name : null;\n}\n\nfunction isError(val) {\n return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';\n}\n\nfunction isDate(val) {\n if (val instanceof Date) return true;\n return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';\n}\n\nfunction kindOf(val) {\n var typeOfVal = typeof val;\n\n if (process.env.NODE_ENV !== 'production') {\n typeOfVal = miniKindOf(val);\n }\n\n return typeOfVal;\n}\n\n/**\n * @deprecated\n *\n * **We recommend using the `configureStore` method\n * of the `@reduxjs/toolkit` package**, which replaces `createStore`.\n *\n * Redux Toolkit is our recommended approach for writing Redux logic today,\n * including store setup, reducers, data fetching, and more.\n *\n * **For more details, please read this Redux docs page:**\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * `configureStore` from Redux Toolkit is an improved version of `createStore` that\n * simplifies setup and helps avoid common bugs.\n *\n * You should not be using the `redux` core package by itself today, except for learning purposes.\n * The `createStore` method from the core `redux` package will not be removed, but we encourage\n * all users to migrate to using Redux Toolkit for all Redux code.\n *\n * If you want to use `createStore` without this visual deprecation warning, use\n * the `legacy_createStore` import instead:\n *\n * `import { legacy_createStore as createStore} from 'redux'`\n *\n */\n\nfunction createStore(reducer, preloadedState, enhancer) {\n var _ref2;\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');\n }\n\n if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n enhancer = preloadedState;\n preloadedState = undefined;\n }\n\n if (typeof enhancer !== 'undefined') {\n if (typeof enhancer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"Expected the enhancer to be a function. Instead, received: '\" + kindOf(enhancer) + \"'\");\n }\n\n return enhancer(createStore)(reducer, preloadedState);\n }\n\n if (typeof reducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"Expected the root reducer to be a function. Instead, received: '\" + kindOf(reducer) + \"'\");\n }\n\n var currentReducer = reducer;\n var currentState = preloadedState;\n var currentListeners = [];\n var nextListeners = currentListeners;\n var isDispatching = false;\n /**\n * This makes a shallow copy of currentListeners so we can use\n * nextListeners as a temporary list while dispatching.\n *\n * This prevents any bugs around consumers calling\n * subscribe/unsubscribe in the middle of a dispatch.\n */\n\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = currentListeners.slice();\n }\n }\n /**\n * Reads the state tree managed by the store.\n *\n * @returns {any} The current state tree of your application.\n */\n\n\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');\n }\n\n return currentState;\n }\n /**\n * Adds a change listener. It will be called any time an action is dispatched,\n * and some part of the state tree may potentially have changed. You may then\n * call `getState()` to read the current state tree inside the callback.\n *\n * You may call `dispatch()` from a change listener, with the following\n * caveats:\n *\n * 1. The subscriptions are snapshotted just before every `dispatch()` call.\n * If you subscribe or unsubscribe while the listeners are being invoked, this\n * will not have any effect on the `dispatch()` that is currently in progress.\n * However, the next `dispatch()` call, whether nested or not, will use a more\n * recent snapshot of the subscription list.\n *\n * 2. The listener should not expect to see all state changes, as the state\n * might have been updated multiple times during a nested `dispatch()` before\n * the listener is called. It is, however, guaranteed that all subscribers\n * registered before the `dispatch()` started will be called with the latest\n * state by the time it exits.\n *\n * @param {Function} listener A callback to be invoked on every dispatch.\n * @returns {Function} A function to remove this change listener.\n */\n\n\n function subscribe(listener) {\n if (typeof listener !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"Expected the listener to be a function. Instead, received: '\" + kindOf(listener) + \"'\");\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n var isSubscribed = true;\n ensureCanMutateNextListeners();\n nextListeners.push(listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');\n }\n\n isSubscribed = false;\n ensureCanMutateNextListeners();\n var index = nextListeners.indexOf(listener);\n nextListeners.splice(index, 1);\n currentListeners = null;\n };\n }\n /**\n * Dispatches an action. It is the only way to trigger a state change.\n *\n * The `reducer` function, used to create the store, will be called with the\n * current state tree and the given `action`. Its return value will\n * be considered the **next** state of the tree, and the change listeners\n * will be notified.\n *\n * The base implementation only supports plain object actions. If you want to\n * dispatch a Promise, an Observable, a thunk, or something else, you need to\n * wrap your store creating function into the corresponding middleware. For\n * example, see the documentation for the `redux-thunk` package. Even the\n * middleware will eventually dispatch plain object actions using this method.\n *\n * @param {Object} action A plain object representing “what changed”. It is\n * a good idea to keep actions serializable so you can record and replay user\n * sessions, or use the time travelling `redux-devtools`. An action must have\n * a `type` property which may not be `undefined`. It is a good idea to use\n * string constants for action types.\n *\n * @returns {Object} For convenience, the same action object you dispatched.\n *\n * Note that, if you use a custom middleware, it may wrap `dispatch()` to\n * return something else (for example, a Promise you can await).\n */\n\n\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"Actions must be plain objects. Instead, the actual type was: '\" + kindOf(action) + \"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.\");\n }\n\n if (typeof action.type === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');\n }\n\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n\n var listeners = currentListeners = nextListeners;\n\n for (var i = 0; i < listeners.length; i++) {\n var listener = listeners[i];\n listener();\n }\n\n return action;\n }\n /**\n * Replaces the reducer currently used by the store to calculate the state.\n *\n * You might need this if your app implements code splitting and you want to\n * load some of the reducers dynamically. You might also need this if you\n * implement a hot reloading mechanism for Redux.\n *\n * @param {Function} nextReducer The reducer for the store to use instead.\n * @returns {void}\n */\n\n\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== 'function') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : \"Expected the nextReducer to be a function. Instead, received: '\" + kindOf(nextReducer));\n }\n\n currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.\n // Any reducers that existed in both the new and old rootReducer\n // will receive the previous state. This effectively populates\n // the new state tree with any relevant data from the old one.\n\n dispatch({\n type: ActionTypes.REPLACE\n });\n }\n /**\n * Interoperability point for observable/reactive libraries.\n * @returns {observable} A minimal observable of state changes.\n * For more information, see the observable proposal:\n * https://github.com/tc39/proposal-observable\n */\n\n\n function observable() {\n var _ref;\n\n var outerSubscribe = subscribe;\n return _ref = {\n /**\n * The minimal observable subscription method.\n * @param {Object} observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns {subscription} An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe: function subscribe(observer) {\n if (typeof observer !== 'object' || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"Expected the observer to be an object. Instead, received: '\" + kindOf(observer) + \"'\");\n }\n\n function observeState() {\n if (observer.next) {\n observer.next(getState());\n }\n }\n\n observeState();\n var unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe: unsubscribe\n };\n }\n }, _ref[$$observable] = function () {\n return this;\n }, _ref;\n } // When a store is created, an \"INIT\" action is dispatched so that every\n // reducer returns their initial state. This effectively populates\n // the initial state tree.\n\n\n dispatch({\n type: ActionTypes.INIT\n });\n return _ref2 = {\n dispatch: dispatch,\n subscribe: subscribe,\n getState: getState,\n replaceReducer: replaceReducer\n }, _ref2[$$observable] = observable, _ref2;\n}\n/**\n * Creates a Redux store that holds the state tree.\n *\n * **We recommend using `configureStore` from the\n * `@reduxjs/toolkit` package**, which replaces `createStore`:\n * **https://redux.js.org/introduction/why-rtk-is-redux-today**\n *\n * The only way to change the data in the store is to call `dispatch()` on it.\n *\n * There should only be a single store in your app. To specify how different\n * parts of the state tree respond to actions, you may combine several reducers\n * into a single reducer function by using `combineReducers`.\n *\n * @param {Function} reducer A function that returns the next state tree, given\n * the current state tree and the action to handle.\n *\n * @param {any} [preloadedState] The initial state. You may optionally specify it\n * to hydrate the state from the server in universal apps, or to restore a\n * previously serialized user session.\n * If you use `combineReducers` to produce the root reducer function, this must be\n * an object with the same shape as `combineReducers` keys.\n *\n * @param {Function} [enhancer] The store enhancer. You may optionally specify it\n * to enhance the store with third-party capabilities such as middleware,\n * time travel, persistence, etc. The only store enhancer that ships with Redux\n * is `applyMiddleware()`.\n *\n * @returns {Store} A Redux store that lets you read the state, dispatch actions\n * and subscribe to changes.\n */\n\nvar legacy_createStore = createStore;\n\n/**\n * Prints a warning in the console if it exists.\n *\n * @param {String} message The warning message.\n * @returns {void}\n */\nfunction warning(message) {\n /* eslint-disable no-console */\n if (typeof console !== 'undefined' && typeof console.error === 'function') {\n console.error(message);\n }\n /* eslint-enable no-console */\n\n\n try {\n // This error was thrown as a convenience so that if you enable\n // \"break on all exceptions\" in your console,\n // it would pause the execution at this line.\n throw new Error(message);\n } catch (e) {} // eslint-disable-line no-empty\n\n}\n\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n var reducerKeys = Object.keys(reducers);\n var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';\n\n if (reducerKeys.length === 0) {\n return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';\n }\n\n if (!isPlainObject(inputState)) {\n return \"The \" + argumentName + \" has unexpected type of \\\"\" + kindOf(inputState) + \"\\\". Expected argument to be an object with the following \" + (\"keys: \\\"\" + reducerKeys.join('\", \"') + \"\\\"\");\n }\n\n var unexpectedKeys = Object.keys(inputState).filter(function (key) {\n return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];\n });\n unexpectedKeys.forEach(function (key) {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === ActionTypes.REPLACE) return;\n\n if (unexpectedKeys.length > 0) {\n return \"Unexpected \" + (unexpectedKeys.length > 1 ? 'keys' : 'key') + \" \" + (\"\\\"\" + unexpectedKeys.join('\", \"') + \"\\\" found in \" + argumentName + \". \") + \"Expected to find one of the known reducer keys instead: \" + (\"\\\"\" + reducerKeys.join('\", \"') + \"\\\". Unexpected keys will be ignored.\");\n }\n}\n\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach(function (key) {\n var reducer = reducers[key];\n var initialState = reducer(undefined, {\n type: ActionTypes.INIT\n });\n\n if (typeof initialState === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined during initialization. \" + \"If the state passed to the reducer is undefined, you must \" + \"explicitly return the initial state. The initial state may \" + \"not be undefined. If you don't want to set a value for this reducer, \" + \"you can use null instead of undefined.\");\n }\n\n if (typeof reducer(undefined, {\n type: ActionTypes.PROBE_UNKNOWN_ACTION()\n }) === 'undefined') {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"The slice reducer for key \\\"\" + key + \"\\\" returned undefined when probed with a random type. \" + (\"Don't try to handle '\" + ActionTypes.INIT + \"' or other actions in \\\"redux/*\\\" \") + \"namespace. They are considered private. Instead, you must return the \" + \"current state for any unknown actions, unless it is undefined, \" + \"in which case you must return the initial state, regardless of the \" + \"action type. The initial state may not be undefined, but can be null.\");\n }\n });\n}\n/**\n * Turns an object whose values are different reducer functions, into a single\n * reducer function. It will call every child reducer, and gather their results\n * into a single state object, whose keys correspond to the keys of the passed\n * reducer functions.\n *\n * @param {Object} reducers An object whose values correspond to different\n * reducer functions that need to be combined into one. One handy way to obtain\n * it is to use ES6 `import * as reducers` syntax. The reducers may never return\n * undefined for any action. Instead, they should return their initial state\n * if the state passed to them was undefined, and the current state for any\n * unrecognized action.\n *\n * @returns {Function} A reducer function that invokes every reducer inside the\n * passed object, and builds a state object with the same shape.\n */\n\n\nfunction combineReducers(reducers) {\n var reducerKeys = Object.keys(reducers);\n var finalReducers = {};\n\n for (var i = 0; i < reducerKeys.length; i++) {\n var key = reducerKeys[i];\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof reducers[key] === 'undefined') {\n warning(\"No reducer provided for key \\\"\" + key + \"\\\"\");\n }\n }\n\n if (typeof reducers[key] === 'function') {\n finalReducers[key] = reducers[key];\n }\n }\n\n var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same\n // keys multiple times.\n\n var unexpectedKeyCache;\n\n if (process.env.NODE_ENV !== 'production') {\n unexpectedKeyCache = {};\n }\n\n var shapeAssertionError;\n\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n\n return function combination(state, action) {\n if (state === void 0) {\n state = {};\n }\n\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n\n var hasChanged = false;\n var nextState = {};\n\n for (var _i = 0; _i < finalReducerKeys.length; _i++) {\n var _key = finalReducerKeys[_i];\n var reducer = finalReducers[_key];\n var previousStateForKey = state[_key];\n var nextStateForKey = reducer(previousStateForKey, action);\n\n if (typeof nextStateForKey === 'undefined') {\n var actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"When called with an action of type \" + (actionType ? \"\\\"\" + String(actionType) + \"\\\"\" : '(unknown type)') + \", the slice reducer for key \\\"\" + _key + \"\\\" returned undefined. \" + \"To ignore an action, you must explicitly return the previous state. \" + \"If you want this reducer to hold no value, you can return null instead of undefined.\");\n }\n\n nextState[_key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\nfunction bindActionCreator(actionCreator, dispatch) {\n return function () {\n return dispatch(actionCreator.apply(this, arguments));\n };\n}\n/**\n * Turns an object whose values are action creators, into an object with the\n * same keys, but with every function wrapped into a `dispatch` call so they\n * may be invoked directly. This is just a convenience method, as you can call\n * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.\n *\n * For convenience, you can also pass an action creator as the first argument,\n * and get a dispatch wrapped function in return.\n *\n * @param {Function|Object} actionCreators An object whose values are action\n * creator functions. One handy way to obtain it is to use ES6 `import * as`\n * syntax. You may also pass a single function.\n *\n * @param {Function} dispatch The `dispatch` function available on your Redux\n * store.\n *\n * @returns {Function|Object} The object mimicking the original object, but with\n * every action creator wrapped into the `dispatch` call. If you passed a\n * function as `actionCreators`, the return value will also be a single\n * function.\n */\n\n\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === 'function') {\n return bindActionCreator(actionCreators, dispatch);\n }\n\n if (typeof actionCreators !== 'object' || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"bindActionCreators expected an object or a function, but instead received: '\" + kindOf(actionCreators) + \"'. \" + \"Did you write \\\"import ActionCreators from\\\" instead of \\\"import * as ActionCreators from\\\"?\");\n }\n\n var boundActionCreators = {};\n\n for (var key in actionCreators) {\n var actionCreator = actionCreators[key];\n\n if (typeof actionCreator === 'function') {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n\n return boundActionCreators;\n}\n\n/**\n * Composes single-argument functions from right to left. The rightmost\n * function can take multiple arguments as it provides the signature for\n * the resulting composite function.\n *\n * @param {...Function} funcs The functions to compose.\n * @returns {Function} A function obtained by composing the argument functions\n * from right to left. For example, compose(f, g, h) is identical to doing\n * (...args) => f(g(h(...args))).\n */\nfunction compose() {\n for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {\n funcs[_key] = arguments[_key];\n }\n\n if (funcs.length === 0) {\n return function (arg) {\n return arg;\n };\n }\n\n if (funcs.length === 1) {\n return funcs[0];\n }\n\n return funcs.reduce(function (a, b) {\n return function () {\n return a(b.apply(void 0, arguments));\n };\n });\n}\n\n/**\n * Creates a store enhancer that applies middleware to the dispatch method\n * of the Redux store. This is handy for a variety of tasks, such as expressing\n * asynchronous actions in a concise manner, or logging every action payload.\n *\n * See `redux-thunk` package as an example of the Redux middleware.\n *\n * Because middleware is potentially asynchronous, this should be the first\n * store enhancer in the composition chain.\n *\n * Note that each middleware will be given the `dispatch` and `getState` functions\n * as named arguments.\n *\n * @param {...Function} middlewares The middleware chain to be applied.\n * @returns {Function} A store enhancer applying the middleware.\n */\n\nfunction applyMiddleware() {\n for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {\n middlewares[_key] = arguments[_key];\n }\n\n return function (createStore) {\n return function () {\n var store = createStore.apply(void 0, arguments);\n\n var _dispatch = function dispatch() {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');\n };\n\n var middlewareAPI = {\n getState: store.getState,\n dispatch: function dispatch() {\n return _dispatch.apply(void 0, arguments);\n }\n };\n var chain = middlewares.map(function (middleware) {\n return middleware(middlewareAPI);\n });\n _dispatch = compose.apply(void 0, chain)(store.dispatch);\n return _objectSpread(_objectSpread({}, store), {}, {\n dispatch: _dispatch\n });\n };\n };\n}\n\n/*\n * This is a dummy function to check if the function name has been altered by minification.\n * If the function has been minified and NODE_ENV !== 'production', warn the user.\n */\n\nfunction isCrushed() {}\n\nif (process.env.NODE_ENV !== 'production' && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {\n warning('You are currently using minified code outside of NODE_ENV === \"production\". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');\n}\n\nexport { ActionTypes as __DO_NOT_USE__ActionTypes, applyMiddleware, bindActionCreators, combineReducers, compose, createStore, legacy_createStore };\n","/** A function that accepts a potential \"extra argument\" value to be injected later,\r\n * and returns an instance of the thunk middleware that uses that value\r\n */\nfunction createThunkMiddleware(extraArgument) {\n // Standard Redux middleware definition pattern:\n // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware\n var middleware = function middleware(_ref) {\n var dispatch = _ref.dispatch,\n getState = _ref.getState;\n return function (next) {\n return function (action) {\n // The thunk middleware looks for any functions that were passed to `store.dispatch`.\n // If this \"action\" is really a function, call it and return the result.\n if (typeof action === 'function') {\n // Inject the store's `dispatch` and `getState` methods, as well as any \"extra arg\"\n return action(dispatch, getState, extraArgument);\n } // Otherwise, pass the action down the middleware chain as usual\n\n\n return next(action);\n };\n };\n };\n\n return middleware;\n}\n\nvar thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version\n// with whatever \"extra arg\" they want to inject into their thunks\n\nthunk.withExtraArgument = createThunkMiddleware;\nexport default thunk;","var __extends = (this && this.__extends) || (function () {\r\n var extendStatics = function (d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n return function (d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n})();\r\nvar __generator = (this && this.__generator) || function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n};\r\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\r\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\r\n to[j] = from[i];\r\n return to;\r\n};\r\nvar __defProp = Object.defineProperty;\r\nvar __defProps = Object.defineProperties;\r\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\r\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\r\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\r\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\r\nvar __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };\r\nvar __spreadValues = function (a, b) {\r\n for (var prop in b || (b = {}))\r\n if (__hasOwnProp.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n if (__getOwnPropSymbols)\r\n for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {\r\n var prop = _c[_i];\r\n if (__propIsEnum.call(b, prop))\r\n __defNormalProp(a, prop, b[prop]);\r\n }\r\n return a;\r\n};\r\nvar __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };\r\nvar __async = function (__this, __arguments, generator) {\r\n return new Promise(function (resolve, reject) {\r\n var fulfilled = function (value) {\r\n try {\r\n step(generator.next(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var rejected = function (value) {\r\n try {\r\n step(generator.throw(value));\r\n }\r\n catch (e) {\r\n reject(e);\r\n }\r\n };\r\n var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };\r\n step((generator = generator.apply(__this, __arguments)).next());\r\n });\r\n};\r\n// src/index.ts\r\nimport { enableES5 } from \"immer\";\r\nexport * from \"redux\";\r\nimport { default as default2, current as current2, freeze, original, isDraft as isDraft4 } from \"immer\";\r\nimport { createSelector as createSelector2 } from \"reselect\";\r\n// src/createDraftSafeSelector.ts\r\nimport { current, isDraft } from \"immer\";\r\nimport { createSelector } from \"reselect\";\r\nvar createDraftSafeSelector = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var selector = createSelector.apply(void 0, args);\r\n var wrappedSelector = function (value) {\r\n var rest = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n rest[_i - 1] = arguments[_i];\r\n }\r\n return selector.apply(void 0, __spreadArray([isDraft(value) ? current(value) : value], rest));\r\n };\r\n return wrappedSelector;\r\n};\r\n// src/configureStore.ts\r\nimport { createStore, compose as compose2, applyMiddleware, combineReducers } from \"redux\";\r\n// src/devtoolsExtension.ts\r\nimport { compose } from \"redux\";\r\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {\r\n if (arguments.length === 0)\r\n return void 0;\r\n if (typeof arguments[0] === \"object\")\r\n return compose;\r\n return compose.apply(null, arguments);\r\n};\r\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {\r\n return function (noop2) {\r\n return noop2;\r\n };\r\n};\r\n// src/isPlainObject.ts\r\nfunction isPlainObject(value) {\r\n if (typeof value !== \"object\" || value === null)\r\n return false;\r\n var proto = Object.getPrototypeOf(value);\r\n if (proto === null)\r\n return true;\r\n var baseProto = proto;\r\n while (Object.getPrototypeOf(baseProto) !== null) {\r\n baseProto = Object.getPrototypeOf(baseProto);\r\n }\r\n return proto === baseProto;\r\n}\r\n// src/getDefaultMiddleware.ts\r\nimport thunkMiddleware from \"redux-thunk\";\r\n// src/utils.ts\r\nfunction getTimeMeasureUtils(maxDelay, fnName) {\r\n var elapsed = 0;\r\n return {\r\n measureTime: function (fn) {\r\n var started = Date.now();\r\n try {\r\n return fn();\r\n }\r\n finally {\r\n var finished = Date.now();\r\n elapsed += finished - started;\r\n }\r\n },\r\n warnIfExceeded: function () {\r\n if (elapsed > maxDelay) {\r\n console.warn(fnName + \" took \" + elapsed + \"ms, which is more than the warning threshold of \" + maxDelay + \"ms. \\nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\\nIt is disabled in production builds, so you don't need to worry about that.\");\r\n }\r\n }\r\n };\r\n}\r\nvar MiddlewareArray = /** @class */ (function (_super) {\r\n __extends(MiddlewareArray, _super);\r\n function MiddlewareArray() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n var _this = _super.apply(this, args) || this;\r\n Object.setPrototypeOf(_this, MiddlewareArray.prototype);\r\n return _this;\r\n }\r\n Object.defineProperty(MiddlewareArray, Symbol.species, {\r\n get: function () {\r\n return MiddlewareArray;\r\n },\r\n enumerable: false,\r\n configurable: true\r\n });\r\n MiddlewareArray.prototype.concat = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n return _super.prototype.concat.apply(this, arr);\r\n };\r\n MiddlewareArray.prototype.prepend = function () {\r\n var arr = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n arr[_i] = arguments[_i];\r\n }\r\n if (arr.length === 1 && Array.isArray(arr[0])) {\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();\r\n }\r\n return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();\r\n };\r\n return MiddlewareArray;\r\n}(Array));\r\n// src/immutableStateInvariantMiddleware.ts\r\nvar isProduction = process.env.NODE_ENV === \"production\";\r\nvar prefix = \"Invariant failed\";\r\nfunction invariant(condition, message) {\r\n if (condition) {\r\n return;\r\n }\r\n if (isProduction) {\r\n throw new Error(prefix);\r\n }\r\n throw new Error(prefix + \": \" + (message || \"\"));\r\n}\r\nfunction stringify(obj, serializer, indent, decycler) {\r\n return JSON.stringify(obj, getSerialize(serializer, decycler), indent);\r\n}\r\nfunction getSerialize(serializer, decycler) {\r\n var stack = [], keys = [];\r\n if (!decycler)\r\n decycler = function (_, value) {\r\n if (stack[0] === value)\r\n return \"[Circular ~]\";\r\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\r\n };\r\n return function (key, value) {\r\n if (stack.length > 0) {\r\n var thisPos = stack.indexOf(this);\r\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\r\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\r\n if (~stack.indexOf(value))\r\n value = decycler.call(this, key, value);\r\n }\r\n else\r\n stack.push(value);\r\n return serializer == null ? value : serializer.call(this, key, value);\r\n };\r\n}\r\nfunction isImmutableDefault(value) {\r\n return typeof value !== \"object\" || value === null || typeof value === \"undefined\" || Object.isFrozen(value);\r\n}\r\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\r\n var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\r\n return {\r\n detectMutations: function () {\r\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\r\n }\r\n };\r\n}\r\nfunction trackProperties(isImmutable, ignorePaths, obj, path) {\r\n if (ignorePaths === void 0) { ignorePaths = []; }\r\n if (path === void 0) { path = \"\"; }\r\n var tracked = { value: obj };\r\n if (!isImmutable(obj)) {\r\n tracked.children = {};\r\n for (var key in obj) {\r\n var childPath = path ? path + \".\" + key : key;\r\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\r\n continue;\r\n }\r\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\r\n }\r\n }\r\n return tracked;\r\n}\r\nfunction detectMutations(isImmutable, ignorePaths, trackedProperty, obj, sameParentRef, path) {\r\n if (ignorePaths === void 0) { ignorePaths = []; }\r\n if (sameParentRef === void 0) { sameParentRef = false; }\r\n if (path === void 0) { path = \"\"; }\r\n var prevObj = trackedProperty ? trackedProperty.value : void 0;\r\n var sameRef = prevObj === obj;\r\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\r\n return { wasMutated: true, path: path };\r\n }\r\n if (isImmutable(prevObj) || isImmutable(obj)) {\r\n return { wasMutated: false };\r\n }\r\n var keysToDetect = {};\r\n for (var key in trackedProperty.children) {\r\n keysToDetect[key] = true;\r\n }\r\n for (var key in obj) {\r\n keysToDetect[key] = true;\r\n }\r\n for (var key in keysToDetect) {\r\n var childPath = path ? path + \".\" + key : key;\r\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\r\n continue;\r\n }\r\n var result = detectMutations(isImmutable, ignorePaths, trackedProperty.children[key], obj[key], sameRef, childPath);\r\n if (result.wasMutated) {\r\n return result;\r\n }\r\n }\r\n return { wasMutated: false };\r\n}\r\nfunction createImmutableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;\r\n ignoredPaths = ignoredPaths || ignore;\r\n var track = trackForMutations.bind(null, isImmutable, ignoredPaths);\r\n return function (_c) {\r\n var getState = _c.getState;\r\n var state = getState();\r\n var tracker = track(state);\r\n var result;\r\n return function (next) { return function (action) {\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n invariant(!result.wasMutated, \"A state mutation was detected between dispatches, in the path '\" + (result.path || \"\") + \"'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n var dispatchedAction = next(action);\r\n measureUtils.measureTime(function () {\r\n state = getState();\r\n result = tracker.detectMutations();\r\n tracker = track(state);\r\n result.wasMutated && invariant(!result.wasMutated, \"A state mutation was detected inside a dispatch, in the path: \" + (result.path || \"\") + \". Take a look at the reducer(s) handling the action \" + stringify(action) + \". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)\");\r\n });\r\n measureUtils.warnIfExceeded();\r\n return dispatchedAction;\r\n }; };\r\n };\r\n}\r\n// src/serializableStateInvariantMiddleware.ts\r\nfunction isPlain(val) {\r\n var type = typeof val;\r\n return type === \"undefined\" || val === null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\r\n}\r\nfunction findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths) {\r\n if (path === void 0) { path = \"\"; }\r\n if (isSerializable === void 0) { isSerializable = isPlain; }\r\n if (ignoredPaths === void 0) { ignoredPaths = []; }\r\n var foundNestedSerializable;\r\n if (!isSerializable(value)) {\r\n return {\r\n keyPath: path || \"\",\r\n value: value\r\n };\r\n }\r\n if (typeof value !== \"object\" || value === null) {\r\n return false;\r\n }\r\n var entries = getEntries != null ? getEntries(value) : Object.entries(value);\r\n var hasIgnoredPaths = ignoredPaths.length > 0;\r\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\r\n var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];\r\n var nestedPath = path ? path + \".\" + key : key;\r\n if (hasIgnoredPaths && ignoredPaths.indexOf(nestedPath) >= 0) {\r\n continue;\r\n }\r\n if (!isSerializable(nestedValue)) {\r\n return {\r\n keyPath: nestedPath,\r\n value: nestedValue\r\n };\r\n }\r\n if (typeof nestedValue === \"object\") {\r\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths);\r\n if (foundNestedSerializable) {\r\n return foundNestedSerializable;\r\n }\r\n }\r\n }\r\n return false;\r\n}\r\nfunction createSerializableStateInvariantMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n if (process.env.NODE_ENV === \"production\") {\r\n return function () { return function (next) { return function (action) { return next(action); }; }; };\r\n }\r\n var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? [\"meta.arg\", \"meta.baseQueryMeta\"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j;\r\n return function (storeAPI) { return function (next) { return function (action) {\r\n var result = next(action);\r\n var measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\r\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\r\n measureUtils.measureTime(function () {\r\n var foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths);\r\n if (foundActionNonSerializableValue) {\r\n var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in an action, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\r\n }\r\n });\r\n }\r\n if (!ignoreState) {\r\n measureUtils.measureTime(function () {\r\n var state = storeAPI.getState();\r\n var foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths);\r\n if (foundStateNonSerializableValue) {\r\n var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;\r\n console.error(\"A non-serializable value was detected in the state, in the path: `\" + keyPath + \"`. Value:\", value, \"\\nTake a look at the reducer(s) handling this action type: \" + action.type + \".\\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)\");\r\n }\r\n });\r\n measureUtils.warnIfExceeded();\r\n }\r\n return result;\r\n }; }; };\r\n}\r\n// src/getDefaultMiddleware.ts\r\nfunction isBoolean(x) {\r\n return typeof x === \"boolean\";\r\n}\r\nfunction curryGetDefaultMiddleware() {\r\n return function curriedGetDefaultMiddleware(options) {\r\n return getDefaultMiddleware(options);\r\n };\r\n}\r\nfunction getDefaultMiddleware(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e;\r\n var middlewareArray = new MiddlewareArray();\r\n if (thunk) {\r\n if (isBoolean(thunk)) {\r\n middlewareArray.push(thunkMiddleware);\r\n }\r\n else {\r\n middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));\r\n }\r\n }\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (immutableCheck) {\r\n var immutableOptions = {};\r\n if (!isBoolean(immutableCheck)) {\r\n immutableOptions = immutableCheck;\r\n }\r\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\r\n }\r\n if (serializableCheck) {\r\n var serializableOptions = {};\r\n if (!isBoolean(serializableCheck)) {\r\n serializableOptions = serializableCheck;\r\n }\r\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\r\n }\r\n }\r\n return middlewareArray;\r\n}\r\n// src/configureStore.ts\r\nvar IS_PRODUCTION = process.env.NODE_ENV === \"production\";\r\nfunction configureStore(options) {\r\n var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();\r\n var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;\r\n var rootReducer;\r\n if (typeof reducer === \"function\") {\r\n rootReducer = reducer;\r\n }\r\n else if (isPlainObject(reducer)) {\r\n rootReducer = combineReducers(reducer);\r\n }\r\n else {\r\n throw new Error('\"reducer\" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');\r\n }\r\n var finalMiddleware = middleware;\r\n if (typeof finalMiddleware === \"function\") {\r\n finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);\r\n if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {\r\n throw new Error(\"when using a middleware builder function, an array of middleware must be returned\");\r\n }\r\n }\r\n if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== \"function\"; })) {\r\n throw new Error(\"each middleware provided to configureStore must be a function\");\r\n }\r\n var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);\r\n var finalCompose = compose2;\r\n if (devTools) {\r\n finalCompose = composeWithDevTools(__spreadValues({\r\n trace: !IS_PRODUCTION\r\n }, typeof devTools === \"object\" && devTools));\r\n }\r\n var storeEnhancers = [middlewareEnhancer];\r\n if (Array.isArray(enhancers)) {\r\n storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);\r\n }\r\n else if (typeof enhancers === \"function\") {\r\n storeEnhancers = enhancers(storeEnhancers);\r\n }\r\n var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);\r\n return createStore(rootReducer, preloadedState, composedEnhancer);\r\n}\r\n// src/createAction.ts\r\nfunction createAction(type, prepareAction) {\r\n function actionCreator() {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n if (prepareAction) {\r\n var prepared = prepareAction.apply(void 0, args);\r\n if (!prepared) {\r\n throw new Error(\"prepareAction did not return an object\");\r\n }\r\n return __spreadValues(__spreadValues({\r\n type: type,\r\n payload: prepared.payload\r\n }, \"meta\" in prepared && { meta: prepared.meta }), \"error\" in prepared && { error: prepared.error });\r\n }\r\n return { type: type, payload: args[0] };\r\n }\r\n actionCreator.toString = function () { return \"\" + type; };\r\n actionCreator.type = type;\r\n actionCreator.match = function (action) { return action.type === type; };\r\n return actionCreator;\r\n}\r\nfunction isFSA(action) {\r\n return isPlainObject(action) && typeof action.type === \"string\" && Object.keys(action).every(isValidKey);\r\n}\r\nfunction isValidKey(key) {\r\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\r\n}\r\nfunction getType(actionCreator) {\r\n return \"\" + actionCreator;\r\n}\r\n// src/createReducer.ts\r\nimport createNextState, { isDraft as isDraft2, isDraftable } from \"immer\";\r\n// src/mapBuilders.ts\r\nfunction executeReducerBuilderCallback(builderCallback) {\r\n var actionsMap = {};\r\n var actionMatchers = [];\r\n var defaultCaseReducer;\r\n var builder = {\r\n addCase: function (typeOrActionCreator, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (actionMatchers.length > 0) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addMatcher`\");\r\n }\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n var type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\r\n if (type in actionsMap) {\r\n throw new Error(\"addCase cannot be called with two reducers for the same action type\");\r\n }\r\n actionsMap[type] = reducer;\r\n return builder;\r\n },\r\n addMatcher: function (matcher, reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\r\n }\r\n }\r\n actionMatchers.push({ matcher: matcher, reducer: reducer });\r\n return builder;\r\n },\r\n addDefaultCase: function (reducer) {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (defaultCaseReducer) {\r\n throw new Error(\"`builder.addDefaultCase` can only be called once\");\r\n }\r\n }\r\n defaultCaseReducer = reducer;\r\n return builder;\r\n }\r\n };\r\n builderCallback(builder);\r\n return [actionsMap, actionMatchers, defaultCaseReducer];\r\n}\r\n// src/createReducer.ts\r\nfunction isStateFunction(x) {\r\n return typeof x === \"function\";\r\n}\r\nfunction createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {\r\n if (actionMatchers === void 0) { actionMatchers = []; }\r\n var _c = typeof mapOrBuilderCallback === \"function\" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];\r\n var getInitialState;\r\n if (isStateFunction(initialState)) {\r\n getInitialState = function () { return createNextState(initialState(), function () {\r\n }); };\r\n }\r\n else {\r\n var frozenInitialState_1 = createNextState(initialState, function () {\r\n });\r\n getInitialState = function () { return frozenInitialState_1; };\r\n }\r\n function reducer(state, action) {\r\n if (state === void 0) { state = getInitialState(); }\r\n var caseReducers = __spreadArray([\r\n actionsMap[action.type]\r\n ], finalActionMatchers.filter(function (_c) {\r\n var matcher = _c.matcher;\r\n return matcher(action);\r\n }).map(function (_c) {\r\n var reducer2 = _c.reducer;\r\n return reducer2;\r\n }));\r\n if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {\r\n caseReducers = [finalDefaultCaseReducer];\r\n }\r\n return caseReducers.reduce(function (previousState, caseReducer) {\r\n if (caseReducer) {\r\n if (isDraft2(previousState)) {\r\n var draft = previousState;\r\n var result = caseReducer(draft, action);\r\n if (typeof result === \"undefined\") {\r\n return previousState;\r\n }\r\n return result;\r\n }\r\n else if (!isDraftable(previousState)) {\r\n var result = caseReducer(previousState, action);\r\n if (typeof result === \"undefined\") {\r\n if (previousState === null) {\r\n return previousState;\r\n }\r\n throw Error(\"A case reducer on a non-draftable value must not return undefined\");\r\n }\r\n return result;\r\n }\r\n else {\r\n return createNextState(previousState, function (draft) {\r\n return caseReducer(draft, action);\r\n });\r\n }\r\n }\r\n return previousState;\r\n }, state);\r\n }\r\n reducer.getInitialState = getInitialState;\r\n return reducer;\r\n}\r\n// src/createSlice.ts\r\nfunction getType2(slice, actionKey) {\r\n return slice + \"/\" + actionKey;\r\n}\r\nfunction createSlice(options) {\r\n var name = options.name;\r\n if (!name) {\r\n throw new Error(\"`name` is a required option for createSlice\");\r\n }\r\n var initialState = typeof options.initialState == \"function\" ? options.initialState : default2(options.initialState, function () {\r\n });\r\n var reducers = options.reducers || {};\r\n var reducerNames = Object.keys(reducers);\r\n var sliceCaseReducersByName = {};\r\n var sliceCaseReducersByType = {};\r\n var actionCreators = {};\r\n reducerNames.forEach(function (reducerName) {\r\n var maybeReducerWithPrepare = reducers[reducerName];\r\n var type = getType2(name, reducerName);\r\n var caseReducer;\r\n var prepareCallback;\r\n if (\"reducer\" in maybeReducerWithPrepare) {\r\n caseReducer = maybeReducerWithPrepare.reducer;\r\n prepareCallback = maybeReducerWithPrepare.prepare;\r\n }\r\n else {\r\n caseReducer = maybeReducerWithPrepare;\r\n }\r\n sliceCaseReducersByName[reducerName] = caseReducer;\r\n sliceCaseReducersByType[type] = caseReducer;\r\n actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);\r\n });\r\n function buildReducer() {\r\n var _c = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;\r\n var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);\r\n return createReducer(initialState, finalCaseReducers, actionMatchers, defaultCaseReducer);\r\n }\r\n var _reducer;\r\n return {\r\n name: name,\r\n reducer: function (state, action) {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer(state, action);\r\n },\r\n actions: actionCreators,\r\n caseReducers: sliceCaseReducersByName,\r\n getInitialState: function () {\r\n if (!_reducer)\r\n _reducer = buildReducer();\r\n return _reducer.getInitialState();\r\n }\r\n };\r\n}\r\n// src/entities/entity_state.ts\r\nfunction getInitialEntityState() {\r\n return {\r\n ids: [],\r\n entities: {}\r\n };\r\n}\r\nfunction createInitialStateFactory() {\r\n function getInitialState(additionalState) {\r\n if (additionalState === void 0) { additionalState = {}; }\r\n return Object.assign(getInitialEntityState(), additionalState);\r\n }\r\n return { getInitialState: getInitialState };\r\n}\r\n// src/entities/state_selectors.ts\r\nfunction createSelectorsFactory() {\r\n function getSelectors(selectState) {\r\n var selectIds = function (state) { return state.ids; };\r\n var selectEntities = function (state) { return state.entities; };\r\n var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });\r\n var selectId = function (_, id) { return id; };\r\n var selectById = function (entities, id) { return entities[id]; };\r\n var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });\r\n if (!selectState) {\r\n return {\r\n selectIds: selectIds,\r\n selectEntities: selectEntities,\r\n selectAll: selectAll,\r\n selectTotal: selectTotal,\r\n selectById: createDraftSafeSelector(selectEntities, selectId, selectById)\r\n };\r\n }\r\n var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);\r\n return {\r\n selectIds: createDraftSafeSelector(selectState, selectIds),\r\n selectEntities: selectGlobalizedEntities,\r\n selectAll: createDraftSafeSelector(selectState, selectAll),\r\n selectTotal: createDraftSafeSelector(selectState, selectTotal),\r\n selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)\r\n };\r\n }\r\n return { getSelectors: getSelectors };\r\n}\r\n// src/entities/state_adapter.ts\r\nimport createNextState2, { isDraft as isDraft3 } from \"immer\";\r\nfunction createSingleArgumentStateOperator(mutator) {\r\n var operator = createStateOperator(function (_, state) { return mutator(state); });\r\n return function operation(state) {\r\n return operator(state, void 0);\r\n };\r\n}\r\nfunction createStateOperator(mutator) {\r\n return function operation(state, arg) {\r\n function isPayloadActionArgument(arg2) {\r\n return isFSA(arg2);\r\n }\r\n var runMutator = function (draft) {\r\n if (isPayloadActionArgument(arg)) {\r\n mutator(arg.payload, draft);\r\n }\r\n else {\r\n mutator(arg, draft);\r\n }\r\n };\r\n if (isDraft3(state)) {\r\n runMutator(state);\r\n return state;\r\n }\r\n else {\r\n return createNextState2(state, runMutator);\r\n }\r\n };\r\n}\r\n// src/entities/utils.ts\r\nfunction selectIdValue(entity, selectId) {\r\n var key = selectId(entity);\r\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\r\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\r\n }\r\n return key;\r\n}\r\nfunction ensureEntitiesArray(entities) {\r\n if (!Array.isArray(entities)) {\r\n entities = Object.values(entities);\r\n }\r\n return entities;\r\n}\r\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var added = [];\r\n var updated = [];\r\n for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {\r\n var entity = newEntities_1[_i];\r\n var id = selectIdValue(entity, selectId);\r\n if (id in state.entities) {\r\n updated.push({ id: id, changes: entity });\r\n }\r\n else {\r\n added.push(entity);\r\n }\r\n }\r\n return [added, updated];\r\n}\r\n// src/entities/unsorted_state_adapter.ts\r\nfunction createUnsortedStateAdapter(selectId) {\r\n function addOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (key in state.entities) {\r\n return;\r\n }\r\n state.ids.push(key);\r\n state.entities[key] = entity;\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {\r\n var entity = newEntities_2[_i];\r\n addOneMutably(entity, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n var key = selectIdValue(entity, selectId);\r\n if (!(key in state.entities)) {\r\n state.ids.push(key);\r\n }\r\n state.entities[key] = entity;\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {\r\n var entity = newEntities_3[_i];\r\n setOneMutably(entity, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.ids = [];\r\n state.entities = {};\r\n addManyMutably(newEntities, state);\r\n }\r\n function removeOneMutably(key, state) {\r\n return removeManyMutably([key], state);\r\n }\r\n function removeManyMutably(keys, state) {\r\n var didMutate = false;\r\n keys.forEach(function (key) {\r\n if (key in state.entities) {\r\n delete state.entities[key];\r\n didMutate = true;\r\n }\r\n });\r\n if (didMutate) {\r\n state.ids = state.ids.filter(function (id) { return id in state.entities; });\r\n }\r\n }\r\n function removeAllMutably(state) {\r\n Object.assign(state, {\r\n ids: [],\r\n entities: {}\r\n });\r\n }\r\n function takeNewKey(keys, update, state) {\r\n var original2 = state.entities[update.id];\r\n var updated = Object.assign({}, original2, update.changes);\r\n var newKey = selectIdValue(updated, selectId);\r\n var hasNewKey = newKey !== update.id;\r\n if (hasNewKey) {\r\n keys[update.id] = newKey;\r\n delete state.entities[update.id];\r\n }\r\n state.entities[newKey] = updated;\r\n return hasNewKey;\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function updateManyMutably(updates, state) {\r\n var newKeys = {};\r\n var updatesPerEntity = {};\r\n updates.forEach(function (update) {\r\n if (update.id in state.entities) {\r\n updatesPerEntity[update.id] = {\r\n id: update.id,\r\n changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)\r\n };\r\n }\r\n });\r\n updates = Object.values(updatesPerEntity);\r\n var didMutateEntities = updates.length > 0;\r\n if (didMutateEntities) {\r\n var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;\r\n if (didMutateIds) {\r\n state.ids = state.ids.map(function (id) { return newKeys[id] || id; });\r\n }\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n return {\r\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\r\n addOne: createStateOperator(addOneMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n upsertMany: createStateOperator(upsertManyMutably),\r\n removeOne: createStateOperator(removeOneMutably),\r\n removeMany: createStateOperator(removeManyMutably)\r\n };\r\n}\r\n// src/entities/sorted_state_adapter.ts\r\nfunction createSortedStateAdapter(selectId, sort) {\r\n var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;\r\n function addOneMutably(entity, state) {\r\n return addManyMutably([entity], state);\r\n }\r\n function addManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });\r\n if (models.length !== 0) {\r\n merge(models, state);\r\n }\r\n }\r\n function setOneMutably(entity, state) {\r\n return setManyMutably([entity], state);\r\n }\r\n function setManyMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n if (newEntities.length !== 0) {\r\n merge(newEntities, state);\r\n }\r\n }\r\n function setAllMutably(newEntities, state) {\r\n newEntities = ensureEntitiesArray(newEntities);\r\n state.entities = {};\r\n state.ids = [];\r\n addManyMutably(newEntities, state);\r\n }\r\n function updateOneMutably(update, state) {\r\n return updateManyMutably([update], state);\r\n }\r\n function takeUpdatedModel(models, update, state) {\r\n if (!(update.id in state.entities)) {\r\n return false;\r\n }\r\n var original2 = state.entities[update.id];\r\n var updated = Object.assign({}, original2, update.changes);\r\n var newKey = selectIdValue(updated, selectId);\r\n delete state.entities[update.id];\r\n models.push(updated);\r\n return newKey !== update.id;\r\n }\r\n function updateManyMutably(updates, state) {\r\n var models = [];\r\n updates.forEach(function (update) { return takeUpdatedModel(models, update, state); });\r\n if (models.length !== 0) {\r\n merge(models, state);\r\n }\r\n }\r\n function upsertOneMutably(entity, state) {\r\n return upsertManyMutably([entity], state);\r\n }\r\n function upsertManyMutably(newEntities, state) {\r\n var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];\r\n updateManyMutably(updated, state);\r\n addManyMutably(added, state);\r\n }\r\n function areArraysEqual(a, b) {\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < a.length && i < b.length; i++) {\r\n if (a[i] === b[i]) {\r\n continue;\r\n }\r\n return false;\r\n }\r\n return true;\r\n }\r\n function merge(models, state) {\r\n models.forEach(function (model) {\r\n state.entities[selectId(model)] = model;\r\n });\r\n var allEntities = Object.values(state.entities);\r\n allEntities.sort(sort);\r\n var newSortedIds = allEntities.map(selectId);\r\n var ids = state.ids;\r\n if (!areArraysEqual(ids, newSortedIds)) {\r\n state.ids = newSortedIds;\r\n }\r\n }\r\n return {\r\n removeOne: removeOne,\r\n removeMany: removeMany,\r\n removeAll: removeAll,\r\n addOne: createStateOperator(addOneMutably),\r\n updateOne: createStateOperator(updateOneMutably),\r\n upsertOne: createStateOperator(upsertOneMutably),\r\n setOne: createStateOperator(setOneMutably),\r\n setMany: createStateOperator(setManyMutably),\r\n setAll: createStateOperator(setAllMutably),\r\n addMany: createStateOperator(addManyMutably),\r\n updateMany: createStateOperator(updateManyMutably),\r\n upsertMany: createStateOperator(upsertManyMutably)\r\n };\r\n}\r\n// src/entities/create_adapter.ts\r\nfunction createEntityAdapter(options) {\r\n if (options === void 0) { options = {}; }\r\n var _c = __spreadValues({\r\n sortComparer: false,\r\n selectId: function (instance) { return instance.id; }\r\n }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;\r\n var stateFactory = createInitialStateFactory();\r\n var selectorsFactory = createSelectorsFactory();\r\n var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\r\n return __spreadValues(__spreadValues(__spreadValues({\r\n selectId: selectId,\r\n sortComparer: sortComparer\r\n }, stateFactory), selectorsFactory), stateAdapter);\r\n}\r\n// src/nanoid.ts\r\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\r\nvar nanoid = function (size) {\r\n if (size === void 0) { size = 21; }\r\n var id = \"\";\r\n var i = size;\r\n while (i--) {\r\n id += urlAlphabet[Math.random() * 64 | 0];\r\n }\r\n return id;\r\n};\r\n// src/createAsyncThunk.ts\r\nvar commonProperties = [\r\n \"name\",\r\n \"message\",\r\n \"stack\",\r\n \"code\"\r\n];\r\nvar RejectWithValue = /** @class */ (function () {\r\n function RejectWithValue(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return RejectWithValue;\r\n}());\r\nvar FulfillWithMeta = /** @class */ (function () {\r\n function FulfillWithMeta(payload, meta) {\r\n this.payload = payload;\r\n this.meta = meta;\r\n }\r\n return FulfillWithMeta;\r\n}());\r\nvar miniSerializeError = function (value) {\r\n if (typeof value === \"object\" && value !== null) {\r\n var simpleError = {};\r\n for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {\r\n var property = commonProperties_1[_i];\r\n if (typeof value[property] === \"string\") {\r\n simpleError[property] = value[property];\r\n }\r\n }\r\n return simpleError;\r\n }\r\n return { message: String(value) };\r\n};\r\nfunction createAsyncThunk(typePrefix, payloadCreator, options) {\r\n var fulfilled = createAction(typePrefix + \"/fulfilled\", function (payload, requestId, arg, meta) { return ({\r\n payload: payload,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"fulfilled\"\r\n })\r\n }); });\r\n var pending = createAction(typePrefix + \"/pending\", function (requestId, arg, meta) { return ({\r\n payload: void 0,\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n requestStatus: \"pending\"\r\n })\r\n }); });\r\n var rejected = createAction(typePrefix + \"/rejected\", function (error, requestId, arg, payload, meta) { return ({\r\n payload: payload,\r\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\r\n meta: __spreadProps(__spreadValues({}, meta || {}), {\r\n arg: arg,\r\n requestId: requestId,\r\n rejectedWithValue: !!payload,\r\n requestStatus: \"rejected\",\r\n aborted: (error == null ? void 0 : error.name) === \"AbortError\",\r\n condition: (error == null ? void 0 : error.name) === \"ConditionError\"\r\n })\r\n }); });\r\n var displayedWarning = false;\r\n var AC = typeof AbortController !== \"undefined\" ? AbortController : /** @class */ (function () {\r\n function class_1() {\r\n this.signal = {\r\n aborted: false,\r\n addEventListener: function () {\r\n },\r\n dispatchEvent: function () {\r\n return false;\r\n },\r\n onabort: function () {\r\n },\r\n removeEventListener: function () {\r\n }\r\n };\r\n }\r\n class_1.prototype.abort = function () {\r\n if (process.env.NODE_ENV !== \"production\") {\r\n if (!displayedWarning) {\r\n displayedWarning = true;\r\n console.info(\"This platform does not implement AbortController. \\nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.\");\r\n }\r\n }\r\n };\r\n return class_1;\r\n }());\r\n function actionCreator(arg) {\r\n return function (dispatch, getState, extra) {\r\n var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();\r\n var abortController = new AC();\r\n var abortReason;\r\n var abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener(\"abort\", function () { return reject({ name: \"AbortError\", message: abortReason || \"Aborted\" }); }); });\r\n var started = false;\r\n function abort(reason) {\r\n if (started) {\r\n abortReason = reason;\r\n abortController.abort();\r\n }\r\n }\r\n var promise = function () {\r\n return __async(this, null, function () {\r\n var _a, _b, finalAction, conditionResult, err_1, skipDispatch;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 4, , 5]);\r\n conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });\r\n if (!isThenable(conditionResult)) return [3 /*break*/, 2];\r\n return [4 /*yield*/, conditionResult];\r\n case 1:\r\n conditionResult = _c.sent();\r\n _c.label = 2;\r\n case 2:\r\n if (conditionResult === false) {\r\n throw {\r\n name: \"ConditionError\",\r\n message: \"Aborted due to condition callback returning false.\"\r\n };\r\n }\r\n started = true;\r\n dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));\r\n return [4 /*yield*/, Promise.race([\r\n abortedPromise,\r\n Promise.resolve(payloadCreator(arg, {\r\n dispatch: dispatch,\r\n getState: getState,\r\n extra: extra,\r\n requestId: requestId,\r\n signal: abortController.signal,\r\n rejectWithValue: function (value, meta) {\r\n return new RejectWithValue(value, meta);\r\n },\r\n fulfillWithValue: function (value, meta) {\r\n return new FulfillWithMeta(value, meta);\r\n }\r\n })).then(function (result) {\r\n if (result instanceof RejectWithValue) {\r\n throw result;\r\n }\r\n if (result instanceof FulfillWithMeta) {\r\n return fulfilled(result.payload, requestId, arg, result.meta);\r\n }\r\n return fulfilled(result, requestId, arg);\r\n })\r\n ])];\r\n case 3:\r\n finalAction = _c.sent();\r\n return [3 /*break*/, 5];\r\n case 4:\r\n err_1 = _c.sent();\r\n finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);\r\n return [3 /*break*/, 5];\r\n case 5:\r\n skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\r\n if (!skipDispatch) {\r\n dispatch(finalAction);\r\n }\r\n return [2 /*return*/, finalAction];\r\n }\r\n });\r\n });\r\n }();\r\n return Object.assign(promise, {\r\n abort: abort,\r\n requestId: requestId,\r\n arg: arg,\r\n unwrap: function () {\r\n return promise.then(unwrapResult);\r\n }\r\n });\r\n };\r\n }\r\n return Object.assign(actionCreator, {\r\n pending: pending,\r\n rejected: rejected,\r\n fulfilled: fulfilled,\r\n typePrefix: typePrefix\r\n });\r\n}\r\nfunction unwrapResult(action) {\r\n if (action.meta && action.meta.rejectedWithValue) {\r\n throw action.payload;\r\n }\r\n if (action.error) {\r\n throw action.error;\r\n }\r\n return action.payload;\r\n}\r\nfunction isThenable(value) {\r\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\r\n}\r\n// src/tsHelpers.ts\r\nvar hasMatchFunction = function (v) {\r\n return v && typeof v.match === \"function\";\r\n};\r\n// src/matchers.ts\r\nvar matches = function (matcher, action) {\r\n if (hasMatchFunction(matcher)) {\r\n return matcher.match(action);\r\n }\r\n else {\r\n return matcher(action);\r\n }\r\n};\r\nfunction isAnyOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.some(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction isAllOf() {\r\n var matchers = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n matchers[_i] = arguments[_i];\r\n }\r\n return function (action) {\r\n return matchers.every(function (matcher) { return matches(matcher, action); });\r\n };\r\n}\r\nfunction hasExpectedRequestMetadata(action, validStatus) {\r\n if (!action || !action.meta)\r\n return false;\r\n var hasValidRequestId = typeof action.meta.requestId === \"string\";\r\n var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\r\n return hasValidRequestId && hasValidRequestStatus;\r\n}\r\nfunction isAsyncThunkArray(a) {\r\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\r\n}\r\nfunction isPending() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isPending()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejected() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejected()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isRejectedWithValue() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n var hasFlag = function (action) {\r\n return action && action.meta && action.meta.rejectedWithValue;\r\n };\r\n if (asyncThunks.length === 0) {\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isRejectedWithValue()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isFulfilled() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"fulfilled\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isFulfilled()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\nfunction isAsyncThunkAction() {\r\n var asyncThunks = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n asyncThunks[_i] = arguments[_i];\r\n }\r\n if (asyncThunks.length === 0) {\r\n return function (action) { return hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]); };\r\n }\r\n if (!isAsyncThunkArray(asyncThunks)) {\r\n return isAsyncThunkAction()(asyncThunks[0]);\r\n }\r\n return function (action) {\r\n var matchers = [];\r\n for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {\r\n var asyncThunk = asyncThunks_1[_i];\r\n matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);\r\n }\r\n var combinedMatcher = isAnyOf.apply(void 0, matchers);\r\n return combinedMatcher(action);\r\n };\r\n}\r\n// src/listenerMiddleware/utils.ts\r\nvar assertFunction = function (func, expected) {\r\n if (typeof func !== \"function\") {\r\n throw new TypeError(expected + \" is not a function\");\r\n }\r\n};\r\nvar noop = function () {\r\n};\r\nvar catchRejection = function (promise, onError) {\r\n if (onError === void 0) { onError = noop; }\r\n promise.catch(onError);\r\n return promise;\r\n};\r\nvar addAbortSignalListener = function (abortSignal, callback) {\r\n abortSignal.addEventListener(\"abort\", callback, { once: true });\r\n};\r\nvar abortControllerWithReason = function (abortController, reason) {\r\n var signal = abortController.signal;\r\n if (signal.aborted) {\r\n return;\r\n }\r\n if (!(\"reason\" in signal)) {\r\n Object.defineProperty(signal, \"reason\", {\r\n enumerable: true,\r\n value: reason,\r\n configurable: true,\r\n writable: true\r\n });\r\n }\r\n ;\r\n abortController.abort(reason);\r\n};\r\n// src/listenerMiddleware/exceptions.ts\r\nvar task = \"task\";\r\nvar listener = \"listener\";\r\nvar completed = \"completed\";\r\nvar cancelled = \"cancelled\";\r\nvar taskCancelled = \"task-\" + cancelled;\r\nvar taskCompleted = \"task-\" + completed;\r\nvar listenerCancelled = listener + \"-\" + cancelled;\r\nvar listenerCompleted = listener + \"-\" + completed;\r\nvar TaskAbortError = /** @class */ (function () {\r\n function TaskAbortError(code) {\r\n this.code = code;\r\n this.name = \"TaskAbortError\";\r\n this.message = task + \" \" + cancelled + \" (reason: \" + code + \")\";\r\n }\r\n return TaskAbortError;\r\n}());\r\n// src/listenerMiddleware/task.ts\r\nvar validateActive = function (signal) {\r\n if (signal.aborted) {\r\n throw new TaskAbortError(signal.reason);\r\n }\r\n};\r\nvar promisifyAbortSignal = function (signal) {\r\n return catchRejection(new Promise(function (_, reject) {\r\n var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };\r\n if (signal.aborted) {\r\n notifyRejection();\r\n }\r\n else {\r\n addAbortSignalListener(signal, notifyRejection);\r\n }\r\n }));\r\n};\r\nvar runTask = function (task2, cleanUp) { return __async(void 0, null, function () {\r\n var value, error_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n _c.trys.push([0, 3, 4, 5]);\r\n return [4 /*yield*/, Promise.resolve()];\r\n case 1:\r\n _c.sent();\r\n return [4 /*yield*/, task2()];\r\n case 2:\r\n value = _c.sent();\r\n return [2 /*return*/, {\r\n status: \"ok\",\r\n value: value\r\n }];\r\n case 3:\r\n error_1 = _c.sent();\r\n return [2 /*return*/, {\r\n status: error_1 instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\r\n error: error_1\r\n }];\r\n case 4:\r\n cleanUp == null ? void 0 : cleanUp();\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n}); };\r\nvar createPause = function (signal) {\r\n return function (promise) {\r\n return catchRejection(Promise.race([promisifyAbortSignal(signal), promise]).then(function (output) {\r\n validateActive(signal);\r\n return output;\r\n }));\r\n };\r\n};\r\nvar createDelay = function (signal) {\r\n var pause = createPause(signal);\r\n return function (timeoutMs) {\r\n return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));\r\n };\r\n};\r\n// src/listenerMiddleware/index.ts\r\nvar assign = Object.assign;\r\nvar INTERNAL_NIL_TOKEN = {};\r\nvar alm = \"listenerMiddleware\";\r\nvar createFork = function (parentAbortSignal) {\r\n var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };\r\n return function (taskExecutor) {\r\n assertFunction(taskExecutor, \"taskExecutor\");\r\n var childAbortController = new AbortController();\r\n linkControllers(childAbortController);\r\n var result = runTask(function () { return __async(void 0, null, function () {\r\n var result2;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(parentAbortSignal);\r\n validateActive(childAbortController.signal);\r\n return [4 /*yield*/, taskExecutor({\r\n pause: createPause(childAbortController.signal),\r\n delay: createDelay(childAbortController.signal),\r\n signal: childAbortController.signal\r\n })];\r\n case 1:\r\n result2 = _c.sent();\r\n validateActive(childAbortController.signal);\r\n return [2 /*return*/, result2];\r\n }\r\n });\r\n }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });\r\n return {\r\n result: createPause(parentAbortSignal)(result),\r\n cancel: function () {\r\n abortControllerWithReason(childAbortController, taskCancelled);\r\n }\r\n };\r\n };\r\n};\r\nvar createTakePattern = function (startListening, signal) {\r\n var take = function (predicate, timeout) { return __async(void 0, null, function () {\r\n var unsubscribe, tuplePromise, promises, output;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n validateActive(signal);\r\n unsubscribe = function () {\r\n };\r\n tuplePromise = new Promise(function (resolve) {\r\n unsubscribe = startListening({\r\n predicate: predicate,\r\n effect: function (action, listenerApi) {\r\n listenerApi.unsubscribe();\r\n resolve([\r\n action,\r\n listenerApi.getState(),\r\n listenerApi.getOriginalState()\r\n ]);\r\n }\r\n });\r\n });\r\n promises = [\r\n promisifyAbortSignal(signal),\r\n tuplePromise\r\n ];\r\n if (timeout != null) {\r\n promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));\r\n }\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, , 3, 4]);\r\n return [4 /*yield*/, Promise.race(promises)];\r\n case 2:\r\n output = _c.sent();\r\n validateActive(signal);\r\n return [2 /*return*/, output];\r\n case 3:\r\n unsubscribe();\r\n return [7 /*endfinally*/];\r\n case 4: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };\r\n};\r\nvar getListenerEntryPropsFrom = function (options) {\r\n var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;\r\n if (type) {\r\n predicate = createAction(type).match;\r\n }\r\n else if (actionCreator) {\r\n type = actionCreator.type;\r\n predicate = actionCreator.match;\r\n }\r\n else if (matcher) {\r\n predicate = matcher;\r\n }\r\n else if (predicate) {\r\n }\r\n else {\r\n throw new Error(\"Creating or removing a listener requires one of the known fields for matching an action\");\r\n }\r\n assertFunction(effect, \"options.listener\");\r\n return { predicate: predicate, type: type, effect: effect };\r\n};\r\nvar createListenerEntry = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;\r\n var id = nanoid();\r\n var entry = {\r\n id: id,\r\n effect: effect,\r\n type: type,\r\n predicate: predicate,\r\n pending: new Set(),\r\n unsubscribe: function () {\r\n throw new Error(\"Unsubscribe not initialized\");\r\n }\r\n };\r\n return entry;\r\n};\r\nvar createClearListenerMiddleware = function (listenerMap) {\r\n return function () {\r\n listenerMap.forEach(cancelActiveListeners);\r\n listenerMap.clear();\r\n };\r\n};\r\nvar safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {\r\n try {\r\n errorHandler(errorToNotify, errorInfo);\r\n }\r\n catch (errorHandlerError) {\r\n setTimeout(function () {\r\n throw errorHandlerError;\r\n }, 0);\r\n }\r\n};\r\nvar addListener = createAction(alm + \"/add\");\r\nvar clearAllListeners = createAction(alm + \"/removeAll\");\r\nvar removeListener = createAction(alm + \"/remove\");\r\nvar defaultErrorHandler = function () {\r\n var args = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n args[_i] = arguments[_i];\r\n }\r\n console.error.apply(console, __spreadArray([alm + \"/error\"], args));\r\n};\r\nvar cancelActiveListeners = function (entry) {\r\n entry.pending.forEach(function (controller) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n });\r\n};\r\nfunction createListenerMiddleware(middlewareOptions) {\r\n var _this = this;\r\n if (middlewareOptions === void 0) { middlewareOptions = {}; }\r\n var listenerMap = new Map();\r\n var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;\r\n assertFunction(onError, \"onError\");\r\n var insertEntry = function (entry) {\r\n entry.unsubscribe = function () { return listenerMap.delete(entry.id); };\r\n listenerMap.set(entry.id, entry);\r\n return function (cancelOptions) {\r\n entry.unsubscribe();\r\n if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n };\r\n };\r\n var findListenerEntry = function (comparator) {\r\n for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {\r\n var entry = _c[_i];\r\n if (comparator(entry)) {\r\n return entry;\r\n }\r\n }\r\n return void 0;\r\n };\r\n var startListening = function (options) {\r\n var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });\r\n if (!entry) {\r\n entry = createListenerEntry(options);\r\n }\r\n return insertEntry(entry);\r\n };\r\n var stopListening = function (options) {\r\n var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;\r\n var entry = findListenerEntry(function (entry2) {\r\n var matchPredicateOrType = typeof type === \"string\" ? entry2.type === type : entry2.predicate === predicate;\r\n return matchPredicateOrType && entry2.effect === effect;\r\n });\r\n if (entry) {\r\n entry.unsubscribe();\r\n if (options.cancelActive) {\r\n cancelActiveListeners(entry);\r\n }\r\n }\r\n return !!entry;\r\n };\r\n var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {\r\n var internalTaskController, take, listenerError_1;\r\n return __generator(this, function (_c) {\r\n switch (_c.label) {\r\n case 0:\r\n internalTaskController = new AbortController();\r\n take = createTakePattern(startListening, internalTaskController.signal);\r\n _c.label = 1;\r\n case 1:\r\n _c.trys.push([1, 3, 4, 5]);\r\n entry.pending.add(internalTaskController);\r\n return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {\r\n getOriginalState: getOriginalState,\r\n condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },\r\n take: take,\r\n delay: createDelay(internalTaskController.signal),\r\n pause: createPause(internalTaskController.signal),\r\n extra: extra,\r\n signal: internalTaskController.signal,\r\n fork: createFork(internalTaskController.signal),\r\n unsubscribe: entry.unsubscribe,\r\n subscribe: function () {\r\n listenerMap.set(entry.id, entry);\r\n },\r\n cancelActiveListeners: function () {\r\n entry.pending.forEach(function (controller, _, set) {\r\n if (controller !== internalTaskController) {\r\n abortControllerWithReason(controller, listenerCancelled);\r\n set.delete(controller);\r\n }\r\n });\r\n }\r\n })))];\r\n case 2:\r\n _c.sent();\r\n return [3 /*break*/, 5];\r\n case 3:\r\n listenerError_1 = _c.sent();\r\n if (!(listenerError_1 instanceof TaskAbortError)) {\r\n safelyNotifyError(onError, listenerError_1, {\r\n raisedBy: \"effect\"\r\n });\r\n }\r\n return [3 /*break*/, 5];\r\n case 4:\r\n abortControllerWithReason(internalTaskController, listenerCompleted);\r\n entry.pending.delete(internalTaskController);\r\n return [7 /*endfinally*/];\r\n case 5: return [2 /*return*/];\r\n }\r\n });\r\n }); };\r\n var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\r\n var middleware = function (api) { return function (next) { return function (action) {\r\n if (addListener.match(action)) {\r\n return startListening(action.payload);\r\n }\r\n if (clearAllListeners.match(action)) {\r\n clearListenerMiddleware();\r\n return;\r\n }\r\n if (removeListener.match(action)) {\r\n return stopListening(action.payload);\r\n }\r\n var originalState = api.getState();\r\n var getOriginalState = function () {\r\n if (originalState === INTERNAL_NIL_TOKEN) {\r\n throw new Error(alm + \": getOriginalState can only be called synchronously\");\r\n }\r\n return originalState;\r\n };\r\n var result;\r\n try {\r\n result = next(action);\r\n if (listenerMap.size > 0) {\r\n var currentState = api.getState();\r\n var listenerEntries = Array.from(listenerMap.values());\r\n for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {\r\n var entry = listenerEntries_1[_i];\r\n var runListener = false;\r\n try {\r\n runListener = entry.predicate(action, currentState, originalState);\r\n }\r\n catch (predicateError) {\r\n runListener = false;\r\n safelyNotifyError(onError, predicateError, {\r\n raisedBy: \"predicate\"\r\n });\r\n }\r\n if (!runListener) {\r\n continue;\r\n }\r\n notifyListener(entry, action, api, getOriginalState);\r\n }\r\n }\r\n }\r\n finally {\r\n originalState = INTERNAL_NIL_TOKEN;\r\n }\r\n return result;\r\n }; }; };\r\n return {\r\n middleware: middleware,\r\n startListening: startListening,\r\n stopListening: stopListening,\r\n clearListeners: clearListenerMiddleware\r\n };\r\n}\r\n// src/index.ts\r\nenableES5();\r\nexport { MiddlewareArray, TaskAbortError, addListener, clearAllListeners, configureStore, createAction, createAsyncThunk, createDraftSafeSelector, createEntityAdapter, createImmutableStateInvariantMiddleware, createListenerMiddleware, default2 as createNextState, createReducer, createSelector2 as createSelector, createSerializableStateInvariantMiddleware, createSlice, current2 as current, findNonSerializableValue, freeze, getDefaultMiddleware, getType, isAllOf, isAnyOf, isAsyncThunkAction, isDraft4 as isDraft, isFulfilled, isImmutableDefault, isPending, isPlain, isPlainObject, isRejected, isRejectedWithValue, miniSerializeError, nanoid, original, removeListener, unwrapResult };\r\n//# sourceMappingURL=redux-toolkit.esm.js.map","import { AnyAction } from '@reduxjs/toolkit';\nimport { AppDispatch, RootState } from '../';\nimport { N2NFieldsType } from '../../layouts/devops-screen/types';\n\ntype N2NFieldProgressActionType = {\n readonly type: string;\n readonly payload?: {\n readonly fieldName: 'email' | 'password' | 'fullName' | 'sitenameNew';\n readonly isPopulated: boolean;\n };\n};\n\n// Actions\nconst INPUT_POPULATED_EMAIL = 'n2n-field-progress/INPUT_POPULATED_EMAIL';\nconst INPUT_POPULATED_PASSWORD = 'n2n-field-progress/INPUT_POPULATED_PASSWORD';\nconst INPUT_POPULATED_FULL_NAME =\n 'n2n-field-progress/INPUT_POPULATED_FULL_NAME';\n\n// Initial State\nconst initialState: N2NFieldsType = {\n email: false,\n password: false,\n fullName: false,\n sitenameNew: false\n};\n\n// Reducer\nexport const n2nFieldProgressReducer = (\n state = initialState,\n action: N2NFieldProgressActionType\n): N2NFieldsType => {\n switch (action.type) {\n case INPUT_POPULATED_EMAIL:\n case INPUT_POPULATED_PASSWORD:\n case INPUT_POPULATED_FULL_NAME:\n return Object.assign({}, state, {\n [action?.payload?.fieldName as string]: action?.payload?.isPopulated\n });\n default:\n return state;\n }\n};\n\n// Thunks\nexport function updateN2NFieldProgressEmail(payload: boolean) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldProgress: { email }\n } = getState();\n if (email !== payload) {\n dispatch({\n type: INPUT_POPULATED_EMAIL,\n payload: {\n fieldName: 'email',\n isPopulated: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NFieldProgressPassword(payload: boolean) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldProgress: { password }\n } = getState();\n if (password !== payload) {\n dispatch({\n type: INPUT_POPULATED_PASSWORD,\n payload: {\n fieldName: 'password',\n isPopulated: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NFieldProgressFullName(payload: boolean) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldProgress: { fullName }\n } = getState();\n if (fullName !== payload) {\n dispatch({\n type: INPUT_POPULATED_FULL_NAME,\n payload: {\n fieldName: 'fullName',\n isPopulated: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n","import { AnyAction } from '@reduxjs/toolkit';\nimport { AppDispatch, RootState } from '../';\nimport { ValidationStateType } from '../../layouts/devops-screen/types';\n\ntype N2NFieldValidationType = {\n readonly email?: ValidationStateType;\n readonly password?: ValidationStateType;\n readonly fullName?: ValidationStateType;\n readonly sitenameNew?: ValidationStateType;\n};\n\ntype N2NFieldValidationActionType = {\n readonly type: string;\n readonly payload?: {\n readonly fieldName: 'email' | 'password' | 'fullName' | 'sitenameNew';\n readonly validationState?: ValidationStateType;\n };\n};\n\n// Actions\nconst INPUT_VALIDATION_EMAIL = 'n2n-field-validation/INPUT_VALIDATION_EMAIL';\nconst INPUT_VALIDATION_PASSWORD =\n 'n2n-field-validation/INPUT_VALIDATION_PASSWORD';\nconst INPUT_VALIDATION_FULL_NAME =\n 'n2n-field-validation/INPUT_VALIDATION_FULL_NAME';\nconst INPUT_VALIDATION_SITENAME =\n 'n2n-field-validation/INPUT_VALIDATION_SITENAME';\n\n// Initial State\nconst initialState: N2NFieldValidationType = {\n email: undefined,\n password: undefined,\n fullName: undefined,\n sitenameNew: undefined\n};\n\n// Reducer\nexport const n2nFieldValidationReducer = (\n state = initialState,\n action: N2NFieldValidationActionType\n): N2NFieldValidationType => {\n switch (action.type) {\n case INPUT_VALIDATION_EMAIL:\n case INPUT_VALIDATION_PASSWORD:\n case INPUT_VALIDATION_FULL_NAME:\n case INPUT_VALIDATION_SITENAME:\n return Object.assign({}, state, {\n [action?.payload?.fieldName as string]: action?.payload?.validationState\n });\n default:\n return state;\n }\n};\n\n// Thunks\nexport function updateN2NFieldValidationEmail(payload: ValidationStateType) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldValidation: { email }\n } = getState();\n if (email !== payload) {\n dispatch({\n type: INPUT_VALIDATION_EMAIL,\n payload: {\n fieldName: 'email',\n validationState: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NFieldValidationPassword(payload: ValidationStateType) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldValidation: { password }\n } = getState();\n if (password !== payload) {\n dispatch({\n type: INPUT_VALIDATION_PASSWORD,\n payload: {\n fieldName: 'password',\n validationState: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NFieldValidationFullName(payload: ValidationStateType) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldValidation: { fullName }\n } = getState();\n if (fullName !== payload) {\n dispatch({\n type: INPUT_VALIDATION_FULL_NAME,\n payload: {\n fieldName: 'fullName',\n validationState: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NFieldValidationSitename(payload: ValidationStateType) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldValidation: { sitenameNew }\n } = getState();\n if (sitenameNew !== payload) {\n dispatch({\n type: INPUT_VALIDATION_SITENAME,\n payload: {\n fieldName: 'sitenameNew',\n validationState: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n","type LoggedInFormValidType = {\n readonly isValid: boolean;\n};\ntype LoggedInFormValidActionType = {\n readonly type: string;\n readonly payload?: LoggedInFormValidType;\n};\n\n// Actions\nconst SET_FORM_VALID = 'logged-in-form-valid/SET_FORM_VALID';\n\n// Initial State\nconst initialState: LoggedInFormValidType = {\n isValid: false\n};\n\n// Reducer\nexport const loggedInFormValidReducer = (\n state = initialState,\n action: LoggedInFormValidActionType\n): LoggedInFormValidType => {\n switch (action.type) {\n case SET_FORM_VALID:\n return Object.assign({}, state, { isValid: action.payload?.isValid });\n default:\n return state;\n }\n};\n\n// Action Creators\nexport function updateLoggedInFormValid(\n isValid: boolean\n): LoggedInFormValidActionType {\n return {\n type: SET_FORM_VALID,\n payload: {\n isValid\n }\n };\n}\n","import { ProductKey } from '@atlassiansox/bxpkit-core';\nimport { ProductPayloadType } from '../../layouts/devops-screen/types';\n\ntype LoggedInFormDataConsentType = {\n readonly marketingConsent?: boolean;\n};\n\ntype LoggedInFormDataProductType = {\n readonly cloudName?: string;\n readonly productsNew?: ProductPayloadType[];\n readonly productsExisting?: ProductKey[];\n readonly bbWorkspaceName?: string;\n};\n\ntype SubmitType =\n | undefined\n | 'shouldSubmit'\n | 'submitting'\n | 'success'\n | 'failure';\n\ntype LoggedInFormDataSubmitType = {\n readonly submitStatus: SubmitType;\n};\n\ntype LoggedInFormDataFreeBreachType = {\n readonly isSiteInFreeBreach: boolean;\n};\n\nexport type LoggedInFormDataType = LoggedInFormDataConsentType &\n LoggedInFormDataProductType &\n LoggedInFormDataSubmitType &\n LoggedInFormDataFreeBreachType;\n\ntype LoggedInFormDataActionType = {\n readonly type: string;\n readonly payload?: Partial | LoggedInFormDataType;\n};\n\n// Actions\nconst UPDATE_PRODUCTS = 'logged-in-form-data/UPDATE_PRODUCTS';\nconst UPDATE_CONSENT = 'logged-in-form-data/UPDATE_CONSENT';\nconst UPDATE_SUBMIT = 'logged-in-form-data/UPDATE_SUBMIT';\nconst UPDATE_FREE_BREACH = 'logged-in-form-data/UPDATE_FREE_BREACH';\n\n// Initial State\nconst initialState: LoggedInFormDataType = {\n cloudName: undefined,\n productsNew: undefined,\n productsExisting: undefined,\n marketingConsent: undefined,\n bbWorkspaceName: undefined,\n isSiteInFreeBreach: false,\n submitStatus: undefined\n};\n\n// Reducer\nexport const loggedInFormDataReducer = (\n state = initialState,\n action: LoggedInFormDataActionType\n): LoggedInFormDataType => {\n switch (action.type) {\n case UPDATE_PRODUCTS:\n return Object.assign({}, state, action.payload);\n case UPDATE_CONSENT:\n return {\n ...state,\n marketingConsent: action.payload?.marketingConsent\n };\n case UPDATE_SUBMIT:\n return {\n ...state,\n submitStatus: action.payload?.submitStatus\n };\n case UPDATE_FREE_BREACH:\n return {\n ...state,\n isSiteInFreeBreach: action.payload?.isSiteInFreeBreach || false\n };\n default:\n return state;\n }\n};\n\n// Action Creators\nexport function updateLoggedInFormDataProducts(\n payload: LoggedInFormDataProductType\n): LoggedInFormDataActionType {\n return {\n type: UPDATE_PRODUCTS,\n payload\n };\n}\n\nexport function updateLoggedInFormDataConsent(\n payload: LoggedInFormDataConsentType\n): LoggedInFormDataActionType {\n return {\n type: UPDATE_CONSENT,\n payload\n };\n}\n\nexport function updateLoggedInFormDataSubmitStatus(\n submitStatus: SubmitType\n): LoggedInFormDataActionType {\n return {\n type: UPDATE_SUBMIT,\n payload: {\n submitStatus\n }\n };\n}\n\nexport function updateLoggedInFormDataFreeBreach(\n isSiteInFreeBreach: boolean\n): LoggedInFormDataActionType {\n return {\n type: UPDATE_FREE_BREACH,\n payload: {\n isSiteInFreeBreach\n }\n };\n}\n","import { SanitizedFormattedHtmlMessageProps } from '@atlassiansox/bxpkit-core';\n\ntype SharedFormDataType = {\n readonly goToProductUrl: string;\n readonly submitErrorMessage?: SanitizedFormattedHtmlMessageProps;\n readonly resendEmailAddress: string;\n};\n\ntype SharedFormDataActionType = {\n readonly type: string;\n readonly payload?: Partial | SharedFormDataType;\n};\n\n// Actions\nconst UPDATE_GOTO_PRODUCT_URL = 'shared-form-data/UPDATE_GOTO_PRODUCT_URL';\nconst UPDATE_SUBMIT_ERROR_MESSAGE =\n 'shared-form-data/UPDATE_SUBMIT_ERROR_MESSAGE';\nconst UPDATE_RESEND_EMAIL_ADDRESS =\n 'shared-form-data/UPDATE_RESEND_EMAIL_ADDRESS';\n// Initial State\nconst initialState: SharedFormDataType = {\n goToProductUrl: '',\n submitErrorMessage: undefined,\n resendEmailAddress: ''\n};\n\n// Reducer\nexport const sharedFormDataReducer = (\n state = initialState,\n action: SharedFormDataActionType\n): SharedFormDataType => {\n switch (action.type) {\n case UPDATE_GOTO_PRODUCT_URL:\n return {\n ...state,\n goToProductUrl: action.payload?.goToProductUrl || ''\n };\n case UPDATE_SUBMIT_ERROR_MESSAGE:\n return {\n ...state,\n submitErrorMessage: action.payload?.submitErrorMessage\n };\n case UPDATE_RESEND_EMAIL_ADDRESS:\n return {\n ...state,\n resendEmailAddress: action.payload?.resendEmailAddress || ''\n };\n default:\n return state;\n }\n};\n\n// Action Creators\nexport function updateSharedFormDataGoToProductUrl(\n goToProductUrl: string\n): SharedFormDataActionType {\n return {\n type: UPDATE_GOTO_PRODUCT_URL,\n payload: {\n goToProductUrl\n }\n };\n}\n\nexport function updateSharedFormDataResendEmailAddress(\n resendEmailAddress: string\n): SharedFormDataActionType {\n return {\n type: UPDATE_RESEND_EMAIL_ADDRESS,\n payload: {\n resendEmailAddress\n }\n };\n}\n\nexport function updateSharedFormDataSubmitErrorMessage(\n submitErrorMessage: undefined | SanitizedFormattedHtmlMessageProps\n): SharedFormDataActionType {\n return {\n type: UPDATE_SUBMIT_ERROR_MESSAGE,\n payload: {\n submitErrorMessage\n }\n };\n}\n","import { AnyAction } from '@reduxjs/toolkit';\nimport { AppDispatch, RootState } from '../';\nimport { ValidationStateType } from '../../layouts/devops-screen/types';\n\ntype N2NDeferredPasswordFieldValidationType = {\n readonly email?: ValidationStateType;\n readonly fullName?: ValidationStateType;\n};\n\ntype N2NDeferredPasswordFieldValidationActionType = {\n readonly type: string;\n readonly payload?: {\n readonly fieldName: 'email' | 'fullName';\n readonly validationState?: ValidationStateType;\n };\n};\n\n// Actions\nconst INPUT_VALIDATION_EMAIL = 'n2n-field-validation/INPUT_VALIDATION_EMAIL';\nconst INPUT_VALIDATION_FULL_NAME =\n 'n2n-field-validation/INPUT_VALIDATION_FULL_NAME';\n\n// Initial State\nconst initialState: N2NDeferredPasswordFieldValidationType = {\n email: undefined,\n fullName: undefined\n};\n\n// Reducer\nexport const n2nDeferredPasswordFieldValidationReducer = (\n state = initialState,\n action: N2NDeferredPasswordFieldValidationActionType\n): N2NDeferredPasswordFieldValidationType => {\n switch (action.type) {\n case INPUT_VALIDATION_EMAIL:\n case INPUT_VALIDATION_FULL_NAME:\n return Object.assign({}, state, {\n [action?.payload?.fieldName as string]: action?.payload?.validationState\n });\n default:\n return state;\n }\n};\n\n// Thunks\nexport function updateN2NDeferredPasswordFieldValidationEmail(\n payload: ValidationStateType\n) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldValidation: { email }\n } = getState();\n if (email !== payload) {\n dispatch({\n type: INPUT_VALIDATION_EMAIL,\n payload: {\n fieldName: 'email',\n validationState: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NDeferredPasswordFieldValidationFullName(\n payload: ValidationStateType\n) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldValidation: { fullName }\n } = getState();\n if (fullName !== payload) {\n dispatch({\n type: INPUT_VALIDATION_FULL_NAME,\n payload: {\n fieldName: 'fullName',\n validationState: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n","import { AnyAction } from '@reduxjs/toolkit';\nimport { AppDispatch, RootState } from '../';\nimport { N2NDeferredPasswordFieldsType } from '../../layouts/devops-screen/types';\n\ntype N2NDeferredPasswordFieldProgressActionType = {\n readonly type: string;\n readonly payload?: {\n readonly fieldName: 'email' | 'fullName';\n readonly isPopulated: boolean;\n };\n};\n\n// Actions\nconst INPUT_POPULATED_EMAIL = 'n2n-field-progress/INPUT_POPULATED_EMAIL';\nconst INPUT_POPULATED_FULL_NAME =\n 'n2n-field-progress/INPUT_POPULATED_FULL_NAME';\n\n// Initial State\nconst initialState: N2NDeferredPasswordFieldsType = {\n email: false,\n fullName: false\n};\n\n// Reducer\nexport const n2nDeferredPasswordFieldProgressReducer = (\n state = initialState,\n action: N2NDeferredPasswordFieldProgressActionType\n): N2NDeferredPasswordFieldsType => {\n switch (action.type) {\n case INPUT_POPULATED_EMAIL:\n case INPUT_POPULATED_FULL_NAME:\n return Object.assign({}, state, {\n [action?.payload?.fieldName as string]: action?.payload?.isPopulated\n });\n default:\n return state;\n }\n};\n\n// Thunks\nexport function updateN2NDeferredPasswordFieldProgressEmail(payload: boolean) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldProgress: { email }\n } = getState();\n if (email !== payload) {\n dispatch({\n type: INPUT_POPULATED_EMAIL,\n payload: {\n fieldName: 'email',\n isPopulated: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n\nexport function updateN2NDeferredPasswordFieldProgressFullName(\n payload: boolean\n) {\n return ((dispatch: AppDispatch, getState: () => RootState) => {\n const {\n n2nFieldProgress: { fullName }\n } = getState();\n if (fullName !== payload) {\n dispatch({\n type: INPUT_POPULATED_FULL_NAME,\n payload: {\n fieldName: 'fullName',\n isPopulated: payload\n }\n });\n }\n }) as unknown as AnyAction;\n}\n","type LoggedInFormInputType = {\n readonly isNewSiteInput: boolean;\n};\ntype LoggedInFormInputActionType = {\n readonly type: string;\n readonly payload?: LoggedInFormInputType;\n};\n\n// Actions\nconst SET_FORM_INPUT = 'logged-in-form-input/SET_FORM_INPUT';\n\n// Initial State\nconst initialState: LoggedInFormInputType = {\n isNewSiteInput: true\n};\n\n// Reducer\nexport const loggedInFormInputReducer = (\n state = initialState,\n action: LoggedInFormInputActionType\n): LoggedInFormInputType => {\n switch (action.type) {\n case SET_FORM_INPUT:\n return Object.assign({}, state, {\n isNewSiteInput: action.payload?.isNewSiteInput\n });\n default:\n return state;\n }\n};\n\n// Action Creators\nexport function updateLoggedInFormInput(\n isNewSiteInput: boolean\n): LoggedInFormInputActionType {\n return {\n type: SET_FORM_INPUT,\n payload: {\n isNewSiteInput\n }\n };\n}\n","export const WAC_SIGNUP_FORM_KEY_BASE = 'WacSignupForm.';\nexport const SIGNUP_OFFERING_LABEL_KEY_BASE =\n WAC_SIGNUP_FORM_KEY_BASE + 'signupOffering';\nexport const TRIAL_DURATION_LABEL_KEY_BASE =\n SIGNUP_OFFERING_LABEL_KEY_BASE + 'TrialLengthText';\nexport const TRIAL_DURATION_LABEL_KEY_EXISTING_SITE =\n TRIAL_DURATION_LABEL_KEY_BASE + 'ExistingSite';\nexport const TRIAL_DURATION_LABEL_KEY_NEW_SITE =\n TRIAL_DURATION_LABEL_KEY_BASE + 'NewSite';\nexport const SIGNUP_OFFERING_LABEL_KEY_PREFIX =\n SIGNUP_OFFERING_LABEL_KEY_BASE + 'IncludesFeatures';\nexport const SIGNUP_SIDE_INFO_HEADER_PREFIX =\n WAC_SIGNUP_FORM_KEY_BASE + 'sideInfoHeader';\n\nexport const [\n CONFLUENCE,\n JIRA_CORE,\n JSW,\n JSD,\n OPSGENIE,\n BITBUCKET,\n STATUSPAGE,\n DEVELOPER_MODE,\n DEVOPS,\n TEAM_CENTRAL,\n JIRA_PRODUCT_DISCOVERY,\n COMPASS\n] = [\n 'Confluence',\n 'JiraCore',\n 'JSW',\n 'JSD',\n 'Opsgenie',\n 'Bitbucket',\n 'Statuspage',\n 'DeveloperMode',\n 'Devops',\n 'TeamCentral',\n 'JiraProductDiscovery',\n 'Compass'\n];\n\nexport const PRODUCT_NAMES = [\n JSD,\n OPSGENIE,\n BITBUCKET,\n STATUSPAGE,\n DEVELOPER_MODE,\n DEVOPS,\n CONFLUENCE,\n TEAM_CENTRAL,\n JSW,\n JIRA_PRODUCT_DISCOVERY\n];\nexport const STANDARD_EDITION_LABEL_KEY = 'Standard';\nexport const FREE_EDITION_LABEL_KEY = 'Free';\nexport const PREMIUM_EDITION_LABEL_KEY = 'Premium';\nexport const BETA_EDITION_LABEL_KEY = 'Beta';\nexport const BUNDLE_LABEL_KEY = 'Bundle';\nexport const MIGRATION_USERS_LABEL_KEY = 'userTypeUsersLabel';\nexport const MIGRATION_AGENTS_LABEL_KEY = 'userTypeAgentsLabel';\nexport const EDITION_LABEL_ARRAY = [\n STANDARD_EDITION_LABEL_KEY,\n FREE_EDITION_LABEL_KEY,\n PREMIUM_EDITION_LABEL_KEY,\n BETA_EDITION_LABEL_KEY\n];\n\nconst SOCIAL_PROOF_KEY_PREFIX =\n 'WacSignupForm.signupOfferingIncludesFeaturesSocialProof';\n\nexport const SOCIAL_PROOF_TEXT_KEY_PREFIX = SOCIAL_PROOF_KEY_PREFIX + 'Text';\nexport const SOCIAL_PROOF_SUPPORT_IMAGE_KEY_PREFIX =\n SOCIAL_PROOF_KEY_PREFIX + 'Image';\nexport const SOCIAL_PROOF_HERO_IMAGE_KEY_PREFIX =\n SOCIAL_PROOF_KEY_PREFIX + 'HeroImage';\n\nexport const FIRST_IMPRESSION_JIRA_SOFTWARE_FEATURE_LIST = 'JSWFI';\nexport const FIRST_IMPRESSION_JIRA_SERVICE_DESK_FEATURE_LIST = 'JSDFI';\n\nexport const DEFERRED_SITENAME_AVAILABLE_PRODUCTS = [\n 'jira-software.ondemand',\n 'confluence.ondemand'\n];\n\nexport const DEFERRED_SITENAME_AVAILABLE_EDITIONS = [\n FREE_EDITION_LABEL_KEY.toLowerCase(),\n STANDARD_EDITION_LABEL_KEY.toLowerCase(),\n PREMIUM_EDITION_LABEL_KEY.toLowerCase()\n];\n","import {\n getIsBundleBbJsw,\n getIsBundleDevops,\n ProductKey\n} from '@atlassiansox/bxpkit-core';\nimport _ from 'lodash';\nimport {\n GetEditionLabelsOptionsType,\n GetEditionLabelsReturnType,\n GetSideInfoHeaderOptionsType,\n GetTrialDurationSiteLabelOptionsType\n} from '../model';\nimport {\n BITBUCKET,\n BUNDLE_LABEL_KEY,\n DEVELOPER_MODE,\n DEVOPS,\n FIRST_IMPRESSION_JIRA_SOFTWARE_FEATURE_LIST,\n FREE_EDITION_LABEL_KEY,\n JIRA_CORE,\n JIRA_PRODUCT_DISCOVERY,\n JSD,\n JSW,\n OPSGENIE,\n SIGNUP_OFFERING_LABEL_KEY_PREFIX,\n SIGNUP_SIDE_INFO_HEADER_PREFIX,\n STATUSPAGE,\n TRIAL_DURATION_LABEL_KEY_EXISTING_SITE,\n TRIAL_DURATION_LABEL_KEY_NEW_SITE,\n WAC_SIGNUP_FORM_KEY_BASE\n} from './constants';\nimport { getProductNameFromKey } from './product-data';\nimport { BundleData } from './types';\n\n/**\n * Label for side-info header (if applicable)\n */\n\nexport const getSideInfoHeader = ({\n labels,\n productKeys,\n developerMode\n}: GetSideInfoHeaderOptionsType): string => {\n let contentKey = SIGNUP_SIDE_INFO_HEADER_PREFIX;\n\n if (getIsBundleBbJsw(productKeys)) {\n contentKey += BUNDLE_LABEL_KEY + JSW + BITBUCKET;\n }\n\n if (getIsBundleDevops(productKeys)) {\n contentKey += BUNDLE_LABEL_KEY + DEVOPS;\n }\n\n if (developerMode) {\n contentKey += BUNDLE_LABEL_KEY + DEVELOPER_MODE;\n }\n\n return labels[contentKey];\n};\n\n/**\n * Edition Labels, eg. 'Cloud Free', 'Cloud Premium'\n */\n\nexport const getEditionLabels = ({\n productKey,\n edition: originalEdition\n}: GetEditionLabelsOptionsType): GetEditionLabelsReturnType => {\n let editionLabel = `Cloud ${_.capitalize(\n originalEdition || FREE_EDITION_LABEL_KEY\n )}`;\n let featuresListEditionLabelKey = originalEdition || FREE_EDITION_LABEL_KEY;\n\n if (getProductNameFromKey(productKey) === BITBUCKET) {\n editionLabel = `Cloud ${_.capitalize(FREE_EDITION_LABEL_KEY)}`;\n featuresListEditionLabelKey = FREE_EDITION_LABEL_KEY;\n }\n\n if (getProductNameFromKey(productKey) === STATUSPAGE) {\n editionLabel = '';\n }\n\n return { editionLabel, featuresListEditionLabelKey };\n};\n\n/**\n * Trial duration text, eg. '1-month free cloud trial',\n * for existing sites\n *\n * Returns empty string for BB & Statuspage\n */\n\nexport const getTrialDurationExistingSiteLabel = ({\n productKey,\n labels\n}: GetTrialDurationSiteLabelOptionsType): string => {\n const productName = getProductNameFromKey(productKey);\n return productName === BITBUCKET || productName === STATUSPAGE\n ? ''\n : labels[TRIAL_DURATION_LABEL_KEY_EXISTING_SITE];\n};\n\n/**\n * Trial duration text, eg. '7-day free cloud trial',\n * for new sites\n *\n * Returns empty string for BB & Statuspage\n */\n\nexport const getTrialDurationNewSiteLabel = ({\n productKey,\n labels\n}: GetTrialDurationSiteLabelOptionsType): string => {\n const productName = getProductNameFromKey(productKey);\n return productName === BITBUCKET || productName === STATUSPAGE\n ? ''\n : labels[\n TRIAL_DURATION_LABEL_KEY_NEW_SITE +\n (productName === OPSGENIE ? OPSGENIE : '')\n ];\n};\n\n/**\n * Get list of features, eg. side-info 's\n */\n\nexport type Labels = { [key: string]: string };\n\nexport type MigrationDataType = {\n readonly migrationSourceUuid: string;\n readonly migrationUserLimit: number;\n readonly migrationUserType: string;\n readonly migrationProductName: string;\n readonly migrationSites: string[];\n readonly invalidMigration: boolean;\n readonly claimedMigration: boolean;\n};\n\nexport type GetFeaturesListOptions = {\n readonly labels: Labels;\n readonly bundleData: BundleData;\n readonly featuresListEditionLabelKey: string;\n readonly migrationData?: MigrationDataType;\n readonly developerMode?: boolean;\n};\n\nexport const getFeaturesList = ({\n labels,\n bundleData,\n featuresListEditionLabelKey,\n migrationData,\n developerMode\n}: GetFeaturesListOptions): string => {\n const isBundle = bundleData.products.length > 1;\n const edition = _.capitalize(featuresListEditionLabelKey);\n const includesJiraServiceManagement = _.includes(\n _.map(\n bundleData.products,\n (product) => product.productKey === ProductKey.JIRA_SERVICE_DESK\n ),\n true\n );\n\n if (migrationData && migrationData.migrationSourceUuid) {\n const migrationFeatureList =\n labels[`${WAC_SIGNUP_FORM_KEY_BASE}migrationFeatureList`] || '';\n if (\n migrationData.migrationUserLimit &&\n migrationData.migrationUserType &&\n migrationData.migrationProductName\n ) {\n return migrationFeatureList\n .replace('{productName}', migrationData.migrationProductName)\n .replace('{usageLimit}', migrationData.migrationUserLimit.toString())\n .replace('{userType}', migrationData.migrationUserType);\n }\n return migrationFeatureList;\n }\n\n const primaryProductKey = bundleData.products[0].productKey;\n let productNameFromKey = getProductNameFromKey(primaryProductKey);\n\n // JSD Standalone\n if (primaryProductKey.includes(ProductKey.JIRA_SERVICE_DESK)) {\n productNameFromKey = JSD;\n }\n\n // Jira Core Standalone\n if (primaryProductKey.includes(ProductKey.JIRA_CORE)) {\n productNameFromKey = JIRA_CORE;\n }\n\n // Jira Software Standalone\n if (primaryProductKey.includes(ProductKey.JIRA_SOFTWARE)) {\n productNameFromKey = FIRST_IMPRESSION_JIRA_SOFTWARE_FEATURE_LIST;\n }\n\n // Free bundles that include JSD\n if (\n isBundle &&\n includesJiraServiceManagement &&\n edition === FREE_EDITION_LABEL_KEY\n ) {\n productNameFromKey = BUNDLE_LABEL_KEY + JSD;\n }\n\n // jira-software-bitbucket\n if (bundleData.bundleName === 'jira-software-bitbucket') {\n productNameFromKey = BUNDLE_LABEL_KEY + JSW + BITBUCKET;\n }\n\n // devops\n if (bundleData.bundleName === 'devops') {\n productNameFromKey = BUNDLE_LABEL_KEY + DEVOPS;\n }\n\n if (developerMode) {\n productNameFromKey = BUNDLE_LABEL_KEY + DEVELOPER_MODE;\n }\n\n // team central\n if (primaryProductKey.includes(ProductKey.TEAM_CENTRAL)) {\n productNameFromKey = 'TeamCentral';\n }\n\n // Jira Product Discovery\n if (primaryProductKey.includes(ProductKey.JIRA_PRODUCT_DISCOVERY)) {\n productNameFromKey = JIRA_PRODUCT_DISCOVERY;\n }\n\n return labels[\n SIGNUP_OFFERING_LABEL_KEY_PREFIX + edition + productNameFromKey\n ];\n};\n","import _ from 'lodash';\nimport { IncludesProductOptionsType, ProductKeysType } from '../model';\nimport { BITBUCKET, OPSGENIE, PRODUCT_NAMES } from './constants';\n\n/**\n * Given Product Key, return Product name\n */\n\nexport const getProductNameFromKey = (productKey: string): string => {\n const nameIdx = PRODUCT_NAMES.map((name: string) =>\n name.toLowerCase()\n ).findIndex((productName) => productKey.includes(productName));\n return nameIdx === -1 ? '' : PRODUCT_NAMES[nameIdx];\n};\n\n/**\n * Check for a matching productName within products\n */\n\nexport const includesProduct = ({\n products,\n productName\n}: IncludesProductOptionsType): boolean => {\n return products.some(({ product: productKey }) => {\n if (typeof productKey !== 'string') {\n return false;\n }\n return getProductNameFromKey(productKey) === productName;\n });\n};\n\nexport const onProductsRequireSitename = (productKeys: ProductKeysType[]) => {\n return productKeys\n .map(({ product: productKey }) => productKey)\n .map(getProductNameFromKey)\n .some((productName: string) => [BITBUCKET, OPSGENIE].includes(productName));\n};\n","import { ProductDataType } from '../model';\nimport { BundleData } from './types';\nimport _ from 'lodash';\nimport { FREE_EDITION_LABEL_KEY } from './constants';\n\nexport type GetBundleDataOptions = {\n readonly activeBundlesMap: { [key: string]: ProductDataType };\n readonly bundleName?: string;\n readonly productKeys?: string;\n readonly edition?: string;\n};\n\nexport function getBundleData({\n activeBundlesMap,\n bundleName,\n productKeys,\n edition\n}: GetBundleDataOptions): BundleData {\n let bundleData;\n\n if (bundleName && bundleName.length) {\n bundleData = getBundleDataByBundleName({\n activeBundlesMap,\n bundleName,\n edition\n });\n } else if (productKeys && productKeys.length) {\n bundleData = getBundleDataByProduct({\n activeBundlesMap,\n productKeys,\n edition\n });\n }\n\n // if all else fails, go with default\n if (!bundleData) {\n return {\n ...activeBundlesMap['default'],\n bundleName: 'default',\n edition: FREE_EDITION_LABEL_KEY.toLowerCase()\n };\n }\n\n return bundleData;\n}\n\nfunction getBundleDataByProduct({\n activeBundlesMap,\n productKeys,\n edition = FREE_EDITION_LABEL_KEY.toLowerCase()\n}: GetBundleDataOptions): BundleData | undefined {\n if (productKeys) {\n const entry = Object.entries(activeBundlesMap).find(\n ([_, rawBundleData]) => {\n return rawBundleData.bundleProductKeys === `${productKeys}`;\n }\n );\n\n if (entry) {\n const [bundleName, rawBundleData] = entry;\n return {\n ...rawBundleData,\n bundleName,\n edition\n };\n }\n }\n\n return undefined;\n}\n\nfunction getBundleDataByBundleName({\n activeBundlesMap,\n bundleName,\n edition = FREE_EDITION_LABEL_KEY.toLowerCase()\n}: GetBundleDataOptions): BundleData | undefined {\n if (bundleName) {\n const rawBundleData = activeBundlesMap[bundleName];\n if (rawBundleData) {\n return {\n ...rawBundleData,\n bundleName,\n edition\n };\n }\n }\n\n return undefined;\n}\n","import { messages } from '../messages';\nimport { BundleData } from './types';\nimport ReactIntl from 'react-intl';\n\nexport interface PageHeaderLabelsParameters {\n readonly labels: {\n [key: string]: string;\n };\n readonly bundleData: BundleData;\n readonly skip?: boolean;\n}\n\nexport type PageHeaderLabels = {\n heading: ReactIntl.FormattedMessage.MessageDescriptor;\n subheading: ReactIntl.FormattedMessage.MessageDescriptor;\n};\n\nexport const getPageHeaderLabels = ({\n labels,\n bundleData,\n skip\n}: PageHeaderLabelsParameters): PageHeaderLabels => {\n if (skip) {\n return {\n heading: messages.heading,\n subheading: messages.subheading\n };\n }\n const editionLabelFragment = getEditionLabelFragment(bundleData.edition);\n const productLabelFragment = getProductLabelFragment(bundleData);\n\n const headingLabel = `${messages.heading.id}${editionLabelFragment}${productLabelFragment}`;\n const subheadingLabel = `${messages.subheading.id}${editionLabelFragment}${productLabelFragment}`;\n\n return {\n heading: {\n id: headingLabel,\n defaultMessage: labels[headingLabel] || messages.heading.defaultMessage\n },\n subheading: {\n id: subheadingLabel,\n defaultMessage:\n labels[subheadingLabel] || messages.subheading.defaultMessage\n }\n };\n};\n\nexport const getEditionLabelFragment = (edition: string) => {\n const matcher: Array<[RegExp, string]> = [\n [/free/gi, 'Free'],\n [/standard/gi, 'Standard'],\n [/premium/gi, 'Standard'],\n [/.*/, 'Free']\n ];\n\n const [, label] = matcher.find(([regex]) => regex.test(edition)) || [];\n return label;\n};\n\nconst JSD_KEY = 'jira-servicedesk.ondemand';\n\nexport const getProductLabelFragment = (bundleData: BundleData) => {\n switch (bundleData.products[0].productKey) {\n case JSD_KEY:\n return 'JSD';\n default:\n return '';\n }\n};\n","// Here is the ticket, where we pulled the offering ID's\n// https://hello.atlassian.net/browse/BXPSU-421\n\nimport { ProductKey as ProductKeys } from '@atlassiansox/bxpkit-core';\n\nconst OFFERING_IDS = {\n dev: {\n [ProductKeys.JIRA_SOFTWARE]: {\n free: {\n offeringId: 'de2887c9-8a55-41d5-b5cf-ad6a5589ebed',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: 'a70b5cbb-1ae1-4003-8f4a-9001a4a50526',\n pricingPlanid: 'd97d4daa-5056-4166-bac5-f47f6fb1d61a',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: '6dd805b4-da75-4374-a7a7-cf0b12f7ea07',\n pricingPlanid: 'eb6aea61-c089-4e19-935b-722cdb6a73c2',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.CONFLUENCE]: {\n free: {\n offeringId: '7547cfd6-a804-4e42-8bed-e656d49ea09e',\n pricingPlanid: '',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '2eda1119-fab4-4699-ab37-ff8f12052cde',\n pricingPlanid: '21b9b9a5-bf91-4872-a79c-51d2c4b3890d',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: '06ef245c-5fa3-473b-8822-5e6fe072ae4b',\n pricingPlanid: '61b1d866-dd64-4e53-a256-ac4391ac4df2',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.JIRA_SERVICE_MANAGEMENT]: {\n free: {\n offeringId: '2bad3c2f-d740-44a9-b08d-849202f11830',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'free',\n chargeDetail: 'agent'\n },\n standard: {\n offeringId: '396efb16-749b-41fa-9cd1-ad10cfefa1d0',\n pricingPlanid: '93a91ad0-22cf-42c6-8716-45a442158e72',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'standard',\n chargeDetail: 'agent'\n },\n premium: {\n offeringId: '0c6683b4-4633-4673-beca-690d171de6a5',\n pricingPlanid: '6f874c58-bc2e-464e-aea4-9892c0541c92',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'premium',\n chargeDetail: 'agent'\n }\n },\n [ProductKeys.JIRA_WORK_MANAGEMENT]: {\n free: {\n offeringId: '769055e8-05f5-4b1a-ba1a-a1afc874ee6d',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_WORK_MANAGEMENT,\n edition: 'free',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.JIRA_PRODUCT_DISCOVERY]: {\n free: {\n offeringId: 'a26ee53d-d28b-49c7-b97d-1a80b387fd60',\n pricingPlanid: '',\n productKey: 'jira-product-discovery',\n edition: 'free',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.COMPASS]: {\n beta: {\n offeringId: '7af07cb3-d4e5-473e-87b3-3ae3bc9248a6',\n pricingPlanid: '',\n productKey: 'compass',\n edition: 'beta',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '5ab35ef5-e441-493a-b6e0-ba2d21a72ac6',\n pricingPlanid: 'f7ce8df0-eae8-44fd-93cc-414b58b3ae5c',\n productKey: ProductKeys.JIRA_WORK_MANAGEMENT,\n edition: 'standard',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.ATLAS]: {\n free: {\n offeringId: '88064fa1-b573-4358-a9de-ec350aac1ddc',\n pricingPlanid: '',\n productKey: ProductKeys.ATLAS,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '01c8ddad-8ea4-4da9-8127-71d6ff6de1c9',\n pricingPlanid: 'b7847fa6-a4c9-4866-938a-0a37ade8f17c',\n productKey: ProductKeys.ATLAS,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: 'f7866043-d6e4-4d54-9c6a-4f82c6a1ebe5',\n pricingPlanid: '6924e04b-7e7f-413a-80ad-8a1cee5129c5',\n productKey: ProductKeys.ATLAS,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.OPSGENIE]: {\n free: {\n offeringId: 'd0c6ab1d-d8ea-49f8-8893-eafca2e05158',\n pricingPlanid: '',\n productKey: ProductKeys.OPSGENIE,\n edition: 'essentials',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.FABRIC]: {\n free: {\n offeringId: 'b0c7b413-b264-4c01-8b67-c61aa2c3e455',\n pricingPlanid: '',\n productKey: ProductKeys.FABRIC,\n edition: 'free',\n chargeDetail: 'user'\n }\n }\n },\n staging: {\n [ProductKeys.JIRA_SOFTWARE]: {\n free: {\n offeringId: 'de2887c9-8a55-41d5-b5cf-ad6a5589ebed',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'free',\n chargeDetail: 'user',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n },\n standard: {\n offeringId: 'a70b5cbb-1ae1-4003-8f4a-9001a4a50526',\n pricingPlanid: 'd97d4daa-5056-4166-bac5-f47f6fb1d61a',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'standard',\n chargeDetail: 'user',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n },\n premium: {\n offeringId: '6dd805b4-da75-4374-a7a7-cf0b12f7ea07',\n pricingPlanid: 'eb6aea61-c089-4e19-935b-722cdb6a73c2',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'premium',\n chargeDetail: 'user',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n }\n },\n [ProductKeys.CONFLUENCE]: {\n free: {\n offeringId: '7547cfd6-a804-4e42-8bed-e656d49ea09e',\n pricingPlanid: '',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '2eda1119-fab4-4699-ab37-ff8f12052cde',\n pricingPlanid: '21b9b9a5-bf91-4872-a79c-51d2c4b3890d',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: '06ef245c-5fa3-473b-8822-5e6fe072ae4b',\n pricingPlanid: '61b1d866-dd64-4e53-a256-ac4391ac4df2',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.JIRA_SERVICE_MANAGEMENT]: {\n free: {\n offeringId: '2bad3c2f-d740-44a9-b08d-849202f11830',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'free',\n chargeDetail: 'agent',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n },\n standard: {\n offeringId: '396efb16-749b-41fa-9cd1-ad10cfefa1d0',\n pricingPlanid: '93a91ad0-22cf-42c6-8716-45a442158e72',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'standard',\n chargeDetail: 'agent',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n },\n premium: {\n offeringId: '0c6683b4-4633-4673-beca-690d171de6a5',\n pricingPlanid: '6f874c58-bc2e-464e-aea4-9892c0541c92',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'premium',\n chargeDetail: 'agent',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n }\n },\n [ProductKeys.JIRA_WORK_MANAGEMENT]: {\n free: {\n offeringId: '769055e8-05f5-4b1a-ba1a-a1afc874ee6d',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_WORK_MANAGEMENT,\n edition: 'free',\n chargeDetail: 'user',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n },\n standard: {\n offeringId: '5ab35ef5-e441-493a-b6e0-ba2d21a72ac6',\n pricingPlanid: 'f7ce8df0-eae8-44fd-93cc-414b58b3ae5c',\n productKey: ProductKeys.JIRA_WORK_MANAGEMENT,\n edition: 'standard',\n chargeDetail: 'user',\n jiraFamilyOfferingId: '009f8789-c10c-4366-9420-f712d02a6499'\n }\n },\n [ProductKeys.JIRA_PRODUCT_DISCOVERY]: {\n free: {\n offeringId: 'a26ee53d-d28b-49c7-b97d-1a80b387fd60',\n pricingPlanid: '',\n productKey: 'jira-product-discovery',\n edition: 'free',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.COMPASS]: {\n beta: {\n offeringId: '7af07cb3-d4e5-473e-87b3-3ae3bc9248a6',\n pricingPlanid: '',\n productKey: 'compass',\n edition: 'beta',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.ATLAS]: {\n free: {\n offeringId: '88064fa1-b573-4358-a9de-ec350aac1ddc',\n pricingPlanid: '',\n productKey: ProductKeys.ATLAS,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '01c8ddad-8ea4-4da9-8127-71d6ff6de1c9',\n pricingPlanid: 'b7847fa6-a4c9-4866-938a-0a37ade8f17c',\n productKey: ProductKeys.ATLAS,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: 'f7866043-d6e4-4d54-9c6a-4f82c6a1ebe5',\n pricingPlanid: '6924e04b-7e7f-413a-80ad-8a1cee5129c5',\n productKey: ProductKeys.ATLAS,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.OPSGENIE]: {\n free: {\n offeringId: 'd0c6ab1d-d8ea-49f8-8893-eafca2e05158',\n pricingPlanid: '',\n productKey: ProductKeys.OPSGENIE,\n edition: 'essentials',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.FABRIC]: {\n free: {\n offeringId: 'b0c7b413-b264-4c01-8b67-c61aa2c3e455',\n pricingPlanid: '',\n productKey: ProductKeys.FABRIC,\n edition: 'free',\n chargeDetail: 'user'\n }\n }\n },\n production: {\n [ProductKeys.JIRA_SOFTWARE]: {\n free: {\n offeringId: 'de2887c9-8a55-41d5-b5cf-ad6a5589ebed',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: 'a70b5cbb-1ae1-4003-8f4a-9001a4a50526',\n pricingPlanid: 'e56cc79e-f64f-4d8d-8e46-cadf12cc996b',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: '6dd805b4-da75-4374-a7a7-cf0b12f7ea07',\n pricingPlanid: 'b1ed9a2b-0be1-4937-a245-cf0ef284c942',\n productKey: ProductKeys.JIRA_SOFTWARE,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.CONFLUENCE]: {\n free: {\n offeringId: '7547cfd6-a804-4e42-8bed-e656d49ea09e',\n pricingPlanid: '',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '2eda1119-fab4-4699-ab37-ff8f12052cde',\n pricingPlanid: 'b14bb264-35aa-4e77-bac1-e5607a0e3d65',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'standard',\n chargeDetail: 'user'\n },\n premium: {\n offeringId: '06ef245c-5fa3-473b-8822-5e6fe072ae4b',\n pricingPlanid: '42602e20-40fd-4438-88b2-2dcf06be11db',\n productKey: ProductKeys.CONFLUENCE,\n edition: 'premium',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.JIRA_SERVICE_MANAGEMENT]: {\n free: {\n offeringId: '2bad3c2f-d740-44a9-b08d-849202f11830',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'free',\n chargeDetail: 'agent'\n },\n standard: {\n offeringId: '396efb16-749b-41fa-9cd1-ad10cfefa1d0',\n pricingPlanid: 'a083dfe6-eee6-4aea-bb66-81d56e119d96',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'standard',\n chargeDetail: 'agent'\n },\n premium: {\n offeringId: '0c6683b4-4633-4673-beca-690d171de6a5',\n pricingPlanid: '4c26f928-ba05-4fff-b728-45ad696e34ac',\n productKey: ProductKeys.JIRA_SERVICE_MANAGEMENT,\n edition: 'premium',\n chargeDetail: 'agent'\n }\n },\n [ProductKeys.JIRA_WORK_MANAGEMENT]: {\n free: {\n offeringId: '769055e8-05f5-4b1a-ba1a-a1afc874ee6d',\n pricingPlanid: '',\n productKey: ProductKeys.JIRA_WORK_MANAGEMENT,\n edition: 'free',\n chargeDetail: 'user'\n },\n standard: {\n offeringId: '5ab35ef5-e441-493a-b6e0-ba2d21a72ac6',\n pricingPlanid: 'c536022f-f6e8-4c40-a9b6-5a7501d5e093',\n productKey: ProductKeys.JIRA_WORK_MANAGEMENT,\n edition: 'standard',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.JIRA_PRODUCT_DISCOVERY]: {\n free: {\n offeringId: 'a26ee53d-d28b-49c7-b97d-1a80b387fd60',\n pricingPlanid: '',\n productKey: 'jira-product-discovery',\n edition: 'free',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.COMPASS]: {\n beta: {\n offeringId: '7af07cb3-d4e5-473e-87b3-3ae3bc9248a6',\n pricingPlanid: '',\n productKey: 'compass',\n edition: 'beta',\n chargeDetail: 'user'\n }\n },\n [ProductKeys.FABRIC]: {\n free: {\n offeringId: 'b0c7b413-b264-4c01-8b67-c61aa2c3e455',\n pricingPlanid: '',\n productKey: ProductKeys.FABRIC,\n edition: 'free',\n chargeDetail: 'user'\n }\n }\n }\n} as const;\n\nexport type EnvironmentType = keyof typeof OFFERING_IDS;\n\nexport type CcpProduct = {\n readonly offeringId: string;\n readonly pricingPlanid: string;\n readonly productKey: string;\n readonly edition: string;\n readonly chargeDetail: string;\n};\n\ntype MapProductKeyAndEditionToCcpProductOptions = {\n productKey: ProductKeys;\n edition: string;\n};\n\nexport class OfferingCatalog {\n private readonly environmentType: EnvironmentType;\n\n public constructor(environmentType: EnvironmentType) {\n this.environmentType = environmentType;\n }\n\n public mapProductKeyAndEditionToCcpProduct = ({\n productKey,\n edition\n }: MapProductKeyAndEditionToCcpProductOptions): CcpProduct => {\n const products = OFFERING_IDS[this.environmentType];\n const editions =\n OFFERING_IDS[this.environmentType][productKey as keyof typeof products];\n\n return products[productKey as keyof typeof products][\n edition as keyof typeof editions\n ] as CcpProduct;\n };\n}\n","import {\n DEFERRED_SITENAME_AVAILABLE_PRODUCTS,\n DEFERRED_SITENAME_AVAILABLE_EDITIONS\n} from '../../utility';\nimport { AppDispatch, RootState, FeatureFlagState } from '../';\nimport { ProductKeysType } from '@atlassiansox/bxpkit-core';\n\ntype DeferredSiteNameType = {\n readonly isEnabled: boolean;\n};\n\ntype DeferredSiteNameThunkType = {\n readonly featureFlags: FeatureFlagState;\n readonly productKeys: ProductKeysType[];\n};\n\ntype DeferredSiteNameActionType = {\n readonly type: string;\n readonly payload?: DeferredSiteNameType &\n DeferredSiteNameThunkType &\n ProductKeysType[];\n};\n\n// Actions\nconst SET_STATUS = 'deferred-sitename/SET_STATUS';\n\n// Initial State\nconst initialState: DeferredSiteNameType = {\n isEnabled: false\n};\n\n// Reducer\nexport const deferredSiteNameReducer = (\n state = initialState,\n action: DeferredSiteNameActionType\n): DeferredSiteNameType => {\n switch (action.type) {\n case SET_STATUS:\n const isEnabled =\n action.payload?.featureFlags.enableDeferredSiteName &&\n action.payload?.productKeys &&\n action.payload?.productKeys.length > 0 &&\n action.payload?.productKeys.filter(\n (p: ProductKeysType) =>\n p.product &&\n DEFERRED_SITENAME_AVAILABLE_PRODUCTS.includes(p.product) &&\n p.edition &&\n DEFERRED_SITENAME_AVAILABLE_EDITIONS.includes(p.edition)\n ).length === action.payload.productKeys.length;\n return { ...state, isEnabled: !!isEnabled };\n default:\n return state;\n }\n};\n\n// Thunks\nexport function updateDeferredSiteNameStatus() {\n return (dispatch: AppDispatch, getState: () => RootState) => {\n const { featureFlags, productKeys } = getState();\n dispatch({ type: SET_STATUS, payload: { featureFlags, productKeys } });\n };\n}\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport type { RootState } from '../store';\n\nexport type FeatureFlagState = {\n readonly enableTintinMvp: boolean;\n readonly enableEmbeddedBundles: boolean;\n readonly enableDevopsGoogleSignup: boolean;\n readonly provisionSecondPartyApps: boolean;\n readonly enableDeferredSiteName: boolean;\n readonly enableDeferredFullName: boolean;\n};\n\nconst initialState = {\n enableTintinMvp: false,\n enableEmbeddedBundles: false,\n enableDevopsGoogleSignup: false,\n provisionSecondPartyApps: false,\n enableDeferredSiteName: false,\n enableDeferredFullName: false\n} as FeatureFlagState;\n\nconst sliceFeatureFlags = createSlice({\n name: 'featureFlags',\n initialState,\n reducers: {\n updateFeatureFlags(state, action: PayloadAction>) {\n return { ...state, ...action.payload };\n }\n }\n});\n\n// export actions\nexport const { updateFeatureFlags } = sliceFeatureFlags.actions;\n// optional - convenience function / state selector for minimal consumer syntax\nexport const selectFeatureFlags = (state: RootState) => state.featureFlags;\n// export named reducer (for nicer syntax in store)\nexport const { reducer: reducerFeatureFlags } = sliceFeatureFlags;\n","import { createSlice, PayloadAction } from '@reduxjs/toolkit';\nimport { ProductKeysType } from '../../model';\n\nconst initialState: ProductKeysType[] = [];\n\nconst sliceProductKeys = createSlice({\n name: 'productKeys',\n initialState,\n reducers: {\n updateProductKeys(state, action: PayloadAction) {\n state = action.payload;\n return state;\n }\n }\n});\n\n// export actions\nexport const { updateProductKeys } = sliceProductKeys.actions;\n// export named reducer (for nicer syntax in store)\nexport const { reducer: reducerProductKeys } = sliceProductKeys;\n","import { configureStore } from '@reduxjs/toolkit';\nimport {\n loggedInFormDataReducer as loggedInFormData,\n loggedInFormInputReducer as formInputSelection,\n loggedInFormValidReducer as loggedInFormValid,\n n2nDeferredPasswordFieldProgressReducer as n2nDeferredPasswordProgress,\n n2nDeferredPasswordFieldValidationReducer as n2nDeferredPasswordFieldValidation,\n n2nFieldProgressReducer as n2nFieldProgress,\n n2nFieldValidationReducer as n2nFieldValidation,\n sharedFormDataReducer as sharedFormData\n} from './ducks-devops';\nimport { deferredSiteNameReducer as deferredSiteName } from './ducks-experimentation';\nimport { reducerFeatureFlags, reducerProductKeys } from './slice';\n\nconst store = configureStore({\n reducer: {\n // ------ Global Redux Slices --\n featureFlags: reducerFeatureFlags,\n productKeys: reducerProductKeys,\n // ------ Devops ducks ------\n n2nFieldProgress,\n n2nFieldValidation,\n n2nDeferredPasswordFieldValidation,\n n2nDeferredPasswordProgress,\n loggedInFormValid,\n loggedInFormData,\n sharedFormData,\n formInputSelection,\n // ------ Experimentation ducks ------\n deferredSiteName\n },\n devTools: {\n name: '@atlassiansox/bxpkit-wac-sign-up/global'\n }\n});\n\n// Infer the `RootState` and `AppDispatch` types from the store itself\nexport type RootState = ReturnType;\n// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}\nexport type AppDispatch = typeof store.dispatch;\n\nexport default store;\n","import React from 'react';\nexport var ReactReduxContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ReactReduxContext.displayName = 'ReactRedux';\n}\n\nexport default ReactReduxContext;","// Default to a dummy \"batch\" implementation that just runs the callback\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\nvar batch = defaultNoopBatch; // Allow injecting another batching function later\n\nexport var setBatch = function setBatch(newBatch) {\n return batch = newBatch;\n}; // Supply a getter just to skip dealing with ESM bindings\n\nexport var getBatch = function getBatch() {\n return batch;\n};","import { getBatch } from './batch'; // encapsulates the subscription logic for connecting a component to the redux store, as\n// well as nesting subscriptions of descendant components, so that we can ensure the\n// ancestor components re-render before descendants\n\nfunction createListenerCollection() {\n var batch = getBatch();\n var first = null;\n var last = null;\n return {\n clear: function clear() {\n first = null;\n last = null;\n },\n notify: function notify() {\n batch(function () {\n var listener = first;\n\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get: function get() {\n var listeners = [];\n var listener = first;\n\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n\n return listeners;\n },\n subscribe: function subscribe(callback) {\n var isSubscribed = true;\n var listener = last = {\n callback: callback,\n next: null,\n prev: last\n };\n\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\n\nvar nullListeners = {\n notify: function notify() {},\n get: function get() {\n return [];\n }\n};\nexport function createSubscription(store, parentSub) {\n var unsubscribe;\n var listeners = nullListeners;\n\n function addNestedSub(listener) {\n trySubscribe();\n return listeners.subscribe(listener);\n }\n\n function notifyNestedSubs() {\n listeners.notify();\n }\n\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n\n function isSubscribed() {\n return Boolean(unsubscribe);\n }\n\n function trySubscribe() {\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n\n function tryUnsubscribe() {\n if (unsubscribe) {\n unsubscribe();\n unsubscribe = undefined;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n\n var subscription = {\n addNestedSub: addNestedSub,\n notifyNestedSubs: notifyNestedSubs,\n handleChangeWrapper: handleChangeWrapper,\n isSubscribed: isSubscribed,\n trySubscribe: trySubscribe,\n tryUnsubscribe: tryUnsubscribe,\n getListeners: function getListeners() {\n return listeners;\n }\n };\n return subscription;\n}","import { useEffect, useLayoutEffect } from 'react'; // React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser. We need useLayoutEffect to ensure the store\n// subscription callback always has the selector from the latest render commit\n// available, otherwise a store update may happen between render and the effect,\n// which may cause missed updates; we also must ensure the store subscription\n// is created synchronously, otherwise a store update may occur before the\n// subscription is created and an inconsistent state may be observed\n\nexport var useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;","import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { ReactReduxContext } from './Context';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\n\nfunction Provider(_ref) {\n var store = _ref.store,\n context = _ref.context,\n children = _ref.children;\n var contextValue = useMemo(function () {\n var subscription = createSubscription(store);\n return {\n store: store,\n subscription: subscription\n };\n }, [store]);\n var previousState = useMemo(function () {\n return store.getState();\n }, [store]);\n useIsomorphicLayoutEffect(function () {\n var subscription = contextValue.subscription;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n\n return function () {\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n };\n }, [contextValue, previousState]);\n var Context = context || ReactReduxContext;\n return /*#__PURE__*/React.createElement(Context.Provider, {\n value: contextValue\n }, children);\n}\n\nif (process.env.NODE_ENV !== 'production') {\n Provider.propTypes = {\n store: PropTypes.shape({\n subscribe: PropTypes.func.isRequired,\n dispatch: PropTypes.func.isRequired,\n getState: PropTypes.func.isRequired\n }),\n context: PropTypes.object,\n children: PropTypes.any\n };\n}\n\nexport default Provider;","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\n/**\r\n * A hook to access the value of the `ReactReduxContext`. This is a low-level\r\n * hook that you should usually not need to call directly.\r\n *\r\n * @returns {any} the value of the `ReactReduxContext`\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useReduxContext } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const { store } = useReduxContext()\r\n * return {store.getState()}
\r\n * }\r\n */\n\nexport function useReduxContext() {\n var contextValue = useContext(ReactReduxContext);\n\n if (process.env.NODE_ENV !== 'production' && !contextValue) {\n throw new Error('could not find react-redux context value; please ensure the component is wrapped in a ');\n }\n\n return contextValue;\n}","import { useContext } from 'react';\nimport { ReactReduxContext } from '../components/Context';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\n/**\r\n * Hook factory, which creates a `useStore` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useStore` hook bound to the specified context.\r\n */\n\nexport function createStoreHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useStore() {\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store;\n\n return store;\n };\n}\n/**\r\n * A hook to access the redux store.\r\n *\r\n * @returns {any} the redux store\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useStore } from 'react-redux'\r\n *\r\n * export const ExampleComponent = () => {\r\n * const store = useStore()\r\n * return {store.getState()}
\r\n * }\r\n */\n\nexport var useStore = /*#__PURE__*/createStoreHook();","import { ReactReduxContext } from '../components/Context';\nimport { useStore as useDefaultStore, createStoreHook } from './useStore';\n/**\r\n * Hook factory, which creates a `useDispatch` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useDispatch` hook bound to the specified context.\r\n */\n\nexport function createDispatchHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useStore = context === ReactReduxContext ? useDefaultStore : createStoreHook(context);\n return function useDispatch() {\n var store = useStore();\n return store.dispatch;\n };\n}\n/**\r\n * A hook to access the redux `dispatch` function.\r\n *\r\n * @returns {any|function} redux store's `dispatch` function\r\n *\r\n * @example\r\n *\r\n * import React, { useCallback } from 'react'\r\n * import { useDispatch } from 'react-redux'\r\n *\r\n * export const CounterComponent = ({ value }) => {\r\n * const dispatch = useDispatch()\r\n * const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])\r\n * return (\r\n * \r\n * {value}\r\n * \r\n *
\r\n * )\r\n * }\r\n */\n\nexport var useDispatch = /*#__PURE__*/createDispatchHook();","import { useReducer, useRef, useMemo, useContext, useDebugValue } from 'react';\nimport { useReduxContext as useDefaultReduxContext } from './useReduxContext';\nimport { createSubscription } from '../utils/Subscription';\nimport { useIsomorphicLayoutEffect } from '../utils/useIsomorphicLayoutEffect';\nimport { ReactReduxContext } from '../components/Context';\n\nvar refEquality = function refEquality(a, b) {\n return a === b;\n};\n\nfunction useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub) {\n var _useReducer = useReducer(function (s) {\n return s + 1;\n }, 0),\n forceRender = _useReducer[1];\n\n var subscription = useMemo(function () {\n return createSubscription(store, contextSub);\n }, [store, contextSub]);\n var latestSubscriptionCallbackError = useRef();\n var latestSelector = useRef();\n var latestStoreState = useRef();\n var latestSelectedState = useRef();\n var storeState = store.getState();\n var selectedState;\n\n try {\n if (selector !== latestSelector.current || storeState !== latestStoreState.current || latestSubscriptionCallbackError.current) {\n var newSelectedState = selector(storeState); // ensure latest selected state is reused so that a custom equality function can result in identical references\n\n if (latestSelectedState.current === undefined || !equalityFn(newSelectedState, latestSelectedState.current)) {\n selectedState = newSelectedState;\n } else {\n selectedState = latestSelectedState.current;\n }\n } else {\n selectedState = latestSelectedState.current;\n }\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n err.message += \"\\nThe error may be correlated with this previous error:\\n\" + latestSubscriptionCallbackError.current.stack + \"\\n\\n\";\n }\n\n throw err;\n }\n\n useIsomorphicLayoutEffect(function () {\n latestSelector.current = selector;\n latestStoreState.current = storeState;\n latestSelectedState.current = selectedState;\n latestSubscriptionCallbackError.current = undefined;\n });\n useIsomorphicLayoutEffect(function () {\n function checkForUpdates() {\n try {\n var newStoreState = store.getState(); // Avoid calling selector multiple times if the store's state has not changed\n\n if (newStoreState === latestStoreState.current) {\n return;\n }\n\n var _newSelectedState = latestSelector.current(newStoreState);\n\n if (equalityFn(_newSelectedState, latestSelectedState.current)) {\n return;\n }\n\n latestSelectedState.current = _newSelectedState;\n latestStoreState.current = newStoreState;\n } catch (err) {\n // we ignore all errors here, since when the component\n // is re-rendered, the selectors are called again, and\n // will throw again, if neither props nor store state\n // changed\n latestSubscriptionCallbackError.current = err;\n }\n\n forceRender();\n }\n\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n return function () {\n return subscription.tryUnsubscribe();\n };\n }, [store, subscription]);\n return selectedState;\n}\n/**\r\n * Hook factory, which creates a `useSelector` hook bound to a given context.\r\n *\r\n * @param {React.Context} [context=ReactReduxContext] Context passed to your ``.\r\n * @returns {Function} A `useSelector` hook bound to the specified context.\r\n */\n\n\nexport function createSelectorHook(context) {\n if (context === void 0) {\n context = ReactReduxContext;\n }\n\n var useReduxContext = context === ReactReduxContext ? useDefaultReduxContext : function () {\n return useContext(context);\n };\n return function useSelector(selector, equalityFn) {\n if (equalityFn === void 0) {\n equalityFn = refEquality;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!selector) {\n throw new Error(\"You must pass a selector to useSelector\");\n }\n\n if (typeof selector !== 'function') {\n throw new Error(\"You must pass a function as a selector to useSelector\");\n }\n\n if (typeof equalityFn !== 'function') {\n throw new Error(\"You must pass a function as an equality function to useSelector\");\n }\n }\n\n var _useReduxContext = useReduxContext(),\n store = _useReduxContext.store,\n contextSub = _useReduxContext.subscription;\n\n var selectedState = useSelectorWithStoreAndSubscription(selector, equalityFn, store, contextSub);\n useDebugValue(selectedState);\n return selectedState;\n };\n}\n/**\r\n * A hook to access the redux store's state. This hook takes a selector function\r\n * as an argument. The selector is called with the store state.\r\n *\r\n * This hook takes an optional equality comparison function as the second parameter\r\n * that allows you to customize the way the selected state is compared to determine\r\n * whether the component needs to be re-rendered.\r\n *\r\n * @param {Function} selector the selector function\r\n * @param {Function=} equalityFn the function that will be used to determine equality\r\n *\r\n * @returns {any} the selected state\r\n *\r\n * @example\r\n *\r\n * import React from 'react'\r\n * import { useSelector } from 'react-redux'\r\n *\r\n * export const CounterComponent = () => {\r\n * const counter = useSelector(state => state.counter)\r\n * return {counter}
\r\n * }\r\n */\n\nexport var useSelector = /*#__PURE__*/createSelectorHook();","export * from './exports';\nimport { unstable_batchedUpdates as batch } from './utils/reactBatchedUpdates';\nimport { setBatch } from './utils/batch'; // Enable batched updates in our subscriptions for use\n// with standard React renderers (ReactDOM, React Native)\n\nsetBatch(batch);\nexport { batch };","import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux';\nimport { AppDispatch, RootState } from './store';\n\n// Use throughout your app instead of plain `useDispatch` and `useSelector`\nexport const useAppDispatch = () => useDispatch();\nexport const useAppSelector: TypedUseSelectorHook = useSelector;\n","import {\n CreateUIAnalyticsEvent,\n UIAnalyticsEvent\n} from '@atlaskit/analytics-next';\nimport {\n ProductKeys,\n BitbucketWorkspace,\n Sites,\n ProductPayloadObject\n} from '../../model/wac-signup-form';\nimport {\n NewRelicTracking,\n OptimizelyType,\n SegmentType\n} from '@atlassiansox/bxpkit-core';\nimport { uniq } from 'lodash';\nimport { DeferSitenameCohort } from '../../layouts/legacy/view/utility/get-defer-sitename-experiment-cohort';\nimport {\n MarieSchemaAnalyticsType,\n Product\n} from '@atlassiansox/bxpkit-core/src';\n\ntype CreateSolutionStatsEventType = {\n readonly workspaceUuid?: string;\n readonly signUpFormUIState: { [key: string]: any };\n readonly createAnalyticsEvent: CreateUIAnalyticsEvent;\n};\n\n/**\n * This function returns an analytics-next event for\n * tracking which products were provisioned vs existing,\n * as well as the primary cloudId & any existing instance IDs\n * in the cloud provisioning (or activateProducts) request.\n *\n * @param signUpFormUIState - complete signup form UIState object\n * @param createAnalyticsEvent - analytics-next function, to be passed in from UI\n */\n\nexport function createSolutionStatsEvent({\n signUpFormUIState,\n createAnalyticsEvent\n}: CreateSolutionStatsEventType): UIAnalyticsEvent | undefined {\n const {\n signupState,\n isBbCopyEnabled,\n bbWorkspaces,\n productsExisting,\n pickableSites,\n isBundleBBJSW,\n isBundleDevops\n } = signUpFormUIState;\n\n if (!isBundleDevops && !isBundleBBJSW) {\n return;\n }\n\n let isNewSiteProvisioned = false;\n const isN2NAtlassian = productsExisting.length === 0;\n const isNewBitbucketWorkspace = isBbCopyEnabled || bbWorkspaces.length === 0;\n const signupUrl = window?.location?.href || '';\n const targetCloudId = signupState?.selectedSite?.cloudId || null;\n\n const existingProducts = uniq(productsExisting);\n let existingInstanceIds: string[] = [];\n let provisionedProducts: string[] = [];\n\n // gather all existing instance IDs\n if (bbWorkspaces && bbWorkspaces.length > 0) {\n existingInstanceIds = existingInstanceIds.concat(\n bbWorkspaces.map(\n (workspace: BitbucketWorkspace) => workspace?.workspace?.uuid\n )\n );\n }\n if (pickableSites && pickableSites.length > 0) {\n existingInstanceIds = existingInstanceIds.concat(\n pickableSites.map((site: Sites) => site?.cloudId)\n );\n }\n\n if (isBundleBBJSW) {\n // either existing sitepicker is not rendered, or a site\n // was selected without JSW included\n isNewSiteProvisioned =\n !signupState.isExistingSitePickerN2E ||\n (signupState?.selectedSite?.products &&\n !signupState?.selectedSite?.products.includes(\n ProductKeys.JIRA_SOFTWARE\n ));\n\n // potentially provisioned products for BB/JSW\n provisionedProducts = [\n ProductKeys.JIRA_SOFTWARE,\n ProductKeys.BITBUCKET\n ].map((key) => key.toString());\n\n // filter out provisioned products if existing products were used\n if (!isNewSiteProvisioned) {\n provisionedProducts = provisionedProducts.filter(\n (key) => key != ProductKeys.JIRA_SOFTWARE\n );\n }\n\n if (!isNewBitbucketWorkspace) {\n provisionedProducts = provisionedProducts.filter(\n (key) => key != ProductKeys.BITBUCKET\n );\n }\n }\n\n existingInstanceIds = uniq(existingInstanceIds);\n\n return createAnalyticsEvent({\n eventName: 'bxp.formCloudSignup.solutionStats',\n event: 'clicked',\n eventComponent: 'button',\n data: {\n isN2NAtlassian,\n signupUrl,\n existingProducts,\n provisionedProducts,\n existingInstanceIds,\n isNewSiteProvisioned,\n targetCloudId,\n provisionedCloudId: null\n }\n });\n}\n\nexport type TrackSignupButtonClickedOptions = {\n context: MarieSchemaAnalyticsType;\n buttonLabel: string | undefined;\n createAnalyticsEvent: CreateUIAnalyticsEvent;\n};\nexport const trackSignupButtonClicked = ({\n context,\n buttonLabel,\n createAnalyticsEvent\n}: TrackSignupButtonClickedOptions) => {\n const eventName = 'bxp.formCloudSignup.signup-button-clicked';\n const data = {\n eventType: 'track',\n eventContainer: 'signUpForm',\n event: 'clicked',\n eventComponent: 'button',\n uuid: '6707236536632157',\n label: buttonLabel,\n productKey: context.productKey,\n productsOffered: context.productsOffered,\n loginUserDetected: context.loginUserDetected,\n userEmail: context.userEmail,\n suiteName: context.suiteName,\n productEdition: context.productEdition,\n productPlatform: context.productPlatform,\n schemaVersion: context.schemaVersion\n };\n\n context?.analyticsTrack?.segment(eventName, data);\n createAnalyticsEvent({ eventName, data }).fire();\n};\n\nexport type TrackN2ESubmitOptions = {\n cloudId: string | undefined;\n products: Product[] | null;\n segment: SegmentType;\n};\nexport const trackN2ESubmit = ({\n cloudId,\n products,\n segment\n}: TrackN2ESubmitOptions) => {\n segment('bxp.formCloudSignup.N2ESubmit', {\n cloudId,\n products,\n signupUrl: window.location.href\n });\n};\n\nexport type TrackN2ESubmitOptions2 = {\n cloudId: string;\n products: Product[];\n signupUrl: string;\n accountId: string;\n createAnalyticsEvent: CreateUIAnalyticsEvent;\n};\nexport const trackN2ESubmit2 = ({\n cloudId,\n products,\n signupUrl,\n accountId,\n createAnalyticsEvent\n}: TrackN2ESubmitOptions2) => {\n createAnalyticsEvent({\n eventName: 'bxp.formCloudSignup.N2ESubmit',\n event: 'clicked',\n eventComponent: 'button',\n targetCloudId: cloudId,\n provisionedProducts: products,\n signupUrl,\n aaid: accountId\n }).fire();\n};\n\nexport type TrackRecaptchaErrorOptions = {\n segment: SegmentType;\n};\nexport const trackRecaptchaError = ({\n segment\n}: TrackRecaptchaErrorOptions) => {\n segment('bxp.formCloudSignup.reCaptchaError', {});\n};\n\nexport type TrackSubmitWithCaptchaOptions = {\n newRelic: NewRelicTracking;\n};\nexport const trackSubmitWithCaptcha = ({\n newRelic\n}: TrackSubmitWithCaptchaOptions) => {\n newRelic.action('bxp.formCloudSignup.submitWithCaptcha', '');\n};\n\nexport type TrackSignUpFormSubmitSucceededOptions = {\n createAnalyticsEvent: CreateUIAnalyticsEvent;\n};\nexport const trackSignUpFormSubmitSucceeded = ({\n createAnalyticsEvent\n}: TrackSignUpFormSubmitSucceededOptions) => {\n createAnalyticsEvent({\n eventName: 'reactSignUpFormSubmitSucceeded',\n data: {\n event: 'submitSucceeded', // event verb, in past tense (eg, \"clicked\")\n uuid: 'reactSignUpForm' // required for Magnolia events, unique id for a given component if available\n }\n }).fire();\n};\n\nexport type TrackSignUpFormSubmitFailedOptions = {\n createAnalyticsEvent: CreateUIAnalyticsEvent;\n};\nexport const trackSignUpFormSubmitFailed = ({\n createAnalyticsEvent\n}: TrackSignUpFormSubmitFailedOptions) => {\n createAnalyticsEvent({\n eventName: 'reactSignUpFormSubmitFailed',\n data: {\n event: 'submitFailed', // event verb, in past tense (eg, \"clicked\")\n uuid: 'reactSignUpForm' // required for Magnolia events, unique id for a given component if available\n }\n }).fire();\n};\n\nexport type TrackSignupContextTooLargeOptions = {\n contextLength: number;\n newRelic: NewRelicTracking;\n};\nexport const trackSignupContextTooLarge = ({\n contextLength,\n newRelic\n}: TrackSignupContextTooLargeOptions) => {\n newRelic.action(\n 'bxp.formCloudSignup.signupContextTooLarge',\n contextLength.toString()\n );\n};\n\nexport type TrackActivateProductsSubmitOptions = {\n activateProducts: boolean;\n segment: SegmentType;\n};\nexport const trackActivateProductsSubmit = ({\n activateProducts,\n segment\n}: TrackActivateProductsSubmitOptions) => {\n segment('bxp.formCloudSignup.activateProductsSubmit', {\n activateProducts\n });\n};\n\nexport type TrackFormSubmitOptions = {\n isLoggedIn: boolean | undefined;\n segment: SegmentType;\n newRelic: NewRelicTracking;\n optimizely: OptimizelyType;\n};\nexport const trackFormSubmit = ({\n isLoggedIn,\n segment,\n newRelic,\n optimizely\n}: TrackFormSubmitOptions) => {\n segment('bxp.formCloudSignup.formSubmit', {\n type: isLoggedIn ? 'N2E' : 'N2N'\n });\n newRelic.action('bxp.formCloudSignup.formSubmit', isLoggedIn ? 'N2E' : 'N2N');\n optimizely('cart-cloud.submitted');\n};\n\nexport type TrackProgressPollInvalidOptions = {\n segment: SegmentType;\n};\nexport const trackProgressPollInvalid = ({\n segment\n}: TrackProgressPollInvalidOptions) => {\n segment('bxp.formCloudSignup.progressPollInvalid', { label: 'cloudName' });\n};\n\nexport type TrackWaitedSignupPageSubmitMoreThan15S = {\n newRelic: NewRelicTracking;\n segment: SegmentType;\n};\nexport const trackWaitedSignupPageSubmitMoreThan15SOptions = ({\n newRelic,\n segment\n}: TrackWaitedSignupPageSubmitMoreThan15S) => {\n const eventName = 'bxp.formCloudSignup.waitedSignupPageSubmit>15s';\n newRelic.action(eventName, '');\n segment(eventName, {});\n};\n\nexport type TrackWaitedSignupPageSubmitMoreThan60SOptions = {\n newRelic: NewRelicTracking;\n segment: SegmentType;\n};\nexport const trackWaitedSignupPageSubmitMoreThan60S = ({\n newRelic,\n segment\n}: TrackWaitedSignupPageSubmitMoreThan60SOptions) => {\n const eventName = 'bxp.formCloudSignup.waitedSignupPageSubmit>60s';\n newRelic.action(eventName, '');\n segment(eventName, {});\n};\n\nexport type TrackProgressUriErrOptions = {\n err: any;\n newRelic: NewRelicTracking;\n segment: SegmentType;\n};\nexport const trackProgressUriErr = ({\n err,\n newRelic,\n segment\n}: TrackProgressUriErrOptions) => {\n const eventName = 'bxp.formCloudSignup.progressUri';\n segment(eventName, { err });\n newRelic.trackAjax(eventName, err, false);\n};\n\nexport type TrackProgressUriOptions = {\n response: any;\n newRelic: NewRelicTracking;\n};\nexport const trackProgressUri = ({\n response,\n newRelic\n}: TrackProgressUriOptions) => {\n newRelic.trackAjax('bxp.formCloudSignup.progressUri', response, true);\n};\n\nexport type TrackProgressPollMissingOptions = {\n segment: SegmentType;\n};\nexport const trackProgressPollMissing = ({\n segment\n}: TrackProgressPollMissingOptions) => {\n segment('bxp.formCloudSignup.progressPollMissing', { label: 'body' });\n};\n\nexport type TrackSubmitSuccessOptions = {\n isLoggedIn: boolean;\n segment: SegmentType;\n optimizely: OptimizelyType;\n};\nexport const trackSubmitSuccess = ({\n isLoggedIn,\n segment,\n optimizely\n}: TrackSubmitSuccessOptions) => {\n segment('bxp.formCloudSignup.submitSuccess', {\n type: isLoggedIn ? 'N2E' : 'N2N'\n });\n segment('bxp.formCloudSignup.confirmedEvaluation', {});\n optimizely('cart-cloud.completed-checkout-step.complete-signup-page');\n};\n\nexport type TrackGoToBitbucketOptions = {\n newRelic: NewRelicTracking;\n};\nexport const trackGoToBitbucket = ({ newRelic }: TrackGoToBitbucketOptions) => {\n newRelic.action('bxp.formCloudSignup.goToBitbucket', '');\n};\n\nexport type TrackGoToJSWOptions = {\n newRelic: NewRelicTracking;\n};\nexport const trackGoToJSW = ({ newRelic }: TrackGoToJSWOptions) => {\n newRelic.action('bxp.formCloudSignup.goToJSW', '');\n};\n\nexport type TrackProgressPollErrorOptions = {\n label: string;\n segment: SegmentType;\n};\nexport const trackProgressPollError = ({\n label,\n segment\n}: TrackProgressPollErrorOptions) => {\n segment('bxp.formCloudSignup.progressPollError', { label });\n};\n\nexport type TrackSubmitSuccessProductsOptions = {\n products: ProductPayloadObject[];\n isLoggedIn: boolean;\n segment: SegmentType;\n optimizely: OptimizelyType;\n};\nexport const trackSubmitSuccessProducts = ({\n products,\n isLoggedIn,\n segment,\n optimizely\n}: TrackSubmitSuccessProductsOptions) => {\n segment('bxp.formCloudSignup.submitSuccess', {\n type: isLoggedIn ? 'N2E' : 'N2N'\n });\n optimizely('cart-cloud.completed-checkout-step.complete-signup-page');\n products.forEach((p) => optimizely(`cart-cloud.added-product.${p.product}`));\n};\n\ninterface TrackDeferSitenameSignups {\n createAnalyticsEvent: CreateUIAnalyticsEvent;\n isSiteNew: boolean;\n isSiteNameSpecified: boolean;\n numberOfExistingUserSites: number;\n optionalSitenameFeatureCohort: DeferSitenameCohort;\n sitename: string | null;\n userId: string;\n}\n\nexport const trackDeferSitenameSignups = ({\n createAnalyticsEvent,\n userId,\n isSiteNameSpecified,\n isSiteNew,\n numberOfExistingUserSites,\n optionalSitenameFeatureCohort,\n sitename\n}: TrackDeferSitenameSignups) =>\n createAnalyticsEvent({\n action: 'provisioningInitiated',\n actionSubject: 'product',\n product: 'marketing',\n attributes: {\n isSiteNew,\n isSiteNameSpecified,\n numberOfExistingUserSites,\n optionalSitenameFeatureCohort,\n sitename\n },\n userId,\n tenantId: 'tenantId',\n tenantIdType: 'tenantIdType'\n }).fire();\n","import { UIAnalyticsEvent } from '@atlaskit/analytics-next';\nimport { Url } from '@atlassiansox/bxpkit-core';\nimport 'isomorphic-fetch';\nimport Cookies from 'js-cookie';\nimport { checkReferrer } from '../../layouts/legacy/view/utility/referrerTracking';\nimport {\n AnalyticsTrackType,\n ConsentsObject,\n ProductPayloadObject,\n ResendEmailType,\n SubmitErrorType\n} from '../../model';\nimport {\n trackGoToBitbucket,\n trackGoToJSW,\n trackProgressPollError,\n trackProgressPollInvalid,\n trackProgressPollMissing,\n trackProgressUri,\n trackProgressUriErr,\n trackSubmitSuccess,\n trackSubmitSuccessProducts,\n trackWaitedSignupPageSubmitMoreThan15SOptions,\n trackWaitedSignupPageSubmitMoreThan60S\n} from './analytics';\n\nconst URL_JSW_STAGE = 'jira-dev.com';\nconst URL_JSW_PROD = 'atlassian.net';\n\nconst URL_BB_STAGE = 'https://integration.bb-inf.net';\nconst URL_BB_PROD = 'https://bitbucket.org';\n\nexport const URL_BITBUCKET_BUNDLE_PAGE = 'software/bitbucket/bundle';\n\nexport type FormSubmitN2NType = {\n readonly payload: FormPayloadType | FormPayloadActivateProducts;\n readonly wacEnvUrl: string;\n readonly confirmationPageUrl: string;\n readonly checkEmailPageUrl: string;\n readonly isStaging: boolean;\n readonly isLoggedIn?: boolean;\n readonly isJswIncluded?: boolean | null;\n readonly isOpsgenieIncluded?: boolean | null;\n readonly dataRegion?: string | null;\n readonly setPollingLoaderShown: (val: boolean) => void;\n readonly analyticsTrack: AnalyticsTrackType;\n readonly setSubmitError: (val: SubmitErrorType) => void;\n readonly resendEmail?: ResendEmailScreenType;\n readonly solutionStatsEvent?: UIAnalyticsEvent;\n readonly hideUserSegmentation?: boolean;\n readonly isAppProvisioningEligible?: boolean;\n};\n\nexport type FormSubmitDeferredPasswordType = {\n readonly email: string | null;\n readonly displayName: string | null | undefined;\n readonly continueUrl: string | null;\n readonly isStaging: boolean | null;\n readonly setPollingLoaderShown: (val: boolean) => void;\n readonly analyticsTrack: AnalyticsTrackType;\n readonly setSubmitError: (val: SubmitErrorType) => void;\n};\n\nexport type ResendEmailScreenType = {\n readonly enableResendEmail: boolean;\n readonly setShowResendEmail: (val: boolean) => void;\n readonly setShowDevopsCarouselEnd: (val: boolean) => void;\n readonly setGoToURL: (val: string) => void;\n readonly enableCarouselEndCard: boolean;\n};\n\nexport type GoToJSWType = {\n readonly isStaging: boolean;\n readonly jswName: string;\n readonly resendEmail?: ResendEmailScreenType;\n};\n\nexport type GoToBitbucketType = {\n readonly isStaging: boolean;\n readonly resendEmail?: ResendEmailScreenType;\n};\n\ntype PollForSuccessType = {\n readonly analyticsTrack: AnalyticsTrackType;\n readonly confirmationPageUrl: string;\n readonly checkEmailPageUrl: string;\n readonly isStaging: boolean;\n readonly wacEnvUrl: string;\n readonly isLoggedIn: boolean;\n readonly progressUri: string;\n readonly cloudName: string | null;\n readonly products: ProductPayloadObject[];\n readonly setSubmitError: (val: SubmitErrorType) => void;\n readonly setPollingLoaderShown: (val: boolean) => void;\n readonly isJswIncluded?: boolean | null;\n readonly isOpsgenieIncluded?: boolean | null;\n readonly dataRegion?: string | null;\n readonly resendEmail?: ResendEmailScreenType;\n readonly solutionStatsEvent?: UIAnalyticsEvent;\n readonly hideUserSegmentation?: boolean;\n readonly isAppProvisioningEligible?: boolean;\n};\n\nexport type FormPayloadActivateProducts = {\n activateProducts?: boolean;\n products: ProductPayloadObject[];\n cloudId?: string;\n cloudName: string | null;\n advancedSettings?: {\n [key: string]: number | boolean | string | Record;\n };\n signupContext?: string;\n};\n\nexport type FormPayloadType = {\n adminUsername: string;\n gRecaptchaResponse?: string;\n cloudName: string | null;\n email: string | null;\n timezone: string | null;\n firstName: string | null;\n lastName: string | null;\n adminPassword?: string | null;\n signupContext?: string;\n dataRegion?: string;\n consent: {\n site: string | null;\n locale: string | null;\n formUrl: string | null;\n consents: ConsentsObject[];\n };\n} & FormPayloadActivateProducts;\n\nconst localStorageGet = (key: string): string => {\n try {\n return localStorage.getItem(key) || '';\n } catch (e) {\n return '';\n }\n};\n\n// N2N anon user\nfunction goToCheckEmail(\n wacEnvUrl: string,\n checkEmailPageUrl: string,\n cloudName: string,\n products: string,\n analyticsTrack: AnalyticsTrackType,\n resendEmail?: ResendEmailScreenType\n) {\n const splitPath = checkEmailPageUrl?.split('/');\n\n if (splitPath && splitPath.length >= 2 && splitPath[1].includes('wac')) {\n // remove contextual path if applicable\n splitPath.splice(0, 2);\n checkEmailPageUrl = `/${splitPath.join('/')}`;\n }\n\n const { newRelic, segment } = analyticsTrack;\n\n newRelic.action('apollo.signup.redirect-to-check-email', '');\n segment('bxp.formCloudSignup.navigatedToCheckEmail', {});\n\n const queryParams = {\n accountName: cloudName,\n products\n };\n\n // if (features.enableAutogenSiteName) {\n // delete queryParams.accountName;\n // }\n // setResendEmailParams(cloudId, requestId);\n\n if (resendEmail?.enableResendEmail) {\n resendEmail.setShowResendEmail(true);\n return;\n }\n const urlParams = csvParams(queryParams);\n const nextUrl = `${wacEnvUrl}${checkEmailPageUrl}/?${urlParams}`;\n window.location.assign(nextUrl);\n return;\n}\n\nfunction goToBitbucket({ isStaging, resendEmail }: GoToBitbucketType) {\n const nextUrl = `${\n isStaging ? URL_BB_STAGE : URL_BB_PROD\n }/dashboard/overview`;\n if (resendEmail?.enableCarouselEndCard) {\n resendEmail.setGoToURL(nextUrl);\n return resendEmail.setShowDevopsCarouselEnd(true);\n }\n window.location.assign(nextUrl);\n}\n\nfunction goToJSW({ isStaging, jswName, resendEmail }: GoToJSWType) {\n const nextUrl = `https://${jswName}.${\n isStaging ? URL_JSW_STAGE : URL_JSW_PROD\n }`;\n if (resendEmail?.enableCarouselEndCard) {\n resendEmail.setGoToURL(nextUrl);\n return resendEmail.setShowDevopsCarouselEnd(true);\n }\n window.location.assign(nextUrl);\n}\n\nexport function generateRenameUrl(\n wacEnvUrl: string,\n cloudId: string,\n progressUri: string,\n redirectUrl: string,\n siteRenamePageUrl: string,\n isPermitted?: boolean\n) {\n const queryParams: any = {\n cloudId,\n requestId: getRequestId(progressUri),\n redirecturl: encodeURIComponent(redirectUrl),\n isPermitted\n };\n return `${wacEnvUrl}${siteRenamePageUrl}?${csvParams(queryParams)}`;\n}\n\n// Allow for product developers to connect to staging instance\nexport const isTestTenantByName = (\n isStaging: boolean,\n cloudName: string | null\n) => {\n const TEST_TENANT_PATTERN =\n /^atl-vertigo--(((?:jira|j|rolex|stg)+-jira-branch-[^-]+--)|(conf-(conf|stg)-proxy-\\w+--[\\w-]+)).*$/;\n return isStaging && cloudName && TEST_TENANT_PATTERN.test(cloudName);\n};\n\ntype GenerateConfirmationUrlOptions = {\n readonly wacEnvUrl: string;\n readonly confirmationPageUrl: string;\n readonly cloudId: string;\n readonly progressUri: string;\n readonly cloudName: string;\n readonly products: string;\n readonly isOpsgenieIncluded?: boolean | null;\n readonly dataRegion?: string | null;\n readonly analyticsTrack?: AnalyticsTrackType;\n readonly bbBundlePreferred?: boolean;\n readonly isDevops?: boolean;\n readonly hideUserSegmentation?: boolean;\n readonly isAppProvisioningEligible?: boolean;\n};\n\n// Generates the post-email confirmation url for verfied users\nexport function generateConfirmationUrl({\n wacEnvUrl,\n confirmationPageUrl,\n cloudId,\n progressUri,\n cloudName,\n products,\n isOpsgenieIncluded,\n dataRegion,\n analyticsTrack,\n bbBundlePreferred,\n isDevops,\n hideUserSegmentation,\n isAppProvisioningEligible\n}: GenerateConfirmationUrlOptions) {\n // code for removing the /wac/ part of url if applicable\n const splitPath = confirmationPageUrl?.split('/');\n\n if (splitPath && splitPath.length >= 2 && splitPath[1].includes('wac')) {\n // remove contextual path if applicable\n splitPath.splice(0, 2);\n confirmationPageUrl = `/${splitPath.join('/')}`;\n }\n\n if (analyticsTrack) {\n const { newRelic, segment } = analyticsTrack;\n\n newRelic.action('apollo.signup.redirect-to-confirmation', '');\n segment('bxp.formCloudSignup.navigatedToConfirmation', {});\n }\n\n const queryParams: any = {\n ondemandurl: cloudName,\n cloudId,\n requestId: getRequestId(progressUri)\n };\n\n queryParams.products = products.length > 1 ? products : undefined;\n\n if (isOpsgenieIncluded) {\n queryParams.dataRegion = dataRegion === 'EU' ? 'europe' : 'main';\n }\n\n if (isDevops) {\n const queryParameters = Url.getUrlParams() || {};\n if (queryParameters.hasOwnProperty('signupSource')) {\n queryParams.signupSource = queryParameters.signupSource;\n }\n queryParams.isFoundingAdmin = true;\n }\n\n // If BB is the preferred signup, it should be ordered first in the product param\n if (bbBundlePreferred) {\n queryParams.products = queryParams.products.split(',').sort().join();\n }\n\n // If this is a Jira Template signup, User Segmentation Screen should be hidden\n if (hideUserSegmentation) {\n queryParams.hideUserSegmentation = true;\n }\n\n if (isAppProvisioningEligible === true) {\n queryParams.provisionApp = true;\n }\n\n const urlParams = csvParams(queryParams);\n const nextUrl = `${wacEnvUrl}${confirmationPageUrl}/?${urlParams}`;\n return nextUrl;\n}\n\nexport function pollForSuccess({\n analyticsTrack,\n confirmationPageUrl,\n checkEmailPageUrl,\n isStaging,\n wacEnvUrl,\n isLoggedIn,\n progressUri,\n cloudName,\n products,\n setSubmitError,\n setPollingLoaderShown,\n isJswIncluded,\n solutionStatsEvent,\n isOpsgenieIncluded,\n dataRegion,\n resendEmail,\n hideUserSegmentation,\n isAppProvisioningEligible\n}: PollForSuccessType) {\n const { segment, newRelic, optimizely } = analyticsTrack;\n\n const bitbucketBundlePreferred = checkReferrer(URL_BITBUCKET_BUNDLE_PAGE);\n\n let secondsPassed = 0;\n if (!cloudName) {\n trackProgressPollInvalid({ segment });\n return;\n }\n const poll = setInterval(async () => {\n secondsPassed++;\n if (secondsPassed === 15) {\n trackWaitedSignupPageSubmitMoreThan15SOptions({\n newRelic,\n segment\n });\n setSubmitError(SubmitErrorType.WARNING_TIMEOUT_PENDING);\n }\n if (secondsPassed === 60) {\n trackWaitedSignupPageSubmitMoreThan60S({\n newRelic,\n segment\n });\n setSubmitError(SubmitErrorType.ERROR_TIMEOUT);\n clearInterval(poll);\n setPollingLoaderShown(false);\n }\n const response = await fetch(`${progressUri}`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json'\n },\n credentials: 'include'\n }).catch((err) => {\n clearInterval(poll);\n trackProgressUriErr({ err, newRelic, segment });\n return err;\n });\n\n trackProgressUri({ newRelic, response });\n const body = response.status === 200 ? await response.json() : null;\n if (!body) {\n clearInterval(poll);\n trackProgressPollMissing({ segment });\n }\n\n if (body) {\n const statusActivate = body.bestStatuses.ACTIVATE_PRODUCT;\n const statusSignup =\n body.bestStatuses.HAMS_CREATE_CLOUD !== 'SKIPPED'\n ? body.bestStatuses.HAMS_CREATE_CLOUD\n : body.bestStatuses.BAG_CREATE_CLOUD;\n\n if (body.cloudId && solutionStatsEvent) {\n if (solutionStatsEvent?.payload?.data?.isNewSiteProvisioned) {\n solutionStatsEvent.update({\n data: Object.assign({}, solutionStatsEvent?.payload?.data, {\n provisionedCloudId: body?.cloudId,\n targetCloudId: body?.cloudId\n })\n });\n }\n solutionStatsEvent.fire();\n }\n\n if (statusActivate && body.completed) {\n clearInterval(poll);\n\n if (body.successful) {\n trackSubmitSuccess({ isLoggedIn, segment, optimizely });\n\n if (isJswIncluded || bitbucketBundlePreferred) {\n trackGoToBitbucket({ newRelic });\n return goToBitbucket({ isStaging, resendEmail });\n } else {\n trackGoToJSW({ newRelic });\n // Give JSW an extra second before redirect\n return setTimeout(\n () => goToJSW({ isStaging, jswName: cloudName, resendEmail }),\n 1000\n );\n }\n } else {\n trackProgressPollError({\n label: 'body',\n segment\n });\n }\n // TODO: else if successful === false, throw error/show in UI\n }\n\n switch (statusSignup) {\n case 'COMPLETE_SUCCESS':\n case 'COMPLETE_MANUAL_SUCCESS':\n clearInterval(poll);\n\n const cloudId = body.cloudId;\n const productParam = products.map((p) => p.product).join(',');\n\n // TODO if (!cloudId) throw Error;\n if (!cloudId) {\n trackProgressPollMissing({ segment });\n } else {\n trackSubmitSuccessProducts({\n products,\n isLoggedIn,\n segment,\n optimizely\n });\n }\n\n if (isLoggedIn) {\n const confirmURL = generateConfirmationUrl({\n wacEnvUrl,\n confirmationPageUrl,\n cloudId,\n progressUri,\n cloudName,\n products: productParam,\n isOpsgenieIncluded,\n dataRegion,\n analyticsTrack,\n bbBundlePreferred: bitbucketBundlePreferred,\n hideUserSegmentation,\n isAppProvisioningEligible\n });\n // devops carousel\n if (resendEmail?.enableCarouselEndCard) {\n resendEmail.setShowDevopsCarouselEnd(true);\n return resendEmail.setGoToURL(confirmURL);\n }\n return window.location.assign(confirmURL);\n } else {\n return goToCheckEmail(\n wacEnvUrl,\n checkEmailPageUrl,\n cloudName,\n productParam,\n analyticsTrack,\n resendEmail\n );\n }\n\n case 'COMPLETE_ERROR':\n clearInterval(poll);\n trackProgressPollError({\n label: statusSignup,\n segment\n });\n // TODO: show error on frontend\n\n return;\n }\n }\n }, 1000);\n}\n\nexport async function formSubmitN2N({\n payload,\n wacEnvUrl,\n confirmationPageUrl,\n checkEmailPageUrl,\n isStaging,\n isLoggedIn,\n isJswIncluded,\n solutionStatsEvent,\n isOpsgenieIncluded,\n dataRegion,\n setPollingLoaderShown,\n analyticsTrack,\n setSubmitError,\n resendEmail,\n hideUserSegmentation,\n isAppProvisioningEligible\n}: FormSubmitN2NType) {\n const { segment, newRelic } = analyticsTrack;\n setPollingLoaderShown(true);\n const submitUrl = isLoggedIn\n ? `https://${\n isStaging ? 'wac.stg.internal.' : 'www.'\n }atlassian.com/gateway/api/cloud/signup`\n : `${wacEnvUrl}/endpoint/cloud/signupAnon`;\n try {\n const response = await fetch(submitUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'atl-cookies': JSON.stringify({\n _ga: Cookies.get('_ga') || '',\n seg_xid: localStorageGet('seg_xid'),\n __atl_path: Cookies.get('__atl_path') || '',\n ajs_anonymous_id: Cookies.get('ajs_anonymous_id') || '',\n optimizelyBuckets: Cookies.get('optimizelyBuckets') || '',\n optimizelySegments: Cookies.get('optimizelySegments') || '',\n optimizelyEndUserId: Cookies.get('optimizelyEndUserId') || ''\n })\n },\n body: JSON.stringify(payload),\n credentials: 'include'\n });\n\n if (response.ok && response.status === 200) {\n newRelic.trackAjax('cofs_create_cloud_bxp_react', response, true);\n const body = await response.json();\n\n // when site name creation is differed the payload wont have a cloudName to pass to the poll function\n // the response from the fetch will include the auto gen site name to be used as the cloudName\n // without a cloudName it wont redirect to the email confirmation or the rename page\n let cloudName = null;\n if (payload?.signupContext?.match('autogenSiteName')) {\n cloudName = body.cloudName;\n } else {\n cloudName = payload.cloudName;\n }\n\n // set r.e.d session key for reading by email verification component\n if ('email' in payload) {\n // ensure payload is type FormPayloadType\n const resendData = Object.assign(\n {},\n {\n cloudName: encodeURIComponent(cloudName || ''),\n cloudId: body.cloudId || '',\n requestId: body.progressUri ? getRequestId(body.progressUri) : '',\n email: encodeURIComponent(payload.email || ''),\n primaryProduct: encodeURIComponent(\n payload?.products[0]?.product || ''\n )\n }\n );\n sessionStorage.setItem(\n ResendEmailType.RESEND_DATA,\n window.btoa(JSON.stringify(resendData))\n );\n }\n\n pollForSuccess({\n isLoggedIn: isLoggedIn || false,\n confirmationPageUrl,\n checkEmailPageUrl,\n progressUri: body.progressUri,\n products: payload.products,\n analyticsTrack,\n isStaging,\n wacEnvUrl,\n cloudName,\n setSubmitError,\n setPollingLoaderShown,\n isJswIncluded,\n isOpsgenieIncluded,\n dataRegion,\n resendEmail,\n solutionStatsEvent,\n hideUserSegmentation,\n isAppProvisioningEligible\n });\n\n return response;\n }\n if (!response.ok || response.status !== 200) {\n let body = '';\n try {\n body = await response.json();\n } catch (e) {\n body = 'Unable to parse response as JSON';\n sessionStorage.removeItem(ResendEmailType.RESEND_DATA);\n }\n newRelic.trackAjax('cofs_create_cloud_bxp_react', response, false);\n segment('bxp.formCloudSignup.submitError', {\n type: isLoggedIn ? 'N2E' : 'N2N',\n body\n });\n setPollingLoaderShown(false);\n setSubmitError(SubmitErrorType.ERROR_TIMEOUT);\n return Promise.reject(response);\n }\n return Promise.reject();\n } catch (error) {\n setPollingLoaderShown(false);\n setSubmitError(SubmitErrorType.ERROR_TIMEOUT);\n newRelic.trackAjax('cofs_create_cloud_bxp_react', error, false);\n segment('bxp.formCloudSignup.submitError', {\n type: isLoggedIn ? 'N2E' : 'N2N',\n error: JSON.stringify(error)\n });\n sessionStorage.removeItem(ResendEmailType.RESEND_DATA);\n return Promise.reject(error);\n }\n}\n\nfunction csvParams(queryParams: any) {\n return Object.keys(queryParams)\n .map((key) => key + '=' + queryParams[key])\n .join('&');\n}\n\nfunction getRequestId(progressUri: string) {\n const pattern = new RegExp(/cloud\\/[\\w-]+\\/status\\/([\\w-]+)$/);\n const matches = pattern.exec(progressUri);\n return matches ? matches[1] : '';\n}\n","import _ from 'lodash';\nimport React, {\n createContext,\n PropsWithChildren,\n useContext,\n useEffect,\n useMemo,\n useState\n} from 'react';\n\nimport {\n BitbucketWorkspace,\n BitbucketWorkspaces,\n Product,\n ProductKeys,\n Sites,\n SubmitErrorType,\n WacSignupFormProps,\n WacSignupFormState\n} from '../model';\n\nimport { messages } from '../messages/sign-up-form';\nimport OriginTracing from '@atlassiansox/origin-tracing';\nimport { getIsBundleBbJsw, getIsBundleDevops } from '@atlassiansox/bxpkit-core';\n\nimport { sanitizeLastName } from '../layouts/legacy/view/utility';\nimport { checkReferrer } from '../layouts/legacy/view/utility/referrerTracking';\nimport { useAppSelector } from '../redux';\n\nimport { URL_BITBUCKET_BUNDLE_PAGE } from '../service/sign-up-form/form-submit';\n\nfunction isSitesDefined(sites?: Sites[] | null): sites is Sites[] {\n return !!sites;\n}\n\nfunction isOpsgenieIncluded(productKeys: Product[]) {\n return _.includes(\n _.map(\n productKeys,\n (productKey: Product) => productKey.product === ProductKeys.OPSGENIE\n ),\n true\n );\n}\n\nexport function isProductIncluded(productKeys: Product[], product: string) {\n return _.includes(\n _.map(productKeys, (productKey: Product) => productKey.product),\n product\n );\n}\n\nexport function cleanseNonAdminWorkspaces(\n bitbucketWorkspaces: BitbucketWorkspaces\n) {\n const purifiedData: BitbucketWorkspace[] = _.filter(\n bitbucketWorkspaces.values,\n (workspace: BitbucketWorkspace) => workspace.permission === 'owner'\n );\n return purifiedData;\n}\n\nexport const SignUpFormUIStateContext = createContext({\n productKeys: [] as Product[],\n bitbucketWorkspaces: {\n size: 0,\n values: [] as BitbucketWorkspace[]\n },\n hideFullName: false,\n showEmail: false,\n userInfo: {\n firstName: '',\n fullName: '',\n lastName: '',\n email: '',\n sites: [] as Sites[],\n isLoggedIn: false,\n extendedTrialOverridableSites: [] as string[],\n accountId: ''\n },\n marketingConsentRequired: false,\n signInAccountUrl: '',\n switchAccountUrl: '',\n originAnalyticsAttributes: {\n signInUser: null,\n switchUser: null\n },\n reCaptchaKey: '',\n devMode: false,\n migrationData: {\n migrationSourceUuid: '',\n migrationUserLimit: 0,\n migrationUserType: '',\n migrationProductName: '',\n migrationSites: [],\n invalidMigration: false,\n claimedMigration: false\n },\n isStaging: false,\n wacEnvUrl: '',\n locale: '',\n templateId: { templateId: '' },\n optimizelyCohorts: [],\n analyticsTrack: {\n newRelic: {\n action: () => undefined,\n attribute: () => undefined,\n trackAjax: () => undefined\n },\n optimizely: () => undefined,\n segment: () => undefined\n },\n formExistingSiteShown: () => undefined,\n deferSiteNameCreation: false,\n defaultErrorType: SubmitErrorType.NO_ERROR,\n enableFreeBreachTest: false,\n simulateFreeBreachState: false,\n spProduct: '',\n hideGreeting: false,\n outlineOnFocus: false,\n fadeOnDisable: false,\n popOverError: false,\n enableFieldProgression: false,\n showWarningIcon: false,\n selectedSiteId: '',\n hideCaptchaEula: false,\n enableResendEmail: false,\n enableCarouselEndCard: false,\n firstImpressionsImageUrls: {\n backgroundImage: '',\n jiraSoftware: {\n heroImage: '',\n socialProofImage: ''\n },\n jiraServiceDesk: {\n heroImage: '',\n socialProofImage: ''\n },\n confluence: {\n heroImage: '',\n socialProofImage: ''\n },\n jiraCore: {\n heroImage: '',\n socialProofImage: ''\n },\n teamCentral: {\n heroImage: '',\n socialProofImage: ''\n },\n jiraProductDiscovery: {\n heroImage: '',\n socialProofImage: ''\n },\n compass: {\n heroImage: '',\n socialProofImage: ''\n },\n fabric: {\n heroImage: '',\n socialProofImage: ''\n }\n },\n siteRenamePageUrl: '',\n enableSkipRecaptcha: false\n});\n\nexport type SignUpFormUIStateProviderProps = PropsWithChildren<{\n readonly signUpFormProps: WacSignupFormProps;\n}>;\n\nexport function SignUpFormUIStateProvider({\n signUpFormProps,\n children\n}: SignUpFormUIStateProviderProps) {\n return (\n \n {children}\n \n );\n}\n\nexport function useSignUpFormUIState() {\n const signUpFormProps = useContext(SignUpFormUIStateContext);\n\n const { featureFlags, deferredSiteName } = useAppSelector((store) => store);\n\n const { enableDeferredFullName } = featureFlags;\n\n const {\n devMode,\n migrationData,\n userInfo,\n bitbucketWorkspaces,\n marketingConsentRequired,\n productKeys,\n isStaging,\n locale,\n deferSiteNameCreation,\n templateId,\n enableResendEmail = false,\n enableCarouselEndCard = false,\n defaultErrorType = SubmitErrorType.NO_ERROR\n } = signUpFormProps;\n\n const welcomeMessage =\n userInfo && userInfo.firstName\n ? messages.personalizedWelcomeMessage\n : messages.defaultWelcomeMessage;\n\n const bitbucketPreferred = checkReferrer(URL_BITBUCKET_BUNDLE_PAGE);\n\n const initialState: WacSignupFormState = {\n email: null,\n firstName: null,\n lastName: null,\n displayName: null,\n password: null,\n cloudName: null,\n bbName: null,\n dataRegion: 'US',\n timezone: null,\n products: [],\n consent: {\n site: null,\n locale: null,\n formUrl: null,\n consents: [\n {\n key: 'termsOfService',\n displayedText: messages.eula.defaultMessage,\n granted: true\n },\n {\n key: 'privacyPolicy',\n displayedText: messages.eula.defaultMessage,\n granted: true\n },\n {\n key: 'generalMarketingOptIn',\n displayedText: messages.marketingConsent.defaultMessage,\n granted: false\n }\n ]\n },\n isExistingSitePickerN2E: false,\n isLoggedIn: false,\n selectedSite: null,\n migrationId: null,\n isSubmitting: false,\n isSSOValid: false,\n cloudNameLength: 0\n };\n const signupOrigin = new OriginTracing({ product: 'wac-sign-up' });\n const [showResendEmail, setShowResendEmail] = useState(false);\n const [showDevopsCarouselEnd, setShowDevopsCarouselEnd] = useState(false);\n const [goToURL, setGoToURL] = useState('');\n const resendEmail = {\n setShowResendEmail,\n enableResendEmail,\n enableCarouselEndCard,\n setShowDevopsCarouselEnd,\n setGoToURL\n };\n\n const [isBbCopyEnabled, setIsBbCopyEnabled] = useState(false);\n const bbWorkspaces = bitbucketWorkspaces?.values\n ? cleanseNonAdminWorkspaces(bitbucketWorkspaces)\n : [];\n const bbWorkspacesTotal = bbWorkspaces.length || 0;\n let buttonText = messages.buttonText;\n let startButtonText = messages.startButtonText;\n\n // @todo: refactor to a function\n const isOpsgenie = isOpsgenieIncluded(productKeys);\n const isStatuspage = isProductIncluded(productKeys, ProductKeys.STATUSPAGE);\n const isTeamCentral = isProductIncluded(\n productKeys,\n ProductKeys.TEAM_CENTRAL\n );\n const isJsw = isProductIncluded(productKeys, ProductKeys.JIRA_SOFTWARE);\n const isJsm = isProductIncluded(productKeys, ProductKeys.JIRA_SERVICE_DESK);\n const isJwm = isProductIncluded(productKeys, ProductKeys.JIRA_CORE);\n const isJpd = isProductIncluded(\n productKeys,\n ProductKeys.JIRA_PRODUCT_DISCOVERY\n );\n const isCompass = isProductIncluded(productKeys, ProductKeys.COMPASS);\n const isBundleBBJSW = getIsBundleBbJsw(productKeys);\n const isBundleDevops = getIsBundleDevops(productKeys);\n const isFree = productKeys.length > 0 && productKeys[0].edition === 'free';\n\n // suppress User Segmentation Screen for Jira Template Signups\n const hideUserSegmentation = !!(templateId && (isJsw || isJsm || isJwm));\n\n let isSitePickerDisabled = false;\n if (isBundleDevops) {\n // use Devops submit button text\n buttonText = messages.devopsButtonText;\n startButtonText = messages.devopsStartButtonText;\n\n // Devops EAP only allows creating new sites. Remove this for Devops GA:\n isSitePickerDisabled = true;\n }\n\n let productsExisting: string[] = [];\n if (isBundleBBJSW && bbWorkspacesTotal > 0) {\n productsExisting = [ProductKeys.BITBUCKET];\n }\n if (isBundleBBJSW && userInfo && userInfo.sites) {\n userInfo.sites.map((site: Sites) => {\n productsExisting = [...productsExisting, ...site.products];\n });\n }\n\n let hideAsterisks = true;\n let pickableSites: Sites[] = [];\n let intialEmail = '';\n\n if (!marketingConsentRequired) {\n initialState.consent.consents[2].granted = true;\n initialState.consent.consents[2].displayedText = 'general consent implied';\n }\n\n if (userInfo && userInfo.firstName && userInfo.email) {\n // N2E\n const { firstName, email, lastName } = userInfo;\n initialState.firstName = firstName;\n initialState.lastName = sanitizeLastName(lastName);\n initialState.displayName = `${firstName} ${initialState.lastName}`.trim();\n intialEmail = email;\n initialState.email = email;\n initialState.isLoggedIn = true;\n initialState.migrationId = migrationData\n ? migrationData.migrationSourceUuid\n : null;\n\n delete initialState.password;\n\n !isOpsgenie\n ? delete initialState.dataRegion\n : (initialState.dataRegion = 'US');\n\n if (isSitesDefined(userInfo?.sites) && userInfo.sites.length > 0) {\n if (userInfo.sites.length === 1) {\n initialState.cloudName = userInfo.sites[0].displayName;\n initialState.selectedSite = userInfo.sites[0];\n }\n\n if (bbWorkspaces.length > 0) {\n initialState.bbName = bbWorkspaces[0].workspace.name;\n }\n\n // filter user's sites excluding sites with target products being signed up for\n const defaultProductKeys = productKeys.map((product) => product.product);\n\n // filter user's sites excluding sites with target products being signed up for,\n // & filter out OG and SP for all signups: a site does not exist for\n // these products, and we cannot add a product to a non-existent site\n const targetProductKeys = productKeys.map((product) => product.product);\n targetProductKeys.push(ProductKeys.STATUSPAGE);\n targetProductKeys.push(ProductKeys.OPSGENIE);\n\n if (isBundleBBJSW) {\n // BB/JSW: only filter out SP/OG, not JSW: user must\n // be able to add BB workspace to JSW site)\n const bbJswFilteredProductKeys: string[] = [\n ProductKeys.STATUSPAGE,\n ProductKeys.OPSGENIE\n ];\n\n // filter out non admin sites for bbjsw\n const adminSites = userInfo.sites.filter((site) => site.adminAccess);\n\n pickableSites = adminSites.filter((site) => {\n const sitesMatch = site.products.map((product) => {\n return !bbJswFilteredProductKeys.includes(product);\n });\n return !sitesMatch.includes(false);\n });\n } else if (isOpsgenie) {\n // OG: also filter out JSM\n targetProductKeys.push(ProductKeys.JIRA_SERVICE_DESK);\n\n pickableSites = userInfo.sites.filter((site) => {\n const sitesMatch = site.products.map((product) => {\n return !targetProductKeys.includes(product);\n });\n return !sitesMatch.includes(false);\n });\n } else if (isBundleDevops) {\n // filter out non admin sites for devops\n const adminSites = userInfo.sites.filter((site) => site.adminAccess);\n\n pickableSites = adminSites.filter((site) => {\n return (\n !_.some(site.products, (product: string) =>\n targetProductKeys.includes(product)\n ) ||\n (userInfo.extendedTrialOverridableSites &&\n userInfo.extendedTrialOverridableSites.includes(site.cloudId))\n );\n });\n } else if (isTeamCentral || isJpd || isCompass) {\n // do not filter out sites containing OG or SP\n pickableSites = userInfo.sites.filter((site) => {\n return (\n !_.some(site.products, (product: string) =>\n defaultProductKeys.includes(product)\n ) ||\n (userInfo.extendedTrialOverridableSites &&\n userInfo.extendedTrialOverridableSites.includes(site.cloudId))\n );\n });\n } else {\n // default filtering\n pickableSites = userInfo.sites.filter((site) => {\n return (\n !_.some(site.products, (product: string) =>\n targetProductKeys.includes(product)\n ) ||\n (userInfo.extendedTrialOverridableSites &&\n userInfo.extendedTrialOverridableSites.includes(site.cloudId))\n );\n });\n }\n }\n }\n\n initialState.consent.locale = locale;\n initialState.consent.site = 'atlassian';\n initialState.consent.formUrl = window.location.href;\n initialState.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;\n initialState.products = productKeys;\n\n // if BB preferred then ensure BB is the primary product\n if (bitbucketPreferred && isBundleBBJSW) {\n initialState.products = initialState.products.sort((a, b) =>\n (a.product || '').localeCompare(b.product || '')\n );\n }\n\n initialState.isExistingSitePickerN2E = !devMode && pickableSites.length > 0;\n\n const [signupState, setSignupState] = useState(initialState);\n const [pollingLoaderShown, setPollingLoaderShown] = useState(false);\n const [shouldShowUseExisting, setShouldShowUseExisting] = useState(\n !devMode && !_.isEmpty(pickableSites)\n );\n const [isValidSiteName, setIsValidSiteName] = useState(false);\n const [submitError, setSubmitError] = useState(defaultErrorType);\n const [selectedSiteIsInBreachOfFree, setSelectedSiteIsInBreachOfFree] =\n useState(false);\n const [\n disableSignInWhileTestingFreeBreach,\n setDisableSignInWhileTestingFreeBreach\n ] = useState(false);\n\n useEffect(() => {\n if (\n isBbCopyEnabled &&\n !signupState.isExistingSitePickerN2E &&\n signupState.cloudName &&\n signupState.bbName !== signupState.cloudName\n ) {\n setSignupState({\n ...signupState,\n bbName: signupState.cloudName || ''\n });\n }\n if (\n isBbCopyEnabled &&\n signupState.isExistingSitePickerN2E &&\n signupState.selectedSite &&\n signupState.bbName !== signupState.selectedSite?.displayName\n ) {\n setSignupState({\n ...signupState,\n bbName: signupState.selectedSite?.displayName || ''\n });\n }\n }, [\n isBbCopyEnabled,\n signupState.cloudName,\n signupState.selectedSite,\n signupState.isExistingSitePickerN2E\n ]);\n\n useEffect(() => {\n const n2eAvailable = !!(\n !devMode &&\n pickableSites.length > 0 &&\n userInfo &&\n isSitesDefined(userInfo?.sites) &&\n userInfo.sites.length > 0\n );\n setSignupState({\n ...signupState,\n products: productKeys,\n isExistingSitePickerN2E: n2eAvailable,\n // @ts-ignore\n selectedSite: n2eAvailable ? userInfo.sites[0] : null,\n cloudName: n2eAvailable\n ? // @ts-ignore\n userInfo.sites[0].displayName\n : signupState.isExistingSitePickerN2E\n ? ''\n : signupState.cloudName\n });\n setShouldShowUseExisting(!devMode && !_.isEmpty(pickableSites));\n }, [productKeys]);\n\n const siteNameAfter = useMemo(() => {\n if (isOpsgenie && !isBundleDevops) {\n return signupState.dataRegion === 'EU'\n ? '.atlassian-app.eu.opsgenie.com'\n : '.atlassian-app.opsgenie.com';\n }\n if (isStaging) {\n return '.jira-dev.com';\n } else {\n return '.atlassian.net';\n }\n }, [signupState.dataRegion]);\n\n const isValid = useMemo(() => {\n return (\n signupState.email !== null &&\n signupState.email !== '' &&\n ((signupState.displayName !== null && signupState.displayName !== '') ||\n enableDeferredFullName) &&\n ((signupState.cloudName !== null && signupState.cloudName !== '') ||\n deferSiteNameCreation ||\n (deferredSiteName.isEnabled && signupState.cloudNameLength === 0)) &&\n !signupState.isSSOValid\n );\n }, [signupState]);\n\n const isValidN2E = useMemo(() => {\n return (\n signupState.email !== null &&\n signupState.email !== '' &&\n signupState.firstName !== null &&\n signupState.firstName !== '' &&\n signupState.lastName !== null &&\n signupState.lastName !== '' &&\n ((userInfo && userInfo.email !== '' && userInfo.email !== null) ||\n (signupState.password !== null && signupState.password !== '')) &&\n signupState.cloudName !== null &&\n signupState.cloudName !== '' &&\n isValidSiteName &&\n !signupState.isSSOValid\n );\n }, [signupState, isValidSiteName]);\n\n return {\n signupState,\n setSignupState,\n pollingLoaderShown,\n setPollingLoaderShown,\n showResendEmail,\n setShowResendEmail,\n intialEmail,\n showDevopsCarouselEnd,\n setShowDevopsCarouselEnd,\n goToURL,\n setGoToURL,\n resendEmail,\n isBbCopyEnabled,\n setIsBbCopyEnabled,\n bbWorkspaces,\n bbWorkspacesTotal,\n isOpsgenie,\n isStatuspage,\n isTeamCentral,\n isBundleBBJSW,\n isBundleDevops,\n isCompass,\n isFree,\n buttonText,\n startButtonText,\n isSitePickerDisabled,\n productsExisting,\n hideAsterisks,\n pickableSites,\n shouldShowUseExisting,\n isValidSiteName,\n setIsValidSiteName,\n submitError,\n setSubmitError,\n selectedSiteIsInBreachOfFree,\n setSelectedSiteIsInBreachOfFree,\n disableSignInWhileTestingFreeBreach,\n setDisableSignInWhileTestingFreeBreach,\n siteNameAfter,\n isValid,\n isValidN2E,\n initialState,\n welcomeMessage,\n signUpFormProps,\n hideUserSegmentation,\n signupOrigin\n };\n}\n","import React, {\n createContext,\n useContext,\n useMemo,\n PropsWithChildren\n} from 'react';\nimport { Url } from '@atlassiansox/bxpkit-core';\nimport { ProductKey } from '@atlassiansox/bxpkit-core';\nimport {\n EDITION_LABEL_ARRAY,\n FREE_EDITION_LABEL_KEY,\n STANDARD_EDITION_LABEL_KEY,\n PREMIUM_EDITION_LABEL_KEY,\n BETA_EDITION_LABEL_KEY\n} from '../utility';\n\nexport type Platform = 'ccp' | 'hams' | 'routing';\nconst PLATFORM_OPTIONS = ['ccp', 'hams', 'routing'] as Platform[];\n\nexport type SignUpFormConfig = {\n readonly bundle?: string;\n readonly product?: string;\n readonly edition?: string;\n readonly templateId?: string;\n readonly migrationSourceUuid?: string;\n readonly developer?: string;\n readonly src?: string;\n readonly useCcpPlatform: boolean;\n readonly platform: Platform;\n};\n\nexport type SignUpFormConfigContextProps = {\n readonly bundleOverride?: string;\n readonly productOverride?: string;\n readonly editionOverride?: string;\n};\n\nexport const SignUpConfigContext = createContext(\n {}\n);\n\nexport function SignUpConfigContextProvider({\n children,\n ...props\n}: PropsWithChildren) {\n return (\n \n {children}\n \n );\n}\n\nfunction buildSignUpFormConfig(\n bundleOverride?: string,\n productOverride?: string,\n editionOverride?: string,\n productParam?: string,\n bundleParam?: string,\n editionParam?: string,\n templateIdParam?: string,\n developerParam?: string,\n migrationSourceUuidParam?: string,\n srcParam?: string,\n platformParam?: string\n) {\n // figure out what the product key is\n let product;\n if (productOverride && productOverride.length > 0) {\n product = productOverride.replace(\n ProductKey.JIRA_SERVICE_MANAGEMENT,\n ProductKey.JIRA_SERVICE_DESK\n );\n } else if (productParam && productParam.length > 0) {\n product = productParam.replace(\n ProductKey.JIRA_SERVICE_MANAGEMENT,\n ProductKey.JIRA_SERVICE_DESK\n );\n }\n\n // figure out what the bundle name is\n let bundle;\n if (bundleOverride && bundleOverride.length > 0) {\n bundle = bundleOverride;\n } else if (bundleParam && bundleParam.length > 0) {\n bundle = bundleParam.split('.')[0];\n }\n\n // either product (product key), or bundle (bundle name), should exist, not both\n if (bundle && bundle.length) {\n product = undefined;\n } else if (product && product.length) {\n bundle = undefined;\n }\n // if nothing is provided, set bundle to 'default', which is Jira Software\n else {\n bundle = 'default';\n }\n\n // add edition data\n let edition;\n if (editionOverride && editionOverride.length > 0) {\n edition = EDITION_LABEL_ARRAY.some(\n (label) => label.toLowerCase() === editionOverride\n )\n ? editionOverride\n : FREE_EDITION_LABEL_KEY.toLowerCase();\n } else if (editionParam && editionParam.length > 0) {\n edition = EDITION_LABEL_ARRAY.some(\n (label) => label.toLowerCase() === editionParam\n )\n ? editionParam\n : FREE_EDITION_LABEL_KEY.toLowerCase();\n } else {\n edition = FREE_EDITION_LABEL_KEY.toLowerCase();\n }\n\n // adjust edition based on migrationSourceUuid query parameter\n // should either be standard or premium; always correct free to standard\n if (\n migrationSourceUuidParam &&\n migrationSourceUuidParam.length > 0 &&\n edition !== STANDARD_EDITION_LABEL_KEY.toLowerCase() &&\n edition !== PREMIUM_EDITION_LABEL_KEY.toLowerCase()\n ) {\n edition = STANDARD_EDITION_LABEL_KEY.toLowerCase();\n }\n\n // Developer Instances should always be Standard Edition\n if (developerParam) {\n edition = STANDARD_EDITION_LABEL_KEY.toLowerCase();\n }\n // SPICE-448: Prototype products - Point A alpha or beta products\n if (bundle === ProductKey.COMPASS || product === ProductKey.COMPASS) {\n edition = BETA_EDITION_LABEL_KEY.toLowerCase();\n }\n\n let platform = 'routing' as Platform;\n let useCcpPlatform = false;\n if (platformParam) {\n const platformParamLowerCase = platformParam.toLowerCase() as Platform;\n if (platformParamLowerCase === 'ccp') {\n useCcpPlatform = true;\n }\n\n if (PLATFORM_OPTIONS.includes(platformParamLowerCase)) {\n platform = platformParamLowerCase;\n }\n }\n\n return {\n bundle,\n edition,\n product,\n migrationSourceUuid: migrationSourceUuidParam,\n templateId: templateIdParam,\n developer: developerParam,\n src: srcParam,\n useCcpPlatform,\n platform\n };\n}\n\nexport function useSignUpFormConfig(): SignUpFormConfig {\n const { bundleOverride, productOverride, editionOverride } =\n useContext(SignUpConfigContext);\n\n const {\n product: productParam,\n bundle: bundleParam,\n edition: editionParam,\n templateId: templateIdParam,\n developer: developerParam,\n migrationSourceUuid: migrationSourceUuidParam,\n src: srcParam,\n platform: platformParam\n } = Url.getUrlParams() || {};\n\n return useMemo(\n () =>\n buildSignUpFormConfig(\n bundleOverride,\n productOverride,\n editionOverride,\n productParam,\n bundleParam,\n editionParam,\n templateIdParam,\n developerParam,\n migrationSourceUuidParam,\n srcParam,\n platformParam\n ),\n [\n bundleOverride,\n productOverride,\n editionOverride,\n productParam,\n bundleParam,\n editionParam,\n templateIdParam,\n developerParam,\n migrationSourceUuidParam,\n srcParam,\n platformParam\n ]\n );\n}\n","import React, {\n createContext,\n useContext,\n useMemo,\n useState,\n useEffect,\n PropsWithChildren\n} from 'react';\n\nimport { Environment } from '@atlassiansox/bxpkit-core';\nimport { LayoutType } from '../sign-up-layout-container';\n\nimport {\n BundleSelectionContextProps,\n BuildBundlesContextArgs,\n UseBundlesReturnType\n} from '../model';\n\nconst BUNDLE_V1 = 'bundle-v1';\nconst BUNDLE_V2 = 'bundle-v2';\nexport const bundlesLayouts: LayoutType[] = [BUNDLE_V1, BUNDLE_V2];\n\nconst isBundleLayout = (layoutName?: LayoutType) => {\n return layoutName && bundlesLayouts.includes(layoutName);\n};\n\nexport const BundlesContext = createContext({\n bundleMap: [],\n setBundle: () => null,\n setEdition: () => null\n});\n\n// Copied from bxpkit-core/src/utils/environment.ts\n// Strange import errors were happening in Magnolia\nfunction getParam(param: string) {\n const params = new URLSearchParams(location.search.slice(1));\n return params.get(param);\n}\n\nexport function BundlesContextProvider({\n children,\n ...props\n}: PropsWithChildren) {\n const [bundle, setBundle] = useState(\n isBundleLayout(props.layout) ? props.bundleMap[0].key : props.bundleOverride\n );\n\n const [edition, setEdition] = useState(\n isBundleLayout(props.layout)\n ? props.bundleMap[0].edition\n : props.editionOverride\n );\n\n useEffect(() => {\n if (isBundleLayout(props.layout)) {\n const availableBundleKeys = props.bundleMap.map((bundle) => bundle.key);\n const bundleParam = getParam('bundle');\n if (bundleParam && availableBundleKeys.includes(bundleParam)) {\n setBundle(bundleParam);\n }\n }\n }, []);\n\n useEffect(() => {\n if (isBundleLayout(props.layout)) {\n const updatedParams = Environment.getCurrentSearchParam({\n bundle,\n edition\n });\n\n window.history.pushState({}, '', updatedParams);\n }\n }, [bundle, edition]);\n\n const product = isBundleLayout(props.layout)\n ? undefined\n : props.productOverride;\n\n return (\n \n {children}\n \n );\n}\n\nfunction buildBundlesContext({\n bundleMap,\n setBundle,\n setEdition,\n productOverride,\n bundleOverride,\n editionOverride,\n layout\n}: BuildBundlesContextArgs): UseBundlesReturnType {\n return {\n setBundle,\n setEdition,\n bundleItems: bundleMap,\n productOverride: isBundleLayout(layout) ? undefined : productOverride,\n bundleOverride,\n editionOverride,\n isBundleV2Layout: layout === BUNDLE_V2\n };\n}\n\nexport function useBundles(): UseBundlesReturnType {\n const {\n bundleMap,\n setBundle,\n setEdition,\n layout,\n productOverride,\n bundleOverride,\n editionOverride\n } = useContext(BundlesContext);\n\n return useMemo(\n () =>\n buildBundlesContext({\n bundleMap,\n setBundle,\n setEdition,\n layout,\n productOverride,\n bundleOverride,\n editionOverride\n }),\n [bundleOverride, editionOverride, productOverride, bundleMap, layout]\n );\n}\n","import deprecationWarning from '@atlaskit/ds-lib/deprecation-warning';\nimport { B100, N30A, skeleton as skeletonColor } from './colors';\nexport const CHANNEL = '__ATLASKIT_THEME__';\nexport const DEFAULT_THEME_MODE = 'light';\nexport const THEME_MODES = ['light', 'dark'];\n/*\n These theme values are expressed as functions so that if we decide to make\n them dependent on props in the future, it wouldn't require a significant\n refactor everywhere they are being used.\n*/\n\nexport const borderRadius = () => 3;\nexport const gridSize = () => 8;\nexport const fontSize = () => 14;\nexport const fontSizeSmall = () => 11;\nexport const fontFamily = () => `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif`;\nexport const codeFontFamily = () => `'SFMono-Medium', 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', Menlo, Consolas, Courier, monospace`;\n/**\n * @deprecated Please use `@atlaskit/focus-ring`\n */\n\nexport const focusRing = (color = `var(--ds-border-focused, ${B100})`, outlineWidth = gridSize() / 4) => {\n deprecationWarning('@atlaskit/theme', 'focus ring mixin', 'Please use `@atlaskit/focus-ring` instead.');\n return `\n &:focus {\n outline: none;\n box-shadow: 0px 0px 0px ${outlineWidth}px ${color};\n }\n`;\n};\n/**\n * @deprecated Please use `@atlaskit/focus-ring`\n */\n\nexport const noFocusRing = () => `\n box-shadow: none;\n`;\nexport const layers = {\n card: () => 100,\n navigation: () => 200,\n dialog: () => 300,\n layer: () => 400,\n blanket: () => 500,\n modal: () => 510,\n flag: () => 600,\n spotlight: () => 700,\n tooltip: () => 800\n}; // eslint-disable-next-line @atlaskit/design-system/use-visually-hidden\n\n/**\n * @deprecated Please use `@atlaskit/visually-hidden`\n */\n\nexport const visuallyHidden = () => {\n deprecationWarning('@atlaskit/theme', 'visually hidden mixin', 'Please use `@atlaskit/visually-hidden` instead.');\n return {\n border: '0 !important',\n clip: 'rect(1px, 1px, 1px, 1px) !important',\n height: '1px !important',\n overflow: 'hidden !important',\n padding: '0 !important',\n position: 'absolute !important',\n width: '1px !important',\n whiteSpace: 'nowrap !important'\n };\n};\n/**\n * @deprecated Please use `@atlaskit/visually-hidden`\n */\n\nexport const assistive = visuallyHidden;\n/**\n * These styles are mirrored in:\n * packages/design-system/menu/src/internal/components/skeleton-shimmer.tsx\n *\n * Please update both.\n */\n\nexport const skeletonShimmer = () => ({\n css: {\n backgroundColor: `var(--ds-skeleton, ${skeletonColor()})`,\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationDirection: 'alternate'\n },\n keyframes: {\n from: {\n backgroundColor: `var(--ds-skeleton, ${skeletonColor()})`\n },\n to: {\n backgroundColor: `var(--ds-skeleton-subtle, ${N30A})`\n }\n }\n});","/** @jsx jsx */\nimport { forwardRef } from 'react';\nimport { css, jsx } from '@emotion/core';\nimport { layers } from '@atlaskit/theme/constants';\nconst VAR_PRIMITIVE_ZINDEX = 'tooltipPrimitiveZindex';\nconst primitiveStyles = css({\n zindex: `var(${VAR_PRIMITIVE_ZINDEX})`,\n cursor: `default`\n});\nconst TooltipPrimitive = /*#__PURE__*/forwardRef(function TooltipPrimitive({\n style,\n className,\n children,\n placement,\n testId,\n onMouseOut,\n onMouseOver,\n id\n}, ref) {\n const styleWithZIndex = { ...style,\n [VAR_PRIMITIVE_ZINDEX]: layers.tooltip()\n };\n return jsx(\"div\", {\n ref: ref,\n style: styleWithZIndex,\n \"data-testid\": `${testId}--wrapper`\n }, jsx(\"div\", {\n role: \"tooltip\",\n className: className,\n onMouseOut: onMouseOut,\n onMouseOver: onMouseOver,\n css: primitiveStyles,\n \"data-placement\": placement,\n \"data-testid\": testId,\n id: id\n }, children));\n});\nTooltipPrimitive.displayName = 'TooltipPrimitive';\nexport default TooltipPrimitive;","import {\n B100,\n B300,\n B400,\n B50,\n G300,\n linkHover,\n N0,\n N20,\n N200,\n N500,\n N60,\n N600,\n N700,\n N80,\n N800,\n N900,\n R400\n} from '@atlaskit/theme/colors';\nimport { TooltipPrimitive } from '@atlaskit/tooltip';\nimport styled from '@emotion/styled';\nimport React from 'react';\n\nconst text =\n \"Charlie Text, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans', 'Ubuntu', 'Droid Sans', 'Helvetica Neue', sans-serif\";\n\nconst display =\n \"Charlie Display, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans', 'Ubuntu', 'Droid Sans', 'Helvetica Neue', sans-serif\";\n\nconst product =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans', 'Ubuntu', 'Droid Sans', 'Helvetica Neue', sans-serif\";\n\nconst WacSignupFormContainer = styled.form`\n box-sizing: border-box;\n font-family: ${text};\n font-weight: 500;\n max-width: 400px;\n * {\n box-sizing: border-box;\n }\n`;\nconst ResendEmailContainer = styled.div`\n box-sizing: border-box;\n font-family: ${text};\n font-weight: 500;\n max-width: 536px;\n min-height: 564px;\n margin: 0 auto;\n * {\n box-sizing: border-box;\n }\n`;\n\nconst StyledPassword = styled.div`\n opacity: ${(props) => {\n if (props.isDisabled && props.fadeOnDisable) {\n return 0.4;\n }\n return 1;\n }};\n div {\n div:nth-child(2) {\n padding: 4px;\n }\n }\n`;\n\nconst FieldContainer = styled.div`\n position: relative;\n margin-bottom: 16px;\n`;\n\ninterface FieldErrorStateProps {\n showError: boolean;\n}\nconst FieldErrorState = styled.div`\n padding: 0;\n background-color: ${(props) => {\n if (props.showError) {\n return R400;\n } else {\n return 'transparent';\n }\n }};\n border-radius: 3px;\n`;\n\nconst FullNameFieldWrapper = styled.div`\n position: relative;\n margin-bottom: 16px;\n`;\n\nconst TwoColumnFieldGroup = styled.div`\n display: grid;\n grid-template-columns: 1fr 1fr;\n grid-column-gap: 16px;\n`;\n\ninterface NameProps {\n isValid: boolean;\n val: string;\n isDisabled?: boolean;\n fadeOnDisable?: boolean;\n outlineOnFocus?: boolean;\n isFocused?: boolean;\n}\nconst NameFieldGroup = styled.div`\n transition: all 0.1s linear 0s;\n opacity: ${(props) => {\n if (props.isDisabled && props.fadeOnDisable) {\n return 0.4;\n }\n return 1;\n }};\n > div {\n border-color: ${(props) => {\n if (props.isDisabled) {\n return `${N60} !important`;\n }\n if (props.isValid && props.val.length > 0) {\n return '#36b37e';\n } else if (!props.isValid) {\n return R400;\n }\n if (props.outlineOnFocus && props.isFocused) {\n return `${B100}`;\n }\n return N60;\n }};\n background: ${N0} !important;\n }\n`;\n\nconst Input = styled.input`\n border: 2px solid ${N60};\n border-radius: 4px;\n color: ${N700};\n display: inline-block;\n font-size: 1rem;\n outline: none;\n padding: 8px;\n width: 100%;\n &.field-error {\n border-color: ${R400};\n }\n`;\n\nexport const InfoIcon = styled.div`\n height: 24px;\n svg {\n margin: 0;\n }\n div {\n display: none;\n }\n :hover {\n div {\n display: block;\n }\n }\n`;\n\nconst Label = styled.label`\n transition: all 0.1s linear 0s;\n opacity: ${(props) => {\n if (props.isDisabled && props.fadeOnDisable) {\n return 0.4;\n }\n return 1;\n }};\n span {\n color: ${N500};\n display: inline-block;\n font-size: 0.875rem;\n font-weight: 500;\n margin-bottom: 5px;\n line-height: normal;\n ::after {\n color: ${R400};\n content: '*';\n display: inline-block;\n padding-left: 4px;\n\n .no-asterisks & {\n content: '';\n }\n }\n }\n display: flex;\n`;\n\nconst InputDescription = styled.div`\n color: ${N500};\n font-weight: 400;\n font-size: 12px;\n margin: 3px 0px;\n`;\n\nconst DropdownTrigger = styled.div`\n font-family: ${text};\n text-align: left;\n font-size: 14px;\n span: {\n fontsize: '14px';\n }\n`;\n\n// Atlaskit dropdown button theme prop\nconst DropdownButtonStyle = {\n width: '100%',\n background: N0,\n appearance: 'none',\n cursor: 'pointer',\n fontSize: '14px',\n color: text,\n paddingTop: '6px',\n paddingBottom: '6px',\n borderColor: N60,\n borderRadius: '3px',\n borderWidth: '2px',\n borderStyle: 'solid'\n};\n\nconst JswTrialNotice = styled.div`\n font-size: 12px;\n font-weight: 400;\n color: ${text};\n margin: 6px 0 4px;\n\n span {\n min-width: 28px;\n vertical-align: middle;\n }\n`;\n\nconst DropdownButtonStyleOpen = {\n background: N20,\n borderColor: B100\n};\n\nconst SiteNameAfter = styled.div`\n padding-right: 8px;\n display: flex;\n font-size: 16px;\n align-items: center;\n justify-content: flex-end;\n width: auto;\n color: #7a869a;\n font-weight: 400;\n svg {\n margin-bottom: 0px;\n }\n span {\n display: flex;\n align-items: center;\n min-width: 24px;\n }\n`;\nconst SiteNameAfterRadioList = styled.div`\n padding-right: 8px;\n display: flex;\n font-size: 14px;\n align-items: center;\n justify-content: flex-start;\n width: auto;\n color: #7a869a;\n svg {\n margin-bottom: 0px;\n }\n span {\n display: flex;\n align-items: center;\n }\n`;\nconst SiteNameAfterLabel = styled.span`\n font-size: 14px !important;\n white-space: nowrap;\n padding-right: 8px;\n`;\n\nconst EmailAfter = styled.div`\n padding-right: 8px;\n display: flex;\n font-size: 16px;\n align-items: center;\n svg {\n margin-bottom: 0px;\n }\n`;\ninterface SharedProps {\n readonly isValid?: boolean;\n readonly textInput?: string;\n readonly hasAccount?: boolean;\n readonly isEmpty?: boolean;\n readonly isFocused?: boolean;\n readonly isDisabled?: boolean;\n readonly popOverError?: boolean; // popover error style type\n readonly outlineOnFocus?: boolean; // blue outline on focus\n readonly fadeOnDisable?: boolean; // fade entire field if disabled\n readonly children?: React.ReactNode;\n readonly className?: string;\n readonly onClick?: (event: any) => void;\n}\nconst SuccessTextfieldWrapper = styled.div`\n .errorMessage {\n background-color: white !important;\n }\n #site-field {\n padding-right: 0px;\n }\n > div {\n transition: all 0.1s linear 0s;\n max-height: 40px;\n opacity: ${(props) => {\n if (props.isDisabled && props.fadeOnDisable) {\n return 0.4;\n }\n return 1;\n }};\n background: ${N0};\n background: ${(props) => {\n if (props.hasAccount) {\n return `${N20} !important;`;\n }\n return `${N0};`;\n }};\n border-color: ${(props) => {\n if (props.isEmpty || props.hasAccount || props.isDisabled) {\n if (props.outlineOnFocus && props.isFocused) {\n return `${B100} !important`; // blue\n }\n return `${N60} !important`; // dark-grey\n }\n if (props.isValid) {\n return `${G300} !important`; // green\n }\n return `${R400} !important`; // red\n }};\n }\n > input {\n background: ${(props) => {\n if (props.hasAccount) {\n return '#F4F5F7';\n }\n return '#FFFFFF';\n }};\n }\n`;\n\nconst ErrorTextfieldWrapper = styled.div`\n > div {\n border-color: ${R400}!important;\n }\n`;\n\nconst CompoundField = styled.div`\n transition: all 0.1s linear 0s;\n display: grid;\n grid-template-columns: max-content 1fr;\n margin-bottom: 5px;\n border-radius: 3px 0 0 3px;\n opacity: ${(props) => {\n if (props.isDisabled && props.fadeOnDisable) {\n return 0.4;\n }\n return 1;\n }};\n > div {\n > div {\n transition: all 0.1s linear 0s;\n border-right: none;\n border-radius: 3px 0 0 3px;\n background: ${N0} !important;\n border-color: ${(props) => {\n if (props.isEmpty || props.isDisabled) {\n if (props.outlineOnFocus && props.isFocused) {\n return `${B100} !important`;\n }\n return `${N60} !important`;\n }\n if (props.isValid) {\n return `${G300} !important`;\n }\n return `${R400}`;\n }};\n }\n }\n\n > label {\n > span {\n margin: 0;\n }\n }\n\n .domain-name-tooltip-trigger {\n border-color: ${B400};\n border-right: 1px solid;\n border-radius: 3px;\n }\n .domain-name-tooltip-trigger-devops {\n background: ${N0};\n border-color: ${N0};\n box-shadow: 0px 3px 5px rgba(9, 30, 66, 0.2),\n 0px 0px 1px rgba(9, 30, 66, 0.31);\n border-radius: 3px;\n }\n`;\n\nexport const PasswordCompoundField = styled(CompoundField)`\n display: flex;\n .full-width {\n width: 100%;\n }\n`;\n\nconst CompoundInput = styled(Input)`\n @supports (display: grid) {\n border-radius: 4px 0 0 4px;\n border-right: none;\n margin: 0;\n min-height: 40px;\n padding-right: 0;\n }\n`;\n\nconst CompoundInputSegment = styled.div`\n @supports (display: grid) {\n transition: all 0.1s linear 0s;\n border: 2px solid ${N60};\n border-radius: 0 4px 4px 0;\n border-color: ${(props) => {\n if (props.isEmpty || props.isDisabled) {\n if (props.outlineOnFocus && props.isFocused) {\n return `${B100} !important`;\n }\n return `${N60} !important`;\n }\n if (props.isValid) {\n return `${G300} !important`;\n }\n return `${R400} !important`;\n }};\n border-left: none;\n display: flex;\n align-items: center;\n height: 100%;\n padding: 4px 8px;\n &.field-error {\n border-color: ${R400};\n }\n }\n`;\n\nconst ErrorMessage = styled.div`\n color: ${R400};\n font-weight: 400;\n margin: 6px 0;\n font-size: 12px;\n line-height: 12px;\n\n a {\n text-decoration: none;\n color: ${B400};\n\n &:hover {\n text-decoration: underline;\n color: ${B300};\n }\n }\n\n ${(props) =>\n props.popOverError &&\n `\n position: absolute;\n display: ${props.isDisabled && props.fadeOnDisable ? 'none' : 'grid'};\n justify-items: center;\n align-items: start;\n width: 100%;\n margin: 0;\n z-index: 9;\n color: ${N900};\n background: transparent !important;\n\n span {\n padding: 7px;\n background: white;\n box-shadow: 0px 0px 1px rgba(9, 30, 66, 0.31), 0px 3px 5px rgba(9, 30, 66, 0.2);\n border-radius: 3px;\n margin-top: 2px;\n max-width: 90%;\n line-height: 1.2em;\n }\n `}\n`;\n\nfunction ErrorMessageWithDefaultClassName({\n className,\n ...props\n}: SharedProps) {\n return (\n \n {props.children}\n \n );\n}\n\nexport const RadioGroupWrapper = styled.div`\n line-height: 1;\n margin-bottom: 12px;\n\n svg {\n margin: 0;\n }\n`;\n\nexport const RadioGroupSpacedWrapper = styled.div`\n line-height: 1;\n margin-top: 12px;\n margin-bottom: 12px;\n\n svg {\n margin: 0;\n }\n`;\n\nexport const RadioWrapper = styled.div`\n display: flex;\n & label {\n flex-direction: row;\n align-items: center;\n }\n`;\n\nconst InfoMessage = styled.div`\n color: ${N700};\n font-size: 0.875rem;\n font-weight: 400;\n margin-top: 6px;\n`;\n\nconst Cursor = styled.div`\n cursor: ${(props) =>\n props.isDisabled && props.fadeOnDisable ? 'not-allowed' : 'pointer'};\n display: flex;\n align-items: center;\n margin-top: 0;\n @supports (display: grid) {\n display: flex;\n align-items: center;\n }\n`;\n\nconst SvgContainer = styled.div`\n svg {\n display: block;\n margin-bottom: 0;\n }\n`;\n\nconst AttentionContainer = styled.div`\n width: 0;\n height: 0;\n left: -29px;\n position: relative;\n top: 6px;\n svg {\n display: block;\n margin-bottom: 0;\n }\n`;\n\nconst Domain = styled.div`\n color: ${N80};\n font-family: ${display};\n font-size: 1rem;\n letter-spacing: 1px;\n`;\n\nconst ToolTipContainer = styled.div`\n position: relative;\n display: none;\n @supports (display: grid) {\n display: block;\n }\n`;\n\nconst ToolTipText = styled.div`\n background: ${N0};\n border: 1px solid ${B400};\n border-radius: 2px;\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);\n color: ${N800};\n font-family: ${text};\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1.42857143;\n padding: 12px;\n position: absolute;\n left: 6px;\n top: 25px;\n width: 298px;\n`;\n\nconst DomainToolTip = styled.div`\n cursor: pointer;\n margin: 0 6px;\n svg {\n height: 18px;\n width: 18px;\n }\n`;\n\nconst AppRegionContainer = styled.div`\n color: ${N700};\n display: grid;\n grid-template-columns: min-content min-content;\n grid-column-gap: 16px;\n margin-bottom: 24px;\n div {\n display: grid;\n grid-template-columns: min-content min-content;\n grid-column-gap: 8px;\n }\n`;\n\nconst CheckboxContainer = styled.div`\n color: ${N700};\n display: grid;\n grid-template-columns: min-content 1fr;\n grid-column-gap: 8px;\n font-size: 0.875rem;\n margin-bottom: 16px;\n &.hidden {\n grid-template-columns: 1fr;\n .checkbox {\n display: none;\n }\n }\n .full-width {\n grid-column: 1 / 3;\n }\n p {\n font-size: 0.875rem;\n line-height: 1.25;\n margin: 0;\n }\n`;\n\nconst SmallPrint = styled.div`\n color: ${N500};\n font-size: 0.75rem;\n margin-bottom: 16px;\n &.compact {\n margin-bottom: 4px;\n }\n p {\n font-size: 0.75rem;\n line-height: 1.25;\n margin: 0;\n }\n`;\nconst ButtonSpinner = styled.div`\n display: inline-block;\n margin-right: 12px;\n margin-left: -28px;\n`;\n\nconst Button = styled.button`\n border: none;\n border-radius: 3px;\n background-color: ${B400};\n color: ${N0};\n cursor: pointer;\n font-size: 1rem;\n font-weight: 500;\n font-family: ${text};\n min-height: 40px;\n width: 100%;\n &:hover {\n background: ${B300};\n }\n &:active {\n background-color: #0047b3;\n }\n &[disabled] {\n cursor: not-allowed;\n background-color: #0047b3;\n }\n`;\n\nconst CapsPrint = styled.div`\n color: ${N500};\n font-size: 0.875rem;\n margin-bottom: 16px;\n margin-top: 8px;\n text-align: center;\n text-transform: uppercase;\n @media (min-width: 540px) {\n margin-top: 16px;\n }\n`;\n\nconst CaptchaContainer = styled.div`\n margin-bottom: 16px;\n`;\n\ninterface WelcomDivProps {\n readonly headerStyle?: boolean;\n}\n\nconst WelcomeDiv = styled.div`\n font-size: 1.25rem;\n line-height: 1.2;\n margin-bottom: 30px;\n letter-spacing: 0.3px;\n font-family: Charlie Display, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n -webkit-font-smoothing: antialiased;\n font-weight: 500;\n\n ${(props) =>\n props.headerStyle &&\n `\n color: ${N600};\n text-align: center;\n font-size: 32px;\n line-height: 40px;\n\n @media only screen and (max-width: 769px) {\n font-size: 28px;\n text-align: left;\n }\n `}\n`;\n\nexport const WelcomeDivDevops = styled.div`\n max-width: 300px;\n margin: 0 auto;\n text-align: center;\n`;\n\nexport const StyledInfoBoxWrapper = styled.div`\n margin: 12px auto 26px;\n`;\n\nconst InfoBoxContainer = styled.div`\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n background-color: ${B50};\n padding: 12px 16px;\n border-radius: 3px;\n margin-bottom: 12px;\n`;\n\ninterface InfoBoxContentProps {\n readonly fontSize?: string;\n}\n\nconst InfoBoxContent = styled.div`\n width: 93%;\n\n .title {\n font-weight: 500;\n }\n\n p {\n font-size: ${({ fontSize }) => {\n if (fontSize) {\n return fontSize;\n } else {\n return '12px';\n }\n }};\n font-weight: 400;\n line-height: 17px;\n margin: 0 0 12px 0;\n color: ${text};\n\n &.link {\n display: inline-block;\n color: ${B400};\n cursor: pointer;\n\n &:hover {\n color: ${linkHover};\n }\n }\n\n &:last-child {\n margin: 0;\n }\n }\n`;\n\nconst ModalContents = styled.div`\n position: relative;\n font-family: ${text};\n font-size: 14px;\n color: ${text};\n padding: 18px 0;\n\n .message {\n padding-right: 24px;\n line-height: 22px;\n }\n\n a {\n color: ${text};\n text-decoration: none;\n font-weight: 500;\n\n &:focus {\n outline: none;\n }\n }\n\n .exit {\n position: absolute;\n top: 8px;\n right: -12px;\n cursor: pointer;\n }\n`;\n\nconst ReCaptchaEula = styled.div`\n margin-top: 40px;\n font-size: 12px;\n color: ${N200};\n line-height: 16px;\n text-align: center;\n > * {\n margin-block-start: 0;\n > a {\n color: ${N200};\n text-decoration: underline;\n }\n }\n}\n`;\n\nconst Eula = styled.div`\n font-size: 12px;\n line-height: 16px;\n color: #6c798f;\n vertical-align: middle;\n padding: 0 0 5px 0;\n font-family: ${text};\n font-weight: 400;\n\n a {\n color: ${B400};\n text-decoration: none;\n cursor: pointer;\n }\n\n p {\n font-size: 12px;\n line-height: 16px;\n margin-bottom: 24px;\n margin-top: 0;\n\n &.eula-compass {\n p {\n display: inline;\n }\n }\n }\n\n div {\n display: inline;\n }\n\n .tooltip {\n color: ${B400};\n cursor: pointer;\n }\n`;\n\nexport const RequiredFieldMessage = styled.div`\n font-size: 12px;\n line-height: 16px;\n color: #6c798f;\n vertical-align: middle;\n padding: 0 0 5px 0;\n font-family: ${text};\n font-weight: 400;\n`;\n\nexport const UnderLabelMessage = styled.div`\n font-size: 12px;\n line-height: 16px;\n color: ${N800};\n vertical-align: middle;\n padding: 0 0 8px 0;\n font-family: ${text};\n font-weight: 400;\n`;\n\nconst TooltipDialog = styled(TooltipPrimitive)`\n font-family: ${text};\n box-sizing: content-box;\n border-radius: 4px;\n padding: 8px 12px;\n max-width: 330px;\n background: #0e0e0e;\n color: ${N0};\n font-size: 14px;\n font-weight: 500;\n\n p {\n margin: 0;\n }\n\n @media only screen and (max-width: 375px) {\n max-width: 300px;\n }\n`;\nconst SigninWithDiffAccount = styled.div`\n font-size: 12px;\n line-height: 16px;\n color: #6c798f;\n vertical-align: middle;\n padding: 5px 0;\n font-family: ${text};\n font-weight: 500;\n > * {\n > * {\n margin-block-start: 0;\n margin-bottom: 0px;\n > a {\n color: ${B400};\n text-decoration: none;\n }\n }\n }\n`;\n\nconst SitePickerToggle = styled.span`\n display: block;\n font-size: 12px;\n line-height: 16px;\n color: ${B400};\n vertical-align: middle;\n padding: 5px 0;\n margin: 0 0 0 0;\n font-family: ${text};\n font-weight: 500;\n cursor: pointer;\n`;\n\nconst NoCard = styled.div`\n margin-top: 15px;\n font-weight: 500;\n margin-bottom: 0;\n text-align: center;\n font-size: 0.875rem;\n letter-spacing: 1px;\n line-height: 1.25;\n font-family: Charlie Display, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n`;\n\nconst MarketingConsent = styled.div`\n > label {\n > span {\n border: none !important;\n padding: 0 !important;\n border-radius: 3px;\n margin-bottom: 12px;\n line-height: 20px;\n font-size: 100%;\n vertical-align: baseline;\n font-family: Charlie Display, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n font-size: 13px;\n letter-spacing: 0.3px;\n }\n }\n`;\n\nconst DeveloperModeDiv = styled.div`\n font-family: Charlie Display, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n border: 1px solid ${N60};\n color: #6c798f;\n border-radius: 6px;\n margin: 20px 0;\n padding: 16px 30px 16px 38px;\n font-size: 14px;\n position: relative;\n h4 {\n font-style: inherit;\n font-family: inherit;\n color: #6c798f;\n font-size: 14px;\n line-height: 20px;\n font-weight: 500;\n }\n p {\n color: inherit;\n font-size: inherit;\n line-height: 20px;\n font-weight: normal;\n font-family: inherit;\n font-style: inherit;\n margin-bottom: 0;\n }\n ul {\n list-style-type: disc;\n margin-bottom: 8px;\n padding-left: 20px;\n }\n`;\nconst MigrationSourceDiv = styled.div`\n margin: 0;\n padding: 0;\n border: 0;\n font-size: 100%;\n vertical-align: baseline;\n font-family: Charlie Text, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,\n Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n span {\n > div {\n font-size: 1.25rem;\n line-height: 1.2;\n margin-bottom: 24px;\n font-weight: 500;\n font-family: inherit;\n font-style: inherit;\n }\n > p {\n font-size: 1rem;\n line-height: 24px;\n margin-bottom: 24px;\n font-family: inherit;\n font-style: inherit;\n font-weight: normal;\n > a {\n color: ${B400};\n text-decoration: none;\n vertical-align: baseline;\n font-family: inherit;\n font-style: inherit;\n font-weight: inherit;\n }\n }\n }\n`;\n\nconst SitePickerTextfieldWrapper = styled.div`\n > div {\n max-height: 40px;\n background: ${N20} !important;\n border-color: ${N60} !important;\n }\n\n svg {\n margin-bottom: 0;\n }\n`;\n\nconst BitbucketAccountCheckbox = styled.div`\n font-size: 12px;\n font-weight: 400;\n color: ${text};\n max-width: 390px;\n margin-top: 4px;\n`;\n\nconst RadioLabel = styled.div`\n display: flex;\n font-weight: 400;\n font-size: 14px;\n line-height: 18px;\n flex-direction: column;\n color: ${N900};\n font-family: Charlie Text, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,\n Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n`;\n\nconst DevopsCarouselRadioGroup = styled.div`\n margin-top: 27px;\n label {\n margin-bottom: 15px;\n font-size: 14px;\n line-height: 24px;\n color: ${N800};\n font-family: Charlie Text, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n }\n`;\nconst DevopsCarouselWorkspaces = styled.div`\n width: 204px;\n`;\nconst DevopsCarouselSites = styled.div`\n width: 204px;\n`;\n\nexport {\n text,\n display,\n product,\n WacSignupFormContainer,\n StyledPassword,\n FieldContainer,\n FieldErrorState,\n FullNameFieldWrapper,\n TwoColumnFieldGroup,\n NameFieldGroup,\n Input,\n Label,\n InputDescription,\n DropdownTrigger,\n DropdownButtonStyle,\n JswTrialNotice,\n DropdownButtonStyleOpen,\n SiteNameAfter,\n SiteNameAfterRadioList,\n SiteNameAfterLabel,\n EmailAfter,\n SuccessTextfieldWrapper,\n ErrorTextfieldWrapper,\n CompoundField,\n CompoundInput,\n CompoundInputSegment,\n ErrorMessage,\n ErrorMessageWithDefaultClassName,\n InfoMessage,\n Cursor,\n SvgContainer,\n AttentionContainer,\n Domain,\n ToolTipContainer,\n ToolTipText,\n DomainToolTip,\n AppRegionContainer,\n CheckboxContainer,\n SmallPrint,\n ButtonSpinner,\n Button,\n CapsPrint,\n CaptchaContainer,\n WelcomeDiv,\n InfoBoxContainer,\n InfoBoxContent,\n ModalContents,\n ReCaptchaEula,\n Eula,\n SigninWithDiffAccount,\n SitePickerToggle,\n NoCard,\n MarketingConsent,\n DeveloperModeDiv,\n MigrationSourceDiv,\n SitePickerTextfieldWrapper,\n BitbucketAccountCheckbox,\n RadioLabel,\n ResendEmailContainer,\n DevopsCarouselRadioGroup,\n DevopsCarouselWorkspaces,\n DevopsCarouselSites,\n TooltipDialog\n};\n","import { useAnalyticsEvents } from '@atlaskit/analytics-next';\nimport CheckCircleOutlineIcon from '@atlaskit/icon/glyph/check-circle-outline';\nimport WarningIcon from '@atlaskit/icon/glyph/warning';\nimport Spinner from '@atlaskit/spinner';\nimport Textfield from '@atlaskit/textfield';\nimport {\n MarieSchemaAnalytics,\n SanitizedFormattedHtmlMessage\n} from '@atlassiansox/bxpkit-core';\nimport { useActor } from '@xstate/react';\nimport React, { useContext, useEffect, useState } from 'react';\nimport { FormattedMessage, injectIntl } from 'react-intl';\nimport {\n useAuthenticationMethodsCheck,\n useDebounce,\n useEmailValidation\n} from '../../../../../hook';\nimport {\n getTranslatableError,\n messages\n} from '../../../../../messages/sign-up-form';\nimport { EmailFieldPropsType } from '../../../../../model/email-field';\nimport {\n EmailAfter,\n ErrorMessageWithDefaultClassName,\n FieldContainer,\n Label,\n SigninWithDiffAccount,\n SuccessTextfieldWrapper\n} from './styled';\n\nexport function EmailField({\n onEmailChange,\n initialEmail,\n signInAccountUrl,\n switchAccountUrl,\n originAnalyticsAttributes,\n analyticsTrack,\n wacEnvUrl,\n isStaging,\n isDisabled,\n outlineOnFocus,\n fadeOnDisable,\n popOverError,\n serviceFieldProgress,\n showWarningIcon,\n onSSOCheckValid,\n isDeferredSiteNameEnabled\n}: EmailFieldPropsType) {\n const [, send] = useActor(serviceFieldProgress);\n\n const { segment } = analyticsTrack;\n const baseUrl = `${wacEnvUrl}${isStaging ? '/apis/stg' : ''}/hamlet`;\n const hasInitialEmail = (initialEmail && initialEmail !== '') || false;\n const [alreadySentValid, setAlreadySentValid] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [email, setEmail] = useState(initialEmail ? initialEmail : '');\n const { setUserEmail } = useContext(MarieSchemaAnalytics);\n const { isValid, message, isValidating } = useEmailValidation({\n email: useDebounce(email, 125),\n baseUrl,\n hasInitialEmail\n });\n\n const { createAnalyticsEvent } = useAnalyticsEvents();\n\n const emailExistsOrSSOAnalytics = () => {\n createAnalyticsEvent({\n eventName: 'wac-signup-existing-user-signin',\n eventComponent: 'button',\n event: 'clicked'\n }).fire();\n };\n\n const { ssoRedirectUrl, isCheckingSSO } = useAuthenticationMethodsCheck({\n email: useDebounce(email, 125),\n allowAuthenticationsMethodCheck: isValid && !hasInitialEmail\n });\n\n const buildErrorMessage = (ssoRedirectUrl: string): JSX.Element => {\n if (ssoRedirectUrl === 'error') {\n return (\n \n );\n } else if (ssoRedirectUrl === 'exists') {\n return (\n \n );\n } else {\n return (\n \n );\n }\n };\n\n if (!isValid && message) {\n // TODO: tracking and analytics, bxp.formCloudSignup.emailValidationFailure\n }\n const handleSignInUserAccount = (event: any) => {\n if (!event.target || !event.target.href) {\n return;\n }\n\n event.preventDefault();\n if (signInAccountUrl) {\n const signInOriginAttributes = originAnalyticsAttributes.signInUser || {};\n segment('wac-signup-existing-user-signin', signInOriginAttributes);\n\n window.location.assign(signInAccountUrl);\n } else {\n segment('wac-signup-existing-user-signin-error', {});\n }\n };\n\n const handleSwitchUserAccount = (event: any) => {\n if (!event.target || !event.target.href) {\n return;\n }\n\n event.preventDefault();\n if (switchAccountUrl) {\n const switchUserOriginAttributes =\n originAnalyticsAttributes.switchUser || {};\n segment('wac-signup-existing-user-switch', switchUserOriginAttributes);\n\n window.location.assign(switchAccountUrl);\n } else {\n segment('wac-signup-existing-user-switch-error', {});\n }\n };\n\n useEffect(() => {\n if (ssoRedirectUrl || isCheckingSSO) {\n onSSOCheckValid(true);\n } else {\n onSSOCheckValid(false);\n }\n }, [ssoRedirectUrl, isCheckingSSO]);\n\n useEffect(() => {\n !isValidating && !!isValid ? onEmailChange(email) : onEmailChange('');\n\n if (!isValidating && !!isValid && !alreadySentValid) {\n // marie schema hash email for context\n setUserEmail(email);\n //\n setAlreadySentValid(true);\n send('VALID_EMAIL');\n }\n }, [email, isValid]);\n\n return (\n \n \n \n setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n onChange={(event: any) => {\n setEmail(event.currentTarget.value);\n }}\n elemAfterInput={\n \n {!isCheckingSSO &&\n !ssoRedirectUrl &&\n initialEmail === '' &&\n isValid ? (\n \n ) : (isValid === false && email !== '') || ssoRedirectUrl ? (\n showWarningIcon && (\n \n )\n ) : isValidating || isCheckingSSO ? (\n \n ) : null}\n \n }\n />\n {message && (\n \n \n \n )}\n\n {isValid && !isCheckingSSO && ssoRedirectUrl && (\n \n \n {buildErrorMessage(ssoRedirectUrl)}\n \n
\n )}\n \n {!!switchAccountUrl && hasInitialEmail && (\n \n {isDeferredSiteNameEnabled ? (\n \n ) : (\n \n )}\n \n )}\n \n );\n}\n\nexport default injectIntl(EmailField);\n","import { useEffect, useState } from 'react';\n\nexport type EmailValidation = {\n readonly isValidating: boolean;\n readonly isValid?: boolean;\n readonly message?: string;\n};\n\nexport type EmailValidationOptions = {\n readonly email: string;\n readonly baseUrl: string;\n readonly hasInitialEmail: boolean;\n};\n\nexport function useEmailValidation({\n email,\n hasInitialEmail\n}: EmailValidationOptions): EmailValidation {\n const [{ isValidating, isValid, message }, setValidation] =\n useState({\n isValidating: false\n });\n\n useEffect(() => {\n if (hasInitialEmail) {\n return setValidation({\n isValidating: false,\n isValid: true,\n message: undefined\n });\n }\n const emailPart = (email || '').split('@');\n\n const re =\n /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (email.length === 0) {\n return setValidation({\n isValidating: false,\n isValid: false,\n message: undefined\n });\n } else if (\n (emailPart[0] || '').length > 64 ||\n (emailPart[1] || '').length > 253 ||\n !re.test(email)\n ) {\n return setValidation({\n isValidating: false,\n isValid: false,\n message: 'Please enter a valid email address'\n });\n } else {\n setValidation({\n isValidating: false,\n isValid: true,\n message: undefined\n });\n }\n }, [email]);\n\n return {\n isValidating,\n isValid,\n message\n };\n}\n","import React from 'react';\nimport { SvgContainer } from '../components/styled';\n\nexport type TooltipIconProps = {\n readonly fillColor?: string;\n};\n\nexport function TooltipIcon({ fillColor }: TooltipIconProps) {\n return (\n \n \n \n );\n}\n","import CheckCircleOutlineIcon from '@atlaskit/icon/glyph/check-circle-outline';\nimport EditorPanelIcon from '@atlaskit/icon/glyph/editor/panel';\nimport WarningIcon from '@atlaskit/icon/glyph/warning';\nimport Spinner from '@atlaskit/spinner';\nimport Textfield from '@atlaskit/textfield';\nimport { B400, N0, N50, N800 } from '@atlaskit/theme/colors';\nimport { MarieSchemaAnalytics } from '@atlassiansox/bxpkit-core';\nimport styled from '@emotion/styled';\nimport { useActor } from '@xstate/react';\nimport { debounce } from 'lodash';\nimport React, { useContext, useEffect, useMemo, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Interpreter } from 'xstate';\nimport { useSiteNameValidation } from '../../../../../hook';\nimport {\n getTranslatableError,\n messages\n} from '../../../../../messages/sign-up-form';\nimport {\n AnalyticsTrackType,\n Sites\n} from '../../../../../model/wac-signup-form';\nimport { TooltipIcon } from '../Icons/tooltip-icon';\nimport {\n CompoundField,\n ErrorMessageWithDefaultClassName,\n FieldContainer,\n InfoIcon,\n InputDescription,\n Label,\n SiteNameAfter,\n SiteNameAfterLabel,\n SitePickerToggle,\n SuccessTextfieldWrapper,\n UnderLabelMessage\n} from './styled';\n\nexport type SiteNameProps = {\n readonly onSiteNameChange: (siteName: string, siteNameLength: number) => void;\n readonly onSiteNameUseExisting: () => void;\n readonly sites: Sites[] | null;\n readonly siteNameAfter: string;\n readonly wacEnvUrl: string;\n readonly analyticsTrack: AnalyticsTrackType;\n readonly shouldShowUseExisting: boolean;\n readonly setIsValidSiteName: (val: boolean) => void;\n readonly isDisabled: boolean;\n readonly serviceFieldProgress: Interpreter;\n readonly fadeOnDisable?: boolean;\n readonly outlineOnFocus?: boolean;\n readonly popOverError?: boolean;\n readonly showWarningIcon?: boolean;\n readonly isSuiteSignup?: boolean;\n readonly showInfoIcon?: boolean;\n readonly isDeferredSiteNameEnabled?: boolean;\n};\n\nexport function useDocumentClick(\n value: boolean,\n callback: React.Dispatch>,\n ignoreClass: string\n) {\n useEffect(() => {\n const handleClick = (event: any) => {\n let isIgnored = false;\n if (event && event.target && event.target.classList) {\n isIgnored = event.target.classList.contains(ignoreClass);\n }\n\n if (value && !isIgnored) {\n callback(!value);\n }\n };\n document.addEventListener('click', handleClick);\n return () => {\n document.removeEventListener('click', handleClick);\n };\n }, [value, callback, ignoreClass]);\n}\n\ninterface ToolTipProps {\n readonly isDisabled?: boolean;\n readonly fadeOnDisable?: boolean;\n}\n\nexport const DomainToolTip = styled.div`\n cursor: ${(props) =>\n props.isDisabled && props.fadeOnDisable ? 'not-allowed' : 'pointer'};\n margin: 0 3px;\n border-radius: 3px;\n svg {\n height: 14px;\n width: 14px;\n }\n`;\nexport const ToolTipText = styled.div`\n display: ${(props) =>\n props.isDisabled && props.fadeOnDisable ? 'none' : 'block'};\n background: ${N0};\n border: 1px solid ${B400};\n border-radius: 2px;\n box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);\n color: ${N800};\n font-family: inherit;\n font-size: 0.875rem;\n font-weight: 400;\n line-height: 1.42857143;\n padding: 12px;\n z-index: 1;\n position: absolute;\n left: 6px;\n top: 25px;\n max-width: 298px;\n`;\n\nexport const ToolTipContainer = styled.div`\n position: relative;\n z-index: 11;\n display: none;\n @supports (display: grid) {\n display: flex;\n align-items: center;\n }\n`;\n\nconst sendErrorEvent = debounce((segment, message, isValidating) => {\n if (isValidating && message) {\n sendErrorEvent(segment, message, isValidating);\n } else if (message) {\n segment('bxp.formCloudSignup.siteValidationError', { message });\n }\n}, 3000);\n\nexport function SiteNameField({\n onSiteNameChange,\n onSiteNameUseExisting,\n sites,\n siteNameAfter,\n shouldShowUseExisting,\n setIsValidSiteName,\n analyticsTrack,\n isDisabled,\n fadeOnDisable,\n outlineOnFocus,\n popOverError,\n serviceFieldProgress,\n showWarningIcon,\n isSuiteSignup,\n isDeferredSiteNameEnabled\n}: SiteNameProps) {\n const checkIsDisabled = () => {\n // ensure isDisabled can be set when form is submitting,\n // otherwise check the field progress state\n return isDisabled || state?.context?.siteName === false;\n };\n const { segment } = analyticsTrack;\n\n const labelMessage = useMemo(() => {\n if (isSuiteSignup) {\n return messages.siteNameSuite;\n } else if (isDeferredSiteNameEnabled) {\n return messages.siteNameOptional;\n } else {\n return messages.yourSite;\n }\n }, [isSuiteSignup, isDeferredSiteNameEnabled]);\n\n const [state] = useActor(serviceFieldProgress);\n const [siteName, setSiteName] = useState(\n sites !== null && sites[0] ? sites[0].displayName : ''\n );\n const [toolTipOpen, setToolTipOpen] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [fieldDisabled, setFieldDisabled] = useState(checkIsDisabled());\n const { isValid, message, isValidating } = useSiteNameValidation(\n siteName,\n analyticsTrack,\n isDeferredSiteNameEnabled\n );\n const toolTipTrigger = 'domain-name-tooltip-trigger';\n\n useDocumentClick(toolTipOpen, setToolTipOpen, toolTipTrigger);\n const { setSuiteName } = useContext(MarieSchemaAnalytics);\n\n useEffect(() => {\n isValid\n ? onSiteNameChange(siteName, siteName.length)\n : onSiteNameChange('', siteName.length);\n setIsValidSiteName(isValid);\n\n if (!isValid) {\n sendErrorEvent(segment, message, isValidating);\n } else {\n setSuiteName(siteName);\n sendErrorEvent.cancel();\n }\n\n setFieldDisabled(checkIsDisabled());\n }, [siteName, isValid, message, state, isDisabled]);\n\n return (\n \n \n \n \n {\n if (fieldDisabled) {\n return;\n }\n if (!toolTipOpen) {\n segment('bxp.formCloudSignup.toolTipDisplayed', {});\n }\n setToolTipOpen(!toolTipOpen);\n }}\n >\n {!isSuiteSignup && (\n \n )}\n \n {toolTipOpen ? (\n \n {isDeferredSiteNameEnabled ? (\n \n ) : (\n \n )}\n \n ) : null}\n \n \n {isDeferredSiteNameEnabled && (\n \n \n \n )}\n \n setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n style={{ height: 'inherit', width: '100%' }}\n onChange={(event: any) => {\n setSiteName(event.currentTarget.value);\n }}\n elemAfterInput={\n \n {siteNameAfter}\n {isValid && siteName !== '' && !isValidating ? (\n \n ) : isValid === false && siteName !== '' && !isValidating ? (\n showWarningIcon && (\n \n )\n ) : isValidating ? (\n \n ) : null}\n \n }\n />\n {message && (\n \n \n \n )}\n \n\n {isSuiteSignup && (\n \n \n \n )}\n\n {shouldShowUseExisting && (\n {\n if (!fieldDisabled) {\n onSiteNameUseExisting();\n }\n }}\n >\n \n \n )}\n \n );\n}\n","// from https://facebook.github.io/react/docs/higher-order-components.html\nvar getDisplayName = function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n};\n\nexport default getDisplayName;","// There are cases where the context is not available, such as when a dropdown item is used\n// inside @atlaskit/navigation. For this reason we have this helper function which safely calls\n// the context functions if they are available.\nexport default (function (instance, contextKey) {\n return function (fnToCall) {\n var _instance$context$con;\n\n if (!instance.context[contextKey]) {\n return null;\n }\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\n return (_instance$context$con = instance.context[contextKey])[fnToCall].apply(_instance$context$con, args);\n };\n});","var prefix = function prefix(key) {\n return \"@atlaskit-private-do-not-use/dropdown-menu:\".concat(key);\n};\n\nexport var focusManagerContext = prefix('focus-manager');\nexport var selectionCacheContext = prefix('selection-cache');\nexport var selectionManagerContext = prefix('selection-manager');\nexport var clickManagerContext = prefix('click-manager');","import { gridSize as akGridSize, borderRadius } from '@atlaskit/theme/constants';\nimport * as colors from '@atlaskit/theme/colors';\nexport var themeNamespace = '@atlaskit-shared-theme/item'; // Used for Group titles and Item descriptions\n\nexport var compactSmallFontSize = 10;\nexport var compactLineHeight = 1.2;\nexport var gridSize = akGridSize();\nexport var defaultTheme = {\n afterItemSpacing: {\n compact: akGridSize(),\n default: akGridSize()\n },\n beforeItemSpacing: {\n compact: akGridSize(),\n default: akGridSize()\n },\n borderRadius: borderRadius(),\n focus: {\n outline: colors.B100\n },\n height: {\n compact: 0,\n default: 0\n },\n width: {\n compact: 'auto',\n default: 'auto'\n },\n padding: {\n default: {\n bottom: akGridSize() / 2,\n left: akGridSize() / 2,\n right: akGridSize() / 2,\n top: akGridSize() / 2\n },\n compact: {\n bottom: akGridSize(),\n left: akGridSize(),\n right: akGridSize(),\n top: akGridSize()\n }\n },\n default: {\n background: colors.background,\n text: colors.text,\n secondaryText: colors.N200\n },\n selected: {\n background: colors.backgroundActive,\n text: colors.N500,\n secondaryText: colors.N200\n },\n active: {\n background: colors.backgroundActive,\n text: colors.textActive,\n secondaryText: colors.N200\n },\n hover: {\n background: colors.backgroundHover,\n text: colors.textHover,\n secondaryText: colors.N200\n },\n disabled: {\n background: colors.N0,\n text: colors.N200,\n secondaryText: colors.N200\n },\n // same as hover in this case\n dragging: {\n background: colors.N20,\n text: colors.N800,\n secondaryText: colors.N200\n }\n};\n\nvar isValidCssValue = function isValidCssValue(value) {\n return value !== undefined && value !== null && value !== '';\n}; // Returns the theme that contains the requested theme key(s), preferring the user-supplied\n// theme if it is provided.\n\n\nexport var themeWithKeys = function themeWithKeys(maybeTheme, key, parentKey) {\n if (parentKey) {\n return maybeTheme && maybeTheme[parentKey] && isValidCssValue(maybeTheme[parentKey][key]) ? maybeTheme : defaultTheme;\n }\n\n return maybeTheme && isValidCssValue(maybeTheme[key]) ? maybeTheme : defaultTheme;\n}; // Returns the theme value for the requested key(s), falling back to the default theme if the\n// user-supplied theme doesn't exist or doesn't contain the requested key(s)\n\nexport var getThemeStyle = function getThemeStyle(maybeTheme, key, parentKey) {\n var theme = themeWithKeys(maybeTheme, key, parentKey);\n return parentKey ? theme[parentKey][key] : theme[key];\n};","import { css } from 'styled-components';\nimport { B100, N30A, skeleton as skeletonColor } from './colors';\nexport const FLATTENED = '__FLATTENED__';\nexport const CHANNEL = '__ATLASKIT_THEME__';\nexport const DEFAULT_THEME_MODE = 'light';\nexport const THEME_MODES = ['light', 'dark'];\n/*\n These theme values are expressed as functions so that if we decide to make\n them dependent on props in the future, it wouldn't require a significant\n refactor everywhere they are being used.\n*/\nexport const borderRadius = () => 3;\nexport const gridSize = () => 8;\nexport const fontSize = () => 14;\nexport const fontSizeSmall = () => 11;\nexport const fontFamily = () => `-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif`;\nexport const codeFontFamily = () => `'SFMono-Medium', 'SF Mono', 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', Menlo, Consolas, Courier, monospace`;\nexport const focusRing = (color = B100, outlineWidth = gridSize() / 4) => `\n &:focus {\n outline: none;\n box-shadow: 0px 0px 0px ${outlineWidth}px ${color};\n }\n`;\nexport const noFocusRing = () => `\n box-shadow: none;\n`;\nexport const layers = {\n card: () => 100,\n dialog: () => 300,\n navigation: () => 200,\n layer: () => 400,\n blanket: () => 500,\n modal: () => 510,\n flag: () => 600,\n spotlight: () => 700,\n tooltip: () => 800,\n};\nexport const visuallyHidden = () => ({\n border: '0 !important',\n clip: 'rect(1px, 1px, 1px, 1px) !important',\n height: '1px !important',\n overflow: 'hidden !important',\n padding: '0 !important',\n position: 'absolute !important',\n width: '1px !important',\n whiteSpace: 'nowrap !important',\n});\n/**\n * Deprecated Styled Components mixin.\n * Use visuallyHidden instead.\n * @deprecated\n */\nexport const assistive = () => css `\n border: 0 !important;\n clip: rect(1px, 1px, 1px, 1px) !important;\n height: 1px !important;\n overflow: hidden !important;\n padding: 0 !important;\n position: absolute !important;\n width: 1px !important;\n white-space: nowrap !important;\n`;\nexport const skeletonShimmer = () => ({\n css: {\n backgroundColor: skeletonColor(),\n animationDuration: '1.5s',\n animationIterationCount: 'infinite',\n animationTimingFunction: 'linear',\n animationDirection: 'alternate',\n },\n keyframes: {\n from: {\n backgroundColor: skeletonColor(),\n },\n to: {\n backgroundColor: N30A,\n },\n },\n});\n//# sourceMappingURL=constants.js.map","import styled, { css } from 'styled-components';\nimport { N60A } from '@atlaskit/theme/colors';\nimport { getThemeStyle, themeNamespace } from '../util/theme';\n\nvar getItemState = function getItemState(stateName) {\n return function (_ref) {\n var theme = _ref.theme;\n var stateStyles = getThemeStyle(theme[themeNamespace], stateName);\n return css([\"\\n background-color: \", \";\\n color: \", \";\\n fill: \", \";\\n text-decoration: none;\\n\\n &:focus {\\n color: \", \";\\n }\\n \"], stateStyles.background, stateStyles.text, stateStyles.background, stateStyles.text);\n };\n};\n\nvar getPadding = function getPadding(_ref2) {\n var isCompact = _ref2.isCompact,\n theme = _ref2.theme,\n description = _ref2.description;\n var paddingKey = isCompact ? 'compact' : 'default';\n\n var _getThemeStyle = getThemeStyle(theme[themeNamespace], paddingKey, 'padding'),\n _getThemeStyle$bottom = _getThemeStyle.bottom,\n bottom = _getThemeStyle$bottom === void 0 ? 0 : _getThemeStyle$bottom,\n _getThemeStyle$left = _getThemeStyle.left,\n left = _getThemeStyle$left === void 0 ? 0 : _getThemeStyle$left,\n _getThemeStyle$right = _getThemeStyle.right,\n right = _getThemeStyle$right === void 0 ? 0 : _getThemeStyle$right,\n _getThemeStyle$top = _getThemeStyle.top,\n top = _getThemeStyle$top === void 0 ? 0 : _getThemeStyle$top;\n\n var adjustedTop = typeof top === 'function' ? top() : top;\n var adjustedBottom = typeof bottom === 'function' ? bottom() : bottom; // Subtract the 1px padding-bottom added to the content and description elements\n // to maintain original height\n\n adjustedTop = Math.max(description ? adjustedTop - 1 : adjustedTop, 0);\n adjustedBottom = Math.max(adjustedBottom - 1, 0);\n return css([\"\\n padding: \", \"px \", \"px \", \"px \", \"px;\\n \"], adjustedTop, right, adjustedBottom, left);\n};\n\nvar getHeightStyles = function getHeightStyles(_ref3) {\n var isCompact = _ref3.isCompact,\n theme = _ref3.theme;\n var heightKey = isCompact ? 'compact' : 'default';\n var height = getThemeStyle(theme[themeNamespace], heightKey, 'height');\n return height ? css([\"\\n height: \", \"px;\\n \"], height) : '';\n};\n\nvar getWidthStyles = function getWidthStyles(_ref4) {\n var isCompact = _ref4.isCompact,\n theme = _ref4.theme;\n var widthKey = isCompact ? 'compact' : 'default';\n var width = getThemeStyle(theme[themeNamespace], widthKey, 'width');\n\n if (!width) {\n return '';\n }\n\n return typeof width === 'number' ? css([\"\\n width: \", \"px;\\n \"], width) : css([\"\\n width: \", \";\\n \"], width);\n}; // This function is responsible for drawing any focus styles for the element\n\n\nvar getInteractiveStyles = function getInteractiveStyles(_ref5) {\n var theme = _ref5.theme,\n isDisabled = _ref5.isDisabled,\n isDragging = _ref5.isDragging,\n isSelected = _ref5.isSelected;\n\n if (isDragging) {\n return css([\"\\n \", \" box-shadow: 0 4px 8px -2px \", \",\\n 0 0 1px \", \";\\n \"], getItemState('dragging'), N60A, N60A);\n }\n\n var standardFocus = css([\"\\n &:focus {\\n box-shadow: 0 0 0 2px\\n \", \" inset;\\n text-decoration: none;\\n }\\n \"], getThemeStyle(theme[themeNamespace], 'outline', 'focus'));\n\n if (isDisabled) {\n return css([\"\\n cursor: not-allowed;\\n \", \" \", \";\\n \"], getItemState('disabled'), standardFocus);\n }\n\n if (isSelected) {\n return css([\"\\n \", \" &:hover {\\n \", \";\\n }\\n\\n &:active {\\n \", \";\\n }\\n\\n \", \";\\n \"], getItemState('selected'), getItemState('hover'), getItemState('active'), standardFocus);\n }\n\n return css([\"\\n &:hover {\\n \", \";\\n }\\n\\n &:active {\\n \", \";\\n }\\n\\n \", \";\\n \"], getItemState('hover'), getItemState('active'), standardFocus);\n}; // This is the main item style. It is defined as a basic style variable so it can\n// later be applied to different component types (span / a / custom link component)\n\n\nexport var ItemBase = function ItemBase(_ref6) {\n var theme = _ref6.theme;\n return css([\"\\n && {\\n align-items: center;\\n border-radius: \", \"px;\\n box-sizing: border-box;\\n cursor: pointer;\\n display: \", \";\\n flex: none;\\n \", \" \", \" \", \" \", \" \", \" &:focus {\\n /* focus shadow drawn by getInteractiveStyles */\\n\\n outline: none;\\n /* relative position prevents bgcolor of a hovered element from\\n obfuscating focus ring of a focused sibling element */\\n position: relative;\\n }\\n }\\n\"], getThemeStyle(theme[themeNamespace], 'borderRadius'), function (_ref7) {\n var isHidden = _ref7.isHidden;\n return isHidden ? 'none' : 'flex';\n }, getItemState('default'), getPadding, getInteractiveStyles, getHeightStyles, getWidthStyles);\n}; // Given some optional link-related props, returns the relevant styled\n// component. For links, it styles the linkComponent if provided, otherwise\n// falling back to a styled tag. If no href is present, a styled \n// is returned. When we upgrade to styled-components@2.x we will be able to\n// simplify this by taking advantage of the withComponent() functionality.\n\nvar styledRootElement = function styledRootElement(_ref8) {\n var href = _ref8.href,\n linkComponent = _ref8.linkComponent;\n\n if (linkComponent) {\n return styled(linkComponent).withConfig({\n displayName: \"Item\",\n componentId: \"z6qfkt-0\"\n })([\"\\n \", \";\\n \"], ItemBase);\n }\n\n if (href) {\n return styled.a.withConfig({\n displayName: \"Item\",\n componentId: \"z6qfkt-1\"\n })([\"\\n \", \";\\n \"], ItemBase);\n }\n\n return styled.span.withConfig({\n displayName: \"Item\",\n componentId: \"z6qfkt-2\"\n })([\"\\n \", \";\\n \"], ItemBase);\n};\n\nexport default styledRootElement;","import styled, { css } from 'styled-components';\nimport { fontSize, fontSizeSmall } from '@atlaskit/theme/constants';\nimport { getThemeStyle, themeNamespace, compactSmallFontSize, compactLineHeight } from '../util/theme'; // Checkbox/Radio wrapper -- sits left of the children\n\nexport var InputWrapper = styled.span.withConfig({\n displayName: \"ItemParts__InputWrapper\",\n componentId: \"sc-14xek3m-0\"\n})([\"\\n display: flex;\\n margin: 0 2px;\\n\"]); // Elements injected before/after the children\n\nvar BeforeAfterBase = styled.span.withConfig({\n displayName: \"ItemParts__BeforeAfterBase\",\n componentId: \"sc-14xek3m-1\"\n})([\"\\n align-items: center;\\n display: flex;\\n flex-shrink: 0;\\n /* Fix windows line-height issue */\\n padding-bottom: 1px;\\n\"]);\n\nvar getBeforeSpacing = function getBeforeSpacing(_ref) {\n var isCompact = _ref.isCompact,\n theme = _ref.theme;\n var spaceKey = isCompact ? 'compact' : 'default';\n var space = getThemeStyle(theme[themeNamespace], spaceKey, 'beforeItemSpacing');\n return css([\"\\n margin-right: \", \"px;\\n \"], space);\n};\n\nexport var Before = styled(BeforeAfterBase).withConfig({\n displayName: \"ItemParts__Before\",\n componentId: \"sc-14xek3m-2\"\n})([\"\\n \", \";\\n\"], getBeforeSpacing);\n\nvar getAfterSpacing = function getAfterSpacing(_ref2) {\n var isCompact = _ref2.isCompact,\n theme = _ref2.theme;\n var spaceKey = isCompact ? 'compact' : 'default';\n var space = getThemeStyle(theme[themeNamespace], spaceKey, 'afterItemSpacing');\n return css([\"\\n margin-left: \", \"px;\\n \"], space);\n};\n\nexport var After = styled(BeforeAfterBase).withConfig({\n displayName: \"ItemParts__After\",\n componentId: \"sc-14xek3m-3\"\n})([\"\\n \", \";\\n\"], getAfterSpacing); // Alignment and layout for the children\n\nexport var ContentWrapper = styled.span.withConfig({\n displayName: \"ItemParts__ContentWrapper\",\n componentId: \"sc-14xek3m-4\"\n})([\"\\n display: flex;\\n flex-direction: column;\\n flex-grow: 1;\\n margin: 0;\\n overflow: hidden;\\n\\n &:first-child {\\n margin: 0;\\n }\\n\"]);\nexport var Content = styled.span.withConfig({\n displayName: \"ItemParts__Content\",\n componentId: \"sc-14xek3m-5\"\n})([\"\\n display: block;\\n flex: 1 1 auto;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: \", \";\\n line-height: \", \";\\n /* Fix windows line-height issue */\\n padding-bottom: 1px;\\n\"], function (_ref3) {\n var allowMultiline = _ref3.allowMultiline;\n return allowMultiline ? 'normal' : 'nowrap';\n}, 16 / fontSize());\n\nvar getColorStyle = function getColorStyle(_ref4) {\n var isDisabled = _ref4.isDisabled,\n theme = _ref4.theme;\n\n if (isDisabled) {\n return css([\"\\n color: \", \";\\n \"], getThemeStyle(theme[themeNamespace], 'secondaryText', 'disabled'));\n }\n\n return css([\"\\n color: \", \";\\n\\n /* This detects hover on the grandparent. Saves us having to maintain isHovered\\n state in the grandparent. */\\n *:hover > * > & {\\n color: \", \";\\n }\\n\\n *:active > * > & {\\n color: \", \";\\n }\\n \"], getThemeStyle(theme[themeNamespace], 'secondaryText', 'default'), function () {\n return getThemeStyle(theme[themeNamespace], 'secondaryText', 'hover');\n }, function () {\n return getThemeStyle(theme[themeNamespace], 'secondaryText', 'active');\n });\n};\n\nvar getDescriptionFontStyles = function getDescriptionFontStyles(_ref5) {\n var isCompact = _ref5.isCompact;\n var descriptionFontSize = isCompact ? compactSmallFontSize : fontSizeSmall();\n var lineHeight = isCompact ? compactLineHeight : 14 / descriptionFontSize;\n return css([\"\\n font-size: \", \"px;\\n line-height: \", \";\\n /* Fix windows line-height issue */\\n padding-bottom: 1px;\\n \"], descriptionFontSize, lineHeight);\n}; // Description is a block element below the children, like a subtitle\n\n\nexport var Description = styled.span.withConfig({\n displayName: \"ItemParts__Description\",\n componentId: \"sc-14xek3m-6\"\n})([\"\\n flex: 1 1 auto;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n white-space: nowrap;\\n \", \" \", \";\\n\"], getColorStyle, getDescriptionFontStyles);","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\n/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport styledRootElement from '../styled/Item';\nimport { Before, After, Content, ContentWrapper, Description } from '../styled/ItemParts';\n\nvar Item =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Item, _Component);\n\n function Item(props) {\n var _this;\n\n _classCallCheck(this, Item);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Item).call(this, props)); // The type of element rendered at the root of render() can vary based on the `href`\n // and `linkComponent` props provided. We generate this component here to avoid re-\n // generating the component inside render(). This is for performance reasons, and also\n // allows us to avoid generating a new `ref` for the root element each render().\n\n _defineProperty(_assertThisInitialized(_this), \"setRef\", function (ref) {\n _this.ref = ref;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"href\", function () {\n return _this.props.isDisabled ? null : _this.props.href;\n });\n\n _this.rootComponent = styledRootElement({\n href: _this.href(),\n linkComponent: props.linkComponent\n });\n return _this;\n }\n\n _createClass(Item, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.ref && this.props.autoFocus) {\n this.ref.focus();\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props = this.props,\n _onClick = _this$props.onClick,\n _onKeyDown = _this$props.onKeyDown,\n isCompact = _this$props.isCompact,\n isDisabled = _this$props.isDisabled,\n isDragging = _this$props.isDragging,\n isHidden = _this$props.isHidden,\n isSelected = _this$props.isSelected,\n onMouseEnter = _this$props.onMouseEnter,\n onMouseLeave = _this$props.onMouseLeave,\n role = _this$props.role,\n dnd = _this$props.dnd,\n otherProps = _objectWithoutProperties(_this$props, [\"onClick\", \"onKeyDown\", \"isCompact\", \"isDisabled\", \"isDragging\", \"isHidden\", \"isSelected\", \"onMouseEnter\", \"onMouseLeave\", \"role\", \"dnd\"]);\n\n var Root = this.rootComponent;\n var dragHandleProps = dnd && dnd.dragHandleProps || null;\n var patchedEventHandlers = {\n onClick: function onClick(event) {\n // rbd will use event.preventDefault() to block clicks that are used\n // as a part of the drag and drop lifecycle.\n if (event.defaultPrevented) {\n return;\n }\n\n if (!isDisabled && _onClick) {\n _onClick(event);\n }\n },\n onMouseDown: function onMouseDown(event) {\n // rbd 11.x support\n if (dragHandleProps && dragHandleProps.onMouseDown) {\n dragHandleProps.onMouseDown(event);\n } // We want to prevent the item from getting focus when clicked\n\n\n event.preventDefault();\n },\n onKeyDown: function onKeyDown(event) {\n // swallowing keyboard events on the element while dragging\n // rbd should already be doing this - but we are being really clear here\n if (isDragging) {\n return;\n } // rbd 11.x support\n\n\n if (dragHandleProps && dragHandleProps.onKeyDown) {\n dragHandleProps.onKeyDown(event);\n } // if default is prevented - do not fire other handlers\n // this can happen if the event is used for drag and drop by rbd\n\n\n if (event.defaultPrevented) {\n return;\n } // swallowing event if disabled\n\n\n if (isDisabled) {\n return;\n }\n\n if (!_onKeyDown) {\n return;\n }\n\n _onKeyDown(event);\n }\n };\n\n var patchedInnerRef = function patchedInnerRef(ref) {\n _this2.setRef(ref); // give rbd the inner ref too\n\n\n if (dnd && dnd.innerRef) {\n dnd.innerRef(ref);\n }\n };\n\n return React.createElement(Root, _extends({\n \"aria-disabled\": isDisabled,\n href: this.href(),\n isCompact: isCompact,\n isDisabled: isDisabled,\n isDragging: isDragging,\n isHidden: isHidden,\n isSelected: isSelected,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave,\n role: role,\n tabIndex: isDisabled || isHidden || this.props.href ? null : 0,\n target: this.props.target,\n title: this.props.title,\n innerRef: patchedInnerRef\n }, dnd && dnd.draggableProps, dragHandleProps, patchedEventHandlers, otherProps), !!this.props.elemBefore && React.createElement(Before, {\n isCompact: isCompact\n }, this.props.elemBefore), React.createElement(ContentWrapper, null, React.createElement(Content, {\n allowMultiline: this.props.shouldAllowMultiline\n }, this.props.children), !!this.props.description && React.createElement(Description, {\n isCompact: this.props.isCompact,\n isDisabled: this.props.isDisabled\n }, this.props.description)), !!this.props.elemAfter && React.createElement(After, {\n isCompact: isCompact\n }, this.props.elemAfter));\n }\n }]);\n\n return Item;\n}(Component);\n\n_defineProperty(Item, \"defaultProps\", {\n autoFocus: false,\n description: '',\n isCompact: false,\n isDisabled: false,\n isHidden: false,\n role: 'button',\n shouldAllowMultiline: false\n});\n\nexport { Item as default };","import Item, { withItemFocus, withItemClick } from '@atlaskit/item';\nexport default withItemClick(withItemFocus(Item));","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\n/* eslint-disable react/prop-types */\n// We currently need to keep the dropdown open if an item with `href` is clicked, to avoid the\n// analytics package to track the href value without the event target disappearing. Without this\n// requirement, we could just use a native click event all the way up to DropdownMenuStateless,\n// and could get rid of this HOC and DropdownItemClickManager.\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport getDisplayName from '../../util/getDisplayName';\nimport safeContextCall from '../../util/safeContextCall';\nimport { clickManagerContext } from '../../util/contextNamespace'; // HOC that typically wraps @atlaskit/item\n\nvar withItemClick = function withItemClick(WrappedItem) {\n var _class, _temp;\n\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inherits(WithItemClick, _Component);\n\n function WithItemClick() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, WithItemClick);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(WithItemClick)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"callContextFn\", safeContextCall(_assertThisInitialized(_this), clickManagerContext));\n\n _defineProperty(_assertThisInitialized(_this), \"shouldCloseAfterClick\", function () {\n return !_this.props.isDisabled && !_this.props.href;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (event) {\n _this.props.onClick(event);\n\n if (_this.shouldCloseAfterClick()) {\n _this.callContextFn('itemClicked');\n }\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleKeyDown\", function (event) {\n if (_this.props.onKeyDown) {\n _this.props.onKeyDown(event);\n } else if (event.key === 'Space' || event.key === 'Enter') {\n _this.handleClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(WithItemClick, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n otherProps = _objectWithoutProperties(_this$props, [\"children\"]);\n\n return React.createElement(WrappedItem, _extends({}, otherProps, {\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown\n }), children);\n }\n }]);\n\n return WithItemClick;\n }(Component), _defineProperty(_class, \"displayName\", \"WithItemClick(\".concat(getDisplayName(WrappedItem), \")\")), _defineProperty(_class, \"defaultProps\", {\n onClick: function onClick() {}\n }), _defineProperty(_class, \"contextTypes\", _defineProperty({}, clickManagerContext, PropTypes.object)), _temp;\n};\n\nexport default withItemClick;","import _extends from \"@babel/runtime/helpers/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/assertThisInitialized\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\n/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ReactDOM from 'react-dom';\nimport uuid from 'uuid';\nimport getDisplayName from '../../util/getDisplayName';\nimport safeContextCall from '../../util/safeContextCall';\nimport { focusManagerContext } from '../../util/contextNamespace'; // HOC that typically wraps @atlaskit/item\n\nvar withItemFocus = function withItemFocus(WrappedComponent) {\n var _class, _temp;\n\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inherits(WithItemFocus, _Component);\n\n function WithItemFocus() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, WithItemFocus);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(WithItemFocus)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_this), \"contextId\", void 0);\n\n _defineProperty(_assertThisInitialized(_this), \"callContextFn\", safeContextCall(_assertThisInitialized(_this), focusManagerContext));\n\n _defineProperty(_assertThisInitialized(_this), \"isFocusable\", function () {\n return !_this.props.isDisabled && !_this.props.isHidden;\n });\n\n _defineProperty(_assertThisInitialized(_this), \"handleFocus\", function () {\n if (_this.isFocusable()) {\n _this.callContextFn('itemFocused', _this.contextId);\n }\n });\n\n return _this;\n }\n\n _createClass(WithItemFocus, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (!this.isFocusable()) {\n return;\n }\n\n this.contextId = uuid();\n this.callContextFn('registerItem', this.contextId, ReactDOM.findDOMNode(this) // eslint-disable-line react/no-find-dom-node\n );\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate() {\n if (!this.isFocusable()) {\n return;\n }\n\n this.callContextFn('updateItem', this.contextId, ReactDOM.findDOMNode(this) // eslint-disable-line react/no-find-dom-node\n );\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n if (this.isFocusable()) {\n this.callContextFn('deregisterItem', this.contextId);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n otherProps = _objectWithoutProperties(_this$props, [\"children\"]);\n\n return React.createElement(WrappedComponent, _extends({\n onFocus: this.handleFocus,\n role: \"menuitem\"\n }, otherProps), children);\n }\n }]);\n\n return WithItemFocus;\n }(Component), _defineProperty(_class, \"displayName\", \"WithItemFocus(\".concat(getDisplayName(WrappedComponent), \")\")), _defineProperty(_class, \"contextTypes\", _defineProperty({}, focusManagerContext, PropTypes.object)), _temp;\n};\n\nexport default withItemFocus;","import styled, { css } from 'styled-components';\nimport { fontSizeSmall } from '@atlaskit/theme/constants';\nimport { getThemeStyle, gridSize, themeNamespace } from '../util/theme';\n\nvar getPadding = function getPadding(_ref) {\n var isCompact = _ref.isCompact,\n theme = _ref.theme;\n var paddingType = isCompact ? 'compact' : 'default';\n\n var _getThemeStyle = getThemeStyle(theme[themeNamespace], paddingType, 'padding'),\n _getThemeStyle$bottom = _getThemeStyle.bottom,\n bottom = _getThemeStyle$bottom === void 0 ? 0 : _getThemeStyle$bottom,\n _getThemeStyle$left = _getThemeStyle.left,\n left = _getThemeStyle$left === void 0 ? 0 : _getThemeStyle$left,\n _getThemeStyle$right = _getThemeStyle.right,\n right = _getThemeStyle$right === void 0 ? 0 : _getThemeStyle$right,\n _getThemeStyle$top = _getThemeStyle.top,\n top = _getThemeStyle$top === void 0 ? 0 : _getThemeStyle$top;\n\n return css([\"\\n padding: \", \"px \", \"px \", \"px \", \"px;\\n \"], top, right, bottom, left);\n}; // eslint-disable-next-line import/prefer-default-export\n\n\nvar GroupTitle = styled.div.withConfig({\n displayName: \"ItemGroup__GroupTitle\",\n componentId: \"ofbfv9-0\"\n})([\"\\n align-items: center;\\n color: \", \";\\n display: flex;\\n flex: 1 1 auto;\\n \", \";\\n\"], function (_ref2) {\n var theme = _ref2.theme;\n return getThemeStyle(theme[themeNamespace], 'secondaryText', 'default');\n}, getPadding);\nGroupTitle.displayName = 'ItemGroupTitle';\nvar GroupTitleAfter = styled.div.withConfig({\n displayName: \"ItemGroup__GroupTitleAfter\",\n componentId: \"ofbfv9-1\"\n})([\"\\n flex: 0 0 auto;\\n margin-right: -\", \"px;\\n\"], gridSize / 2);\nGroupTitleAfter.displayName = 'ItemGroupTitleAfter';\nvar GroupTitleText = styled.div.withConfig({\n displayName: \"ItemGroup__GroupTitleText\",\n componentId: \"ofbfv9-2\"\n})([\"\\n flex: 1 1 auto;\\n font-size: \", \"px;\\n line-height: 1;\\n text-transform: uppercase;\\n /* Required for children to truncate */\\n min-width: 0;\\n\"], fontSizeSmall);\nGroupTitleText.displayName = 'ItemGroupTitleText';\nexport { GroupTitle, GroupTitleAfter, GroupTitleText };","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\n\n/* eslint-disable react/prop-types */\nimport React, { Component } from 'react';\nimport textContent from 'react-addons-text-content';\nimport { GroupTitle, GroupTitleText, GroupTitleAfter } from '../styled/ItemGroup';\n\nvar ItemGroup =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ItemGroup, _Component);\n\n function ItemGroup() {\n _classCallCheck(this, ItemGroup);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ItemGroup).apply(this, arguments));\n }\n\n _createClass(ItemGroup, [{\n key: \"render\",\n value: function render() {\n var _this = this;\n\n var _this$props = this.props,\n children = _this$props.children,\n elemAfter = _this$props.elemAfter,\n isCompact = _this$props.isCompact,\n title = _this$props.title,\n label = _this$props.label,\n innerRef = _this$props.innerRef,\n role = _this$props.role;\n\n var ariaLabel = function () {\n if (label) {\n return textContent(label);\n }\n\n if (title) {\n return textContent(title);\n }\n\n return '';\n }();\n\n return React.createElement(\"div\", {\n \"aria-label\": ariaLabel,\n role: role,\n ref: innerRef\n }, title ? React.createElement(GroupTitle, {\n \"aria-hidden\": \"true\",\n isCompact: isCompact\n }, React.createElement(GroupTitleText, null, title), elemAfter ? React.createElement(GroupTitleAfter, {\n innerRef: function innerRef(r) {\n _this.headingAfterElement = r;\n }\n }, elemAfter) : null) : null, children);\n }\n }]);\n\n return ItemGroup;\n}(Component);\n\n_defineProperty(ItemGroup, \"defaultProps\", {\n role: 'group'\n});\n\nexport { ItemGroup as default };","import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport React, { Component } from 'react';\nimport { ItemGroup } from '@atlaskit/item';\n\nvar DropdownItemGroup =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(DropdownItemGroup, _Component);\n\n function DropdownItemGroup() {\n _classCallCheck(this, DropdownItemGroup);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DropdownItemGroup).apply(this, arguments));\n }\n\n _createClass(DropdownItemGroup, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n elemAfter = _this$props.elemAfter,\n title = _this$props.title;\n return React.createElement(ItemGroup, {\n elemAfter: elemAfter,\n title: title,\n role: \"menu\"\n }, children);\n }\n }]);\n\n return DropdownItemGroup;\n}(Component);\n\nexport { DropdownItemGroup as default };","import DropdownMenu, {\n DropdownItem,\n DropdownItemGroup\n} from '@atlaskit/dropdown-menu';\nimport CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';\nimport Textfield from '@atlaskit/textfield';\nimport { G300 } from '@atlaskit/theme/colors';\nimport _ from 'lodash';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport {\n AnalyticsTrackType,\n Product,\n ProductKeys,\n Sites\n} from '../../../../../model/wac-signup-form';\nimport { InfoBox } from './';\n\nimport { isProductIncluded, useSitePermission } from '../../../../../hook';\nimport {\n DomainToolTip,\n ToolTipText,\n ToolTipContainer,\n useDocumentClick\n} from './site-name-field';\nimport { B400, N50 } from '@atlaskit/theme/colors';\nimport { TooltipIcon } from '../Icons/tooltip-icon';\n\nimport {\n CompoundField,\n DropdownButtonStyle,\n DropdownButtonStyleOpen,\n DropdownTrigger,\n ErrorMessageWithDefaultClassName,\n FieldContainer,\n FieldErrorState,\n JswTrialNotice,\n Label,\n SiteNameAfter,\n SiteNameAfterLabel,\n SitePickerTextfieldWrapper,\n SitePickerToggle,\n StyledInfoBoxWrapper,\n UnderLabelMessage\n} from './styled';\n\nexport type SitePickerProps = {\n onSiteNameChange: (selectedSite: Sites, cloudName: string) => void;\n onSiteNameStartNew: () => void;\n sites: Sites[];\n isBundleActive: boolean;\n siteNameAfter: string;\n wacEnvUrl: string;\n analyticsTrack: AnalyticsTrackType;\n isFree: boolean;\n setIsValidSiteName: (val: boolean) => void;\n isDisabled: boolean;\n showFreeLimitExceededError: boolean;\n selectedSiteId: string;\n productKeys: Product[];\n isDeferredSiteNameEnabled?: boolean;\n fadeOnDisable?: boolean;\n};\n\nexport type FormattedSite = {\n readonly name: string;\n readonly value: string;\n readonly products?: string[];\n};\n\nexport type FormattedProduct = {\n readonly title: FormattedMessage.MessageDescriptor;\n readonly sites: FormattedSite[];\n};\n\ntype OnOpenChangeProps = {\n readonly isOpen: boolean;\n readonly event?: { [key: string]: any };\n};\n\nconst getSiteById = (cloudId: string, sites: Sites[]) => {\n const matchedSites = sites.filter((site) => site.cloudId === cloudId);\n return matchedSites.length > 0 ? matchedSites[0] : sites[0];\n};\n\nexport const isSelectedSiteValid = (\n sitesByCategory: {\n [key: string]: FormattedProduct;\n },\n siteId: string\n) => {\n return (\n sitesByCategory?.withJiraSoftware?.sites?.find(\n (site) => site.value === siteId\n ) ||\n sitesByCategory?.withoutJiraSoftware?.sites?.find(\n (site) => site.value === siteId\n )\n );\n};\n\nfunction productKeyToSplitSitesBy(productKeys: Product[]) {\n if (\n isProductIncluded(productKeys, ProductKeys.JIRA_SERVICE_DESK) ||\n isProductIncluded(productKeys, ProductKeys.JIRA_SERVICE_MANAGEMENT)\n ) {\n return {\n siteKey: ProductKeys.CONFLUENCE,\n recommendedSitesTitle: messages.dropdownWithRecommended,\n otherSitesTitle: messages.dropdownWithoutRecommended\n };\n } else {\n return {\n siteKey: ProductKeys.JIRA_SOFTWARE,\n recommendedSitesTitle: messages.dropdownWithJiraSoftware,\n otherSitesTitle: messages.dropdownWithoutJiraSoftware\n };\n }\n}\nexport function orderSpecificProductFirstSort(\n a: FormattedSite,\n b: FormattedSite\n) {\n if (\n a?.products?.includes(ProductKeys.CONFLUENCE) &&\n !b?.products?.includes(ProductKeys.CONFLUENCE)\n ) {\n return -1;\n }\n if (\n !a?.products?.includes(ProductKeys.CONFLUENCE) &&\n b?.products?.includes(ProductKeys.CONFLUENCE)\n ) {\n return 1;\n }\n if (\n a?.products?.includes(ProductKeys.CONFLUENCE) &&\n b?.products?.includes(ProductKeys.CONFLUENCE)\n ) {\n return 0;\n }\n return 0;\n}\n\nexport function SitePickerField({\n isBundleActive,\n sites,\n siteNameAfter,\n onSiteNameStartNew,\n onSiteNameChange,\n setIsValidSiteName,\n wacEnvUrl,\n isFree,\n isDisabled,\n showFreeLimitExceededError = false,\n selectedSiteId,\n productKeys,\n isDeferredSiteNameEnabled,\n fadeOnDisable,\n analyticsTrack\n}: SitePickerProps) {\n // const isSiteAdmin = false; // TODO change to use hook\n const baseUrl = `${wacEnvUrl}`;\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [activeSite, setActiveSite] = useState(sites[0]);\n const [triggerText, setTriggerText] = useState({ ...messages.selectSite });\n const [hideJswTrialNotice, setHideJswTrialNotice] = useState(true);\n const [showConfluenceNotice, setShowConfluenceNotice] = useState(false);\n const [isLoaded, setIsLoaded] = useState(false);\n const [toolTipOpen, setToolTipOpen] = useState(false);\n const { isPermitted, isValidating } = useSitePermission(\n baseUrl,\n activeSite.cloudId,\n isBundleActive\n );\n\n const showSiteSwitcher = sites.length > 1;\n const isJsm =\n isProductIncluded(productKeys, ProductKeys.JIRA_SERVICE_DESK) ||\n isProductIncluded(productKeys, ProductKeys.JIRA_SERVICE_MANAGEMENT);\n const hasSitesWithConfluence = sites.some((site) => {\n return site?.products.some((p) => p === ProductKeys.CONFLUENCE);\n });\n\n const toolTipTrigger = 'domain-name-tooltip-trigger';\n useDocumentClick(toolTipOpen, setToolTipOpen, toolTipTrigger);\n\n const { segment } = analyticsTrack;\n\n const useRecomendedSitesInDropdown = isBundleActive || isJsm;\n\n const categorizedSitesData = useMemo(() => {\n const siteKeyDataToSplitBy = productKeyToSplitSitesBy(productKeys);\n const sitesByCategory: { [key: string]: FormattedProduct } = {\n withRecommendedSite: {\n title: siteKeyDataToSplitBy.recommendedSitesTitle,\n sites: []\n },\n withoutRecommendedSite: {\n title: siteKeyDataToSplitBy.otherSitesTitle,\n sites: []\n }\n };\n sites = _.sortBy(sites, ['displayName']);\n\n const addSiteToResult = (hasJsw: boolean, site: FormattedSite) => {\n if (hasJsw) {\n sitesByCategory.withRecommendedSite.sites.push(site);\n } else {\n sitesByCategory.withoutRecommendedSite.sites.push(site);\n }\n };\n\n sites.map((site) => {\n addSiteToResult(site.products.includes(siteKeyDataToSplitBy.siteKey), {\n value: site.cloudId,\n name: site.displayName,\n products: site.products\n });\n });\n\n const displaySitesFromAllCategories =\n sitesByCategory.withRecommendedSite.sites.length > 0 &&\n sitesByCategory.withoutRecommendedSite.sites.length > 0;\n\n const displayOnlySitesContainingJiraSoftware =\n sitesByCategory.withRecommendedSite.sites.length > 0 &&\n sitesByCategory.withoutRecommendedSite.sites.length === 0;\n\n const displayOnlySitesMissingJiraSoftware =\n sitesByCategory.withRecommendedSite.sites.length === 0 &&\n sitesByCategory.withoutRecommendedSite.sites.length > 0;\n\n return {\n sitesByCategory,\n displaySitesFromAllCategories,\n displayOnlySitesContainingJiraSoftware,\n displayOnlySitesMissingJiraSoftware\n };\n }, [sites]);\n\n useEffect(() => {\n if (isLoaded) {\n if (selectedSiteId) {\n const found = isSelectedSiteValid(\n categorizedSitesData.sitesByCategory,\n selectedSiteId\n );\n if (found) {\n handleDropdownItemClick(found);\n return;\n }\n }\n if (categorizedSitesData.sitesByCategory?.withRecommendedSite?.sites[0]) {\n handleDropdownItemClick(\n categorizedSitesData.sitesByCategory.withRecommendedSite.sites[0]\n );\n } else if (\n categorizedSitesData.sitesByCategory?.withoutRecommendedSite?.sites[0]\n ) {\n handleDropdownItemClick(\n categorizedSitesData.sitesByCategory.withoutRecommendedSite.sites[0]\n );\n }\n if (isJsm) {\n const confluenceOrderedFirst = [\n ...categorizedSitesData.sitesByCategory.withRecommendedSite.sites,\n ...categorizedSitesData.sitesByCategory.withoutRecommendedSite.sites\n ].sort(orderSpecificProductFirstSort);\n handleDropdownItemClick(confluenceOrderedFirst[0]);\n }\n } else {\n setIsLoaded(true);\n }\n }, [isLoaded]);\n\n useEffect(() => {\n if (isJsm) {\n const siteHasConf = activeSite?.products.some(\n (p) => p === ProductKeys.CONFLUENCE\n );\n setShowConfluenceNotice(\n !siteHasConf && hasSitesWithConfluence && !showFreeLimitExceededError\n );\n }\n }, [activeSite]);\n\n useEffect(() => {\n setIsValidSiteName(isPermitted);\n }, [isPermitted]);\n\n const trigger = (\n \n \n \n );\n\n const handleDropdownItemClick = ({ name, value }: FormattedSite) => {\n const selectedSite = getSiteById(value, sites);\n onSiteNameChange(selectedSite, selectedSite.displayName);\n setActiveSite(selectedSite);\n setTriggerText(\n Object.assign({}, messages.selectSite, {\n defaultMessage: name + siteNameAfter\n })\n );\n setHideJswTrialNotice(\n isFree || selectedSite.products.includes(ProductKeys.JIRA_SOFTWARE)\n );\n };\n\n const triggerButtonTheme = () => {\n const buttonStyles = !isDropdownOpen\n ? DropdownButtonStyle\n : Object.assign({}, DropdownButtonStyle, DropdownButtonStyleOpen);\n return {\n buttonStyles,\n spinnerStyles: {}\n };\n };\n\n const dropDownItems = (sitesData: FormattedSite[]) => {\n return sitesData.map((site: FormattedSite) => {\n return (\n handleDropdownItemClick(site)}\n >\n {site.name + siteNameAfter}\n \n );\n });\n };\n\n return (\n \n \n \n {isDeferredSiteNameEnabled && (\n \n {\n if (isDisabled) {\n return;\n }\n if (!toolTipOpen) {\n segment('bxp.formCloudSignup.toolTipDisplayed', {});\n }\n setToolTipOpen(!toolTipOpen);\n }}\n >\n \n \n {toolTipOpen && (\n \n \n \n )}\n \n )}\n \n {isDeferredSiteNameEnabled && (\n \n \n \n )}\n \n {showSiteSwitcher && (\n \n setIsDropdownOpen(isOpen)\n }\n >\n {useRecomendedSitesInDropdown && (\n <>\n {categorizedSitesData.displaySitesFromAllCategories && (\n <>\n \n }\n >\n {dropDownItems(\n categorizedSitesData.sitesByCategory.withRecommendedSite\n .sites\n )}\n \n \n }\n >\n {dropDownItems(\n categorizedSitesData.sitesByCategory\n .withoutRecommendedSite.sites\n )}\n \n >\n )}\n {categorizedSitesData.displayOnlySitesContainingJiraSoftware &&\n dropDownItems(\n categorizedSitesData.sitesByCategory.withRecommendedSite\n .sites\n )}\n {categorizedSitesData.displayOnlySitesMissingJiraSoftware &&\n dropDownItems(\n categorizedSitesData.sitesByCategory.withoutRecommendedSite\n .sites\n )}\n >\n )}\n {!useRecomendedSitesInDropdown && [\n ...dropDownItems(\n categorizedSitesData.sitesByCategory.withRecommendedSite.sites\n ),\n ...dropDownItems(\n categorizedSitesData.sitesByCategory.withoutRecommendedSite\n .sites\n )\n ]}\n \n )}\n\n {!showSiteSwitcher && (\n \n \n {siteNameAfter}\n \n }\n />\n \n )}\n \n\n {isPermitted && !hideJswTrialNotice && isBundleActive && (\n \n \n \n \n )}\n\n {!isPermitted && (\n \n \n \n )}\n\n {showFreeLimitExceededError && (\n \n \n \n )}\n\n {\n if (!isDisabled) {\n onSiteNameStartNew();\n }\n }}\n >\n {isDeferredSiteNameEnabled ? (\n \n ) : (\n \n )}\n \n\n {showConfluenceNotice && (\n \n \n \n \n
\n \n \n )}\n \n );\n}\n","import { useEffect, useState } from 'react';\n\nexport type SitePermission = {\n readonly isValidating: boolean;\n readonly isPermitted: boolean;\n};\n\nexport function useSitePermission(\n baseUrl: string,\n siteId: string,\n isBBJSW: boolean\n): SitePermission {\n if (!isBBJSW) {\n return { isValidating: false, isPermitted: true };\n }\n const [{ isValidating, isPermitted }, setValidation] =\n useState({\n isValidating: false,\n isPermitted: true\n });\n useEffect(() => {\n setValidation({ isValidating: true, isPermitted: true });\n fetch(`${baseUrl}/gateway/api/permissions/permitted`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n credentials: 'include',\n body: JSON.stringify({\n permissionId: 'manage',\n resourceId: `ari:cloud:platform::site/${siteId}`\n })\n })\n .then((res) => res.json())\n .then((json) => {\n if (json.permitted) {\n return setValidation({\n isValidating: false,\n isPermitted: true\n });\n } else {\n return setValidation({\n isValidating: false,\n isPermitted: false\n });\n }\n })\n .catch(() => {\n return setValidation({\n isValidating: false,\n isPermitted: false\n });\n });\n }, [siteId]);\n\n return { isValidating, isPermitted };\n}\n","import { useCallback } from 'react';\nimport { useAnalyticsEvents } from './useAnalyticsEvents';\nimport { useTrackedRef } from './useTrackedRef';\nexport const useCallbackWithAnalytics = (method, payload, channel) => {\n const {\n createAnalyticsEvent\n } = useAnalyticsEvents();\n const methodRef = useTrackedRef(method);\n const payloadRef = useTrackedRef(payload);\n return useCallback((...args) => {\n const pload = typeof payloadRef.current === 'function' ? payloadRef.current(...args) : payloadRef.current;\n createAnalyticsEvent(pload).fire(channel);\n methodRef.current(...args);\n }, [createAnalyticsEvent, methodRef, payloadRef, channel]);\n};","export const presetSizes = {\n xsmall: 8,\n small: 16,\n medium: 24,\n large: 48,\n xlarge: 96\n};","/** @jsx jsx */\nimport React from 'react';\nimport { css, jsx, keyframes } from '@emotion/core';\nimport { DN500, DN900, N0, N500 } from '@atlaskit/theme/colors';\nimport { useGlobalTheme } from '@atlaskit/theme/components';\nimport { presetSizes } from './constants';\n\n/**\n * Returns the appropriate circle stroke color.\n */\nfunction getStrokeColor({\n mode,\n appearance\n}) {\n if (mode === 'light') {\n return appearance === 'inherit' ? `var(--ds-text-subtle, ${N500})` : `var(--ds-text-inverse, ${N0})`;\n }\n\n return appearance === 'inherit' ? `var(--ds-text-subtle, ${DN900})` : `var(--ds-text-inverse, ${DN500})`;\n}\n\nconst rotate = keyframes({\n to: {\n transform: 'rotate(360deg)'\n }\n});\nconst rotateStyles = css({\n animation: `${rotate} 0.86s infinite`,\n animationTimingFunction: 'cubic-bezier(0.4, 0.15, 0.6, 0.85)',\n transformOrigin: 'center'\n});\n/**\n * There are three parts to the load in animation:\n * 1. Fade in\n * 2. Accelerated spin\n * 3. Stretch the spinner line\n */\n\nconst loadIn = keyframes({\n from: {\n transform: 'rotate(50deg)',\n opacity: 0,\n strokeDashoffset: 60\n },\n to: {\n transform: 'rotate(230deg)',\n opacity: 1,\n strokeDashoffset: 50\n }\n});\nconst loadInStyles = css({\n animation: `${loadIn} 1s ease-in-out`,\n\n /**\n * When the animation completes, stay at the last frame of the animation.\n */\n animationFillMode: 'forwards',\n\n /**\n * We are going to animate this in.\n */\n opacity: 0\n});\nconst wrapperStyles = css({\n display: 'inline-flex',\n\n /**\n * Align better inline with text.\n */\n verticalAlign: 'middle'\n});\nconst circleStyles = css({\n fill: 'none',\n strokeDasharray: 60,\n strokeDashoffset: 'inherit',\n strokeLinecap: 'round',\n strokeWidth: 1.5,\n '@media screen and (forced-colors: active)': {\n filter: 'grayscale(100%)',\n stroke: 'CanvasText'\n }\n});\nexport default /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(function Spinner({\n testId,\n appearance = 'inherit',\n delay = 0,\n size: providedSize = 'medium'\n}, ref) {\n const size = typeof providedSize === 'number' ? providedSize : presetSizes[providedSize];\n const animationDelay = `${delay}ms`;\n const {\n mode\n } = useGlobalTheme();\n const stroke = getStrokeColor({\n mode,\n appearance\n });\n /**\n * The Spinner animation uses a combination of two\n * css animations on two separate elements.\n */\n\n return jsx(\"span\", {\n /**\n * This span exists to off-load animations from the circle element,\n * which were causing performance issues (style recalculations)\n * on Safari and older versions of Chrome.\n *\n * This can be removed and styles placed back on the circle element once\n * Safari fixes this bug and off-loads rendering to the GPU from the CPU.\n */\n css: [wrapperStyles, rotateStyles],\n \"data-testid\": testId && `${testId}-wrapper`,\n style: {\n animationDelay,\n width: size,\n height: size\n }\n }, jsx(\"svg\", {\n height: size,\n width: size,\n viewBox: \"0 0 16 16\",\n xmlns: \"http://www.w3.org/2000/svg\",\n \"data-testid\": testId,\n ref: ref,\n css: loadInStyles,\n style: {\n animationDelay\n }\n }, jsx(\"circle\", {\n cx: \"8\",\n cy: \"8\",\n r: \"7\",\n css: circleStyles,\n style: {\n stroke\n }\n })));\n}));","import React from 'react';\nimport Spinner from '@atlaskit/spinner';\n\nfunction getSpinnerAppearance({\n appearance,\n isDisabled,\n isSelected\n}) {\n if (isDisabled) {\n return 'inherit';\n }\n\n if (isSelected) {\n return 'invert';\n }\n\n if (appearance === 'primary' || appearance === 'danger') {\n return 'invert';\n }\n\n return 'inherit';\n}\n\nexport default function LoadingSpinner({\n spacing = 'default',\n ...rest\n}) {\n const size = spacing === 'default' ? 'medium' : 'small';\n return /*#__PURE__*/React.createElement(Spinner, {\n size: size,\n appearance: getSpinnerAppearance(rest)\n });\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport Button from './button';\nimport LoadingSpinner from './shared/loading-spinner';\nconst LoadingButton = /*#__PURE__*/React.forwardRef(function LoadingButton({\n isLoading = false,\n ...rest\n}, ref) {\n // Button already has React.memo, so just leaning on that\n return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {\n ref: ref,\n overlay: isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, rest) : null\n }));\n}); // Tools including enzyme rely on components having a display name\n\nLoadingButton.displayName = 'LoadingButton';\nexport default LoadingButton;","import { useCallbackWithAnalytics } from '@atlaskit/analytics-next';\nimport { LoadingButton } from '@atlaskit/button';\nimport { N30, N80 } from '@atlaskit/theme/colors';\nimport styled from '@emotion/styled';\nimport React from 'react';\nimport { text } from './styled';\n\nexport const StyledSubmitButton = styled(LoadingButton)`\n font-family: ${text};\n font-weight: 500;\n svg {\n margin: 0;\n }\n\n :hover {\n background-color: #0049b0;\n }\n\n :disabled,\n :disabled:hover {\n color: ${N80} !important;\n background-color: ${N30};\n opacity: 0.6;\n }\n &.devops {\n margin-top: 30px;\n }\n`;\n\nexport const SubmitButton = ({ label = '', ...props }) => {\n const handler = useCallbackWithAnalytics(() => undefined, {\n eventName: 'reactSignUpFormSubmitButtonClicked',\n data: {\n event: 'clicked', // event verb, in past tense (eg, \"clicked\")\n eventComponent: 'submitButton', // name of component being interacted with, in camelCase\n label,\n uuid: 'reactSignUpFormSubmitButton' // required for Magnolia events, unique id for a given component if available\n }\n });\n\n return (\n \n {props.children}\n \n );\n};\n","import Textfield from '@atlaskit/textfield';\nimport { useActor } from '@xstate/react';\nimport React, { useEffect, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { Interpreter } from 'xstate';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport {\n ErrorMessageWithDefaultClassName,\n FullNameFieldWrapper,\n Label,\n NameFieldGroup\n} from './styled';\n\nexport type DisplayNameProps = {\n readonly onNameChange: (displayName: string | null) => void;\n readonly displayname: string | null | undefined;\n readonly isDisabled: boolean;\n readonly serviceFieldProgress: Interpreter;\n readonly fadeOnDisable?: boolean;\n readonly outlineOnFocus?: boolean;\n readonly popOverError?: boolean;\n};\n\nconst nonValidNamePattern =\n /((http(s)?|ftp|callto|mailto|skype|magnet):)|www\\.|:\\/\\/|@|\\$|^\\s+$/i;\n\nexport function DisplayNameField({\n onNameChange,\n displayname,\n isDisabled,\n fadeOnDisable,\n popOverError,\n outlineOnFocus,\n serviceFieldProgress\n}: DisplayNameProps) {\n const checkIsDisabled = () => {\n // ensure isDisabled can be set when form is submitting,\n // otherwise check the field progress state\n return isDisabled || state?.context?.fullName === false;\n };\n const [alreadySentValid, setAlreadySentValid] = useState(false);\n const [state, send] = useActor(serviceFieldProgress);\n const [displayName, setDisplayName] = useState(\n displayname ? displayname : ''\n );\n const [isValidDisplayName, setIsValidDisplayName] = useState(true);\n const [isWithinMaxLength, setIsWithinMaxLength] = useState(true);\n const [isDisplayNameFocused, setIsDisplayNameFocused] = useState(false);\n const [fieldDisabled, setFieldDisabled] = useState(checkIsDisabled());\n\n useEffect(() => {\n isValidDisplayName && isWithinMaxLength\n ? onNameChange(displayName)\n : onNameChange('');\n\n if (\n isValidDisplayName &&\n isWithinMaxLength &&\n displayName.length > 0 &&\n !alreadySentValid\n ) {\n setAlreadySentValid(true);\n send('VALID_NAME');\n }\n }, [displayName]);\n\n useEffect(() => {\n setFieldDisabled(checkIsDisabled());\n }, [state, isDisabled]);\n\n const updateDisplayName = (event: React.FormEvent) => {\n const value: string = event.currentTarget.value;\n setDisplayName(event.currentTarget.value);\n setIsValidDisplayName(true);\n setIsWithinMaxLength(true);\n\n if (value.match(nonValidNamePattern)) {\n setIsValidDisplayName(false);\n } else if (value.length > 255) {\n setIsWithinMaxLength(false);\n }\n };\n\n return (\n \n \n \n setIsDisplayNameFocused(true)}\n onBlur={() => setIsDisplayNameFocused(false)}\n />\n \n {!isValidDisplayName && (\n \n \n \n )}\n {!isWithinMaxLength && (\n \n \n \n )}\n \n );\n}\n","import InfoIcon from '@atlaskit/icon/glyph/info';\nimport { B400 } from '@atlaskit/theme/colors';\nimport React from 'react';\nimport { InfoBoxContainer, InfoBoxContent } from './styled';\n\nexport type InfoBoxProps = {\n readonly children: React.ReactNode;\n readonly fontSize?: string;\n};\n\nexport function InfoBox({ children, fontSize }: InfoBoxProps) {\n return (\n \n \n {children}\n \n );\n}\n","import CrossIcon from '@atlaskit/icon/glyph/cross';\nimport ModalDialog, { ModalTransition } from '@atlaskit/modal-dialog';\nimport { SanitizedFormattedHtmlMessage } from '@atlassiansox/bxpkit-core';\nimport React, { useEffect, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport {\n AnalyticsTrackType,\n BitbucketWorkspaces,\n ProductKeys\n} from '../../../../../model/wac-signup-form';\nimport { InfoBox } from './info-box';\nimport { ModalContents } from './styled';\n\nexport type BitbucketJiraInfoBoxProps = {\n readonly productsExisting: string[];\n analyticsTrack: AnalyticsTrackType;\n bitbucketWorkspaces?: BitbucketWorkspaces;\n};\n\nexport function BitbucketJiraInfoBox({\n productsExisting,\n analyticsTrack,\n bitbucketWorkspaces\n}: BitbucketJiraInfoBoxProps) {\n const { segment } = analyticsTrack;\n\n let hasOtherProducts = false;\n let hasBitBucket = false;\n let hasJiraSoftware = false;\n let infoText: FormattedMessage.MessageDescriptor = messages.infoBoxDefault;\n\n const [isModalOpen, setModalBoxOpen] = useState(false);\n\n productsExisting.map((productKey) => {\n switch (productKey) {\n case ProductKeys.BITBUCKET:\n hasBitBucket = true;\n break;\n case ProductKeys.JIRA_SOFTWARE:\n hasJiraSoftware = true;\n break;\n default:\n hasOtherProducts = true;\n }\n });\n\n useEffect(() => {\n if (!!bitbucketWorkspaces) {\n let userstate = '';\n if (hasOtherProducts && !hasBitBucket && !hasJiraSoftware) {\n userstate = 'noBB_noJSW_yesOtherSite';\n segment('bxp.try.signup.initialversionshown', { userstate });\n } else if (hasJiraSoftware && !hasBitBucket) {\n userstate = 'noBB_yesJSW';\n segment('bxp.try.signup.initialversionshown', { userstate });\n } else if (!hasOtherProducts && hasBitBucket && hasJiraSoftware) {\n userstate = 'yesBB_yesJSW_noOtherSite';\n segment('bxp.try.signup.initialversionshown', { userstate });\n } else if (hasBitBucket && !hasJiraSoftware && !hasOtherProducts) {\n userstate = 'yesBB_noJSW_noOtherSite';\n segment('bxp.try.signup.initialversionshown', { userstate });\n } else if (hasOtherProducts && hasBitBucket && !hasJiraSoftware) {\n userstate = 'yesBB_noJSW_yesOtherSite';\n segment('bxp.try.signup.initialversionshown', { userstate });\n } else if (hasOtherProducts && hasBitBucket && hasJiraSoftware) {\n userstate = 'yesBB_yesJSW_yesOtherSite';\n segment('bxp.try.signup.initialversionshown', { userstate });\n }\n }\n }, [bitbucketWorkspaces]);\n\n if (hasOtherProducts && !hasBitBucket && !hasJiraSoftware) {\n infoText = messages.infoBoxSite;\n } else if (hasJiraSoftware && !hasBitBucket) {\n infoText = messages.infoBoxSiteJsw;\n } else if (!hasOtherProducts && hasBitBucket && hasJiraSoftware) {\n infoText = messages.infoBoxBb;\n } else if (hasBitBucket && !hasJiraSoftware && !hasOtherProducts) {\n infoText = messages.infoBoxBb;\n } else if (hasOtherProducts && hasBitBucket && !hasJiraSoftware) {\n infoText = messages.infoBoxSiteBb;\n } else if (hasOtherProducts && hasBitBucket && hasJiraSoftware) {\n infoText = messages.infoBoxSiteBb;\n }\n\n if (!(infoText.defaultMessage && infoText.defaultMessage.length > 1)) {\n return null;\n } else {\n return (\n \n \n \n
\n setModalBoxOpen(true)}>\n \n
\n \n {isModalOpen && (\n setModalBoxOpen(false)} width=\"370px\">\n \n \n \n
\n setModalBoxOpen(false)}>\n \n \n \n \n )}\n \n \n );\n }\n}\n","import 'isomorphic-fetch';\nimport { Product, ProductKeys } from '../../model/wac-signup-form';\n\nexport type FreeBreachTestPayloadType = {\n readonly cloudId: string;\n readonly productKeys: string[];\n readonly wacEnvUrl: string;\n};\n\nexport type BreachStatusType = {\n readonly isInBreachOfFree: boolean;\n};\n\nconst FREE_BREACH_PRODUCTS = [\n ProductKeys.JIRA_SOFTWARE,\n ProductKeys.JIRA_SERVICE_DESK,\n ProductKeys.JIRA_CORE,\n ProductKeys.CONFLUENCE\n];\n\nexport function computeFreeTrialRedirectURL(selectedSiteId: string) {\n const { origin, pathname, search } = window.location;\n const searchParams = new URLSearchParams(search);\n searchParams.set('edition', 'standard');\n searchParams.set('selectedSiteId', selectedSiteId);\n return `${origin}${pathname}?${searchParams.toString()}`;\n}\n\nexport function productsCanBeInBreachOfFree(products: Product[]) {\n const productsCanBeInBreach = products.reduce(\n (allProductsAreEligible: boolean, product: Product) => {\n return (\n allProductsAreEligible &&\n FREE_BREACH_PRODUCTS.includes(product.product as ProductKeys) &&\n product.edition === 'free'\n );\n },\n true\n );\n\n return productsCanBeInBreach;\n}\n\nexport async function checkBreachStatus({\n cloudId,\n productKeys,\n wacEnvUrl\n}: FreeBreachTestPayloadType) {\n const postBody = {\n cloudId,\n productKeys\n };\n\n const options = {\n headers: {\n 'content-type': 'application/json'\n },\n method: 'POST',\n body: JSON.stringify(postBody)\n };\n const breachStatusResponse = await fetch(\n `${wacEnvUrl}/endpoint/cloud/expand-free-validation`,\n options\n );\n\n const breachStatus = (await breachStatusResponse.json()) as BreachStatusType;\n\n return breachStatus.isInBreachOfFree;\n}\n","import { SanitizedFormattedHtmlMessage } from '@atlassiansox/bxpkit-core';\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport { AnalyticsTrackType } from '../../../../../model/wac-signup-form';\nimport { computeFreeTrialRedirectURL } from '../../../../../service/sign-up-form/free-breach';\nimport { InfoBox } from './info-box';\n\nexport type BreachInfoBoxProps = {\n analyticsTrack: AnalyticsTrackType;\n selectedSiteId: string;\n};\n\nexport function BreachInfoBox({\n analyticsTrack,\n selectedSiteId\n}: BreachInfoBoxProps) {\n const freeTrialRedirectURL = computeFreeTrialRedirectURL(selectedSiteId);\n return (\n \n \n \n
\n \n {\n analyticsTrack.segment('bxpSignupFreeUserBreachStart30DayTrial', {\n selectedSiteId\n });\n window.location.href = freeTrialRedirectURL;\n }}\n >\n \n
\n \n );\n}\n","import { Checkbox } from '@atlaskit/checkbox';\nimport DropdownMenu, { DropdownItem } from '@atlaskit/dropdown-menu';\nimport Textfield from '@atlaskit/textfield';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport {\n AnalyticsTrackType,\n BitbucketWorkspace,\n WorkspaceType\n} from '../../../../../model/wac-signup-form';\nimport {\n BitbucketAccountCheckbox,\n CompoundField,\n DropdownButtonStyle,\n DropdownButtonStyleOpen,\n DropdownTrigger,\n FieldContainer,\n Label,\n SitePickerTextfieldWrapper\n} from './styled';\n\nexport type BitbucketAccountPickerProps = {\n bbWorkspaces: BitbucketWorkspace[];\n bbWorkspacesTotal: number;\n bbNameOverride: string;\n selectedSite: string | null;\n sitesCount: number;\n onAccountChange: (accountName: string) => void;\n bbAccountCopy: (isEnabled: boolean) => void;\n analyticsTrack: AnalyticsTrackType;\n isValidSiteName: boolean;\n isDisabled: boolean;\n};\n\ntype OnOpenChangeProps = {\n readonly isOpen: boolean;\n readonly isDisabled: boolean;\n readonly event?: { [key: string]: any };\n};\n\nexport function BitbucketAccountPicker({\n bbWorkspaces,\n bbAccountCopy,\n bbNameOverride,\n onAccountChange,\n selectedSite,\n sitesCount,\n isValidSiteName,\n isDisabled\n}: BitbucketAccountPickerProps) {\n const [isCopyChecked, setIsCopyChecked] = useState(false);\n const [isDropdownOpen, setIsDropdownOpen] = useState(false);\n const [triggerText, setTriggerText] = useState({ ...messages.selectAccount });\n const [isCheckboxDisabled, setIsCheckboxDisabled] = useState(sitesCount > 1);\n const [bbAccountName, setBbAccountName] = useState('');\n\n useMemo(() => {\n if (selectedSite && selectedSite.length > 0) {\n setIsCheckboxDisabled(false);\n }\n if (!isValidSiteName) {\n setIsCheckboxDisabled(true);\n }\n }, [selectedSite, isValidSiteName]);\n\n useEffect(() => {\n if (!isValidSiteName) {\n setIsCopyChecked(false);\n bbAccountCopy(false);\n }\n }, [isValidSiteName]);\n\n useEffect(() => {\n if (bbWorkspaces?.[0]?.workspace?.name) {\n handleDropdownItemClick(bbWorkspaces[0].workspace);\n }\n }, []);\n\n const triggerButtonTheme = () => {\n const buttonStyles = !isDropdownOpen\n ? DropdownButtonStyle\n : Object.assign({}, DropdownButtonStyle, DropdownButtonStyleOpen);\n return {\n buttonStyles,\n spinnerStyles: {}\n };\n };\n\n const handleCopyAccount = () => {\n setIsCopyChecked(!isCopyChecked);\n\n bbAccountCopy(!isCopyChecked);\n if (isCopyChecked) {\n onAccountChange(bbAccountName);\n }\n };\n\n const handleDropdownItemClick = ({ name }: WorkspaceType) => {\n setTriggerText(\n Object.assign({}, messages.selectAccount, { defaultMessage: name })\n );\n onAccountChange(name);\n setBbAccountName(name);\n };\n\n const trigger = (\n \n \n \n );\n\n return (\n \n \n \n \n\n {isCopyChecked && (\n \n \n \n )}\n\n {!isCopyChecked && bbWorkspaces.length === 1 && (\n \n \n \n )}\n {!isCopyChecked && bbWorkspaces.length > 1 && (\n \n setIsDropdownOpen(isOpen)\n }\n >\n {bbWorkspaces.map((workspace) => {\n return (\n handleDropdownItemClick(workspace.workspace)}\n >\n {workspace.workspace.name}\n \n );\n })}\n \n )}\n {\n \n }\n isChecked={isCopyChecked}\n onChange={() => handleCopyAccount()}\n name=\"checkbox-basic\"\n isDisabled={isCheckboxDisabled || isDisabled}\n />\n \n }\n \n );\n}\n","import _extends from \"@babel/runtime/helpers/extends\";\nimport React, { useCallback, useState } from 'react';\nimport Radio from './Radio';\n\nconst noop = () => {};\n\nconst noOptions = [];\nexport default function RadioGroup(props) {\n const {\n onChange,\n options = noOptions,\n value: propValue,\n defaultValue,\n isDisabled,\n isRequired,\n isInvalid,\n onInvalid = noop,\n name,\n analyticsContext,\n ['aria-labelledby']: ariaLabelledBy\n } = props;\n const [selectedValue, setSelectedValue] = useState(propValue !== undefined ? propValue : defaultValue);\n const onRadioChange = useCallback((e, analyticsEvent) => {\n setSelectedValue(e.currentTarget.value);\n\n if (onChange) {\n onChange(e, analyticsEvent);\n }\n }, [onChange]); // If propValue is provided than act as a controlled component\n // If not then act as an uncontrolled component using the value from state\n\n const value = typeof propValue !== 'undefined' ? propValue : selectedValue;\n return /*#__PURE__*/React.createElement(\"div\", {\n role: \"radiogroup\",\n \"aria-labelledby\": ariaLabelledBy\n }, options.map(({ ...optionProps\n }, index) => {\n if (typeof isDisabled !== 'undefined') {\n optionProps.isDisabled = isDisabled;\n }\n\n const isChecked = value != null && optionProps.value === value;\n return /*#__PURE__*/React.createElement(Radio, _extends({}, optionProps, {\n name: name || optionProps.name,\n key: index,\n onChange: onRadioChange,\n onInvalid: onInvalid,\n isInvalid: isChecked && isInvalid,\n isChecked: isChecked,\n isRequired: isRequired,\n analyticsContext: analyticsContext\n }));\n }));\n}","import { RadioGroup } from '@atlaskit/radio';\nimport { SanitizedFormattedHtmlMessage } from '@atlassiansox/bxpkit-core';\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport { AnalyticsTrackType } from '../../../../../model/wac-signup-form';\nimport { InfoBox } from './info-box';\n\nimport { Label, RadioGroupWrapper } from './styled';\n\nexport type GdprLocationProps = {\n onLocationChange: (gdprLocation: string | null) => void;\n analyticsTrack: AnalyticsTrackType;\n};\nconst gdprData = [\n { name: 'gdprDataUS', value: 'US', label: 'US' },\n { name: 'gdprDataEU', value: 'EU', label: 'EU' }\n];\n\nexport function GdprLocation({\n onLocationChange,\n analyticsTrack\n}: GdprLocationProps) {\n const { segment } = analyticsTrack;\n\n return (\n <>\n \n \n {\n segment('wac-signup-gdpr-selected', { value: event.target.value });\n onLocationChange(event.target.value);\n }}\n />\n \n \n \n \n >\n );\n}\n","import { AnalyticsContext } from '@atlaskit/analytics-next';\nimport { SanitizedFormattedHtmlMessage } from '@atlassiansox/bxpkit-core';\nimport React from 'react';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport { MigrationSourceDiv, WacSignupFormContainer } from './styled';\n\nexport type MigrationSourceProps = {\n readonly isClaimedMigration: boolean;\n};\n\nexport function MigrationSource({ isClaimedMigration }: MigrationSourceProps) {\n return (\n \n \n \n {isClaimedMigration && (\n \n )}\n\n {!isClaimedMigration && (\n \n )}\n \n \n \n );\n}\n","import { useEffect, useState } from 'react';\nimport { bind } from 'bind-event-listener';\n\nconst isMatchMediaAvailable = () => typeof window !== 'undefined' && 'matchMedia' in window;\n/**\n * Use for any programatic motions needed at runtime.\n * Will return `true` if the current user prefers reduced motion.\n * This is generally set through OS preferences/settings.\n */\n\n\nexport const isReducedMotion = () => {\n if (!isMatchMediaAvailable()) {\n return false;\n }\n\n const {\n matches\n } = window.matchMedia('(prefers-reduced-motion: reduce)');\n return matches;\n};\n/**\n * A React hook version of {@link isReducedMotion}.\n * Useful for React components that need to re-render if the user's motion\n * preference changes at runtime.\n */\n\nexport const useIsReducedMotion = () => {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(isReducedMotion);\n useEffect(() => {\n if (!isMatchMediaAvailable()) {\n return;\n }\n\n const mediaQueryList = window.matchMedia('(prefers-reduced-motion: reduce)');\n\n const onChange = event => setPrefersReducedMotion(event.matches);\n\n return bind(mediaQueryList, {\n type: 'change',\n listener: onChange\n });\n }, []);\n return prefersReducedMotion;\n};\n/**\n * Use for any CSS based motion (animation or transition).\n * Always put at the end of your declaration for correct use of the cascade.\n * Reduced motion preference is generally set through OS preferences/settings.\n */\n\nexport const prefersReducedMotion = () => ({\n '@media (prefers-reduced-motion: reduce)': {\n animation: 'none',\n transition: 'none'\n }\n});","import React, { Children, createContext, memo, useContext, useMemo, useRef } from 'react';\nimport { isReducedMotion } from '../utils/accessibility';\nimport { useForceRender } from '../utils/use-force-render';\n/**\n * Internally we will be playing with an element that will always have a key defined.\n */\n\n// We define empty context here so the object doesn't change.\nconst emptyContext = {\n // Motions will always appear if not inside a exiting persistence component.\n appear: true,\n isExiting: false\n};\nconst ExitingContext = /*#__PURE__*/createContext(emptyContext);\n\nconst isAnyPreviousKeysMissingFromCurrent = (currentMap, previous) => {\n for (let i = 0; i < previous.length; i++) {\n const element = previous[i];\n const key = element.key;\n\n if (!currentMap[key]) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * This method will wrap any React element with a context provider. We're using context (instead of\n * cloneElement) so we can communicate between multiple elements without the need of prop drilling\n * (results in a better API for consumers).\n */\n\n\nconst wrapChildWithContextProvider = (child, value = emptyContext) => {\n return /*#__PURE__*/React.createElement(ExitingContext.Provider, {\n key: `${child.key}-provider`,\n value: value\n }, child);\n};\n\nconst childrenToObj = children => {\n return children.reduce((acc, child) => {\n acc[child.key] = child;\n return acc;\n }, {});\n};\n\nconst spliceNewElementsIntoPrevious = (current, previous) => {\n const splicedChildren = previous.concat([]);\n const previousMap = childrenToObj(previous);\n\n for (let i = 0; i < current.length; i++) {\n const child = current[i];\n const childIsNew = !previousMap[child.key];\n\n if (childIsNew) {\n // This will insert the new element after the previous element.\n splicedChildren.splice(i + 1, 0, child);\n }\n }\n\n return splicedChildren;\n};\n/**\n * This function will convert all children types to an array while also filtering out non-valid React elements.\n */\n\n\nconst childrenToArray = children => {\n const childrenAsArray = []; // We convert children to an array using this helper method as it will add keys to children that do not\n // have them, such as when we have hardcoded children that are conditionally rendered.\n\n Children.toArray(children).forEach(child => {\n // We ignore any boolean children to make our code a little more simple later on,\n // and also filter out any falsies (empty strings, nulls, and undefined).\n if (typeof child !== 'boolean' && Boolean(child)) {\n // Children WILL have a key after being forced into an array using the React.Children helper.\n childrenAsArray.push(child);\n }\n });\n return childrenAsArray;\n};\n/**\n * This handles the case when a render updates during an exit motion.\n * If any child is mounted again we removed them from the exiting children object and return true.\n */\n\n\nconst hasAnyExitingChildMountedAgain = (exitingChildren, children) => {\n let exitingChildMountedAgain = false;\n children.forEach(child => {\n if (exitingChildren.current[child.key]) {\n exitingChildMountedAgain = true;\n delete exitingChildren.current[child.key];\n }\n });\n return exitingChildMountedAgain;\n};\n\nconst ExitingPersistence = /*#__PURE__*/memo(({\n appear: appearFromProp = false,\n children: childs,\n exitThenEnter\n}) => {\n const children = childrenToArray(childs);\n const childrenObj = childrenToObj(children);\n const previousChildren = useRef([]);\n const persistedChildren = useRef([]);\n const forceRender = useForceRender();\n const exitingChildren = useRef({});\n const appear = useRef(appearFromProp);\n const defaultContextValue = useMemo(() => ({\n appear: appear.current,\n isExiting: false\n }), // React rules of hooks says this isn't needed because mutating appear won't cause a re-render.\n // While technically true - it will trigger this to make a new object on the _next_ render which is what we want.\n // Remove this or use appear instead of appear.current and you will notice a test breaks.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [appear.current]);\n\n if (isReducedMotion()) {\n return children;\n }\n\n if (!appear.current) {\n // We always want child motions to appear after the initial mount.\n appear.current = true;\n } // This entire block can't be an effect because we need it to run synchronously during a render\n // else when elements are being removed they will be remounted instead of being updated.\n\n\n if (previousChildren.current.length && isAnyPreviousKeysMissingFromCurrent(childrenObj, previousChildren.current)) {\n if (persistedChildren.current.length === 0 || hasAnyExitingChildMountedAgain(exitingChildren, children)) {\n persistedChildren.current = previousChildren.current;\n } // We have persisted children now set from previous children.\n // Let's update previous children so we have it available next render.\n\n\n previousChildren.current = children;\n return (exitThenEnter ? persistedChildren.current : spliceNewElementsIntoPrevious(children, persistedChildren.current)).map(child => {\n const currentChild = childrenObj[child.key];\n\n if (!currentChild) {\n // We've found an exiting child - mark it!\n exitingChildren.current[child.key] = true;\n return wrapChildWithContextProvider(child, {\n isExiting: true,\n appear: true,\n onFinish: () => {\n delete exitingChildren.current[child.key]; // We will only remove the exiting elements when any subsequent exiting elements have also finished.\n // Think of removing many items from a todo list - when removing a few over a few clicks we don't\n // want the list jumping around when they exit.\n\n if (Object.keys(exitingChildren.current).length === 0) {\n // Set previous children to nothing.\n // This let's us skip the next render check as it's assumed children and previous will be the same.\n previousChildren.current = [];\n persistedChildren.current = []; // Re-render after the element(s) have animated away which will end up rendering the latest children.\n\n forceRender();\n }\n }\n });\n } // This element isn't exiting.\n // Wrap context and let's continue on our way.\n\n\n return wrapChildWithContextProvider(currentChild, defaultContextValue);\n });\n } else {\n previousChildren.current = children;\n }\n\n return children.map(child => wrapChildWithContextProvider(child, defaultContextValue));\n});\nexport const useExitingPersistence = () => {\n return useContext(ExitingContext);\n};\nExitingPersistence.displayName = 'ExitingPersistence';\nexport default ExitingPersistence;","import { useCallback, useState } from 'react';\nexport const useForceRender = () => {\n const [, updateState] = useState({});\n const forceRender = useCallback(() => updateState({}), []);\n return forceRender;\n};","import { useCallback, useEffect, useRef } from 'react';\n\nconst getHookDeps = opts => {\n switch (opts.cleanup) {\n case 'next-effect':\n return undefined;\n\n case 'unmount':\n default:\n return [];\n }\n};\n/**\n * Will return request animation frame as a function which will clean itself up.\n */\n\n\nexport const useRequestAnimationFrame = (opts = {\n cleanup: 'unmount'\n}) => {\n const frames = useRef([]);\n useEffect(() => {\n return () => {\n if (frames.current.length) {\n frames.current.forEach(id => cancelAnimationFrame(id));\n frames.current = [];\n }\n }; // We dynamically set this so we either clean up on the next effect - or on unmount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, getHookDeps(opts));\n return useCallback(handler => {\n const id = requestAnimationFrame(time => {\n frames.current = frames.current.filter(frameId => frameId !== id);\n handler(time);\n });\n frames.current.push(id);\n }, []);\n};\n/**\n * Will return set timeout as a function which will clean itself up.\n */\n\nexport const useSetTimeout = (opts = {\n cleanup: 'unmount'\n}) => {\n const timeouts = useRef([]);\n useEffect(() => {\n return () => {\n if (timeouts.current.length) {\n timeouts.current.forEach(id => clearTimeout(id));\n timeouts.current = [];\n }\n }; // We dynamically set this so we either clean up on the next effect - or on unmount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, getHookDeps(opts));\n return useCallback((handler, timeout, ...args) => {\n const id = setTimeout(() => {\n timeouts.current = timeouts.current.filter(timeoutId => timeoutId !== id);\n handler();\n }, timeout, ...args);\n timeouts.current.push(id);\n }, []);\n};","import React, { createContext, useContext, useRef, useState } from 'react';\nimport { useLayoutEffect } from '../utils/use-layout-effect';\nimport { useUniqueId } from '../utils/use-unique-id';\nconst StaggeredEntranceContext = /*#__PURE__*/createContext(() => ({\n isReady: true,\n delay: 0,\n ref: () => {}\n}));\nexport const useStaggeredEntrance = () => {\n const indentifier = useUniqueId();\n const context = useContext(StaggeredEntranceContext);\n return context(indentifier);\n};\n/**\n * For a list of elements that need to animate in,\n * this should be used in conjunction with entering components.\n * This does not need Javascript to execute so it will run immediately for any SSR rendered React apps before the JS has executed.\n *\n * Will dynamically add delay to each child entering component.\n * Unfortunately all entering components _NEED_ to be a direct descendant.\n */\n\nconst StaggeredEntrance = ({\n children,\n column,\n columns = 'responsive',\n delayStep = 50\n}) => {\n const elementRefs = useRef([]);\n const indexes = [];\n const [actualColumns, setActualColumns] = useState(() => {\n if (typeof columns === 'number') {\n // A hardcoded columns is set so bail out and set it to that!\n return columns;\n }\n\n if (typeof column === 'number') {\n // A hardcoded column is set so we will set actualColumns to be 1.\n return 1;\n } // We are in \"responsive\" mode.\n // So we will be calculating when the Javascript executes on the client how many columns there will be.\n\n\n return 0;\n });\n useLayoutEffect(() => {\n // We want to only run this code when we are in \"responsive\" mode.\n // It is assumed we are in responsive mode if `columns` is \"responsive\",\n // we have children element refs ready to be read (i.e. if there are no children this won't run as well)\n // and finally that `actualColumns` is `0` - this is because for the first render cycle `actualColumns` will be `0` (set above)\n // and then after this layout effect runs the value for `actualColumns` will then be calculated and set.\n if (columns === 'responsive' && elementRefs.current.length && actualColumns === 0) {\n let currentTop = 0;\n let numberColumns = 0;\n\n if (elementRefs.current.length <= 1) {\n setActualColumns(1);\n return;\n } // We set the current top to the first elements.\n // We will be comparing this and incrementing the column count\n // until we hit an element that has a different offset top (or we run out of elements).\n\n\n currentTop = elementRefs.current[0] ? elementRefs.current[0].offsetTop : 0;\n\n for (let i = 0; i < elementRefs.current.length; i++) {\n const child = elementRefs.current[i];\n\n if (!child) {\n break;\n }\n\n if (currentTop === child.offsetTop) {\n numberColumns += 1;\n\n if (elementRefs.current.length - 1 === i) {\n setActualColumns(numberColumns);\n }\n\n continue;\n }\n\n setActualColumns(numberColumns);\n break;\n }\n } // We only want this effect to run once - on initial mount.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n\n }, []);\n return /*#__PURE__*/React.createElement(StaggeredEntranceContext.Provider, {\n value: id => {\n if (!indexes.includes(id)) {\n indexes.push(id);\n }\n\n const isReady = actualColumns > 0;\n const index = indexes.indexOf(id);\n const currentColumn = column || index % actualColumns;\n const currentRow = Math.floor(index / actualColumns);\n const distanceFromTopLeftElement = currentRow + currentColumn; // We don't want loads of elements to have the same staggered delay as it ends up looking slow for users.\n // To get around that we calculate the logarithm using `distanceFromTopLeftElement` which ends making\n // elements appear faster the further away from the top left element.\n\n const delay = Math.ceil(Math.log(distanceFromTopLeftElement + 1) * delayStep * 1.5) || 0;\n return {\n delay,\n isReady,\n ref: element => elementRefs.current[index] = element\n };\n }\n }, children);\n};\n\nexport default StaggeredEntrance;","import React, { useEffect, useState } from 'react';\nimport { ClassNames, keyframes } from '@emotion/core';\nimport { prefersReducedMotion } from '../utils/accessibility';\nimport { largeDurationMs } from '../utils/durations';\nimport { useSetTimeout } from '../utils/timer-hooks';\nimport { useExitingPersistence } from './exiting-persistence';\nimport { useStaggeredEntrance } from './staggered-entrance';\n\n/**\n * Used to multiply the initial duration for exiting motions.\n */\nconst EXITING_MOTION_MULTIPLIER = 0.5;\n/**\n * This is the base INTERNAL component used for all other entering motions.\n * This does not need Javascript to execute on the client so it will run immediately\n * for any SSR rendered React apps before the JS has executed.\n */\n\nconst EnteringMotion = ({\n children,\n animationTimingFunction,\n enteringAnimation,\n exitingAnimation,\n isPaused,\n onFinish: onFinishMotion,\n duration = largeDurationMs\n}) => {\n const staggered = useStaggeredEntrance();\n const {\n isExiting,\n onFinish: onExitFinished,\n appear\n } = useExitingPersistence();\n const setTimeout = useSetTimeout();\n const paused = isPaused || !staggered.isReady;\n const delay = isExiting ? 0 : staggered.delay;\n const state = isExiting ? 'exiting' : 'entering';\n const [hasAnimationStyles, setHasAnimationStyles] = useState(appear);\n useEffect(() => {\n // Tracking this to prevent changing state on an unmounted component\n let isCancelled = false;\n\n if (paused) {\n return;\n } // On initial mount if elements aren't set to animate on appear, we return early and callback\n\n\n if (!appear) {\n onFinishMotion && onFinishMotion(state);\n return;\n } // Elements may need animation styles back after initial mount (they could animate out)\n\n\n setHasAnimationStyles(true);\n setTimeout(() => {\n if (state === 'exiting') {\n onExitFinished && onExitFinished();\n }\n\n if (!isCancelled) {\n setHasAnimationStyles(false);\n }\n\n onFinishMotion && onFinishMotion(state);\n }, isExiting ? duration * EXITING_MOTION_MULTIPLIER : duration + delay);\n return () => {\n isCancelled = true;\n }; // We ignore this for onFinishMotion as consumers could potentially inline the function\n // which would then trigger this effect every re-render.\n // We want to make it easier for consumers so we go down this path unfortunately.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [onExitFinished, state, isExiting, duration, delay, paused, setTimeout]);\n return /*#__PURE__*/React.createElement(ClassNames, null, ({\n css\n }) => children({\n ref: staggered.ref,\n className: hasAnimationStyles ? css({\n animationName: `${keyframes(isExiting ? exitingAnimation || enteringAnimation : enteringAnimation)}`,\n animationTimingFunction: animationTimingFunction(state),\n animationDelay: `${delay}ms`,\n animationFillMode: isExiting ? 'forwards' : 'backwards',\n animationDuration: `${isExiting ? duration * EXITING_MOTION_MULTIPLIER : duration}ms`,\n animationPlayState: paused ? 'paused' : 'running',\n ...prefersReducedMotion()\n }) : ''\n }, state));\n};\n\nexport default EnteringMotion;","/**\n * Think of this as the motion equivalent of the @atlaskit/theme `grid()`.\n */\nexport const durationStep = 25;\nexport const smallDurationMs = durationStep * 4;\nexport const mediumDurationMs = durationStep * 14;\nexport const largeDurationMs = durationStep * 28;","import { useRef } from 'react';\n/**\n * Will return a unique id that does not change between renders.\n * Try not use this to render DOM markup (attributes or otherwise)\n * as you will probably not get the same result on the Server vs. Client.\n */\n\nexport function useUniqueId() {\n const identifier = useRef('');\n\n if (!identifier.current) {\n identifier.current = '_' + (Number(String(Math.random()).slice(2)) + Date.now() + Math.round(performance.now())).toString(36);\n }\n\n return identifier.current;\n}","import _extends from \"@babel/runtime/helpers/extends\";\nimport React from 'react';\nimport { easeInOut } from '../utils/curves';\nimport { largeDurationMs } from '../utils/durations';\nimport KeyframesMotion from './keyframes-motion';\nconst directionMotions = {\n proportional: {\n bottom: 'translate3d(0, calc(5% + 4px), 0)',\n left: 'translate3d(calc(-5% - 4px), 0, 0)',\n right: 'translate3d(calc(5% + 4px), 0, 0)',\n top: 'translate3d(0, calc(-5% - 4px), 0)'\n },\n constant: {\n bottom: 'translate3d(0, 4px, 0)',\n left: 'translate3d(-4px, 0, 0)',\n right: 'translate3d(4px, 0, 0)',\n top: 'translate3d(0, -4px, 0)'\n }\n};\nconst invertedDirection = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n};\nexport const fadeInAnimation = (direction, distance = 'proportional') => {\n return {\n from: {\n opacity: 0,\n ...(direction !== undefined && {\n transform: directionMotions[distance][direction]\n })\n },\n '50%': {\n opacity: 1\n },\n to: {\n transform: direction !== undefined ? 'none' : undefined\n }\n };\n};\nexport const fadeOutAnimation = (direction, distance = 'proportional') => ({\n from: {\n opacity: 1,\n transform: direction !== undefined ? 'translate3d(0, 0, 0)' : undefined\n },\n to: {\n opacity: 0,\n ...(direction !== undefined && {\n transform: directionMotions[distance][direction]\n })\n }\n});\n/**\n * Props for controlling the behavior of the FadeIn animation\n */\n\nconst FadeIn = ({\n children,\n duration = largeDurationMs,\n entranceDirection,\n exitDirection,\n distance = 'proportional',\n ...props\n}) => {\n const invertedEntranceDirection = entranceDirection && invertedDirection[entranceDirection];\n return /*#__PURE__*/React.createElement(KeyframesMotion, _extends({\n duration: duration,\n enteringAnimation: fadeInAnimation(entranceDirection, distance),\n exitingAnimation: fadeOutAnimation(exitDirection || invertedEntranceDirection, distance),\n animationTimingFunction: () => easeInOut\n }, props), children);\n};\n\nexport default FadeIn;","export const easeInOut = 'cubic-bezier(0.15,1,0.3,1)';\nexport const easeOut = 'cubic-bezier(0.2,0,0,1)';\nexport const easeIn = 'cubic-bezier(0.8,0,0,0.8)';","let delayId = null;\nexport function clearScheduled() {\n if (delayId != null) {\n window.clearTimeout(delayId);\n delayId = null;\n }\n}\nexport function scheduleTimeout(fn, delay) {\n clearScheduled();\n delayId = window.setTimeout(() => {\n delayId = null;\n fn();\n }, delay);\n}","import { clearScheduled, scheduleTimeout } from './shared-schedule'; // This file is a singleton for managing tooltips\n\nlet active = null;\nexport function show(entry) {\n let phase = 'waiting-to-show';\n\n function isActive() {\n return Boolean(active && active.entry === entry);\n }\n\n function cleanup() {\n if (isActive()) {\n clearScheduled();\n active = null;\n }\n }\n\n function done() {\n if (isActive()) {\n entry.done();\n }\n\n phase = 'done';\n cleanup();\n }\n\n function immediatelyHideAndDone() {\n if (isActive()) {\n entry.hide({\n isImmediate: true\n });\n }\n\n done();\n }\n\n function keep() {\n if (!isActive()) {\n return;\n } // aborting a wait to hide\n\n\n if (phase === 'waiting-to-hide') {\n phase = 'shown';\n clearScheduled();\n return;\n } // aborting hide animation\n\n\n if (phase === 'hide-animating') {\n phase = 'shown';\n clearScheduled();\n entry.show({\n isImmediate: false\n });\n return;\n }\n }\n\n function requestHide({\n isImmediate\n }) {\n if (!isActive()) {\n return;\n } // If we were not showing yet anyway; finish straight away\n\n\n if (phase === 'waiting-to-show') {\n immediatelyHideAndDone();\n return;\n } // already waiting to hide\n\n\n if (phase === 'waiting-to-hide') {\n return;\n }\n\n if (isImmediate) {\n immediatelyHideAndDone();\n return;\n }\n\n phase = 'waiting-to-hide';\n scheduleTimeout(() => {\n phase = 'hide-animating';\n entry.hide({\n isImmediate: false\n });\n }, entry.delay);\n }\n\n function finishHideAnimation() {\n if (isActive() && phase === 'hide-animating') {\n done();\n }\n }\n\n function isVisible() {\n return phase === 'shown' || phase === 'waiting-to-hide' || phase === 'hide-animating';\n }\n\n function getInitialMouse() {\n if (entry.source.type === 'mouse') {\n return entry.source.mouse;\n }\n\n return null;\n }\n\n function start() {\n const showImmediately = Boolean(active && active.isVisible()); // If there was an active tooltip; we tell it to remove itself at once!\n\n if (active) {\n clearScheduled();\n active.entry.hide({\n isImmediate: true\n });\n active.entry.done();\n active = null;\n } // this tooltip is now the active tooltip\n\n\n active = {\n entry,\n isVisible\n };\n\n function show() {\n phase = 'shown';\n entry.show({\n isImmediate: showImmediately\n });\n }\n\n if (showImmediately) {\n show();\n return;\n }\n\n phase = 'waiting-to-show';\n scheduleTimeout(show, entry.delay);\n } // let's get started!\n\n\n start();\n const result = {\n keep,\n abort: cleanup,\n isActive,\n requestHide,\n finishHideAnimation,\n getInitialMouse\n };\n return result;\n}","import { CHANNEL, DEFAULT_THEME_MODE, THEME_MODES } from '../constants';\n// Resolves the different types of theme objects in the current API\nexport default function getTheme(props) {\n if (props && props.theme) {\n // Theme is the global Atlaskit theme\n if (CHANNEL in props.theme) {\n return props.theme[CHANNEL];\n } // User has provided alternative modes\n else if ('mode' in props.theme && THEME_MODES.includes(props.theme.mode)) {\n return props.theme;\n }\n } // If format not supported (or no theme provided), return standard theme\n\n\n return {\n mode: DEFAULT_THEME_MODE\n };\n}","/* eslint-disable prefer-rest-params */\nimport getTheme from './get-theme';\n\n// Unpack custom variants, and get correct value for the current theme\nfunction themedVariants(variantProp, variants) {\n return props => {\n const theme = getTheme(props);\n\n if (props && props[variantProp] && variants) {\n const modes = variants[props[variantProp]];\n\n if (modes && modes[theme.mode]) {\n const value = modes[theme.mode];\n\n if (value) {\n return value;\n } // TS believes value can be undefined\n\n }\n }\n\n return '';\n };\n}\n\nexport default function themed(modesOrVariant, variantModes) {\n if (typeof modesOrVariant === 'string') {\n return themedVariants(modesOrVariant, variantModes);\n }\n\n const modes = modesOrVariant;\n return props => {\n // Get theme from the user's props\n const theme = getTheme(props); // User isn't required to provide both light and dark values\n\n if (theme.mode in modes) {\n const value = modes[theme.mode]; // TS believes value can be undefined\n\n if (value) {\n return value;\n }\n }\n\n return '';\n };\n}","/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */\nimport themed from './utils/themed'; // Reds\n\nexport const R50 = '#FFEBE6';\nexport const R75 = '#FFBDAD';\nexport const R100 = '#FF8F73';\nexport const R200 = '#FF7452';\nexport const R300 = '#FF5630';\nexport const R400 = '#DE350B';\nexport const R500 = '#BF2600'; // Yellows\n\nexport const Y50 = '#FFFAE6';\nexport const Y75 = '#FFF0B3';\nexport const Y100 = '#FFE380';\nexport const Y200 = '#FFC400';\nexport const Y300 = '#FFAB00';\nexport const Y400 = '#FF991F';\nexport const Y500 = '#FF8B00'; // Greens\n\nexport const G50 = '#E3FCEF';\nexport const G75 = '#ABF5D1';\nexport const G100 = '#79F2C0';\nexport const G200 = '#57D9A3';\nexport const G300 = '#36B37E';\nexport const G400 = '#00875A';\nexport const G500 = '#006644'; // Blues\n\nexport const B50 = '#DEEBFF';\nexport const B75 = '#B3D4FF';\nexport const B100 = '#4C9AFF';\nexport const B200 = '#2684FF';\nexport const B300 = '#0065FF';\nexport const B400 = '#0052CC';\nexport const B500 = '#0747A6'; // Purples\n\nexport const P50 = '#EAE6FF';\nexport const P75 = '#C0B6F2';\nexport const P100 = '#998DD9';\nexport const P200 = '#8777D9';\nexport const P300 = '#6554C0';\nexport const P400 = '#5243AA';\nexport const P500 = '#403294'; // Teals\n\nexport const T50 = '#E6FCFF';\nexport const T75 = '#B3F5FF';\nexport const T100 = '#79E2F2';\nexport const T200 = '#00C7E6';\nexport const T300 = '#00B8D9';\nexport const T400 = '#00A3BF';\nexport const T500 = '#008DA6'; // Neutrals\n\nexport const N0 = '#FFFFFF';\nexport const N10 = '#FAFBFC';\nexport const N20 = '#F4F5F7';\nexport const N30 = '#EBECF0';\nexport const N40 = '#DFE1E6';\nexport const N50 = '#C1C7D0';\nexport const N60 = '#B3BAC5';\nexport const N70 = '#A5ADBA';\nexport const N80 = '#97A0AF';\nexport const N90 = '#8993A4';\nexport const N100 = '#7A869A';\nexport const N200 = '#6B778C';\nexport const N300 = '#5E6C84';\nexport const N400 = '#505F79';\nexport const N500 = '#42526E';\nexport const N600 = '#344563';\nexport const N700 = '#253858';\nexport const N800 = '#172B4D'; // ATTENTION: update the tints if you update this\n\nexport const N900 = '#091E42'; // Each tint is made of N900 and an alpha channel\n\nexport const N10A = 'rgba(9, 30, 66, 0.02)';\nexport const N20A = 'rgba(9, 30, 66, 0.04)';\nexport const N30A = 'rgba(9, 30, 66, 0.08)';\nexport const N40A = 'rgba(9, 30, 66, 0.13)';\nexport const N50A = 'rgba(9, 30, 66, 0.25)';\nexport const N60A = 'rgba(9, 30, 66, 0.31)';\nexport const N70A = 'rgba(9, 30, 66, 0.36)';\nexport const N80A = 'rgba(9, 30, 66, 0.42)';\nexport const N90A = 'rgba(9, 30, 66, 0.48)';\nexport const N100A = 'rgba(9, 30, 66, 0.54)';\nexport const N200A = 'rgba(9, 30, 66, 0.60)';\nexport const N300A = 'rgba(9, 30, 66, 0.66)';\nexport const N400A = 'rgba(9, 30, 66, 0.71)';\nexport const N500A = 'rgba(9, 30, 66, 0.77)';\nexport const N600A = 'rgba(9, 30, 66, 0.82)';\nexport const N700A = 'rgba(9, 30, 66, 0.89)';\nexport const N800A = 'rgba(9, 30, 66, 0.95)'; // Dark Mode Neutrals\n\nexport const DN900 = '#E6EDFA';\nexport const DN800 = '#DCE5F5';\nexport const DN700 = '#CED9EB';\nexport const DN600 = '#B8C7E0';\nexport const DN500 = '#ABBBD6';\nexport const DN400 = '#9FB0CC';\nexport const DN300 = '#8C9CB8';\nexport const DN200 = '#7988A3';\nexport const DN100 = '#67758F';\nexport const DN90 = '#56637A';\nexport const DN80 = '#455166';\nexport const DN70 = '#3B475C';\nexport const DN60 = '#313D52';\nexport const DN50 = '#283447';\nexport const DN40 = '#202B3D';\nexport const DN30 = '#1B2638';\nexport const DN20 = '#121A29';\nexport const DN10 = '#0E1624'; // ATTENTION: update the tints if you update this\n\nexport const DN0 = '#0D1424'; // Each dark tint is made of DN0 and an alpha channel\n\nexport const DN800A = 'rgba(13, 20, 36, 0.06)';\nexport const DN700A = 'rgba(13, 20, 36, 0.14)';\nexport const DN600A = 'rgba(13, 20, 36, 0.18)';\nexport const DN500A = 'rgba(13, 20, 36, 0.29)';\nexport const DN400A = 'rgba(13, 20, 36, 0.36)';\nexport const DN300A = 'rgba(13, 20, 36, 0.40)';\nexport const DN200A = 'rgba(13, 20, 36, 0.47)';\nexport const DN100A = 'rgba(13, 20, 36, 0.53)';\nexport const DN90A = 'rgba(13, 20, 36, 0.63)';\nexport const DN80A = 'rgba(13, 20, 36, 0.73)';\nexport const DN70A = 'rgba(13, 20, 36, 0.78)';\nexport const DN60A = 'rgba(13, 20, 36, 0.81)';\nexport const DN50A = 'rgba(13, 20, 36, 0.85)';\nexport const DN40A = 'rgba(13, 20, 36, 0.89)';\nexport const DN30A = 'rgba(13, 20, 36, 0.92)';\nexport const DN20A = 'rgba(13, 20, 36, 0.95)';\nexport const DN10A = 'rgba(13, 20, 36, 0.97)'; // Themed colors\n\nexport const background = themed({\n light: `var(--ds-surface, ${N0})`,\n dark: `var(--ds-surface, ${DN30})`\n});\nexport const backgroundActive = themed({\n light: `var(--ds-background-selected, ${B50})`,\n dark: `var(--ds-background-selected, ${B75})`\n});\nexport const backgroundHover = themed({\n light: `var(--ds-background-neutral-hovered, ${N30})`,\n dark: `var(--ds-background-neutral-hovered, ${DN70})`\n});\nexport const backgroundOnLayer = themed({\n light: `var(--ds-surface-overlay, ${N0})`,\n dark: `var(--ds-surface-overlay, ${DN50})`\n});\nexport const text = themed({\n light: `var(--ds-text, ${N900})`,\n dark: `var(--ds-text, ${DN600})`\n});\nexport const textHover = themed({\n light: `var(--ds-text, ${N800})`,\n dark: `var(--ds-text, ${DN600})`\n});\nexport const textActive = themed({\n light: `var(--ds-text-selected, ${B400})`,\n dark: `var(--ds-text-selected, ${B400})`\n});\nexport const subtleText = themed({\n light: `var(--ds-text-subtlest, ${N200})`,\n dark: `var(--ds-text-subtlest, ${DN300})`\n});\nexport const placeholderText = themed({\n light: `var(--ds-text-subtlest, ${N100})`,\n dark: `var(--ds-text-subtlest, ${DN200})`\n});\nexport const heading = themed({\n light: `var(--ds-text, ${N800})`,\n dark: `var(--ds-text, ${DN600})`\n});\nexport const subtleHeading = themed({\n light: `var(--ds-text-subtlest, ${N200})`,\n dark: `var(--ds-text-subtlest, ${DN300})`\n});\nexport const codeBlock = themed({\n light: N20,\n dark: DN50\n});\nexport const link = themed({\n light: `var(--ds-link, ${B400})`,\n dark: `var(--ds-link, ${B100})`\n});\nexport const linkHover = themed({\n light: `var(--ds-link-pressed, ${B300})`,\n dark: `var(--ds-link-pressed, ${B200})`\n});\nexport const linkActive = themed({\n light: `var(--ds-link-pressed, ${B500})`,\n dark: `var(--ds-link-pressed, ${B100})`\n});\nexport const linkOutline = themed({\n light: `var(--ds-border-focused, ${B100})`,\n dark: `var(--ds-border-focused, ${B200})`\n});\nexport const primary = themed({\n light: `var(--ds-background-brand-bold, ${B400})`,\n dark: `var(--ds-background-brand-bold, ${B100})`\n});\nexport const blue = themed({\n light: B400,\n dark: B100\n});\nexport const teal = themed({\n light: T300,\n dark: T200\n});\nexport const purple = themed({\n light: P300,\n dark: P100\n});\nexport const red = themed({\n light: R300,\n dark: R300\n});\nexport const yellow = themed({\n light: Y300,\n dark: Y300\n});\nexport const green = themed({\n light: G300,\n dark: G300\n});\nexport const skeleton = () => `var(--ds-skeleton, ${N20A})`;","import { createTheme } from '../utils/create-theme'; // Create default global light theme\n\nconst {\n Provider,\n Consumer,\n useTheme\n} = createTheme(() => ({\n mode: 'light'\n}));\nexport { useTheme as useGlobalTheme };\nexport default {\n Provider,\n Consumer\n};","import React, { createContext, useCallback, useContext } from 'react';\n\n/**\n * createTheme is used to create a set of Providers and Consumers for theming components.\n * - Takes a default theme function; this theme function gets a set of props, and returns tokens\n * based on those props. An example of this default theme function is one that produces the standard\n * appearance of the component\n * - Returns three things - a Provider that allow for additional themes to be applied, a Consumer\n * that can get the current theme and fetch it, and a custom hook - useTheme which provides an alternate (although functionally the same) API\n * to the Consumer.\n */\nexport function createTheme(defaultGetTokens) {\n const emptyThemeFn = (getTokens, props) => getTokens(props);\n /**\n * Internally, Theme uses React Context, with internal providers and consumers.\n * The React Context passes only a function that gets props, and turns them into tokens. This\n * function gets mixed as more Providers with their own themes are added. This mixed function\n * is ultimately picked up by Consumers, which implement a context consumer internally to fetch\n * the theme.\n */\n\n\n const ThemeContext = /*#__PURE__*/createContext(defaultGetTokens);\n\n function useTheme(themeProps) {\n const theme = useContext(ThemeContext);\n const themeFn = theme || emptyThemeFn;\n const tokens = themeFn(themeProps);\n return tokens;\n } // The Theme Consumer takes a function as its child - this function takes tokens, and the\n // return value is generally a set of nodes with the tokens applied appropriately.\n\n\n function Consumer(props) {\n const {\n children,\n ...themeProps\n } = props; // @ts-ignore See issue for more info: https://github.com/Microsoft/TypeScript/issues/10727\n // Argument of type 'Pick ReactNode; }, Exclude>' is not assignable to parameter of type 'ThemeProps'.ts(2345)\n\n const tokens = useTheme(themeProps); // We add a fragment to ensure we don't break people upgrading.\n // Previously they may have been able to pass in undefined without things blowing up.\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, children(tokens));\n }\n /**\n * The Theme Provider takes regular nodes as its children, but also takes a *theme function*\n * - The theme function takes a set of props, as well as a function (getTokens) that can turn props into tokens.\n * - The getTokens function isn't called immediately - instead the props are passed\n * through a mix of parent theming functions\n * Children of this provider will receive this mixed theme\n */\n\n\n function Provider(props) {\n const themeFn = useContext(ThemeContext);\n const valueFn = props.value || emptyThemeFn;\n const mixedFn = useCallback(themeProps => valueFn(themeFn, themeProps), [themeFn, valueFn]);\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: mixedFn\n }, props.children);\n }\n\n return {\n Consumer,\n Provider,\n useTheme\n };\n}","/** @jsx jsx */\nimport { forwardRef } from 'react';\nimport { css, jsx } from '@emotion/core';\nimport { DN0, DN600, N0, N800 } from '@atlaskit/theme/colors';\nimport GlobalTheme from '@atlaskit/theme/components';\nimport { borderRadius } from '@atlaskit/theme/constants';\nimport TooltipPrimitive from './TooltipPrimitive';\nconst baseStyles = css({\n boxSizing: 'border-box',\n maxWidth: '240px',\n padding: '2px 6px',\n top: 0,\n left: 0,\n borderRadius: `${borderRadius()}px`,\n fontSize: '12px',\n lineHeight: 1.3,\n overflowWrap: 'break-word',\n wordWrap: 'break-word'\n});\nconst truncateStyles = css({\n maxWidth: '420px',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n});\nconst lightStyles = css({\n backgroundColor: `var(--ds-background-neutral-bold, ${N800})`,\n color: `var(--ds-text-inverse, ${N0})`\n});\nconst darkStyles = css({\n backgroundColor: `var(--ds-background-neutral-bold, ${DN0})`,\n color: `var(--ds-text-inverse, ${DN600})`\n});\nconst TooltipContainer = /*#__PURE__*/forwardRef(function TooltipContainer({\n style,\n className,\n children,\n truncate,\n placement,\n testId,\n onMouseOut,\n onMouseOver,\n id\n}, ref) {\n return jsx(GlobalTheme.Consumer, null, ({\n mode\n }) => // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events\n jsx(TooltipPrimitive, {\n ref: ref,\n style: style,\n className: className,\n placement: placement,\n testId: testId,\n id: id,\n onMouseOut: onMouseOut,\n onMouseOver: onMouseOver,\n css: [baseStyles, truncate ? truncateStyles : null, mode === 'light' ? lightStyles : darkStyles]\n }, children));\n});\nTooltipContainer.displayName = 'TooltipContainer';\nexport default TooltipContainer;","export function getMousePosition(mouseCoordinates) {\n const safeMouse = mouseCoordinates || {\n top: 0,\n left: 0\n };\n\n const getBoundingClientRect = () => ({\n top: safeMouse.top,\n left: safeMouse.left,\n bottom: safeMouse.top,\n right: safeMouse.left,\n width: 0,\n height: 0\n });\n\n return {\n getBoundingClientRect,\n clientWidth: 0,\n clientHeight: 0\n };\n}","import _extends from \"@babel/runtime/helpers/extends\";\n\n/** @jsx jsx */\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { jsx } from '@emotion/core';\nimport { bind } from 'bind-event-listener';\nimport { usePlatformLeafSyntheticEventHandler } from '@atlaskit/analytics-next';\nimport useCloseOnEscapePress from '@atlaskit/ds-lib/use-close-on-escape-press';\nimport { ExitingPersistence, FadeIn } from '@atlaskit/motion';\nimport { mediumDurationMs } from '@atlaskit/motion/durations';\nimport { Popper } from '@atlaskit/popper';\nimport Portal from '@atlaskit/portal';\nimport { layers } from '@atlaskit/theme/constants';\nimport { show } from './internal/tooltip-manager';\nimport useUniqueId from './internal/use-unique-id';\nimport TooltipContainer from './TooltipContainer';\nimport { getMousePosition } from './utilities';\nconst tooltipZIndex = layers.tooltip();\nconst analyticsAttributes = {\n componentName: 'tooltip',\n packageName: \"@atlaskit/tooltip\",\n packageVersion: \"17.5.13\"\n};\n\nfunction noop() {} // Inverts motion direction\n\n\nconst invertedDirection = {\n top: 'bottom',\n bottom: 'top',\n left: 'right',\n right: 'left'\n};\n/**\n * Converts a Popper placement to it's general direction.\n *\n * @param position - Popper Placement value, e.g. 'top-start'\n * @returns Popper Direction, e.g. 'top'\n */\n\nconst getDirectionFromPlacement = placement => placement.split('-')[0];\n\nfunction Tooltip({\n children,\n position = 'bottom',\n mousePosition = 'bottom',\n content,\n truncate = false,\n component: Container = TooltipContainer,\n tag: TargetContainer = 'div',\n testId,\n delay = 300,\n onShow = noop,\n onHide = noop,\n hideTooltipOnClick = false,\n hideTooltipOnMouseDown = false,\n analyticsContext,\n strategy = 'fixed'\n}) {\n const tooltipPosition = position === 'mouse' ? mousePosition : position;\n const onShowHandler = usePlatformLeafSyntheticEventHandler({\n fn: onShow,\n action: 'displayed',\n analyticsData: analyticsContext,\n ...analyticsAttributes\n });\n const onHideHandler = usePlatformLeafSyntheticEventHandler({\n fn: onHide,\n action: 'hidden',\n analyticsData: analyticsContext,\n ...analyticsAttributes\n });\n const apiRef = useRef(null);\n const [state, setState] = useState('hide');\n const targetRef = useRef(null);\n const containerRef = useRef(null);\n const setRef = useCallback(node => {\n if (!node) {\n return;\n }\n\n if (typeof children === 'function') {\n // @ts-ignore - React Ref typing is too strict for this use case\n targetRef.current = node;\n } else {\n // @ts-ignore - React Ref typing is too strict for this use case\n containerRef.current = node; // @ts-ignore - React Ref typing is too strict for this use case\n\n targetRef.current = node.firstChild;\n }\n }, [children]); // Putting a few things into refs so that we don't have to break memoization\n\n const lastState = useRef(state);\n const lastDelay = useRef(delay);\n const lastHandlers = useRef({\n onShowHandler,\n onHideHandler\n });\n const hasCalledShowHandler = useRef(false);\n useEffect(() => {\n lastState.current = state;\n lastDelay.current = delay;\n lastHandlers.current = {\n onShowHandler,\n onHideHandler\n };\n }, [delay, onHideHandler, onShowHandler, state]);\n const start = useCallback(api => {\n // @ts-ignore\n apiRef.current = api;\n hasCalledShowHandler.current = false;\n }, []);\n const done = useCallback(() => {\n if (!apiRef.current) {\n return;\n } // Only call onHideHandler if we have called onShowHandler\n\n\n if (hasCalledShowHandler.current) {\n lastHandlers.current.onHideHandler();\n } // @ts-ignore\n\n\n apiRef.current = null; // @ts-ignore\n\n hasCalledShowHandler.current = false; // just in case\n\n setState('hide');\n }, []);\n const abort = useCallback(() => {\n if (!apiRef.current) {\n return;\n }\n\n apiRef.current.abort(); // Only call onHideHandler if we have called onShowHandler\n\n if (hasCalledShowHandler.current) {\n lastHandlers.current.onHideHandler();\n } // @ts-ignore\n\n\n apiRef.current = null;\n }, []);\n useEffect(function mount() {\n return function unmount() {\n if (apiRef.current) {\n abort();\n }\n };\n }, [abort]);\n const showTooltip = useCallback(source => {\n if (apiRef.current && !apiRef.current.isActive()) {\n abort();\n } // Tell the tooltip to keep showing\n\n\n if (apiRef.current && apiRef.current.isActive()) {\n apiRef.current.keep();\n return;\n }\n\n const entry = {\n source,\n delay: lastDelay.current,\n show: ({\n isImmediate\n }) => {\n // Call the onShow handler if it hasn't been called yet\n if (!hasCalledShowHandler.current) {\n hasCalledShowHandler.current = true;\n lastHandlers.current.onShowHandler();\n }\n\n setState(isImmediate ? 'show-immediate' : 'fade-in');\n },\n hide: ({\n isImmediate\n }) => {\n if (isImmediate) {\n setState('hide');\n } else {\n setState('before-fade-out');\n }\n },\n done: done\n };\n const api = show(entry);\n start(api);\n }, [abort, done, start]);\n const hideTooltipOnEsc = useCallback(() => {\n var _apiRef$current;\n\n (_apiRef$current = apiRef.current) === null || _apiRef$current === void 0 ? void 0 : _apiRef$current.requestHide({\n isImmediate: true\n });\n }, [apiRef]);\n useCloseOnEscapePress({\n onClose: hideTooltipOnEsc,\n isDisabled: state === 'hide' || state === 'fade-out'\n });\n useEffect(() => {\n if (state === 'hide') {\n return noop;\n }\n\n if (state === 'before-fade-out') {\n setState('fade-out');\n }\n\n const unbind = bind(window, {\n type: 'scroll',\n listener: () => {\n if (apiRef.current) {\n apiRef.current.requestHide({\n isImmediate: true\n });\n }\n },\n options: {\n capture: true,\n passive: true,\n once: true\n }\n });\n return unbind;\n }, [state]);\n const onMouseDown = useCallback(() => {\n if (hideTooltipOnMouseDown && apiRef.current) {\n apiRef.current.requestHide({\n isImmediate: true\n });\n }\n }, [hideTooltipOnMouseDown]);\n const onClick = useCallback(() => {\n if (hideTooltipOnClick && apiRef.current) {\n apiRef.current.requestHide({\n isImmediate: true\n });\n }\n }, [hideTooltipOnClick]); // Ideally we would be using onMouseEnter here, but\n // because we are binding the event to the target parent\n // we need to listen for the mouseover of all sub elements\n // This means when moving along a tooltip we are quickly toggling\n // between api.requestHide and api.keep. This it not ideal\n\n const onMouseOver = useCallback(event => {\n // Ignoring events from the container ref\n if (containerRef.current && event.target === containerRef.current) {\n return;\n } // Using prevent default as a signal that parent tooltips\n\n\n if (event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n const source = position === 'mouse' ? {\n type: 'mouse',\n // TODO: ideally not recalculating this object each time\n mouse: getMousePosition({\n left: event.clientX,\n top: event.clientY\n })\n } : {\n type: 'keyboard'\n };\n showTooltip(source);\n }, [position, showTooltip]); // Ideally we would be using onMouseEnter here, but\n // because we are binding the event to the target parent\n // we need to listen for the mouseout of all sub elements\n // This means when moving along a tooltip we are quickly toggling\n // between api.requestHide and api.keep. This it not ideal\n\n const onMouseOut = useCallback(event => {\n // Ignoring events from the container ref\n if (containerRef.current && event.target === containerRef.current) {\n return;\n } // Using prevent default as a signal that parent tooltips\n\n\n if (event.defaultPrevented) {\n return;\n }\n\n event.preventDefault();\n\n if (apiRef.current) {\n apiRef.current.requestHide({\n isImmediate: false\n });\n }\n }, []);\n const onMouseOverTooltip = useCallback(() => {\n if (apiRef.current && apiRef.current.isActive()) {\n apiRef.current.keep();\n return;\n }\n }, []);\n const onFocus = useCallback(() => {\n showTooltip({\n type: 'keyboard'\n });\n }, [showTooltip]);\n const onBlur = useCallback(() => {\n if (apiRef.current) {\n apiRef.current.requestHide({\n isImmediate: false\n });\n }\n }, []);\n const onAnimationFinished = useCallback(transition => {\n // Using lastState here because motion is not picking up the latest value\n if (transition === 'exiting' && lastState.current === 'fade-out' && apiRef.current) {\n // @ts-ignore: refs are writeable\n apiRef.current.finishHideAnimation();\n }\n }, []); // Doing a cast because typescript is struggling to narrow the type\n\n const CastTargetContainer = TargetContainer;\n const shouldRenderTooltipContainer = state !== 'hide' && Boolean(content);\n const shouldRenderTooltipChildren = state !== 'hide' && state !== 'fade-out';\n\n const getReferenceElement = () => {\n // Use the initial mouse position if appropriate, or the target element\n const api = apiRef.current;\n const initialMouse = api ? api.getInitialMouse() : null;\n\n if (position === 'mouse' && initialMouse) {\n return initialMouse;\n }\n\n return targetRef.current || undefined;\n };\n\n const tooltipId = useUniqueId('tooltip', shouldRenderTooltipContainer);\n const tooltipTriggerProps = {\n onMouseOver,\n onMouseOut,\n onClick,\n onMouseDown,\n onFocus,\n onBlur,\n ref: setRef,\n 'aria-describedby': tooltipId,\n 'data-testid': testId ? `${testId}--container` : undefined\n };\n return jsx(React.Fragment, null, typeof children === 'function' ? children(tooltipTriggerProps) : jsx(CastTargetContainer, _extends({}, tooltipTriggerProps, {\n role: \"presentation\"\n }), children), shouldRenderTooltipContainer ? jsx(Portal, {\n zIndex: tooltipZIndex\n }, jsx(Popper, {\n placement: tooltipPosition,\n referenceElement: getReferenceElement(),\n strategy: strategy\n }, ({\n ref,\n style,\n update,\n placement\n }) => {\n // Invert the entrance and exit directions.\n // E.g. a tooltip's position is on the 'right', it should enter from and exit to the 'left'\n // This gives the effect the tooltip is appearing from the target\n const direction = position === 'mouse' ? undefined : invertedDirection[getDirectionFromPlacement(placement)];\n return jsx(ExitingPersistence, {\n appear: true\n }, shouldRenderTooltipChildren && jsx(FadeIn, {\n distance: \"constant\",\n entranceDirection: direction,\n exitDirection: direction,\n onFinish: onAnimationFinished,\n duration: state === 'show-immediate' ? 0 : mediumDurationMs\n }, ({\n className\n }) => // eslint-disable-next-line jsx-a11y/mouse-events-have-key-events\n jsx(Container, {\n ref: ref,\n className: `Tooltip ${className}`,\n style: style,\n truncate: truncate,\n placement: tooltipPosition,\n testId: testId,\n onMouseOut: onMouseOut,\n onMouseOver: onMouseOverTooltip,\n id: tooltipId\n }, typeof content === 'function' ? content({\n update\n }) : content)));\n })) : null);\n}\n\nTooltip.displayName = 'Tooltip';\nexport default Tooltip;","import { useUIDSeed } from 'react-uid';\nexport default function useUniqueId(prefix, shouldRenderId) {\n const seed = useUIDSeed();\n return shouldRenderId ? `${seed(prefix)}` : undefined;\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***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nexport { __assign, __read, __rest, __spreadArray, __values };\n","var STATE_DELIMITER = '.';\nvar EMPTY_ACTIVITY_MAP = {};\nvar DEFAULT_GUARD_TYPE = 'xstate.guard';\nvar TARGETLESS_KEY = '';\n\nexport { DEFAULT_GUARD_TYPE, EMPTY_ACTIVITY_MAP, STATE_DELIMITER, TARGETLESS_KEY };\n","import { __spreadArray, __read, __values, __assign } from './_virtual/_tslib.js';\nimport { DEFAULT_GUARD_TYPE, TARGETLESS_KEY, STATE_DELIMITER } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar _a;\nfunction keys(value) {\n return Object.keys(value);\n}\nfunction matchesState(parentStateId, childStateId, delimiter) {\n if (delimiter === void 0) {\n delimiter = STATE_DELIMITER;\n }\n\n var parentStateValue = toStateValue(parentStateId, delimiter);\n var childStateValue = toStateValue(childStateId, delimiter);\n\n if (isString(childStateValue)) {\n if (isString(parentStateValue)) {\n return childStateValue === parentStateValue;\n } // Parent more specific than child\n\n\n return false;\n }\n\n if (isString(parentStateValue)) {\n return parentStateValue in childStateValue;\n }\n\n return keys(parentStateValue).every(function (key) {\n if (!(key in childStateValue)) {\n return false;\n }\n\n return matchesState(parentStateValue[key], childStateValue[key]);\n });\n}\nfunction getEventType(event) {\n try {\n return isString(event) || typeof event === 'number' ? \"\".concat(event) : event.type;\n } catch (e) {\n throw new Error('Events must be strings or objects with a string event.type property.');\n }\n}\nfunction toStatePath(stateId, delimiter) {\n try {\n if (isArray(stateId)) {\n return stateId;\n }\n\n return stateId.toString().split(delimiter);\n } catch (e) {\n throw new Error(\"'\".concat(stateId, \"' is not a valid state path.\"));\n }\n}\nfunction isStateLike(state) {\n return typeof state === 'object' && 'value' in state && 'context' in state && 'event' in state && '_event' in state;\n}\nfunction toStateValue(stateValue, delimiter) {\n if (isStateLike(stateValue)) {\n return stateValue.value;\n }\n\n if (isArray(stateValue)) {\n return pathToStateValue(stateValue);\n }\n\n if (typeof stateValue !== 'string') {\n return stateValue;\n }\n\n var statePath = toStatePath(stateValue, delimiter);\n return pathToStateValue(statePath);\n}\nfunction pathToStateValue(statePath) {\n if (statePath.length === 1) {\n return statePath[0];\n }\n\n var value = {};\n var marker = value;\n\n for (var i = 0; i < statePath.length - 1; i++) {\n if (i === statePath.length - 2) {\n marker[statePath[i]] = statePath[i + 1];\n } else {\n marker[statePath[i]] = {};\n marker = marker[statePath[i]];\n }\n }\n\n return value;\n}\nfunction mapValues(collection, iteratee) {\n var result = {};\n var collectionKeys = keys(collection);\n\n for (var i = 0; i < collectionKeys.length; i++) {\n var key = collectionKeys[i];\n result[key] = iteratee(collection[key], key, collection, i);\n }\n\n return result;\n}\nfunction mapFilterValues(collection, iteratee, predicate) {\n var e_1, _a;\n\n var result = {};\n\n try {\n for (var _b = __values(keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var item = collection[key];\n\n if (!predicate(item)) {\n continue;\n }\n\n result[key] = iteratee(item, key, collection);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return result;\n}\n/**\r\n * Retrieves a value at the given path.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nvar path = function (props) {\n return function (object) {\n var e_2, _a;\n\n var result = object;\n\n try {\n for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var prop = props_1_1.value;\n result = result[prop];\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n return result;\n };\n};\n/**\r\n * Retrieves a value at the given path via the nested accessor prop.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nfunction nestedPath(props, accessorProp) {\n return function (object) {\n var e_3, _a;\n\n var result = object;\n\n try {\n for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {\n var prop = props_2_1.value;\n result = result[accessorProp][prop];\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n return result;\n };\n}\nfunction toStatePaths(stateValue) {\n if (!stateValue) {\n return [[]];\n }\n\n if (isString(stateValue)) {\n return [[stateValue]];\n }\n\n var result = flatten(keys(stateValue).map(function (key) {\n var subStateValue = stateValue[key];\n\n if (typeof subStateValue !== 'string' && (!subStateValue || !Object.keys(subStateValue).length)) {\n return [[key]];\n }\n\n return toStatePaths(stateValue[key]).map(function (subPath) {\n return [key].concat(subPath);\n });\n }));\n return result;\n}\nfunction flatten(array) {\n var _a;\n\n return (_a = []).concat.apply(_a, __spreadArray([], __read(array), false));\n}\nfunction toArrayStrict(value) {\n if (isArray(value)) {\n return value;\n }\n\n return [value];\n}\nfunction toArray(value) {\n if (value === undefined) {\n return [];\n }\n\n return toArrayStrict(value);\n}\nfunction mapContext(mapper, context, _event) {\n var e_5, _a;\n\n if (isFunction(mapper)) {\n return mapper(context, _event.data);\n }\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var subMapper = mapper[key];\n\n if (isFunction(subMapper)) {\n result[key] = subMapper(context, _event.data);\n } else {\n result[key] = subMapper;\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return result;\n}\nfunction isBuiltInEvent(eventType) {\n return /^(done|error)\\./.test(eventType);\n}\nfunction isPromiseLike(value) {\n if (value instanceof Promise) {\n return true;\n } // Check if shape matches the Promise/A+ specification for a \"thenable\".\n\n\n if (value !== null && (isFunction(value) || typeof value === 'object') && isFunction(value.then)) {\n return true;\n }\n\n return false;\n}\nfunction isBehavior(value) {\n return value !== null && typeof value === 'object' && 'transition' in value && typeof value.transition === 'function';\n}\nfunction partition(items, predicate) {\n var e_6, _a;\n\n var _b = __read([[], []], 2),\n truthy = _b[0],\n falsy = _b[1];\n\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n\n if (predicate(item)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n return [truthy, falsy];\n}\nfunction updateHistoryStates(hist, stateValue) {\n return mapValues(hist.states, function (subHist, key) {\n if (!subHist) {\n return undefined;\n }\n\n var subStateValue = (isString(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);\n\n if (!subStateValue) {\n return undefined;\n }\n\n return {\n current: subStateValue,\n states: updateHistoryStates(subHist, subStateValue)\n };\n });\n}\nfunction updateHistoryValue(hist, stateValue) {\n return {\n current: stateValue,\n states: updateHistoryStates(hist, stateValue)\n };\n}\nfunction updateContext(context, _event, assignActions, state) {\n if (!IS_PRODUCTION) {\n warn(!!context, 'Attempting to update undefined context');\n }\n\n var updatedContext = context ? assignActions.reduce(function (acc, assignAction) {\n var e_7, _a;\n\n var assignment = assignAction.assignment;\n var meta = {\n state: state,\n action: assignAction,\n _event: _event\n };\n var partialUpdate = {};\n\n if (isFunction(assignment)) {\n partialUpdate = assignment(acc, _event.data, meta);\n } else {\n try {\n for (var _b = __values(keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var propAssignment = assignment[key];\n partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n\n return Object.assign({}, acc, partialUpdate);\n }, context) : context;\n return updatedContext;\n} // tslint:disable-next-line:no-empty\n\nvar warn = function () {};\n\nif (!IS_PRODUCTION) {\n warn = function (condition, message) {\n var error = condition instanceof Error ? condition : undefined;\n\n if (!error && condition) {\n return;\n }\n\n if (console !== undefined) {\n var args = [\"Warning: \".concat(message)];\n\n if (error) {\n args.push(error);\n } // tslint:disable-next-line:no-console\n\n\n console.warn.apply(console, args);\n }\n };\n}\nfunction isArray(value) {\n return Array.isArray(value);\n} // tslint:disable-next-line:ban-types\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isString(value) {\n return typeof value === 'string';\n} // export function memoizedGetter(\n// o: TP,\n// property: string,\n// getter: () => T\n// ): void {\n// Object.defineProperty(o.prototype, property, {\n// get: getter,\n// enumerable: false,\n// configurable: false\n// });\n// }\n\nfunction toGuard(condition, guardMap) {\n if (!condition) {\n return undefined;\n }\n\n if (isString(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition,\n predicate: guardMap ? guardMap[condition] : undefined\n };\n }\n\n if (isFunction(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition.name,\n predicate: condition\n };\n }\n\n return condition;\n}\nfunction isObservable(value) {\n try {\n return 'subscribe' in value && isFunction(value.subscribe);\n } catch (e) {\n return false;\n }\n}\nvar symbolObservable = /*#__PURE__*/function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n}();\nvar interopSymbols = (_a = {}, _a[symbolObservable] = function () {\n return this;\n}, _a);\nfunction isMachine(value) {\n try {\n return '__xstatenode' in value;\n } catch (e) {\n return false;\n }\n}\nfunction isActor(value) {\n return !!value && typeof value.send === 'function';\n}\nvar uniqueId = /*#__PURE__*/function () {\n var currentId = 0;\n return function () {\n currentId++;\n return currentId.toString(16);\n };\n}();\nfunction toEventObject(event, payload // id?: TEvent['type']\n) {\n if (isString(event) || typeof event === 'number') {\n return __assign({\n type: event\n }, payload);\n }\n\n return event;\n}\nfunction toSCXMLEvent(event, scxmlEvent) {\n if (!isString(event) && '$$type' in event && event.$$type === 'scxml') {\n return event;\n }\n\n var eventObject = toEventObject(event);\n return __assign({\n name: eventObject.type,\n data: eventObject,\n $$type: 'scxml',\n type: 'external'\n }, scxmlEvent);\n}\nfunction toTransitionConfigArray(event, configLike) {\n var transitions = toArrayStrict(configLike).map(function (transitionLike) {\n if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string' || isMachine(transitionLike)) {\n return {\n target: transitionLike,\n event: event\n };\n }\n\n return __assign(__assign({}, transitionLike), {\n event: event\n });\n });\n return transitions;\n}\nfunction normalizeTarget(target) {\n if (target === undefined || target === TARGETLESS_KEY) {\n return undefined;\n }\n\n return toArray(target);\n}\nfunction reportUnhandledExceptionOnInvocation(originalError, currentError, id) {\n if (!IS_PRODUCTION) {\n var originalStackTrace = originalError.stack ? \" Stacktrace was '\".concat(originalError.stack, \"'\") : '';\n\n if (originalError === currentError) {\n // tslint:disable-next-line:no-console\n console.error(\"Missing onError handler for invocation '\".concat(id, \"', error was '\").concat(originalError, \"'.\").concat(originalStackTrace));\n } else {\n var stackTrace = currentError.stack ? \" Stacktrace was '\".concat(currentError.stack, \"'\") : ''; // tslint:disable-next-line:no-console\n\n console.error(\"Missing onError handler and/or unhandled exception/promise rejection for invocation '\".concat(id, \"'. \") + \"Original error: '\".concat(originalError, \"'. \").concat(originalStackTrace, \" Current error is '\").concat(currentError, \"'.\").concat(stackTrace));\n }\n }\n}\nfunction evaluateGuard(machine, guard, context, _event, state) {\n var guards = machine.options.guards;\n var guardMeta = {\n state: state,\n cond: guard,\n _event: _event\n }; // TODO: do not hardcode!\n\n if (guard.type === DEFAULT_GUARD_TYPE) {\n return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);\n }\n\n var condFn = guards[guard.type];\n\n if (!condFn) {\n throw new Error(\"Guard '\".concat(guard.type, \"' is not implemented on machine '\").concat(machine.id, \"'.\"));\n }\n\n return condFn(context, _event.data, guardMeta);\n}\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n return {\n type: src\n };\n }\n\n return src;\n}\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n if (typeof nextHandler === 'object') {\n return nextHandler;\n }\n\n var noop = function () {\n return void 0;\n };\n\n return {\n next: nextHandler,\n error: errorHandler || noop,\n complete: completionHandler || noop\n };\n}\nfunction createInvokeId(stateNodeId, index) {\n return \"\".concat(stateNodeId, \":invocation[\").concat(index, \"]\");\n}\n\nexport { createInvokeId, evaluateGuard, flatten, getEventType, interopSymbols, isActor, isArray, isBehavior, isBuiltInEvent, isFunction, isMachine, isObservable, isPromiseLike, isStateLike, isString, keys, mapContext, mapFilterValues, mapValues, matchesState, nestedPath, normalizeTarget, partition, path, pathToStateValue, reportUnhandledExceptionOnInvocation, symbolObservable, toArray, toArrayStrict, toEventObject, toGuard, toInvokeSource, toObserver, toSCXMLEvent, toStatePath, toStatePaths, toStateValue, toTransitionConfigArray, uniqueId, updateContext, updateHistoryStates, updateHistoryValue, warn };\n","import { __values, __spreadArray, __read } from './_virtual/_tslib.js';\nimport { flatten, keys } from './utils.js';\n\nvar isLeafNode = function (stateNode) {\n return stateNode.type === 'atomic' || stateNode.type === 'final';\n};\nfunction getChildren(stateNode) {\n return keys(stateNode.states).map(function (key) {\n return stateNode.states[key];\n });\n}\nfunction getAllStateNodes(stateNode) {\n var stateNodes = [stateNode];\n\n if (isLeafNode(stateNode)) {\n return stateNodes;\n }\n\n return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));\n}\nfunction getConfiguration(prevStateNodes, stateNodes) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d;\n\n var prevConfiguration = new Set(prevStateNodes);\n var prevAdjList = getAdjList(prevConfiguration);\n var configuration = new Set(stateNodes);\n\n try {\n // add all ancestors\n for (var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {\n var s = configuration_1_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n var adjList = getAdjList(configuration);\n\n try {\n // add descendants\n for (var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {\n var s = configuration_2_1.value; // if previously active, add existing child nodes\n\n if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {\n if (prevAdjList.get(s)) {\n prevAdjList.get(s).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n s.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n } else {\n if (s.type === 'parallel') {\n try {\n for (var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var child = _f.value;\n\n if (child.type === 'history') {\n continue;\n }\n\n if (!configuration.has(child)) {\n configuration.add(child);\n\n if (prevAdjList.get(child)) {\n prevAdjList.get(child).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n child.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n }\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n try {\n // add all ancestors\n for (var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {\n var s = configuration_3_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return configuration;\n}\n\nfunction getValueFromAdj(baseNode, adjList) {\n var childStateNodes = adjList.get(baseNode);\n\n if (!childStateNodes) {\n return {}; // todo: fix?\n }\n\n if (baseNode.type === 'compound') {\n var childStateNode = childStateNodes[0];\n\n if (childStateNode) {\n if (isLeafNode(childStateNode)) {\n return childStateNode.key;\n }\n } else {\n return {};\n }\n }\n\n var stateValue = {};\n childStateNodes.forEach(function (csn) {\n stateValue[csn.key] = getValueFromAdj(csn, adjList);\n });\n return stateValue;\n}\n\nfunction getAdjList(configuration) {\n var e_5, _a;\n\n var adjList = new Map();\n\n try {\n for (var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {\n var s = configuration_4_1.value;\n\n if (!adjList.has(s)) {\n adjList.set(s, []);\n }\n\n if (s.parent) {\n if (!adjList.has(s.parent)) {\n adjList.set(s.parent, []);\n }\n\n adjList.get(s.parent).push(s);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return adjList;\n}\nfunction getValue(rootNode, configuration) {\n var config = getConfiguration([rootNode], configuration);\n return getValueFromAdj(rootNode, getAdjList(config));\n}\nfunction has(iterable, item) {\n if (Array.isArray(iterable)) {\n return iterable.some(function (member) {\n return member === item;\n });\n }\n\n if (iterable instanceof Set) {\n return iterable.has(item);\n }\n\n return false; // TODO: fix\n}\nfunction nextEvents(configuration) {\n return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function (sn) {\n return sn.ownEvents;\n })), false)))), false);\n}\nfunction isInFinalState(configuration, stateNode) {\n if (stateNode.type === 'compound') {\n return getChildren(stateNode).some(function (s) {\n return s.type === 'final' && has(configuration, s);\n });\n }\n\n if (stateNode.type === 'parallel') {\n return getChildren(stateNode).every(function (sn) {\n return isInFinalState(configuration, sn);\n });\n }\n\n return false;\n}\nfunction getMeta(configuration) {\n if (configuration === void 0) {\n configuration = [];\n }\n\n return configuration.reduce(function (acc, stateNode) {\n if (stateNode.meta !== undefined) {\n acc[stateNode.id] = stateNode.meta;\n }\n\n return acc;\n }, {});\n}\nfunction getTagsFromConfiguration(configuration) {\n return new Set(flatten(configuration.map(function (sn) {\n return sn.tags;\n })));\n}\n\nexport { getAdjList, getAllStateNodes, getChildren, getConfiguration, getMeta, getTagsFromConfiguration, getValue, has, isInFinalState, isLeafNode, nextEvents };\n","var ActionTypes;\n\n(function (ActionTypes) {\n ActionTypes[\"Start\"] = \"xstate.start\";\n ActionTypes[\"Stop\"] = \"xstate.stop\";\n ActionTypes[\"Raise\"] = \"xstate.raise\";\n ActionTypes[\"Send\"] = \"xstate.send\";\n ActionTypes[\"Cancel\"] = \"xstate.cancel\";\n ActionTypes[\"NullEvent\"] = \"\";\n ActionTypes[\"Assign\"] = \"xstate.assign\";\n ActionTypes[\"After\"] = \"xstate.after\";\n ActionTypes[\"DoneState\"] = \"done.state\";\n ActionTypes[\"DoneInvoke\"] = \"done.invoke\";\n ActionTypes[\"Log\"] = \"xstate.log\";\n ActionTypes[\"Init\"] = \"xstate.init\";\n ActionTypes[\"Invoke\"] = \"xstate.invoke\";\n ActionTypes[\"ErrorExecution\"] = \"error.execution\";\n ActionTypes[\"ErrorCommunication\"] = \"error.communication\";\n ActionTypes[\"ErrorPlatform\"] = \"error.platform\";\n ActionTypes[\"ErrorCustom\"] = \"xstate.error\";\n ActionTypes[\"Update\"] = \"xstate.update\";\n ActionTypes[\"Pure\"] = \"xstate.pure\";\n ActionTypes[\"Choose\"] = \"xstate.choose\";\n})(ActionTypes || (ActionTypes = {}));\n\nvar SpecialTargets;\n\n(function (SpecialTargets) {\n SpecialTargets[\"Parent\"] = \"#_parent\";\n SpecialTargets[\"Internal\"] = \"#_internal\";\n})(SpecialTargets || (SpecialTargets = {}));\n\nexport { ActionTypes, SpecialTargets };\n","import { ActionTypes } from './types.js';\n\nvar start = ActionTypes.Start;\nvar stop = ActionTypes.Stop;\nvar raise = ActionTypes.Raise;\nvar send = ActionTypes.Send;\nvar cancel = ActionTypes.Cancel;\nvar nullEvent = ActionTypes.NullEvent;\nvar assign = ActionTypes.Assign;\nvar after = ActionTypes.After;\nvar doneState = ActionTypes.DoneState;\nvar log = ActionTypes.Log;\nvar init = ActionTypes.Init;\nvar invoke = ActionTypes.Invoke;\nvar errorExecution = ActionTypes.ErrorExecution;\nvar errorPlatform = ActionTypes.ErrorPlatform;\nvar error = ActionTypes.ErrorCustom;\nvar update = ActionTypes.Update;\nvar choose = ActionTypes.Choose;\nvar pure = ActionTypes.Pure;\n\nexport { after, assign, cancel, choose, doneState, error, errorExecution, errorPlatform, init, invoke, log, nullEvent, pure, raise, send, start, stop, update };\n","import { __assign, __read, __spreadArray } from './_virtual/_tslib.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { isFunction, toEventObject, getEventType, toSCXMLEvent, isString, partition, updateContext, flatten, toArray, toGuard, evaluateGuard, warn, isArray } from './utils.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { send as send$1, update, assign as assign$1, init, raise as raise$1, log as log$1, cancel as cancel$1, error as error$1, stop as stop$1, pure as pure$1, choose as choose$1 } from './actionTypes.js';\n\nvar initEvent = /*#__PURE__*/toSCXMLEvent({\n type: init\n});\nfunction getActionFunction(actionType, actionFunctionMap) {\n return actionFunctionMap ? actionFunctionMap[actionType] || undefined : undefined;\n}\nfunction toActionObject(action, actionFunctionMap) {\n var actionObject;\n\n if (isString(action) || typeof action === 'number') {\n var exec = getActionFunction(action, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = {\n type: action,\n exec: exec\n };\n } else if (exec) {\n actionObject = exec;\n } else {\n actionObject = {\n type: action,\n exec: undefined\n };\n }\n } else if (isFunction(action)) {\n actionObject = {\n // Convert action to string if unnamed\n type: action.name || action.toString(),\n exec: action\n };\n } else {\n var exec = getActionFunction(action.type, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = __assign(__assign({}, action), {\n exec: exec\n });\n } else if (exec) {\n var actionType = exec.type || action.type;\n actionObject = __assign(__assign(__assign({}, exec), action), {\n type: actionType\n });\n } else {\n actionObject = action;\n }\n }\n\n return actionObject;\n}\nvar toActionObjects = function (action, actionFunctionMap) {\n if (!action) {\n return [];\n }\n\n var actions = isArray(action) ? action : [action];\n return actions.map(function (subAction) {\n return toActionObject(subAction, actionFunctionMap);\n });\n};\nfunction toActivityDefinition(action) {\n var actionObject = toActionObject(action);\n return __assign(__assign({\n id: isString(action) ? action : actionObject.id\n }, actionObject), {\n type: actionObject.type\n });\n}\n/**\r\n * Raises an event. This places the event in the internal event queue, so that\r\n * the event is immediately consumed by the machine in the current step.\r\n *\r\n * @param eventType The event to raise.\r\n */\n\nfunction raise(event) {\n if (!isString(event)) {\n return send(event, {\n to: SpecialTargets.Internal\n });\n }\n\n return {\n type: raise$1,\n event: event\n };\n}\nfunction resolveRaise(action) {\n return {\n type: raise$1,\n _event: toSCXMLEvent(action.event)\n };\n}\n/**\r\n * Sends an event. This returns an action that will be read by an interpreter to\r\n * send the event in the next step, after the current step is finished executing.\r\n *\r\n * @param event The event to send.\r\n * @param options Options to pass into the send event:\r\n * - `id` - The unique send event identifier (used with `cancel()`).\r\n * - `delay` - The number of milliseconds to delay the sending of the event.\r\n * - `to` - The target of this event (by default, the machine the event was sent from).\r\n */\n\nfunction send(event, options) {\n return {\n to: options ? options.to : undefined,\n type: send$1,\n event: isFunction(event) ? event : toEventObject(event),\n delay: options ? options.delay : undefined,\n id: options && options.id !== undefined ? options.id : isFunction(event) ? event.name : getEventType(event)\n };\n}\nfunction resolveSend(action, ctx, _event, delaysMap) {\n var meta = {\n _event: _event\n }; // TODO: helper function for resolving Expr\n\n var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n var resolvedDelay;\n\n if (isString(action.delay)) {\n var configDelay = delaysMap && delaysMap[action.delay];\n resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n } else {\n resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n }\n\n var resolvedTarget = isFunction(action.to) ? action.to(ctx, _event.data, meta) : action.to;\n return __assign(__assign({}, action), {\n to: resolvedTarget,\n _event: resolvedEvent,\n event: resolvedEvent.data,\n delay: resolvedDelay\n });\n}\n/**\r\n * Sends an event to this machine's parent.\r\n *\r\n * @param event The event to send to the parent machine.\r\n * @param options Options to pass into the send event.\r\n */\n\nfunction sendParent(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\n/**\r\n * Sends an event to an actor.\r\n *\r\n * @param actor The `ActorRef` to send the event to.\r\n * @param event The event to send, or an expression that evaluates to the event to send\r\n * @param options Send action options\r\n * @returns An XState send action object\r\n */\n\nfunction sendTo(actor, event, options) {\n return send(event, __assign(__assign({}, options), {\n to: actor\n }));\n}\n/**\r\n * Sends an update event to this machine's parent.\r\n */\n\nfunction sendUpdate() {\n return sendParent(update);\n}\n/**\r\n * Sends an event back to the sender of the original event.\r\n *\r\n * @param event The event to send back to the sender\r\n * @param options Options to pass into the send event\r\n */\n\nfunction respond(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: function (_, __, _a) {\n var _event = _a._event;\n return _event.origin; // TODO: handle when _event.origin is undefined\n }\n }));\n}\n\nvar defaultLogExpr = function (context, event) {\n return {\n context: context,\n event: event\n };\n};\n/**\r\n *\r\n * @param expr The expression function to evaluate which will be logged.\r\n * Takes in 2 arguments:\r\n * - `ctx` - the current state context\r\n * - `event` - the event that caused this action to be executed.\r\n * @param label The label to give to the logged expression.\r\n */\n\n\nfunction log(expr, label) {\n if (expr === void 0) {\n expr = defaultLogExpr;\n }\n\n return {\n type: log$1,\n label: label,\n expr: expr\n };\n}\nvar resolveLog = function (action, ctx, _event) {\n return __assign(__assign({}, action), {\n value: isString(action.expr) ? action.expr : action.expr(ctx, _event.data, {\n _event: _event\n })\n });\n};\n/**\r\n * Cancels an in-flight `send(...)` action. A canceled sent action will not\r\n * be executed, nor will its event be sent, unless it has already been sent\r\n * (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).\r\n *\r\n * @param sendId The `id` of the `send(...)` action to cancel.\r\n */\n\nvar cancel = function (sendId) {\n return {\n type: cancel$1,\n sendId: sendId\n };\n};\n/**\r\n * Starts an activity.\r\n *\r\n * @param activity The activity to start.\r\n */\n\nfunction start(activity) {\n var activityDef = toActivityDefinition(activity);\n return {\n type: ActionTypes.Start,\n activity: activityDef,\n exec: undefined\n };\n}\n/**\r\n * Stops an activity.\r\n *\r\n * @param actorRef The activity to stop.\r\n */\n\nfunction stop(actorRef) {\n var activity = isFunction(actorRef) ? actorRef : toActivityDefinition(actorRef);\n return {\n type: ActionTypes.Stop,\n activity: activity,\n exec: undefined\n };\n}\nfunction resolveStop(action, context, _event) {\n var actorRefOrString = isFunction(action.activity) ? action.activity(context, _event.data) : action.activity;\n var resolvedActorRef = typeof actorRefOrString === 'string' ? {\n id: actorRefOrString\n } : actorRefOrString;\n var actionObject = {\n type: ActionTypes.Stop,\n activity: resolvedActorRef\n };\n return actionObject;\n}\n/**\r\n * Updates the current context of the machine.\r\n *\r\n * @param assignment An object that represents the partial context to update.\r\n */\n\nvar assign = function (assignment) {\n return {\n type: assign$1,\n assignment: assignment\n };\n};\n/**\r\n * Returns an event type that represents an implicit event that\r\n * is sent after the specified `delay`.\r\n *\r\n * @param delayRef The delay in milliseconds\r\n * @param id The state node ID where this event is handled\r\n */\n\nfunction after(delayRef, id) {\n var idSuffix = id ? \"#\".concat(id) : '';\n return \"\".concat(ActionTypes.After, \"(\").concat(delayRef, \")\").concat(idSuffix);\n}\n/**\r\n * Returns an event that represents that a final state node\r\n * has been reached in the parent state node.\r\n *\r\n * @param id The final state node's parent state node `id`\r\n * @param data The data to pass into the event\r\n */\n\nfunction done(id, data) {\n var type = \"\".concat(ActionTypes.DoneState, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\n/**\r\n * Returns an event that represents that an invoked service has terminated.\r\n *\r\n * An invoked service is terminated when it has reached a top-level final state node,\r\n * but not when it is canceled.\r\n *\r\n * @param id The final state node ID\r\n * @param data The data to pass into the event\r\n */\n\nfunction doneInvoke(id, data) {\n var type = \"\".concat(ActionTypes.DoneInvoke, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction error(id, data) {\n var type = \"\".concat(ActionTypes.ErrorPlatform, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction pure(getActions) {\n return {\n type: ActionTypes.Pure,\n get: getActions\n };\n}\n/**\r\n * Forwards (sends) an event to a specified service.\r\n *\r\n * @param target The target service to forward the event to.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction forwardTo(target, options) {\n return send(function (_, event) {\n return event;\n }, __assign(__assign({}, options), {\n to: target\n }));\n}\n/**\r\n * Escalates an error by sending it as an event to this machine's parent.\r\n *\r\n * @param errorData The error data to send, or the expression function that\r\n * takes in the `context`, `event`, and `meta`, and returns the error data to send.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction escalate(errorData, options) {\n return sendParent(function (context, event, meta) {\n return {\n type: error$1,\n data: isFunction(errorData) ? errorData(context, event, meta) : errorData\n };\n }, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\nfunction choose(conds) {\n return {\n type: ActionTypes.Choose,\n conds: conds\n };\n}\nfunction resolveActions(machine, currentState, currentContext, _event, actions, preserveActionOrder) {\n if (preserveActionOrder === void 0) {\n preserveActionOrder = false;\n }\n\n var _a = __read(preserveActionOrder ? [[], actions] : partition(actions, function (action) {\n return action.type === assign$1;\n }), 2),\n assignActions = _a[0],\n otherActions = _a[1];\n\n var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;\n var preservedContexts = preserveActionOrder ? [currentContext] : undefined;\n var resolvedActions = flatten(otherActions.map(function (actionObject) {\n var _a;\n\n switch (actionObject.type) {\n case raise$1:\n return resolveRaise(actionObject);\n\n case send$1:\n var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays); // TODO: fix ActionTypes.Init\n\n if (!IS_PRODUCTION) {\n // warn after resolving as we can create better contextual message here\n warn(!isString(actionObject.delay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length\n \"No delay reference for delay expression '\".concat(actionObject.delay, \"' was found on machine '\").concat(machine.id, \"'\"));\n }\n\n return sendAction;\n\n case log$1:\n return resolveLog(actionObject, updatedContext, _event);\n\n case choose$1:\n {\n var chooseAction = actionObject;\n var matchedActions = (_a = chooseAction.conds.find(function (condition) {\n var guard = toGuard(condition.cond, machine.options.guards);\n return !guard || evaluateGuard(machine, guard, updatedContext, _event, currentState);\n })) === null || _a === void 0 ? void 0 : _a.actions;\n\n if (!matchedActions) {\n return [];\n }\n\n var _b = __read(resolveActions(machine, currentState, updatedContext, _event, toActionObjects(toArray(matchedActions), machine.options.actions), preserveActionOrder), 2),\n resolvedActionsFromChoose = _b[0],\n resolvedContextFromChoose = _b[1];\n\n updatedContext = resolvedContextFromChoose;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromChoose;\n }\n\n case pure$1:\n {\n var matchedActions = actionObject.get(updatedContext, _event.data);\n\n if (!matchedActions) {\n return [];\n }\n\n var _c = __read(resolveActions(machine, currentState, updatedContext, _event, toActionObjects(toArray(matchedActions), machine.options.actions), preserveActionOrder), 2),\n resolvedActionsFromPure = _c[0],\n resolvedContext = _c[1];\n\n updatedContext = resolvedContext;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromPure;\n }\n\n case stop$1:\n {\n return resolveStop(actionObject, updatedContext, _event);\n }\n\n case assign$1:\n {\n updatedContext = updateContext(updatedContext, _event, [actionObject], currentState);\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n break;\n }\n\n default:\n var resolvedActionObject = toActionObject(actionObject, machine.options.actions);\n var exec_1 = resolvedActionObject.exec;\n\n if (exec_1 && preservedContexts) {\n var contextIndex_1 = preservedContexts.length - 1;\n resolvedActionObject = __assign(__assign({}, resolvedActionObject), {\n exec: function (_ctx) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n exec_1.apply(void 0, __spreadArray([preservedContexts[contextIndex_1]], __read(args), false));\n }\n });\n }\n\n return resolvedActionObject;\n }\n }).filter(function (a) {\n return !!a;\n }));\n return [resolvedActions, updatedContext];\n}\n\nexport { after, assign, cancel, choose, done, doneInvoke, error, escalate, forwardTo, getActionFunction, initEvent, log, pure, raise, resolveActions, resolveLog, resolveRaise, resolveSend, resolveStop, respond, send, sendParent, sendTo, sendUpdate, start, stop, toActionObject, toActionObjects, toActivityDefinition };\n","import { __spreadArray, __read, __rest, __assign } from './_virtual/_tslib.js';\nimport { EMPTY_ACTIVITY_MAP } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { isString, matchesState, warn, keys } from './utils.js';\nimport { getMeta, nextEvents } from './stateUtils.js';\nimport { initEvent } from './actions.js';\n\nfunction stateValuesEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a === undefined || b === undefined) {\n return false;\n }\n\n if (isString(a) || isString(b)) {\n return a === b;\n }\n\n var aKeys = keys(a);\n var bKeys = keys(b);\n return aKeys.length === bKeys.length && aKeys.every(function (key) {\n return stateValuesEqual(a[key], b[key]);\n });\n}\nfunction isState(state) {\n if (isString(state)) {\n return false;\n }\n\n return 'value' in state && 'history' in state;\n}\nfunction bindActionToState(action, state) {\n var exec = action.exec;\n\n var boundAction = __assign(__assign({}, action), {\n exec: exec !== undefined ? function () {\n return exec(state.context, state.event, {\n action: action,\n state: state,\n _event: state._event\n });\n } : undefined\n });\n\n return boundAction;\n}\n\nvar State =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new State instance.\r\n * @param value The state value\r\n * @param context The extended state\r\n * @param historyValue The tree representing historical values of the state nodes\r\n * @param history The previous state\r\n * @param actions An array of action objects to execute as side-effects\r\n * @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).\r\n * @param meta\r\n * @param events Internal event queue. Should be empty with run-to-completion semantics.\r\n * @param configuration\r\n */\n function State(config) {\n var _this = this;\n\n var _a;\n\n this.actions = [];\n this.activities = EMPTY_ACTIVITY_MAP;\n this.meta = {};\n this.events = [];\n this.value = config.value;\n this.context = config.context;\n this._event = config._event;\n this._sessionid = config._sessionid;\n this.event = this._event.data;\n this.historyValue = config.historyValue;\n this.history = config.history;\n this.actions = config.actions || [];\n this.activities = config.activities || EMPTY_ACTIVITY_MAP;\n this.meta = getMeta(config.configuration);\n this.events = config.events || [];\n this.matches = this.matches.bind(this);\n this.toStrings = this.toStrings.bind(this);\n this.configuration = config.configuration;\n this.transitions = config.transitions;\n this.children = config.children;\n this.done = !!config.done;\n this.tags = (_a = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a !== void 0 ? _a : new Set();\n this.machine = config.machine;\n Object.defineProperty(this, 'nextEvents', {\n get: function () {\n return nextEvents(_this.configuration);\n }\n });\n }\n /**\r\n * Creates a new State instance for the given `stateValue` and `context`.\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.from = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (stateValue.context !== context) {\n return new State({\n value: stateValue.value,\n context: context,\n _event: stateValue._event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n actions: [],\n activities: stateValue.activities,\n meta: {},\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n }\n\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: undefined,\n history: undefined,\n actions: [],\n activities: undefined,\n meta: undefined,\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n };\n /**\r\n * Creates a new State instance for the given `config`.\r\n * @param config The state config\r\n */\n\n\n State.create = function (config) {\n return new State(config);\n };\n /**\r\n * Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.inert = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (!stateValue.actions.length) {\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue.value,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n activities: stateValue.activities,\n configuration: stateValue.configuration,\n transitions: [],\n children: {}\n });\n }\n\n return State.from(stateValue, context);\n };\n /**\r\n * Returns an array of all the string leaf state node paths.\r\n * @param stateValue\r\n * @param delimiter The character(s) that separate each subpath in the string state node path.\r\n */\n\n\n State.prototype.toStrings = function (stateValue, delimiter) {\n var _this = this;\n\n if (stateValue === void 0) {\n stateValue = this.value;\n }\n\n if (delimiter === void 0) {\n delimiter = '.';\n }\n\n if (isString(stateValue)) {\n return [stateValue];\n }\n\n var valueKeys = keys(stateValue);\n return valueKeys.concat.apply(valueKeys, __spreadArray([], __read(valueKeys.map(function (key) {\n return _this.toStrings(stateValue[key], delimiter).map(function (s) {\n return key + delimiter + s;\n });\n })), false));\n };\n\n State.prototype.toJSON = function () {\n var _a = this,\n configuration = _a.configuration,\n transitions = _a.transitions,\n tags = _a.tags,\n machine = _a.machine,\n jsonValues = __rest(_a, [\"configuration\", \"transitions\", \"tags\", \"machine\"]);\n\n return __assign(__assign({}, jsonValues), {\n tags: Array.from(tags)\n });\n };\n /**\r\n * Whether the current state value is a subset of the given parent state value.\r\n * @param parentStateValue\r\n */\n\n\n State.prototype.matches = function (parentStateValue) {\n return matchesState(parentStateValue, this.value);\n };\n /**\r\n * Whether the current state configuration has a state node with the specified `tag`.\r\n * @param tag\r\n */\n\n\n State.prototype.hasTag = function (tag) {\n return this.tags.has(tag);\n };\n /**\r\n * Determines whether sending the `event` will cause a non-forbidden transition\r\n * to be selected, even if the transitions have no actions nor\r\n * change the state value.\r\n *\r\n * @param event The event to test\r\n * @returns Whether the event will cause a transition\r\n */\n\n\n State.prototype.can = function (event) {\n var _a;\n\n if (IS_PRODUCTION) {\n warn(!!this.machine, \"state.can(...) used outside of a machine-created State object; this will always return false.\");\n }\n\n var transitionData = (_a = this.machine) === null || _a === void 0 ? void 0 : _a.getTransitionData(this, event);\n return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && // Check that at least one transition is not forbidden\n transitionData.transitions.some(function (t) {\n return t.target !== undefined || t.actions.length;\n });\n };\n\n return State;\n}();\n\nexport { State, bindActionToState, isState, stateValuesEqual };\n","/**\r\n * Maintains a stack of the current service in scope.\r\n * This is used to provide the correct service to spawn().\r\n */\nvar serviceStack = [];\nvar provide = function (service, fn) {\n serviceStack.push(service);\n var result = fn(service);\n serviceStack.pop();\n return result;\n};\nvar consume = function (fn) {\n return fn(serviceStack[serviceStack.length - 1]);\n};\n\nexport { consume, provide };\n","import { __assign } from './_virtual/_tslib.js';\nimport { toInvokeSource, mapContext, interopSymbols, isMachine } from './utils.js';\nimport { provide } from './serviceScope.js';\n\nfunction createNullActor(id) {\n return __assign({\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, interopSymbols);\n}\n/**\r\n * Creates a deferred actor that is able to be invoked given the provided\r\n * invocation information in its `.meta` value.\r\n *\r\n * @param invokeDefinition The meta information needed to invoke the actor.\r\n */\n\nfunction createInvocableActor(invokeDefinition, machine, context, _event) {\n var _a;\n\n var invokeSrc = toInvokeSource(invokeDefinition.src);\n var serviceCreator = (_a = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a === void 0 ? void 0 : _a[invokeSrc.type];\n var resolvedData = invokeDefinition.data ? mapContext(invokeDefinition.data, context, _event) : undefined;\n var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id); // @ts-ignore\n\n tempActor.meta = invokeDefinition;\n return tempActor;\n}\nfunction createDeferredActor(entity, id, data) {\n var tempActor = createNullActor(id); // @ts-ignore\n\n tempActor.deferred = true;\n\n if (isMachine(entity)) {\n // \"mute\" the existing service scope so potential spawned actors within the `.initialState` stay deferred here\n var initialState_1 = tempActor.state = provide(undefined, function () {\n return (data ? entity.withContext(data) : entity).initialState;\n });\n\n tempActor.getSnapshot = function () {\n return initialState_1;\n };\n }\n\n return tempActor;\n}\nfunction isActor(item) {\n try {\n return typeof item.send === 'function';\n } catch (e) {\n return false;\n }\n}\nfunction isSpawnedActor(item) {\n return isActor(item) && 'id' in item;\n}\nfunction toActorRef(actorRefLike) {\n return __assign(__assign({\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n id: 'anonymous',\n getSnapshot: function () {\n return undefined;\n }\n }, interopSymbols), actorRefLike);\n}\n\nexport { createDeferredActor, createInvocableActor, createNullActor, isActor, isSpawnedActor, toActorRef };\n","import { __assign } from './_virtual/_tslib.js';\n\nvar defaultOptions = {\n deferEvents: false\n};\n\nvar Scheduler =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function Scheduler(options) {\n this.processingEvent = false;\n this.queue = [];\n this.initialized = false;\n this.options = __assign(__assign({}, defaultOptions), options);\n }\n\n Scheduler.prototype.initialize = function (callback) {\n this.initialized = true;\n\n if (callback) {\n if (!this.options.deferEvents) {\n this.schedule(callback);\n return;\n }\n\n this.process(callback);\n }\n\n this.flushEvents();\n };\n\n Scheduler.prototype.schedule = function (task) {\n if (!this.initialized || this.processingEvent) {\n this.queue.push(task);\n return;\n }\n\n if (this.queue.length !== 0) {\n throw new Error('Event queue should be empty when it is not processing events');\n }\n\n this.process(task);\n this.flushEvents();\n };\n\n Scheduler.prototype.clear = function () {\n this.queue = [];\n };\n\n Scheduler.prototype.flushEvents = function () {\n var nextCallback = this.queue.shift();\n\n while (nextCallback) {\n this.process(nextCallback);\n nextCallback = this.queue.shift();\n }\n };\n\n Scheduler.prototype.process = function (callback) {\n this.processingEvent = true;\n\n try {\n callback();\n } catch (e) {\n // there is no use to keep the future events\n // as the situation is not anymore the same\n this.clear();\n throw e;\n } finally {\n this.processingEvent = false;\n }\n };\n\n return Scheduler;\n}();\n\nexport { Scheduler };\n","var children = /*#__PURE__*/new Map();\nvar sessionIdIndex = 0;\nvar registry = {\n bookId: function () {\n return \"x:\".concat(sessionIdIndex++);\n },\n register: function (id, actor) {\n children.set(id, actor);\n return id;\n },\n get: function (id) {\n return children.get(id);\n },\n free: function (id) {\n children.delete(id);\n }\n};\n\nexport { registry };\n","// From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n\n if (typeof self !== 'undefined') {\n return self;\n }\n\n if (typeof window !== 'undefined') {\n return window;\n }\n\n if (typeof global !== 'undefined') {\n return global;\n }\n\n return undefined;\n}\n\nfunction getDevTools() {\n var global = getGlobal();\n\n if (global && '__xstate__' in global) {\n return global.__xstate__;\n }\n\n return undefined;\n}\n\nfunction registerService(service) {\n if (!getGlobal()) {\n return;\n }\n\n var devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n}\n\nexport { getGlobal, registerService };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { warn, mapContext, isFunction, keys, toSCXMLEvent, toInvokeSource, isMachine, isPromiseLike, isObservable, isBehavior, reportUnhandledExceptionOnInvocation, interopSymbols, symbolObservable, isArray, toEventObject, isString, isActor, toObserver, uniqueId } from './utils.js';\nimport { ActionTypes, SpecialTargets } from './types.js';\nimport { isInFinalState } from './stateUtils.js';\nimport { errorPlatform, log, stop, start, cancel, send, update, error as error$1 } from './actionTypes.js';\nimport { doneInvoke, initEvent, getActionFunction, error } from './actions.js';\nimport { isState, State, bindActionToState } from './State.js';\nimport { provide, consume } from './serviceScope.js';\nimport { isSpawnedActor, createDeferredActor } from './Actor.js';\nimport { Scheduler } from './scheduler.js';\nimport { registry } from './registry.js';\nimport { registerService, getGlobal } from './devTools.js';\nimport { spawnBehavior } from './behaviors.js';\n\nvar DEFAULT_SPAWN_OPTIONS = {\n sync: false,\n autoForward: false\n};\nvar InterpreterStatus;\n\n(function (InterpreterStatus) {\n InterpreterStatus[InterpreterStatus[\"NotStarted\"] = 0] = \"NotStarted\";\n InterpreterStatus[InterpreterStatus[\"Running\"] = 1] = \"Running\";\n InterpreterStatus[InterpreterStatus[\"Stopped\"] = 2] = \"Stopped\";\n})(InterpreterStatus || (InterpreterStatus = {}));\n\nvar Interpreter =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to be interpreted\r\n * @param options Interpreter options\r\n */\n function Interpreter(machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n this.machine = machine;\n this.scheduler = new Scheduler();\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this.status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this.status === InterpreterStatus.Stopped) {\n // do nothing\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\".concat(_event.name, \"\\\" was sent to stopped service \\\"\").concat(_this.machine.id, \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n return _this.state;\n }\n\n if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n throw new Error(\"Event \\\"\".concat(_event.name, \"\\\" was sent to uninitialized service \\\"\").concat(_this.machine.id // tslint:disable-next-line:max-line-length\n , \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this.nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isString(to) ? _this.children.get(to) || registry.get(to) : isActor(to) ? to : undefined;\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\".concat(to, \"' from service '\").concat(_this.id, \"'.\"));\n } // tslint:disable-next-line:no-console\n\n\n if (!IS_PRODUCTION) {\n warn(false, \"Service '\".concat(_this.id, \"' has no parent: unable to send event \").concat(event.type));\n }\n\n return;\n }\n\n if ('machine' in target) {\n // Send SCXML events to machines\n target.send(__assign(__assign({}, event), {\n name: event.name === error$1 ? \"\".concat(error(_this.id)) : event.name,\n origin: _this.sessionId\n }));\n } else {\n // Send normal events to other targets\n target.send(event.data);\n }\n };\n\n var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }\n\n Object.defineProperty(Interpreter.prototype, \"initialState\", {\n get: function () {\n var _this = this;\n\n if (this._initialState) {\n return this._initialState;\n }\n\n return provide(this, function () {\n _this._initialState = _this.machine.initialState;\n return _this._initialState;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Interpreter.prototype, \"state\", {\n get: function () {\n if (!IS_PRODUCTION) {\n warn(this.status !== InterpreterStatus.NotStarted, \"Attempted to read state from uninitialized service '\".concat(this.id, \"'. Make sure the service is started first.\"));\n }\n\n return this._state;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Executes the actions of the given state, with that state's `context` and `event`.\r\n *\r\n * @param state The state whose actions will be executed\r\n * @param actionsConfig The action implementations to use\r\n */\n\n Interpreter.prototype.execute = function (state, actionsConfig) {\n var e_1, _a;\n\n try {\n for (var _b = __values(state.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n this.exec(action, state, actionsConfig);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n };\n\n Interpreter.prototype.update = function (state, _event) {\n var e_2, _a, e_3, _b, e_4, _c, e_5, _d;\n\n var _this = this; // Attach session ID to state\n\n\n state._sessionid = this.sessionId; // Update state\n\n this._state = state; // Execute actions\n\n if (this.options.execute) {\n this.execute(this.state);\n } // Update children\n\n\n this.children.forEach(function (child) {\n _this.state.children[child.id] = child;\n }); // Dev tools\n\n if (this.devTools) {\n this.devTools.send(_event.data, state);\n } // Execute listeners\n\n\n if (state.event) {\n try {\n for (var _e = __values(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()) {\n var listener = _f.value;\n listener(state.event);\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n\n try {\n for (var _g = __values(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()) {\n var listener = _h.value;\n listener(state, state.event);\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n try {\n for (var _j = __values(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()) {\n var contextListener = _k.value;\n contextListener(this.state.context, this.state.history ? this.state.history.context : undefined);\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (_k && !_k.done && (_c = _j.return)) _c.call(_j);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n var isDone = isInFinalState(state.configuration || [], this.machine);\n\n if (this.state.configuration && isDone) {\n // get final child state node\n var finalChildStateNode = state.configuration.find(function (sn) {\n return sn.type === 'final' && sn.parent === _this.machine;\n });\n var doneData = finalChildStateNode && finalChildStateNode.doneData ? mapContext(finalChildStateNode.doneData, state.context, _event) : undefined;\n\n try {\n for (var _l = __values(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()) {\n var listener = _m.value;\n listener(doneInvoke(this.id, doneData));\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_m && !_m.done && (_d = _l.return)) _d.call(_l);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n this.stop();\n }\n };\n /*\r\n * Adds a listener that is notified whenever a state transition happens. The listener is called with\r\n * the next state and the event object that caused the state transition.\r\n *\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onTransition = function (listener) {\n this.listeners.add(listener); // Send current state to listener\n\n if (this.status === InterpreterStatus.Running) {\n listener(this.state, this.state.event);\n }\n\n return this;\n };\n\n Interpreter.prototype.subscribe = function (nextListenerOrObserver, _, // TODO: error listener\n completeListener) {\n var _this = this;\n\n if (!nextListenerOrObserver) {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n }\n\n var listener;\n var resolvedCompleteListener = completeListener;\n\n if (typeof nextListenerOrObserver === 'function') {\n listener = nextListenerOrObserver;\n } else {\n listener = nextListenerOrObserver.next.bind(nextListenerOrObserver);\n resolvedCompleteListener = nextListenerOrObserver.complete.bind(nextListenerOrObserver);\n }\n\n this.listeners.add(listener); // Send current state to listener\n\n if (this.status === InterpreterStatus.Running) {\n listener(this.state);\n }\n\n if (resolvedCompleteListener) {\n this.onDone(resolvedCompleteListener);\n }\n\n return {\n unsubscribe: function () {\n listener && _this.listeners.delete(listener);\n resolvedCompleteListener && _this.doneListeners.delete(resolvedCompleteListener);\n }\n };\n };\n /**\r\n * Adds an event listener that is notified whenever an event is sent to the running interpreter.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onEvent = function (listener) {\n this.eventListeners.add(listener);\n return this;\n };\n /**\r\n * Adds an event listener that is notified whenever a `send` event occurs.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onSend = function (listener) {\n this.sendListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a context listener that is notified whenever the state context changes.\r\n * @param listener The context listener\r\n */\n\n\n Interpreter.prototype.onChange = function (listener) {\n this.contextListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a listener that is notified when the machine is stopped.\r\n * @param listener The listener\r\n */\n\n\n Interpreter.prototype.onStop = function (listener) {\n this.stopListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a state listener that is notified when the statechart has reached its final state.\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onDone = function (listener) {\n this.doneListeners.add(listener);\n return this;\n };\n /**\r\n * Removes a listener.\r\n * @param listener The listener to remove\r\n */\n\n\n Interpreter.prototype.off = function (listener) {\n this.listeners.delete(listener);\n this.eventListeners.delete(listener);\n this.sendListeners.delete(listener);\n this.stopListeners.delete(listener);\n this.doneListeners.delete(listener);\n this.contextListeners.delete(listener);\n return this;\n };\n /**\r\n * Starts the interpreter from the given state, or the initial state.\r\n * @param initialState The state to start the statechart from\r\n */\n\n\n Interpreter.prototype.start = function (initialState) {\n var _this = this;\n\n if (this.status === InterpreterStatus.Running) {\n // Do not restart the service if it is already started\n return this;\n }\n\n registry.register(this.sessionId, this);\n this.initialized = true;\n this.status = InterpreterStatus.Running;\n var resolvedState = initialState === undefined ? this.initialState : provide(this, function () {\n return isState(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(State.from(initialState, _this.machine.context));\n });\n\n if (this.options.devTools) {\n this.attachDev();\n }\n\n this.scheduler.initialize(function () {\n _this.update(resolvedState, initEvent);\n });\n return this;\n };\n /**\r\n * Stops the interpreter and unsubscribe all listeners.\r\n *\r\n * This will also notify the `onStop` listeners.\r\n */\n\n\n Interpreter.prototype.stop = function () {\n var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;\n\n var _this = this;\n\n try {\n for (var _f = __values(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()) {\n var listener = _g.value;\n this.listeners.delete(listener);\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n try {\n for (var _h = __values(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()) {\n var listener = _j.value; // call listener, then remove\n\n listener();\n this.stopListeners.delete(listener);\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n\n try {\n for (var _k = __values(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()) {\n var listener = _l.value;\n this.contextListeners.delete(listener);\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n\n try {\n for (var _m = __values(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()) {\n var listener = _o.value;\n this.doneListeners.delete(listener);\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (_o && !_o.done && (_d = _m.return)) _d.call(_m);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n\n if (!this.initialized) {\n // Interpreter already stopped; do nothing\n return this;\n }\n\n __spreadArray([], __read(this.state.configuration), false).sort(function (a, b) {\n return b.order - a.order;\n }).forEach(function (stateNode) {\n var e_11, _a;\n\n try {\n for (var _b = __values(stateNode.definition.exit), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n\n _this.exec(action, _this.state);\n }\n } catch (e_11_1) {\n e_11 = {\n error: e_11_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_11) throw e_11.error;\n }\n }\n }); // Stop all children\n\n\n this.children.forEach(function (child) {\n if (isFunction(child.stop)) {\n child.stop();\n }\n });\n\n try {\n // Cancel all delayed events\n for (var _p = __values(keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n this.clock.clearTimeout(this.delayedEventsMap[key]);\n }\n } catch (e_10_1) {\n e_10 = {\n error: e_10_1\n };\n } finally {\n try {\n if (_q && !_q.done && (_e = _p.return)) _e.call(_p);\n } finally {\n if (e_10) throw e_10.error;\n }\n }\n\n this.scheduler.clear();\n this.initialized = false;\n this.status = InterpreterStatus.Stopped;\n registry.free(this.sessionId);\n return this;\n };\n\n Interpreter.prototype.batch = function (events) {\n var _this = this;\n\n if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\" and are deferred. Make sure .start() is called for this service.\\nEvent: \").concat(JSON.stringify(event)));\n }\n } else if (this.status !== InterpreterStatus.Running) {\n throw new Error( // tslint:disable-next-line:max-line-length\n \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\"));\n }\n\n this.scheduler.schedule(function () {\n var e_12, _a;\n\n var nextState = _this.state;\n var batchChanged = false;\n var batchedActions = [];\n\n var _loop_1 = function (event_1) {\n var _event = toSCXMLEvent(event_1);\n\n _this.forward(_event);\n\n nextState = provide(_this, function () {\n return _this.machine.transition(nextState, _event);\n });\n batchedActions.push.apply(batchedActions, __spreadArray([], __read(nextState.actions.map(function (a) {\n return bindActionToState(a, nextState);\n })), false));\n batchChanged = batchChanged || !!nextState.changed;\n };\n\n try {\n for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {\n var event_1 = events_1_1.value;\n\n _loop_1(event_1);\n }\n } catch (e_12_1) {\n e_12 = {\n error: e_12_1\n };\n } finally {\n try {\n if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);\n } finally {\n if (e_12) throw e_12.error;\n }\n }\n\n nextState.changed = batchChanged;\n nextState.actions = batchedActions;\n\n _this.update(nextState, toSCXMLEvent(events[events.length - 1]));\n });\n };\n /**\r\n * Returns a send function bound to this interpreter instance.\r\n *\r\n * @param event The event to be sent by the sender.\r\n */\n\n\n Interpreter.prototype.sender = function (event) {\n return this.send.bind(this, event);\n };\n /**\r\n * Returns the next state given the interpreter's current state and the event.\r\n *\r\n * This is a pure method that does _not_ update the interpreter's state.\r\n *\r\n * @param event The event to determine the next state\r\n */\n\n\n Interpreter.prototype.nextState = function (event) {\n var _this = this;\n\n var _event = toSCXMLEvent(event);\n\n if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {\n return nextEvent.indexOf(errorPlatform) === 0;\n })) {\n throw _event.data.data;\n }\n\n var nextState = provide(this, function () {\n return _this.machine.transition(_this.state, _event);\n });\n return nextState;\n };\n\n Interpreter.prototype.forward = function (event) {\n var e_13, _a;\n\n try {\n for (var _b = __values(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()) {\n var id = _c.value;\n var child = this.children.get(id);\n\n if (!child) {\n throw new Error(\"Unable to forward event '\".concat(event, \"' from interpreter '\").concat(this.id, \"' to nonexistant child '\").concat(id, \"'.\"));\n }\n\n child.send(event);\n }\n } catch (e_13_1) {\n e_13 = {\n error: e_13_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_13) throw e_13.error;\n }\n }\n };\n\n Interpreter.prototype.defer = function (sendAction) {\n var _this = this;\n\n this.delayedEventsMap[sendAction.id] = this.clock.setTimeout(function () {\n if (sendAction.to) {\n _this.sendTo(sendAction._event, sendAction.to);\n } else {\n _this.send(sendAction._event);\n }\n }, sendAction.delay);\n };\n\n Interpreter.prototype.cancel = function (sendId) {\n this.clock.clearTimeout(this.delayedEventsMap[sendId]);\n delete this.delayedEventsMap[sendId];\n };\n\n Interpreter.prototype.exec = function (action, state, actionFunctionMap) {\n if (actionFunctionMap === void 0) {\n actionFunctionMap = this.machine.options.actions;\n }\n\n var context = state.context,\n _event = state._event;\n var actionOrExec = action.exec || getActionFunction(action.type, actionFunctionMap);\n var exec = isFunction(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;\n\n if (exec) {\n try {\n return exec(context, _event.data, {\n action: action,\n state: this.state,\n _event: _event\n });\n } catch (err) {\n if (this.parent) {\n this.parent.send({\n type: 'xstate.error',\n data: err\n });\n }\n\n throw err;\n }\n }\n\n switch (action.type) {\n case send:\n var sendAction = action;\n\n if (typeof sendAction.delay === 'number') {\n this.defer(sendAction);\n return;\n } else {\n if (sendAction.to) {\n this.sendTo(sendAction._event, sendAction.to);\n } else {\n this.send(sendAction._event);\n }\n }\n\n break;\n\n case cancel:\n this.cancel(action.sendId);\n break;\n\n case start:\n {\n if (this.status !== InterpreterStatus.Running) {\n return;\n }\n\n var activity = action.activity; // If the activity will be stopped right after it's started\n // (such as in transient states)\n // don't bother starting the activity.\n\n if (!this.state.activities[activity.id || activity.type]) {\n break;\n } // Invoked services\n\n\n if (activity.type === ActionTypes.Invoke) {\n var invokeSource = toInvokeSource(activity.src);\n var serviceCreator = this.machine.options.services ? this.machine.options.services[invokeSource.type] : undefined;\n var id = activity.id,\n data = activity.data;\n\n if (!IS_PRODUCTION) {\n warn(!('forward' in activity), // tslint:disable-next-line:max-line-length\n \"`forward` property is deprecated (found in invocation of '\".concat(activity.src, \"' in in machine '\").concat(this.machine.id, \"'). \") + \"Please use `autoForward` instead.\");\n }\n\n var autoForward = 'autoForward' in activity ? activity.autoForward : !!activity.forward;\n\n if (!serviceCreator) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"No service found for invocation '\".concat(activity.src, \"' in machine '\").concat(this.machine.id, \"'.\"));\n }\n\n return;\n }\n\n var resolvedData = data ? mapContext(data, context, _event) : undefined;\n\n if (typeof serviceCreator === 'string') {\n // TODO: warn\n return;\n }\n\n var source = isFunction(serviceCreator) ? serviceCreator(context, _event.data, {\n data: resolvedData,\n src: invokeSource,\n meta: activity.meta\n }) : serviceCreator;\n\n if (!source) {\n // TODO: warn?\n return;\n }\n\n var options = void 0;\n\n if (isMachine(source)) {\n source = resolvedData ? source.withContext(resolvedData) : source;\n options = {\n autoForward: autoForward\n };\n }\n\n this.spawn(source, id, options);\n } else {\n this.spawnActivity(activity);\n }\n\n break;\n }\n\n case stop:\n {\n this.stopChild(action.activity.id);\n break;\n }\n\n case log:\n var label = action.label,\n value = action.value;\n\n if (label) {\n this.logger(label, value);\n } else {\n this.logger(value);\n }\n\n break;\n\n default:\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for action type '\".concat(action.type, \"'\"));\n }\n\n break;\n }\n\n return undefined;\n };\n\n Interpreter.prototype.removeChild = function (childId) {\n var _a;\n\n this.children.delete(childId);\n this.forwardTo.delete(childId); // this.state might not exist at the time this is called,\n // such as when a child is added then removed while initializing the state\n\n (_a = this.state) === null || _a === void 0 ? true : delete _a.children[childId];\n };\n\n Interpreter.prototype.stopChild = function (childId) {\n var child = this.children.get(childId);\n\n if (!child) {\n return;\n }\n\n this.removeChild(childId);\n\n if (isFunction(child.stop)) {\n child.stop();\n }\n };\n\n Interpreter.prototype.spawn = function (entity, name, options) {\n if (isPromiseLike(entity)) {\n return this.spawnPromise(Promise.resolve(entity), name);\n } else if (isFunction(entity)) {\n return this.spawnCallback(entity, name);\n } else if (isSpawnedActor(entity)) {\n return this.spawnActor(entity, name);\n } else if (isObservable(entity)) {\n return this.spawnObservable(entity, name);\n } else if (isMachine(entity)) {\n return this.spawnMachine(entity, __assign(__assign({}, options), {\n id: name\n }));\n } else if (isBehavior(entity)) {\n return this.spawnBehavior(entity, name);\n } else {\n throw new Error(\"Unable to spawn entity \\\"\".concat(name, \"\\\" of type \\\"\").concat(typeof entity, \"\\\".\"));\n }\n };\n\n Interpreter.prototype.spawnMachine = function (machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var childService = new Interpreter(machine, __assign(__assign({}, this.options), {\n parent: this,\n id: options.id || machine.id\n }));\n\n var resolvedOptions = __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), options);\n\n if (resolvedOptions.sync) {\n childService.onTransition(function (state) {\n _this.send(update, {\n state: state,\n id: childService.id\n });\n });\n }\n\n var actor = childService;\n this.children.set(childService.id, actor);\n\n if (resolvedOptions.autoForward) {\n this.forwardTo.add(childService.id);\n }\n\n childService.onDone(function (doneEvent) {\n _this.removeChild(childService.id);\n\n _this.send(toSCXMLEvent(doneEvent, {\n origin: childService.id\n }));\n }).start();\n return actor;\n };\n\n Interpreter.prototype.spawnBehavior = function (behavior, id) {\n var actorRef = spawnBehavior(behavior, {\n id: id,\n parent: this\n });\n this.children.set(id, actorRef);\n return actorRef;\n };\n\n Interpreter.prototype.spawnPromise = function (promise, id) {\n var _this = this;\n\n var canceled = false;\n var resolvedData;\n promise.then(function (response) {\n if (!canceled) {\n resolvedData = response;\n\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id, response), {\n origin: id\n }));\n }\n }, function (errorData) {\n if (!canceled) {\n _this.removeChild(id);\n\n var errorEvent = error(id, errorData);\n\n try {\n // Send \"error.platform.id\" to this (parent).\n _this.send(toSCXMLEvent(errorEvent, {\n origin: id\n }));\n } catch (error) {\n reportUnhandledExceptionOnInvocation(errorData, error, id);\n\n if (_this.devTools) {\n _this.devTools.send(errorEvent, _this.state);\n }\n\n if (_this.machine.strict) {\n // it would be better to always stop the state machine if unhandled\n // exception/promise rejection happens but because we don't want to\n // break existing code so enforce it on strict mode only especially so\n // because documentation says that onError is optional\n _this.stop();\n }\n }\n }\n });\n\n var actor = __assign({\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n var unsubscribed = false;\n promise.then(function (response) {\n if (unsubscribed) {\n return;\n }\n\n observer.next(response);\n\n if (unsubscribed) {\n return;\n }\n\n observer.complete();\n }, function (err) {\n if (unsubscribed) {\n return;\n }\n\n observer.error(err);\n });\n return {\n unsubscribe: function () {\n return unsubscribed = true;\n }\n };\n },\n stop: function () {\n canceled = true;\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return resolvedData;\n }\n }, interopSymbols);\n\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnCallback = function (callback, id) {\n var _this = this;\n\n var canceled = false;\n var receivers = new Set();\n var listeners = new Set();\n var emitted;\n\n var receive = function (e) {\n emitted = e;\n listeners.forEach(function (listener) {\n return listener(e);\n });\n\n if (canceled) {\n return;\n }\n\n _this.send(toSCXMLEvent(e, {\n origin: id\n }));\n };\n\n var callbackStop;\n\n try {\n callbackStop = callback(receive, function (newListener) {\n receivers.add(newListener);\n });\n } catch (err) {\n this.send(error(id, err));\n }\n\n if (isPromiseLike(callbackStop)) {\n // it turned out to be an async function, can't reliably check this before calling `callback`\n // because transpiled async functions are not recognizable\n return this.spawnPromise(callbackStop, id);\n }\n\n var actor = __assign({\n id: id,\n send: function (event) {\n return receivers.forEach(function (receiver) {\n return receiver(event);\n });\n },\n subscribe: function (next) {\n listeners.add(next);\n return {\n unsubscribe: function () {\n listeners.delete(next);\n }\n };\n },\n stop: function () {\n canceled = true;\n\n if (isFunction(callbackStop)) {\n callbackStop();\n }\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return emitted;\n }\n }, interopSymbols);\n\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnObservable = function (source, id) {\n var _this = this;\n\n var emitted;\n var subscription = source.subscribe(function (value) {\n emitted = value;\n\n _this.send(toSCXMLEvent(value, {\n origin: id\n }));\n }, function (err) {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(error(id, err), {\n origin: id\n }));\n }, function () {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id), {\n origin: id\n }));\n });\n\n var actor = __assign({\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n return source.subscribe(next, handleError, complete);\n },\n stop: function () {\n return subscription.unsubscribe();\n },\n getSnapshot: function () {\n return emitted;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, interopSymbols);\n\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActor = function (actor, name) {\n this.children.set(name, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActivity = function (activity) {\n var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : undefined;\n\n if (!implementation) {\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for activity '\".concat(activity.type, \"'\"));\n } // tslint:disable-next-line:no-console\n\n\n return;\n } // Start implementation\n\n\n var dispose = implementation(this.state.context, activity);\n this.spawnEffect(activity.id, dispose);\n };\n\n Interpreter.prototype.spawnEffect = function (id, dispose) {\n this.children.set(id, __assign({\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n stop: dispose || undefined,\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, interopSymbols));\n };\n\n Interpreter.prototype.attachDev = function () {\n var global = getGlobal();\n\n if (this.options.devTools && global) {\n if (global.__REDUX_DEVTOOLS_EXTENSION__) {\n var devToolsOptions = typeof this.options.devTools === 'object' ? this.options.devTools : undefined;\n this.devTools = global.__REDUX_DEVTOOLS_EXTENSION__.connect(__assign(__assign({\n name: this.id,\n autoPause: true,\n stateSanitizer: function (state) {\n return {\n value: state.value,\n context: state.context,\n actions: state.actions\n };\n }\n }, devToolsOptions), {\n features: __assign({\n jump: false,\n skip: false\n }, devToolsOptions ? devToolsOptions.features : undefined)\n }), this.machine);\n this.devTools.init(this.state);\n } // add XState-specific dev tooling hook\n\n\n registerService(this);\n }\n };\n\n Interpreter.prototype.toJSON = function () {\n return {\n id: this.id\n };\n };\n\n Interpreter.prototype[symbolObservable] = function () {\n return this;\n }; // this gets stripped by Babel to avoid having \"undefined\" property in environments without this non-standard Symbol\n // it has to be here to be included in the generated .d.ts\n\n\n Interpreter.prototype.getSnapshot = function () {\n if (this.status === InterpreterStatus.NotStarted) {\n return this.initialState;\n }\n\n return this._state;\n };\n /**\r\n * The default interpreter options:\r\n *\r\n * - `clock` uses the global `setTimeout` and `clearTimeout` functions\r\n * - `logger` uses the global `console.log()` method\r\n */\n\n\n Interpreter.defaultOptions = /*#__PURE__*/function (global) {\n return {\n execute: true,\n deferEvents: true,\n clock: {\n setTimeout: function (fn, ms) {\n return setTimeout(fn, ms);\n },\n clearTimeout: function (id) {\n return clearTimeout(id);\n }\n },\n logger: global.console.log.bind(console),\n devTools: false\n };\n }(typeof self !== 'undefined' ? self : global);\n\n Interpreter.interpret = interpret;\n return Interpreter;\n}();\n\nvar resolveSpawnOptions = function (nameOrOptions) {\n if (isString(nameOrOptions)) {\n return __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: nameOrOptions\n });\n }\n\n return __assign(__assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: uniqueId()\n }), nameOrOptions);\n};\n\nfunction spawn(entity, nameOrOptions) {\n var resolvedOptions = resolveSpawnOptions(nameOrOptions);\n return consume(function (service) {\n if (!IS_PRODUCTION) {\n var isLazyEntity = isMachine(entity) || isFunction(entity);\n warn(!!service || isLazyEntity, \"Attempted to spawn an Actor (ID: \\\"\".concat(isMachine(entity) ? entity.id : 'undefined', \"\\\") outside of a service. This will have no effect.\"));\n }\n\n if (service) {\n return service.spawn(entity, resolvedOptions.name, resolvedOptions);\n } else {\n return createDeferredActor(entity, resolvedOptions.name);\n }\n });\n}\n/**\r\n * Creates a new Interpreter instance for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to interpret\r\n * @param options Interpreter options\r\n */\n\nfunction interpret(machine, options) {\n var interpreter = new Interpreter(machine, options);\n return interpreter;\n}\n\nexport { Interpreter, InterpreterStatus, interpret, spawn };\n","export var ReactEffectType;\n(function (ReactEffectType) {\n ReactEffectType[ReactEffectType[\"Effect\"] = 1] = \"Effect\";\n ReactEffectType[ReactEffectType[\"LayoutEffect\"] = 2] = \"LayoutEffect\";\n})(ReactEffectType || (ReactEffectType = {}));\n","import './environment.js';\nimport { toObserver } from './utils.js';\nimport './types.js';\nimport './actionTypes.js';\nimport { toActorRef } from './Actor.js';\n\nfunction spawnBehavior(behavior, options) {\n if (options === void 0) {\n options = {};\n }\n\n var state = behavior.initialState;\n var observers = new Set();\n var mailbox = [];\n var flushing = false;\n\n var flush = function () {\n if (flushing) {\n return;\n }\n\n flushing = true;\n\n while (mailbox.length > 0) {\n var event_1 = mailbox.shift();\n state = behavior.transition(state, event_1, actorCtx);\n observers.forEach(function (observer) {\n return observer.next(state);\n });\n }\n\n flushing = false;\n };\n\n var actor = toActorRef({\n id: options.id,\n send: function (event) {\n mailbox.push(event);\n flush();\n },\n getSnapshot: function () {\n return state;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n observers.add(observer);\n observer.next(state);\n return {\n unsubscribe: function () {\n observers.delete(observer);\n }\n };\n }\n });\n var actorCtx = {\n parent: options.parent,\n self: actor,\n id: options.id || 'anonymous',\n observers: observers\n };\n state = behavior.start ? behavior.start(actorCtx) : state;\n return actor;\n}\n\nexport { spawnBehavior };\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nexport function partition(items, predicate) {\n var e_1, _a;\n var _b = __read([[], []], 2), truthy = _b[0], falsy = _b[1];\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n if (predicate(item)) {\n truthy.push(item);\n }\n else {\n falsy.push(item);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return [truthy, falsy];\n}\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { useEffect, useRef } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { ReactEffectType } from './types';\nimport { partition } from './utils';\nfunction executeEffect(action, state) {\n var exec = action.exec;\n var originalExec = exec(state.context, state._event.data, {\n action: action,\n state: state,\n _event: state._event\n });\n originalExec();\n}\nexport function useReactEffectActions(service) {\n var effectActionsRef = useRef([]);\n var layoutEffectActionsRef = useRef([]);\n useIsomorphicLayoutEffect(function () {\n var sub = service.subscribe(function (currentState) {\n var _a, _b;\n if (currentState.actions.length) {\n var reactEffectActions = currentState.actions.filter(function (action) {\n return (typeof action.exec === 'function' &&\n '__effect' in action.exec);\n });\n var _c = __read(partition(reactEffectActions, function (action) {\n return action.exec.__effect === ReactEffectType.Effect;\n }), 2), effectActions = _c[0], layoutEffectActions = _c[1];\n (_a = effectActionsRef.current).push.apply(_a, __spreadArray([], __read(effectActions.map(function (effectAction) { return [effectAction, currentState]; })), false));\n (_b = layoutEffectActionsRef.current).push.apply(_b, __spreadArray([], __read(layoutEffectActions.map(function (layoutEffectAction) { return [layoutEffectAction, currentState]; })), false));\n }\n });\n return function () {\n sub.unsubscribe();\n };\n }, []);\n // this is somewhat weird - this should always be flushed within useLayoutEffect\n // but we don't want to receive warnings about useLayoutEffect being used on the server\n // so we have to use `useIsomorphicLayoutEffect` to silence those warnings\n useIsomorphicLayoutEffect(function () {\n while (layoutEffectActionsRef.current.length) {\n var _a = __read(layoutEffectActionsRef.current.shift(), 2), layoutEffectAction = _a[0], effectState = _a[1];\n executeEffect(layoutEffectAction, effectState);\n }\n }); // https://github.com/davidkpiano/xstate/pull/1202#discussion_r429677773\n useEffect(function () {\n while (effectActionsRef.current.length) {\n var _a = __read(effectActionsRef.current.shift(), 2), effectAction = _a[0], effectState = _a[1];\n executeEffect(effectAction, effectState);\n }\n });\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n 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]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { useState } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { interpret, State } from 'xstate';\nimport useConstant from './useConstant';\nimport { useReactEffectActions } from './useReactEffectActions';\n// copied from core/src/utils.ts\n// it avoids a breaking change between this package and XState which is its peer dep\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n if (typeof nextHandler === 'object') {\n return nextHandler;\n }\n var noop = function () { return void 0; };\n return {\n next: nextHandler,\n error: errorHandler || noop,\n complete: completionHandler || noop\n };\n}\nexport function useInterpret(getMachine, options, observerOrListener) {\n if (options === void 0) { options = {}; }\n var machine = useConstant(function () {\n return typeof getMachine === 'function' ? getMachine() : getMachine;\n });\n if (process.env.NODE_ENV !== 'production' &&\n typeof getMachine !== 'function') {\n var _a = __read(useState(machine), 1), initialMachine = _a[0];\n if (getMachine !== initialMachine) {\n console.warn('Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\\n' +\n 'Please make sure that you pass the same Machine as argument each time.');\n }\n }\n var context = options.context, guards = options.guards, actions = options.actions, activities = options.activities, services = options.services, delays = options.delays, rehydratedState = options.state, interpreterOptions = __rest(options, [\"context\", \"guards\", \"actions\", \"activities\", \"services\", \"delays\", \"state\"]);\n var service = useConstant(function () {\n var machineConfig = {\n context: context,\n guards: guards,\n actions: actions,\n activities: activities,\n services: services,\n delays: delays\n };\n var machineWithConfig = machine.withConfig(machineConfig, function () { return (__assign(__assign({}, machine.context), context)); });\n return interpret(machineWithConfig, __assign({ deferEvents: true }, interpreterOptions));\n });\n useIsomorphicLayoutEffect(function () {\n var sub;\n if (observerOrListener) {\n sub = service.subscribe(toObserver(observerOrListener));\n }\n return function () {\n sub === null || sub === void 0 ? void 0 : sub.unsubscribe();\n };\n }, [observerOrListener]);\n useIsomorphicLayoutEffect(function () {\n service.start(rehydratedState ? State.create(rehydratedState) : undefined);\n return function () {\n service.stop();\n };\n }, []);\n // Make sure options are kept updated when they change.\n // This mutation assignment is safe because the service instance is only used\n // in one place -- this hook's caller.\n useIsomorphicLayoutEffect(function () {\n Object.assign(service.machine.options.actions, actions);\n Object.assign(service.machine.options.guards, guards);\n Object.assign(service.machine.options.activities, activities);\n Object.assign(service.machine.options.services, services);\n Object.assign(service.machine.options.delays, delays);\n }, [actions, guards, activities, services, delays]);\n useReactEffectActions(service);\n return service;\n}\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { useCallback, useState } from 'react';\nimport { State } from 'xstate';\nimport { ReactEffectType } from './types';\nimport { useInterpret } from './useInterpret';\nfunction createReactActionFunction(exec, tag) {\n var effectExec = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // don't execute; just return\n return function () {\n return exec.apply(void 0, __spreadArray([], __read(args), false));\n };\n };\n Object.defineProperties(effectExec, {\n name: { value: \"effect:\".concat(exec.name) },\n __effect: { value: tag }\n });\n return effectExec;\n}\nexport function asEffect(exec) {\n return createReactActionFunction(exec, ReactEffectType.Effect);\n}\nexport function asLayoutEffect(exec) {\n return createReactActionFunction(exec, ReactEffectType.LayoutEffect);\n}\nexport function useMachine(getMachine, options) {\n if (options === void 0) { options = {}; }\n var listener = useCallback(function (nextState) {\n // Only change the current state if:\n // - the incoming state is the \"live\" initial state (since it might have new actors)\n // - OR the incoming state actually changed.\n //\n // The \"live\" initial state will have .changed === undefined.\n var initialStateChanged = nextState.changed === undefined &&\n Object.keys(nextState.children).length;\n if (nextState.changed || initialStateChanged) {\n setState(nextState);\n }\n }, []);\n var service = useInterpret(getMachine, options, listener);\n var _a = __read(useState(function () {\n var initialState = service.machine.initialState;\n return (options.state\n ? State.create(options.state)\n : initialState);\n }), 2), state = _a[0], setState = _a[1];\n return [state, service.send, service];\n}\n","import e,{createContext as t,useState as r,useEffect as o,useCallback as n,useMemo as c,useContext as a}from\"react\";\n/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */var i=function(){return(i=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&n[n.length-1])||6!==c[0]&&2!==c[0])){a=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1] \"+f.SCRIPT_NOT_AVAILABLE)},onError:function(){y(\"Error loading google recaptcha script\")}}),function(){l(e)}}y(\" recaptcha key not provided\")}),[h,b,x,g,i]);var E=n((function(e){return s(a,void 0,void 0,(function(){return u(this,(function(t){switch(t.label){case 0:if(!P||!P.execute)throw new Error(\" Google Recaptcha has not been loaded\");return[4,P.execute(i,{action:e})];case 1:return[2,t.sent()]}}))}))}),[P]),R=c((function(){return{executeRecaptcha:P?E:void 0}}),[E,P]);return e.createElement(d.Provider,{value:R},$)}var v=function(){return a(d)};function b(e){var t=this,r=e.action,n=e.onVerify,c=v();return o((function(){var e=c.executeRecaptcha;if(e){s(t,void 0,void 0,(function(){var t;return u(this,(function(o){switch(o.label){case 0:return[4,e(r)];case 1:return t=o.sent(),n?(n(t),[2]):(y(\"Please define an onVerify function\"),[2])}}))}))}}),[r,n,c]),null}function S(e,t){return e(t={exports:{}},t.exports),t.exports\n/** @license React v16.13.1\n * react-is.production.min.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 */}var g=\"function\"==typeof Symbol&&Symbol.for,$=g?Symbol.for(\"react.element\"):60103,w=g?Symbol.for(\"react.portal\"):60106,P=g?Symbol.for(\"react.fragment\"):60107,C=g?Symbol.for(\"react.strict_mode\"):60108,x=g?Symbol.for(\"react.profiler\"):60114,E=g?Symbol.for(\"react.provider\"):60109,R=g?Symbol.for(\"react.context\"):60110,M=g?Symbol.for(\"react.async_mode\"):60111,N=g?Symbol.for(\"react.concurrent_mode\"):60111,O=g?Symbol.for(\"react.forward_ref\"):60112,T=g?Symbol.for(\"react.suspense\"):60113,_=g?Symbol.for(\"react.suspense_list\"):60120,j=g?Symbol.for(\"react.memo\"):60115,F=g?Symbol.for(\"react.lazy\"):60116,A=g?Symbol.for(\"react.block\"):60121,L=g?Symbol.for(\"react.fundamental\"):60117,k=g?Symbol.for(\"react.responder\"):60118,V=g?Symbol.for(\"react.scope\"):60119;function G(e){if(\"object\"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case $:switch(e=e.type){case M:case N:case P:case x:case C:case T:return e;default:switch(e=e&&e.$$typeof){case R:case O:case F:case j:case E:return e;default:return t}}case w:return t}}}function z(e){return G(e)===N}var I={AsyncMode:M,ConcurrentMode:N,ContextConsumer:R,ContextProvider:E,Element:$,ForwardRef:O,Fragment:P,Lazy:F,Memo:j,Portal:w,Profiler:x,StrictMode:C,Suspense:T,isAsyncMode:function(e){return z(e)||G(e)===M},isConcurrentMode:z,isContextConsumer:function(e){return G(e)===R},isContextProvider:function(e){return G(e)===E},isElement:function(e){return\"object\"==typeof e&&null!==e&&e.$$typeof===$},isForwardRef:function(e){return G(e)===O},isFragment:function(e){return G(e)===P},isLazy:function(e){return G(e)===F},isMemo:function(e){return G(e)===j},isPortal:function(e){return G(e)===w},isProfiler:function(e){return G(e)===x},isStrictMode:function(e){return G(e)===C},isSuspense:function(e){return G(e)===T},isValidElementType:function(e){return\"string\"==typeof e||\"function\"==typeof e||e===P||e===N||e===x||e===C||e===T||e===_||\"object\"==typeof e&&null!==e&&(e.$$typeof===F||e.$$typeof===j||e.$$typeof===E||e.$$typeof===R||e.$$typeof===O||e.$$typeof===L||e.$$typeof===k||e.$$typeof===V||e.$$typeof===A)},typeOf:G},D=S((function(e,t){\"production\"!==process.env.NODE_ENV&&function(){var e=\"function\"==typeof Symbol&&Symbol.for,r=e?Symbol.for(\"react.element\"):60103,o=e?Symbol.for(\"react.portal\"):60106,n=e?Symbol.for(\"react.fragment\"):60107,c=e?Symbol.for(\"react.strict_mode\"):60108,a=e?Symbol.for(\"react.profiler\"):60114,i=e?Symbol.for(\"react.provider\"):60109,s=e?Symbol.for(\"react.context\"):60110,u=e?Symbol.for(\"react.async_mode\"):60111,f=e?Symbol.for(\"react.concurrent_mode\"):60111,l=e?Symbol.for(\"react.forward_ref\"):60112,p=e?Symbol.for(\"react.suspense\"):60113,y=e?Symbol.for(\"react.suspense_list\"):60120,d=e?Symbol.for(\"react.memo\"):60115,m=e?Symbol.for(\"react.lazy\"):60116,h=e?Symbol.for(\"react.block\"):60121,v=e?Symbol.for(\"react.fundamental\"):60117,b=e?Symbol.for(\"react.responder\"):60118,S=e?Symbol.for(\"react.scope\"):60119;function g(e){if(\"object\"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:var y=e.type;switch(y){case u:case f:case n:case a:case c:case p:return y;default:var h=y&&y.$$typeof;switch(h){case s:case l:case m:case d:case i:return h;default:return t}}case o:return t}}}var $=u,w=f,P=s,C=i,x=r,E=l,R=n,M=m,N=d,O=o,T=a,_=c,j=p,F=!1;function A(e){return g(e)===f}t.AsyncMode=$,t.ConcurrentMode=w,t.ContextConsumer=P,t.ContextProvider=C,t.Element=x,t.ForwardRef=E,t.Fragment=R,t.Lazy=M,t.Memo=N,t.Portal=O,t.Profiler=T,t.StrictMode=_,t.Suspense=j,t.isAsyncMode=function(e){return F||(F=!0,console.warn(\"The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.\")),A(e)||g(e)===u},t.isConcurrentMode=A,t.isContextConsumer=function(e){return g(e)===s},t.isContextProvider=function(e){return g(e)===i},t.isElement=function(e){return\"object\"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return g(e)===l},t.isFragment=function(e){return g(e)===n},t.isLazy=function(e){return g(e)===m},t.isMemo=function(e){return g(e)===d},t.isPortal=function(e){return g(e)===o},t.isProfiler=function(e){return g(e)===a},t.isStrictMode=function(e){return g(e)===c},t.isSuspense=function(e){return g(e)===p},t.isValidElementType=function(e){return\"string\"==typeof e||\"function\"==typeof e||e===n||e===f||e===a||e===c||e===p||e===y||\"object\"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===d||e.$$typeof===i||e.$$typeof===s||e.$$typeof===l||e.$$typeof===v||e.$$typeof===b||e.$$typeof===S||e.$$typeof===h)},t.typeOf=g}()})),q=(D.AsyncMode,D.ConcurrentMode,D.ContextConsumer,D.ContextProvider,D.Element,D.ForwardRef,D.Fragment,D.Lazy,D.Memo,D.Portal,D.Profiler,D.StrictMode,D.Suspense,D.isAsyncMode,D.isConcurrentMode,D.isContextConsumer,D.isContextProvider,D.isElement,D.isForwardRef,D.isFragment,D.isLazy,D.isMemo,D.isPortal,D.isProfiler,D.isStrictMode,D.isSuspense,D.isValidElementType,D.typeOf,S((function(e){\"production\"===process.env.NODE_ENV?e.exports=I:e.exports=D}))),B={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},K={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},J={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},U={};function H(e){return q.isMemo(e)?J:U[e.$$typeof]||B}U[q.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},U[q.Memo]=J;var Q=Object.defineProperty,W=Object.getOwnPropertyNames,X=Object.getOwnPropertySymbols,Y=Object.getOwnPropertyDescriptor,Z=Object.getPrototypeOf,ee=Object.prototype;var te=function e(t,r,o){if(\"string\"!=typeof r){if(ee){var n=Z(r);n&&n!==ee&&e(t,n,o)}var c=W(r);X&&(c=c.concat(X(r)));for(var a=H(t),i=H(r),s=0;s= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport warn from '../utils/console/warn';\nvar NEWTAB = '_blank';\nvar MIDDLECLICK = 1;\n\nvar OutboundLink = /*#__PURE__*/function (_Component) {\n _inherits(OutboundLink, _Component);\n\n var _super = _createSuper(OutboundLink);\n\n function OutboundLink() {\n var _this;\n\n _classCallCheck(this, OutboundLink);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _defineProperty(_assertThisInitialized(_this), \"handleClick\", function (event) {\n var _this$props = _this.props,\n target = _this$props.target,\n eventLabel = _this$props.eventLabel,\n to = _this$props.to,\n onClick = _this$props.onClick,\n trackerNames = _this$props.trackerNames;\n var eventMeta = {\n label: eventLabel\n };\n var sameTarget = target !== NEWTAB;\n var normalClick = !(event.ctrlKey || event.shiftKey || event.metaKey || event.button === MIDDLECLICK);\n\n if (sameTarget && normalClick) {\n event.preventDefault();\n OutboundLink.trackLink(eventMeta, function () {\n window.location.href = to;\n }, trackerNames);\n } else {\n OutboundLink.trackLink(eventMeta, function () {}, trackerNames);\n }\n\n if (onClick) {\n onClick(event);\n }\n });\n\n return _this;\n }\n\n _createClass(OutboundLink, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n href = _this$props2.to,\n target = _this$props2.target,\n oldProps = _objectWithoutProperties(_this$props2, [\"to\", \"target\"]);\n\n var props = _objectSpread(_objectSpread({}, oldProps), {}, {\n target: target,\n href: href,\n onClick: this.handleClick\n });\n\n if (target === NEWTAB) {\n props.rel = \"\".concat(props.rel ? props.rel : '', \" noopener noreferrer\").trim();\n }\n\n delete props.eventLabel;\n delete props.trackerNames;\n return /*#__PURE__*/React.createElement('a', props);\n }\n }]);\n\n return OutboundLink;\n}(Component);\n\n_defineProperty(OutboundLink, \"trackLink\", function () {\n warn('ga tracking not enabled');\n});\n\nexport { OutboundLink as default };\nOutboundLink.propTypes = {\n eventLabel: PropTypes.string.isRequired,\n target: PropTypes.string,\n to: PropTypes.string,\n onClick: PropTypes.func,\n trackerNames: PropTypes.arrayOf(PropTypes.string)\n};\nOutboundLink.defaultProps = {\n target: null,\n to: null,\n onClick: null,\n trackerNames: null\n};","import warn from './console/warn';\nimport mightBeEmail from './mightBeEmail';\nvar redacted = 'REDACTED (Potential Email Address)';\nexport default function redactEmail(string) {\n if (mightBeEmail(string)) {\n warn('This arg looks like an email address, redacting.');\n return redacted;\n }\n\n return string;\n}","// See if s could be an email address. We don't want to send personal data like email.\n// https://support.google.com/analytics/answer/2795983?hl=en\nexport default function mightBeEmail(s) {\n // There's no point trying to validate rfc822 fully, just look for ...@...\n return typeof s === 'string' && s.indexOf('@') !== -1;\n}","// GA strings need to have leading/trailing whitespace trimmed, and not all\n// browsers have String.prototoype.trim().\nexport default function trim(s) {\n return s && s.toString().replace(/^\\s+|\\s+$/g, '');\n}","/**\n * To Title Case 2.1 - http://individed.com/code/to-title-case/\n * Copyright 2008-2013 David Gouch. Licensed under the MIT License.\n * https://github.com/gouch/to-title-case\n */\nimport trim from './trim';\nvar smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\\.?|via)$/i; // test\n\nexport default function toTitleCase(string) {\n return trim(string).replace(/[A-Za-z0-9\\u00C0-\\u00FF]+[^\\s-]*/g, function (match, index, title) {\n if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' && (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') && title.charAt(index - 1).search(/[^\\s-]/) < 0) {\n return match.toLowerCase();\n }\n\n if (match.substr(1).search(/[A-Z]|\\../) > -1) {\n return match;\n }\n\n return match.charAt(0).toUpperCase() + match.substr(1);\n });\n}","var isLoaded = false;\nexport default function (options) {\n if (isLoaded) return;\n isLoaded = true;\n var gaAddress = 'https://www.google-analytics.com/analytics.js';\n\n if (options && options.gaAddress) {\n gaAddress = options.gaAddress;\n } else if (options && options.debug) {\n gaAddress = 'https://www.google-analytics.com/analytics_debug.js';\n }\n\n var onerror = options && options.onerror; // https://developers.google.com/analytics/devguides/collection/analyticsjs/\n\n /* eslint-disable */\n\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments);\n }, i[r].l = 1 * new Date();\n a = s.createElement(o), m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n a.onerror = onerror;\n m.parentNode.insertBefore(a, m);\n })(window, document, 'script', gaAddress, 'ga');\n /* eslint-enable */\n\n}","export default function log(s) {\n console.info('[react-ga]', s);\n}","export var gaCalls = [];\nexport default {\n calls: gaCalls,\n ga: function ga() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n gaCalls.push([].concat(args));\n },\n resetCalls: function resetCalls() {\n gaCalls.length = 0;\n }\n};","function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * React Google Analytics Module\n *\n * @package react-ga\n * @author Adam Lofting \n * Atul Varma \n */\n\n/**\n * Utilities\n */\nimport format from './utils/format';\nimport removeLeadingSlash from './utils/removeLeadingSlash';\nimport trim from './utils/trim';\nimport loadGA from './utils/loadGA';\nimport warn from './utils/console/warn';\nimport log from './utils/console/log';\nimport TestModeAPI from './utils/testModeAPI';\n\nvar _isNotBrowser = typeof window === 'undefined' || typeof document === 'undefined';\n\nvar _debug = false;\nvar _titleCase = true;\nvar _testMode = false;\nvar _alwaysSendToDefaultTracker = true;\nvar _redactEmail = true;\n\nvar internalGa = function internalGa() {\n var _window;\n\n if (_testMode) return TestModeAPI.ga.apply(TestModeAPI, arguments);\n if (_isNotBrowser) return false;\n if (!window.ga) return warn('ReactGA.initialize must be called first or GoogleAnalytics should be loaded manually');\n return (_window = window).ga.apply(_window, arguments);\n};\n\nfunction _format(s) {\n return format(s, _titleCase, _redactEmail);\n}\n\nfunction _gaCommand(trackerNames) {\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\n var command = args[0];\n\n if (typeof internalGa === 'function') {\n if (typeof command !== 'string') {\n warn('ga command must be a string');\n return;\n }\n\n if (_alwaysSendToDefaultTracker || !Array.isArray(trackerNames)) internalGa.apply(void 0, args);\n\n if (Array.isArray(trackerNames)) {\n trackerNames.forEach(function (name) {\n internalGa.apply(void 0, _toConsumableArray([\"\".concat(name, \".\").concat(command)].concat(args.slice(1))));\n });\n }\n }\n}\n\nfunction _initialize(gaTrackingID, options) {\n if (!gaTrackingID) {\n warn('gaTrackingID is required in initialize()');\n return;\n }\n\n if (options) {\n if (options.debug && options.debug === true) {\n _debug = true;\n }\n\n if (options.titleCase === false) {\n _titleCase = false;\n }\n\n if (options.redactEmail === false) {\n _redactEmail = false;\n }\n\n if (options.useExistingGa) {\n return;\n }\n }\n\n if (options && options.gaOptions) {\n internalGa('create', gaTrackingID, options.gaOptions);\n } else {\n internalGa('create', gaTrackingID, 'auto');\n }\n}\n\nexport function addTrackers(configsOrTrackingId, options) {\n if (Array.isArray(configsOrTrackingId)) {\n configsOrTrackingId.forEach(function (config) {\n if (_typeof(config) !== 'object') {\n warn('All configs must be an object');\n return;\n }\n\n _initialize(config.trackingId, config);\n });\n } else {\n _initialize(configsOrTrackingId, options);\n }\n\n return true;\n}\nexport function initialize(configsOrTrackingId, options) {\n if (options && options.testMode === true) {\n _testMode = true;\n } else {\n if (_isNotBrowser) {\n return;\n }\n\n if (!options || options.standardImplementation !== true) loadGA(options);\n }\n\n _alwaysSendToDefaultTracker = options && typeof options.alwaysSendToDefaultTracker === 'boolean' ? options.alwaysSendToDefaultTracker : true;\n addTrackers(configsOrTrackingId, options);\n}\n/**\n * ga:\n * Returns the original GA object.\n */\n\nexport function ga() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n if (args.length > 0) {\n internalGa.apply(void 0, args);\n\n if (_debug) {\n log(\"called ga('arguments');\");\n log(\"with arguments: \".concat(JSON.stringify(args)));\n }\n }\n\n return window.ga;\n}\n/**\n * set:\n * GA tracker set method\n * @param {Object} fieldsObject - a field/value pair or a group of field/value pairs on the tracker\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function set(fieldsObject, trackerNames) {\n if (!fieldsObject) {\n warn('`fieldsObject` is required in .set()');\n return;\n }\n\n if (_typeof(fieldsObject) !== 'object') {\n warn('Expected `fieldsObject` arg to be an Object');\n return;\n }\n\n if (Object.keys(fieldsObject).length === 0) {\n warn('empty `fieldsObject` given to .set()');\n }\n\n _gaCommand(trackerNames, 'set', fieldsObject);\n\n if (_debug) {\n log(\"called ga('set', fieldsObject);\");\n log(\"with fieldsObject: \".concat(JSON.stringify(fieldsObject)));\n }\n}\n/**\n * send:\n * Clone of the low level `ga.send` method\n * WARNING: No validations will be applied to this\n * @param {Object} fieldObject - field object for tracking different analytics\n * @param {Array} trackerNames - trackers to send the command to\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function send(fieldObject, trackerNames) {\n _gaCommand(trackerNames, 'send', fieldObject);\n\n if (_debug) {\n log(\"called ga('send', fieldObject);\");\n log(\"with fieldObject: \".concat(JSON.stringify(fieldObject)));\n log(\"with trackers: \".concat(JSON.stringify(trackerNames)));\n }\n}\n/**\n * pageview:\n * Basic GA pageview tracking\n * @param {String} path - the current page page e.g. '/about'\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n * @param {String} title - (optional) the page title e. g. 'My Website'\n */\n\nexport function pageview(rawPath, trackerNames, title) {\n if (!rawPath) {\n warn('path is required in .pageview()');\n return;\n }\n\n var path = trim(rawPath);\n\n if (path === '') {\n warn('path cannot be an empty string in .pageview()');\n return;\n }\n\n var extraFields = {};\n\n if (title) {\n extraFields.title = title;\n }\n\n if (typeof ga === 'function') {\n _gaCommand(trackerNames, 'send', _objectSpread({\n hitType: 'pageview',\n page: path\n }, extraFields));\n\n if (_debug) {\n log(\"called ga('send', 'pageview', path);\");\n var extraLog = '';\n\n if (title) {\n extraLog = \" and title: \".concat(title);\n }\n\n log(\"with path: \".concat(path).concat(extraLog));\n }\n }\n}\n/**\n * modalview:\n * a proxy to basic GA pageview tracking to consistently track\n * modal views that are an equivalent UX to a traditional pageview\n * @param {String} modalName e.g. 'add-or-edit-club'\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function modalview(rawModalName, trackerNames) {\n if (!rawModalName) {\n warn('modalName is required in .modalview(modalName)');\n return;\n }\n\n var modalName = removeLeadingSlash(trim(rawModalName));\n\n if (modalName === '') {\n warn('modalName cannot be an empty string or a single / in .modalview()');\n return;\n }\n\n if (typeof ga === 'function') {\n var path = \"/modal/\".concat(modalName);\n\n _gaCommand(trackerNames, 'send', 'pageview', path);\n\n if (_debug) {\n log(\"called ga('send', 'pageview', path);\");\n log(\"with path: \".concat(path));\n }\n }\n}\n/**\n * timing:\n * GA timing\n * @param args.category {String} required\n * @param args.variable {String} required\n * @param args.value {Int} required\n * @param args.label {String} required\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function timing() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n category = _ref.category,\n variable = _ref.variable,\n value = _ref.value,\n label = _ref.label;\n\n var trackerNames = arguments.length > 1 ? arguments[1] : undefined;\n\n if (typeof ga === 'function') {\n if (!category || !variable || typeof value !== 'number') {\n warn('args.category, args.variable ' + 'AND args.value are required in timing() ' + 'AND args.value has to be a number');\n return;\n } // Required Fields\n\n\n var fieldObject = {\n hitType: 'timing',\n timingCategory: _format(category),\n timingVar: _format(variable),\n timingValue: value\n };\n\n if (label) {\n fieldObject.timingLabel = _format(label);\n }\n\n send(fieldObject, trackerNames);\n }\n}\n/**\n * event:\n * GA event tracking\n * @param args.category {String} required\n * @param args.action {String} required\n * @param args.label {String} optional\n * @param args.value {Int} optional\n * @param args.nonInteraction {boolean} optional\n * @param args.transport {string} optional\n * @param {{action: string, category: string}} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function event() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n category = _ref2.category,\n action = _ref2.action,\n label = _ref2.label,\n value = _ref2.value,\n nonInteraction = _ref2.nonInteraction,\n transport = _ref2.transport,\n args = _objectWithoutProperties(_ref2, [\"category\", \"action\", \"label\", \"value\", \"nonInteraction\", \"transport\"]);\n\n var trackerNames = arguments.length > 1 ? arguments[1] : undefined;\n\n if (typeof ga === 'function') {\n // Simple Validation\n if (!category || !action) {\n warn('args.category AND args.action are required in event()');\n return;\n } // Required Fields\n\n\n var fieldObject = {\n hitType: 'event',\n eventCategory: _format(category),\n eventAction: _format(action)\n }; // Optional Fields\n\n if (label) {\n fieldObject.eventLabel = _format(label);\n }\n\n if (typeof value !== 'undefined') {\n if (typeof value !== 'number') {\n warn('Expected `args.value` arg to be a Number.');\n } else {\n fieldObject.eventValue = value;\n }\n }\n\n if (typeof nonInteraction !== 'undefined') {\n if (typeof nonInteraction !== 'boolean') {\n warn('`args.nonInteraction` must be a boolean.');\n } else {\n fieldObject.nonInteraction = nonInteraction;\n }\n }\n\n if (typeof transport !== 'undefined') {\n if (typeof transport !== 'string') {\n warn('`args.transport` must be a string.');\n } else {\n if (['beacon', 'xhr', 'image'].indexOf(transport) === -1) {\n warn('`args.transport` must be either one of these values: `beacon`, `xhr` or `image`');\n }\n\n fieldObject.transport = transport;\n }\n }\n\n Object.keys(args).filter(function (key) {\n return key.substr(0, 'dimension'.length) === 'dimension';\n }).forEach(function (key) {\n fieldObject[key] = args[key];\n });\n Object.keys(args).filter(function (key) {\n return key.substr(0, 'metric'.length) === 'metric';\n }).forEach(function (key) {\n fieldObject[key] = args[key];\n }); // Send to GA\n\n send(fieldObject, trackerNames);\n }\n}\n/**\n * exception:\n * GA exception tracking\n * @param args.description {String} optional\n * @param args.fatal {boolean} optional\n * @param {Array} trackerNames - (optional) a list of extra trackers to run the command on\n */\n\nexport function exception(_ref3, trackerNames) {\n var description = _ref3.description,\n fatal = _ref3.fatal;\n\n if (typeof ga === 'function') {\n // Required Fields\n var fieldObject = {\n hitType: 'exception'\n }; // Optional Fields\n\n if (description) {\n fieldObject.exDescription = _format(description);\n }\n\n if (typeof fatal !== 'undefined') {\n if (typeof fatal !== 'boolean') {\n warn('`args.fatal` must be a boolean.');\n } else {\n fieldObject.exFatal = fatal;\n }\n } // Send to GA\n\n\n send(fieldObject, trackerNames);\n }\n}\nexport var plugin = {\n /**\n * require:\n * GA requires a plugin\n * @param name {String} e.g. 'ecommerce' or 'myplugin'\n * @param options {Object} optional e.g {path: '/log', debug: true}\n * @param trackerName {String} optional e.g 'trackerName'\n */\n require: function require(rawName, options, trackerName) {\n if (typeof ga === 'function') {\n // Required Fields\n if (!rawName) {\n warn('`name` is required in .require()');\n return;\n }\n\n var name = trim(rawName);\n\n if (name === '') {\n warn('`name` cannot be an empty string in .require()');\n return;\n }\n\n var requireString = trackerName ? \"\".concat(trackerName, \".require\") : 'require'; // Optional Fields\n\n if (options) {\n if (_typeof(options) !== 'object') {\n warn('Expected `options` arg to be an Object');\n return;\n }\n\n if (Object.keys(options).length === 0) {\n warn('Empty `options` given to .require()');\n }\n\n ga(requireString, name, options);\n\n if (_debug) {\n log(\"called ga('require', '\".concat(name, \"', \").concat(JSON.stringify(options)));\n }\n } else {\n ga(requireString, name);\n\n if (_debug) {\n log(\"called ga('require', '\".concat(name, \"');\"));\n }\n }\n }\n },\n\n /**\n * execute:\n * GA execute action for plugin\n * Takes variable number of arguments\n * @param pluginName {String} e.g. 'ecommerce' or 'myplugin'\n * @param action {String} e.g. 'addItem' or 'myCustomAction'\n * @param actionType {String} optional e.g. 'detail'\n * @param payload {Object} optional e.g { id: '1x5e', name : 'My product to track' }\n */\n execute: function execute(pluginName, action) {\n var payload;\n var actionType;\n\n for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n args[_key3 - 2] = arguments[_key3];\n }\n\n if (args.length === 1) {\n payload = args[0];\n } else {\n actionType = args[0];\n payload = args[1];\n }\n\n if (typeof ga === 'function') {\n if (typeof pluginName !== 'string') {\n warn('Expected `pluginName` arg to be a String.');\n } else if (typeof action !== 'string') {\n warn('Expected `action` arg to be a String.');\n } else {\n var command = \"\".concat(pluginName, \":\").concat(action);\n payload = payload || null;\n\n if (actionType && payload) {\n ga(command, actionType, payload);\n\n if (_debug) {\n log(\"called ga('\".concat(command, \"');\"));\n log(\"actionType: \\\"\".concat(actionType, \"\\\" with payload: \").concat(JSON.stringify(payload)));\n }\n } else if (payload) {\n ga(command, payload);\n\n if (_debug) {\n log(\"called ga('\".concat(command, \"');\"));\n log(\"with payload: \".concat(JSON.stringify(payload)));\n }\n } else {\n ga(command);\n\n if (_debug) {\n log(\"called ga('\".concat(command, \"');\"));\n }\n }\n }\n }\n }\n};\n/**\n * outboundLink:\n * GA outboundLink tracking\n * @param args.label {String} e.g. url, or 'Create an Account'\n * @param {function} hitCallback - Called after processing a hit.\n */\n\nexport function outboundLink(args, hitCallback, trackerNames) {\n if (typeof hitCallback !== 'function') {\n warn('hitCallback function is required');\n return;\n }\n\n if (typeof ga === 'function') {\n // Simple Validation\n if (!args || !args.label) {\n warn('args.label is required in outboundLink()');\n return;\n } // Required Fields\n\n\n var fieldObject = {\n hitType: 'event',\n eventCategory: 'Outbound',\n eventAction: 'Click',\n eventLabel: _format(args.label)\n };\n var safetyCallbackCalled = false;\n\n var safetyCallback = function safetyCallback() {\n // This prevents a delayed response from GA\n // causing hitCallback from being fired twice\n safetyCallbackCalled = true;\n hitCallback();\n }; // Using a timeout to ensure the execution of critical application code\n // in the case when the GA server might be down\n // or an ad blocker prevents sending the data\n // register safety net timeout:\n\n\n var t = setTimeout(safetyCallback, 250);\n\n var clearableCallbackForGA = function clearableCallbackForGA() {\n clearTimeout(t);\n\n if (!safetyCallbackCalled) {\n hitCallback();\n }\n };\n\n fieldObject.hitCallback = clearableCallbackForGA; // Send to GA\n\n send(fieldObject, trackerNames);\n } else {\n // if ga is not defined, return the callback so the application\n // continues to work as expected\n setTimeout(hitCallback, 0);\n }\n}\nexport var testModeAPI = TestModeAPI;\nexport default {\n initialize: initialize,\n ga: ga,\n set: set,\n send: send,\n pageview: pageview,\n modalview: modalview,\n timing: timing,\n event: event,\n exception: exception,\n plugin: plugin,\n outboundLink: outboundLink,\n testModeAPI: TestModeAPI\n};","import redactEmail from './redactEmail';\nimport toTitleCase from './toTitleCase';\nexport default function format() {\n var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var titleCase = arguments.length > 1 ? arguments[1] : undefined;\n var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _str = s || '';\n\n if (titleCase) {\n _str = toTitleCase(s);\n }\n\n if (redactingEmail) {\n _str = redactEmail(_str);\n }\n\n return _str;\n}","export default function removeLeadingSlash(string) {\n if (string.substring(0, 1) === '/') {\n return string.substring(1);\n }\n\n return string;\n}","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport UnboundOutboundLink from './components/OutboundLink';\nimport * as Defaults from './core';\nvar initialize = Defaults.initialize;\nexport { initialize };\nvar addTrackers = Defaults.addTrackers;\nexport { addTrackers };\nvar ga = Defaults.ga;\nexport { ga };\nvar set = Defaults.set;\nexport { set };\nvar send = Defaults.send;\nexport { send };\nvar pageview = Defaults.pageview;\nexport { pageview };\nvar modalview = Defaults.modalview;\nexport { modalview };\nvar timing = Defaults.timing;\nexport { timing };\nvar event = Defaults.event;\nexport { event };\nvar exception = Defaults.exception;\nexport { exception };\nvar plugin = Defaults.plugin;\nexport { plugin };\nvar outboundLink = Defaults.outboundLink;\nexport { outboundLink };\nvar testModeAPI = Defaults.testModeAPI;\nexport { testModeAPI };\nUnboundOutboundLink.origTrackLink = UnboundOutboundLink.trackLink;\nUnboundOutboundLink.trackLink = Defaults.outboundLink;\nexport var OutboundLink = UnboundOutboundLink;\nexport default _objectSpread(_objectSpread({}, Defaults), {}, {\n OutboundLink: OutboundLink\n});","import {\n CartServiceInterface,\n CheckEmailAnalyticsInterface,\n GetCheckEmailAnalyticsServiceOptions,\n HamletClientInterface\n} from '../../model/check-email-page';\nimport { CheckEmailAnalytics } from './analytics';\nimport { CartService } from './cart-service';\nimport { HamletClient } from './mini-hamlet-client';\n\nexport * from './analytics';\nexport * from './cart-service';\nexport * from './mini-hamlet-client';\n\nlet hamletClient: HamletClientInterface;\nlet cartService: CartServiceInterface;\nlet checkEmailAnalytics: CheckEmailAnalyticsInterface;\n\nexport function getCheckEmailAnalyticsService({\n baseUrl,\n analyticsTrack,\n productKeys,\n googleAnalyticsId\n}: GetCheckEmailAnalyticsServiceOptions) {\n if (!checkEmailAnalytics) {\n hamletClient = new HamletClient({ baseUrl });\n cartService = new CartService({ productKeys, hamletClient });\n checkEmailAnalytics = new CheckEmailAnalytics({\n analyticsTrack,\n googleAnalyticsId,\n cartService\n });\n }\n return checkEmailAnalytics;\n}\n","import { ProductKey, Url } from '@atlassiansox/bxpkit-core';\nimport { extend } from 'lodash';\nimport {\n CartServiceContructorType,\n CartServiceInterface,\n HamletClientInterface,\n HamletPricingResponseType,\n HamletProductType\n} from '../../model/check-email-page';\n\nexport const CartService: CartServiceContructorType = class CartServiceClass\n implements CartServiceInterface\n{\n private readonly client: HamletClientInterface;\n private readonly productKeysProp?: string[];\n private products: HamletProductType[];\n\n constructor({\n productKeys,\n hamletClient\n }: {\n productKeys?: string[];\n hamletClient: HamletClientInterface;\n }) {\n this.client = hamletClient;\n this.productKeysProp = productKeys;\n this.products = [];\n }\n\n /**\n * Return cart products\n */\n\n getProducts(): Promise {\n return new Promise(async (resolve) => {\n if (this.products.length > 0) {\n return resolve(this.products);\n } else {\n this.products = await this._load();\n resolve(this.products);\n }\n });\n }\n\n /**\n * Loads cart data from Hamlet Pricing\n */\n\n async _load(): Promise {\n const queryProducts = [\n ProductKey.JIRA_SOFTWARE,\n ProductKey.JIRA_SERVICE_DESK,\n ProductKey.JIRA_CORE,\n ProductKey.JIRA_ROADMAPS,\n ProductKey.JIRA_BONFIRE,\n ProductKey.JIRA_REFAPP,\n ProductKey.CONFLUENCE,\n ProductKey.CONFLUENCE_PLUGIN_QUESTIONS,\n ProductKey.CONFLUENCE_TEAM_CALENDARS\n ];\n\n const pricingData = await this.client.hamletPricing({\n productKeys: queryProducts,\n licenseType: 'evaluation',\n requestingApplication: 'WAC',\n monthsValid: '1'\n });\n\n // parse\n const products = this._parseProducts(pricingData);\n return Promise.resolve(products);\n }\n\n /**\n * Parse products into cart\n */\n\n _parseProducts(pricingData: HamletPricingResponseType): HamletProductType[] {\n const result: any[] = [];\n if (pricingData?.products?.length === 0) {\n return result;\n }\n const productCatalog = pricingData.products;\n const urlProducts: { [key: string]: number } = {};\n\n // read unitCount and products query string parameters\n const queryParams = Url.getUrlParams();\n const unitCounts = queryParams?.unitCount\n ? queryParams.unitCount.split(',')\n : [10];\n let queryParamProducts = [];\n // check query string params for products\n if (queryParams?.products) {\n queryParamProducts = queryParams?.products.split(',');\n }\n // if props exist for productKeys, those have priority\n if (this.productKeysProp && this.productKeysProp.length > 0) {\n queryParamProducts = this.productKeysProp;\n }\n\n // create a map of products/unit counts for each item in querystring\n for (let i = 0, iLen = queryParamProducts.length; i < iLen; i++) {\n const product = queryParamProducts[i];\n let count = 0;\n\n if (unitCounts.length === 1) {\n if (\n product === ProductKey.JIRA_SOFTWARE ||\n product === ProductKey.CONFLUENCE\n ) {\n count = parseInt(unitCounts[0], 10);\n }\n } else if (unitCounts.length === queryParamProducts.length) {\n count = parseInt(unitCounts[i], 10);\n }\n\n urlProducts[product] = count;\n }\n\n // check if product is orderable, if so then add it to the cart\n Object.keys(urlProducts).map((key) => {\n let orderable = null;\n const productUnitCount = urlProducts[key];\n const productHamlet = productCatalog.filter((p) => {\n return p.productKey === key;\n })[0];\n\n if (productHamlet) {\n if (\n productHamlet.parentKey === 'atlassian.ondemand' ||\n productHamlet.productType === 'HOSTED_ADDON' ||\n productUnitCount !== 0\n ) {\n orderable = productHamlet.orderableItems.filter((item) => {\n return item.unitCount === productUnitCount;\n })[0];\n }\n if (!orderable) {\n orderable =\n productHamlet.monthly.length > 0\n ? productHamlet.monthly[0]\n : productHamlet.orderableItems[0];\n }\n }\n\n if (productHamlet && orderable) {\n result.push(\n extend({}, orderable, {\n amount: orderable?.renewalAmount,\n mpac: productHamlet.marketplaceAddon === true,\n productKey: productHamlet.productKey,\n name: productHamlet.productDescription,\n saleType: 'EVALUATION'\n })\n );\n }\n });\n\n return result;\n }\n};\n","import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';\nimport { AnalyticsTrackType, Storage, Url } from '@atlassiansox/bxpkit-core';\nimport ReactGA from 'react-ga';\nimport { CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES } from '../../model/check-email-page';\nimport {\n CartServiceInterface,\n CheckEmailAnalyticsContructorType,\n CheckEmailAnalyticsInterface,\n CheckEmailAnalyticsOptionsType\n} from '../../model/check-email-page';\n\n/**\n * Analytics service for Check Email Component\n */\n\nexport const CheckEmailAnalytics: CheckEmailAnalyticsContructorType = class CheckEmailAnalyticsClass\n implements CheckEmailAnalyticsInterface\n{\n baseUrl?: string;\n analyticsTrack?: AnalyticsTrackType;\n cartService: CartServiceInterface;\n\n constructor({\n analyticsTrack,\n cartService,\n googleAnalyticsId = ''\n }: CheckEmailAnalyticsOptionsType) {\n this.analyticsTrack = analyticsTrack;\n this.cartService = cartService;\n\n ReactGA.initialize(googleAnalyticsId, {\n testMode: process?.env?.NODE_ENV === 'test'\n });\n this._onloadEvents();\n if (!this.analyticsTrack) {\n // tslint:disable-next-line: no-console\n console.warn('Check Email Component: analytics disabled');\n }\n }\n\n /**\n * All events that should fire on load\n */\n\n async _onloadEvents() {\n const googleApps =\n Url.getParameterByName('googleappsintegration') === 'true';\n\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n const products = await this.cartService.getProducts();\n\n const completedOrderDetails: any = [];\n optimizely('cart-cloud.viewed-checkout-step.view-confirmation-page');\n\n products.map((product) => {\n // add to cart events\n const detailsAddToCart = {\n id: product.productKey,\n label: `${product.productKey}.cloud`,\n name: product.name,\n description: product.description,\n sku: product.orderableItemId,\n category: 'cart-cloud',\n saleType: product.saleType,\n core_funnel: true\n };\n segment('Added Product', detailsAddToCart);\n optimizely('added-product.' + detailsAddToCart.id);\n\n // confirmed eval event(s)\n const detailsConfirmedEval = {\n id: product.productKey,\n sku: product.orderableItemId,\n name: product.name,\n description: product.description,\n saleType: 'EVALUATION',\n category: 'cart-cloud',\n core_funnel: false,\n label: `${product.productKey}.cloud`,\n lead_score: '',\n licenses: '',\n platform: 'cloud',\n product: product.name,\n start_date: new Date(),\n _atl_path: Storage.getCookie('__atl_path'),\n _sio: Storage.getCookie('_sio')\n };\n segment('Confirmed Evaluation', detailsConfirmedEval);\n optimizely(\n 'cart-cloud.confirmed-evaluation.' + detailsConfirmedEval.id\n );\n\n // save for completed order event\n completedOrderDetails.push({\n id: product.productKey,\n sku: product.orderableItemId,\n name: product.name,\n description: product.description,\n saleType: 'EVALUATION'\n });\n });\n\n // order event with everything in-cart\n if (completedOrderDetails.length > 0) {\n segment('Completed Order', {\n type: 'ONDEMAND_TRIAL',\n googleApps: googleApps.toString(),\n products: completedOrderDetails\n });\n }\n\n if (googleApps) {\n segment('Confirm Google Apps', {\n category: 'cart-cloud',\n label: 'google-apps',\n core_funnel: false\n });\n }\n }\n\n ReactGA.event({\n category: 'cart-cloud',\n action: 'Viewed Checkout Step',\n label: 'view-confirmation-page',\n nonInteraction: true\n });\n\n return Promise.resolve();\n }\n\n /**\n * User selects resend email button\n */\n\n clickResendButton(createAnalyticsEvent: CreateUIAnalyticsEvent) {\n createAnalyticsEvent({\n action: 'clicked',\n name: CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES.RESEND_EMAIL_CLICKED\n }).fire();\n\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Click resend email', {});\n optimizely('resend-email-page.Click resend email');\n }\n\n ReactGA.event({\n category: 'Signup',\n action: 'Clicked',\n label: 'resend-verification-email'\n });\n }\n\n /**\n * track no-content/204 status\n */\n\n resendApiNoContent() {\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Resend api returned no content', {});\n optimizely('resend-email-page.Resend api returned no content');\n }\n }\n\n /**\n * track already verified/304 status\n */\n\n resendApiAlreadyVerified() {\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Resend api account already verified', {});\n optimizely('resend-email-page.Resend api account already verified');\n }\n }\n\n /**\n * track resend API failures\n */\n\n resendApiFailure() {\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Resend api fail', {});\n optimizely('resend-email-page.Resend api fail');\n }\n }\n\n /**\n * track success/200 status\n */\n\n resendApiSuccess() {\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Resend api success', {});\n optimizely('resend-email-page.Resend api success');\n }\n }\n\n /**\n * User selects contact link\n */\n\n contactLinkAnalytics(createAnalyticsEvent: CreateUIAnalyticsEvent) {\n createAnalyticsEvent({\n action: 'clicked',\n name: CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES.CONTACT_LINK_CLICKED\n }).fire();\n\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Click contact us', {});\n optimizely('resend-email-page.Click contact us');\n }\n }\n\n /**\n * User selects create a new account link\n */\n\n navigateBack(\n event: React.MouseEvent,\n createAnalyticsEvent: CreateUIAnalyticsEvent\n ) {\n event.preventDefault();\n\n createAnalyticsEvent({\n action: 'clicked',\n name: CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES.CREATE_NEW_ACCOUNT_CLICKED\n }).fire();\n\n if (this.analyticsTrack) {\n const { segment, optimizely } = this.analyticsTrack;\n segment('Click change email', {});\n optimizely('resend-email-page.Click change email');\n }\n\n window.history.back();\n }\n};\n\ndeclare global {\n interface Window {\n ga: any;\n }\n}\n","import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';\nimport { AnalyticsTrackType } from '@atlassiansox/bxpkit-core';\n\nexport const CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES = {\n CREATE_NEW_ACCOUNT_CLICKED: 'check_email_page_create_new_account_clicked',\n CONTACT_LINK_CLICKED: 'check_email_page_contact_link_clicked',\n RESEND_EMAIL_CLICKED: 'check_email_page_resend_email_clicked',\n RESEND_EMAIL_API_SUCCESS: 'check_email_page_resend_email_api_success',\n RESEND_EMAIL_API_FAILURE: 'check_email_page_resend_email_api_failure'\n};\n\nexport type GetCheckEmailAnalyticsServiceOptions = {\n readonly baseUrl?: string;\n readonly productKeys?: string[];\n readonly analyticsTrack?: AnalyticsTrackType;\n readonly googleAnalyticsId?: string;\n};\n\nexport interface CheckEmailPagePropsType {\n readonly layout?: 'default' | 'devops';\n readonly baseUrl?: string;\n readonly productKeys?: string[];\n readonly analyticsTrack?: AnalyticsTrackType;\n readonly hideHeader?: boolean;\n}\n\nexport type CheckEmailPageLayoutPropsType = {\n readonly email: string;\n readonly shouldEnable: boolean;\n readonly baseUrl?: string;\n readonly hideHeader?: boolean;\n readonly checkEmailAnalyticsService: CheckEmailAnalyticsInterface;\n};\n\nexport type CheckEmailAnalyticsOptionsType = {\n readonly productKeys?: string[];\n readonly analyticsTrack?: AnalyticsTrackType;\n readonly cartService: CartServiceInterface;\n readonly googleAnalyticsId?: string;\n};\n\nexport type ResendVerificationEmailRequestType = {\n readonly cloudId?: string;\n readonly cloudName?: string;\n readonly email?: string;\n readonly pagePath?: string;\n readonly requestId?: string;\n readonly primaryProduct?: string;\n};\n\nexport type HamletClientOptionsType = {\n readonly baseUrl?: string;\n};\n\nexport type ResendVerificationEmailResponseType = {\n readonly success: boolean;\n readonly status: number;\n};\n\nexport type HamletPricingRequestType = {\n readonly productKeys: string[];\n readonly licenseType?: string;\n readonly monthsValid?: string | number;\n readonly requestingApplication?: string;\n};\n\nexport type HamletOrderableItemsType = {\n readonly amount: number;\n readonly description: string;\n readonly edition: unknown;\n readonly editionDescription: string;\n readonly editionId: string;\n readonly editionType: string;\n readonly editionTypeIsDeprecated: boolean;\n readonly enterprise: boolean;\n readonly licenseType: string;\n readonly monthsValid: number;\n readonly orderableItemId: string;\n readonly publiclyAvailable: boolean;\n readonly renewalAmount: number;\n readonly renewalFrequency: string;\n readonly saleType: string;\n readonly sku: unknown;\n readonly starter: boolean;\n readonly unitCount: number;\n readonly unitLabel: string;\n};\n\nexport type HamletMonthlyType = {\n readonly editionType: string;\n readonly editionTypeIsDeprecated: boolean;\n readonly price: number;\n readonly unitBlockSize: number;\n readonly unitLabel: string;\n readonly unitLimit: number;\n readonly unitStart: number;\n readonly renewalAmount: number;\n};\n\nexport type HamletProductsType = {\n readonly annual: unknown[];\n readonly billingType: string;\n readonly contactSalesForAdditionalPricing: boolean;\n readonly dataCenter: boolean;\n readonly discountOptOut: boolean;\n readonly lastModified: string;\n readonly marketplaceAddon: boolean;\n readonly parentDescription: string;\n readonly parentKey: string;\n readonly productDescription: string;\n readonly productKey: string;\n readonly productType: string;\n readonly userCountEnforced: boolean;\n readonly monthly: HamletMonthlyType[];\n readonly orderableItems: HamletOrderableItemsType[];\n};\n\nexport type HamletPricingResponseType = {\n readonly currency: string;\n readonly products: HamletProductsType[];\n};\n\nexport type HamletProductType = {\n readonly name: string;\n} & (HamletOrderableItemsType & HamletMonthlyType & HamletProductsType);\n\nexport type HamletClientConstructorType = new ({\n baseUrl\n}: HamletClientOptionsType) => HamletClientInterface;\n\nexport interface HamletClientInterface {\n hamletPricing({\n productKeys,\n licenseType,\n requestingApplication,\n monthsValid\n }: HamletPricingRequestType): Promise;\n\n sendEmail(\n resendData: ResendVerificationEmailRequestType\n ): Promise;\n\n sendVerificationEmail({\n cloudName,\n email\n }: ResendVerificationEmailRequestType): Promise;\n\n resendVerificationEmail({\n cloudId,\n cloudName,\n email,\n pagePath,\n requestId\n }: ResendVerificationEmailRequestType): Promise;\n}\n\nexport type CartServiceOptionstype = {\n productKeys?: string[];\n hamletClient: HamletClientInterface;\n};\n\nexport type CartServiceContructorType = new ({\n productKeys,\n hamletClient\n}: CartServiceOptionstype) => CartServiceInterface;\n\nexport interface CartServiceInterface {\n getProducts(): Promise;\n _load(): Promise;\n _parseProducts(pricingData: HamletPricingResponseType): HamletProductType[];\n}\n\nexport type CheckEmailAnalyticsContructorType = new ({\n cartService,\n analyticsTrack\n}: CheckEmailAnalyticsOptionsType) => CheckEmailAnalyticsInterface;\n\nexport interface CheckEmailAnalyticsInterface {\n gaId?: string;\n baseUrl?: string;\n analyticsTrack?: AnalyticsTrackType;\n cartService: CartServiceInterface;\n _onloadEvents(): Promise;\n clickResendButton(createAnalyticsEvent: CreateUIAnalyticsEvent): void;\n resendApiNoContent(): void;\n resendApiAlreadyVerified(): void;\n resendApiFailure(): void;\n resendApiSuccess(): void;\n contactLinkAnalytics(createAnalyticsEvent: CreateUIAnalyticsEvent): void;\n navigateBack(\n event: React.MouseEvent,\n createAnalyticsEvent: CreateUIAnalyticsEvent\n ): void;\n}\n","import React from 'react';\n\nconst InboxImg: React.FC = (props) => (\n \n);\n\nexport default InboxImg;\n","import { defineMessages } from 'react-intl';\n\nconst ID_PREFIX = 'WacSignupForm.';\nexport const messages = defineMessages({\n header: {\n id: `${ID_PREFIX}header`,\n defaultMessage: 'Great, check your inbox'\n },\n devopsHeader: {\n id: `${ID_PREFIX}devopsHeader`,\n defaultMessage: 'Your suite is ready!'\n },\n devopsSubHeader: {\n id: `${ID_PREFIX}devopsSubHeader`,\n defaultMessage: 'Activate your account to log in'\n },\n devopsNoResendNoEmail: {\n id: `${ID_PREFIX}devopsNoResendNoEmail`,\n defaultMessage:\n \"Didn't receive an email from us?
Check your spam folder or try resending the email below.\"\n },\n devopsEmailSent: {\n id: `${ID_PREFIX}devopsEmailSent`,\n defaultMessage:\n \"We've sent an email to {email}
with a link to activate your account.\"\n },\n resendEmailLineOne: {\n id: `${ID_PREFIX}resendEmailLineOne`,\n defaultMessage: \"We've emailed a verification link to:\"\n },\n resendEmailLineTwo: {\n id: `${ID_PREFIX}resendEmailLineTwo`,\n defaultMessage: 'It will expire shortly, so verify soon.'\n },\n resendEmailCheckSpam: {\n id: `${ID_PREFIX}resendEmailCheckSpam`,\n defaultMessage: 'Remember to check your spam folder.'\n },\n resendEmailAction: {\n id: `${ID_PREFIX}resendEmailAction`,\n defaultMessage: 'Resend Email'\n },\n resendEmailChangeEmail: {\n id: `${ID_PREFIX}resendEmailChangeEmail`,\n defaultMessage: 'Need to change your email address?'\n },\n resendEmailChangeEmailAction: {\n id: `${ID_PREFIX}resendEmailChangeEmailAction`,\n defaultMessage: \"You'll need to create a new account.\"\n },\n resendEmailStillNoEmail: {\n id: `${ID_PREFIX}resendEmailStillNoEmail`,\n defaultMessage: 'Still not getting the email? We can help.'\n },\n resendEmailCreateAHelpTicket: {\n id: `${ID_PREFIX}resendEmailCreateAHelpTicket`,\n defaultMessage: 'Create a help ticket.'\n },\n noResendNoEmail: {\n id: `${ID_PREFIX}noResendNoEmail`,\n defaultMessage: \"Didn't receive an email from us?\"\n },\n noResendEmailConfirmation: {\n id: `${ID_PREFIX}noResendEmailConfirmation`,\n defaultMessage:\n 'Email confirmation helps us to ensure your data will always be safe.'\n },\n noResendContactUsHtml: {\n id: `${ID_PREFIX}noResendContactUsHtml`,\n defaultMessage: 'Contact us.'\n }\n});\n","import { N20A, N500, N600, N800 } from '@atlaskit/theme/colors';\nimport { keyframes } from '@emotion/react';\nimport styled from '@emotion/styled';\n\nexport const CharlieDisplayFontStack =\n \"'Charlie Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans', 'Ubuntu', 'Droid Sans', 'Helvetica Neue', sans-serif;\";\n\nexport const CharlieTextFontStack =\n \"'Charlie Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans', 'Ubuntu', 'Droid Sans', 'Helvetica Neue', sans-serif;\";\n\nexport const Wrapper = styled.div`\n display: flex;\n flex-direction: column;\n padding-top: 0px;\n align-items: center;\n font-family: ${CharlieTextFontStack};\n font-weight: 400;\n font-size: 16px;\n line-height: 24px;\n color: #091e42;\n letter-spacing: 0.05em;\n\n a {\n text-decoration: none !important;\n }\n\n a:hover {\n text-decoration: underline !important;\n }\n\n svg {\n margin-bottom: 0 !important;\n }\n`;\n\nexport const Header = styled.span`\n padding: 25px 0;\n font-weight: 600;\n font-family: ${CharlieDisplayFontStack};\n font-size: 1.25em;\n line-height: 1.2;\n letter-spacing: unset;\n color: #172b4d;\n`;\nexport const DevopsHeader = styled.span`\n font-size: 32px;\n line-height: 40px;\n font-family: ${CharlieDisplayFontStack};\n color: ${N600};\n font-weight: 400;\n text-align: center;\n display: flex;\n flex-direction: column;\n padding-bottom: 20px;\n\n @media only screen and (max-width: 769px) {\n font-size: 24px;\n line-height: 28px;\n padding-bottom: 16px;\n }\n\n span:first-child {\n padding-bottom: 14px;\n }\n\n @media only screen and (max-width: 424px) {\n max-width: 266px;\n }\n`;\nexport const DevopsImageWrapper = styled.div`\n width: 225px;\n padding-bottom: 25px;\n display: flex;\n justify-content: center;\n margin-top: 35px;\n\n @media only screen and (max-width: 769px) {\n margin-top: 16px;\n padding-bottom: 20px;\n }\n`;\nexport const ImageWrapper = styled.div`\n width: 225px;\n padding-bottom: 25px;\n`;\n\nexport const Group = styled.div`\n display: flex;\n flex-direction: column;\n padding-bottom: 25px;\n align-items: center;\n`;\n\nexport const Bold = styled.span`\n font-weight: 900;\n`;\n\nexport const RotationKeyframes = keyframes`\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n`;\n\nexport const Devopsgroup = styled.div`\n display: flex;\n flex-direction: column;\n padding-bottom: 0px;\n align-items: center;\n text-align: center;\n max-width: 422px;\n\n @media only screen and (max-width: 769px) {\n max-width: 300px;\n }\n`;\nexport const DevopsText = styled.p`\n font-family: ${CharlieTextFontStack};\n color: ${N800};\n div {\n font-weight: 600;\n display: contents;\n\n @media only screen and (max-width: 769px) {\n display: block;\n }\n }\n\n &.break div {\n @media only screen and (max-width: 769px) {\n padding-bottom: 10px;\n }\n }\n`;\nexport const DevopsButtonGroup = styled.div`\n margin-top: 20px;\n margin-bottom: 20px;\n button {\n background: ${N20A};\n border-radius: 3px;\n padding: 6px 12px;\n }\n span {\n color: ${N500};\n font-size: 14px;\n line-height: 20px;\n font-family: ${CharlieTextFontStack};\n }\n`;\n","import { useAnalyticsEvents } from '@atlaskit/analytics-next';\nimport Button from '@atlaskit/button';\nimport CheckCircleIcon from '@atlaskit/icon/glyph/check-circle';\nimport CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';\nimport RefreshIcon from '@atlaskit/icon/glyph/refresh';\nimport { G300, R300 } from '@atlaskit/theme/colors';\nimport styled from '@emotion/styled';\nimport React from 'react';\nimport { FormattedMessage, injectIntl } from 'react-intl';\n\nimport useResendEmailAPI, {\n ResendEmailStatuses\n} from '../../../../../../hook/useResendEmailAPI';\nimport useResendEmailData from '../../../../../../hook/useResendEmailData';\nimport { CheckEmailAnalyticsInterface } from '../../../../../../model/check-email-page';\nimport { CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES } from '../../../../../../model/check-email-page';\nimport { messages } from '../../messages';\nimport { CharlieDisplayFontStack, RotationKeyframes } from '../../styled';\n\nconst RESEND_ATTEMPT_LIMIT = 3;\n\nconst StyledButton = styled(Button)`\n font-family: ${CharlieDisplayFontStack} !important;\n line-height: 15px !important;\n`;\n\nconst Container = styled.div`\n position: relative;\n`;\n\nconst IconContainer = styled.div`\n display: flex;\n justify-content: center;\n align-items: center;\n position: absolute;\n right: -36px;\n top: 50%;\n transform: translateY(-50%);\n height: 32px;\n width: 32px;\n`;\n\nconst Rotation = styled.div`\n animation: ${RotationKeyframes} 1.25s linear 0s infinite;\n`;\n\ninterface ResendEmailButtonProps {\n baseUrl?: string;\n checkEmailAnalyticsService: CheckEmailAnalyticsInterface;\n}\n\nconst ResendEmailButton: React.FC = ({\n baseUrl,\n checkEmailAnalyticsService\n}) => {\n const { createAnalyticsEvent } = useAnalyticsEvents();\n const [resendEmailData, incrementResendCount] = useResendEmailData();\n const { state: resendEmailState, triggerResendEmail } = useResendEmailAPI({\n baseUrl,\n checkEmailAnalyticsService\n });\n\n if (\n resendEmailData.resendCount > RESEND_ATTEMPT_LIMIT ||\n resendEmailData.resendCount < 0\n ) {\n return (\n <>\n \n \n \n \n >\n );\n }\n\n const onClick = () => {\n const newCount = resendEmailData.resendCount + 1;\n if (newCount > RESEND_ATTEMPT_LIMIT) {\n return incrementResendCount();\n }\n\n checkEmailAnalyticsService.clickResendButton(createAnalyticsEvent);\n\n triggerResendEmail(resendEmailData).then((success) => {\n if (success) {\n incrementResendCount();\n createAnalyticsEvent({\n action: 'resendEmail',\n name: CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES.RESEND_EMAIL_API_SUCCESS\n }).fire();\n } else {\n createAnalyticsEvent({\n action: 'resendEmail',\n name: CHECK_EMAIL_PAGE_TRACKING_EVENT_NAMES.RESEND_EMAIL_API_FAILURE\n }).fire();\n }\n });\n };\n\n const Icon = () => {\n switch (resendEmailState.status) {\n case ResendEmailStatuses.SUCCESS:\n return (\n \n );\n case ResendEmailStatuses.FAILURE:\n return (\n \n );\n default:\n return null;\n }\n };\n\n return (\n \n \n \n \n ) : undefined\n }\n >\n \n \n \n \n \n \n );\n};\n\nexport default injectIntl(ResendEmailButton);\n","import { useAnalyticsEvents } from '@atlaskit/analytics-next';\nimport { AtlassianLogo } from '@atlaskit/logo';\nimport { B400, B200 } from '@atlaskit/theme/colors';\nimport React from 'react';\nimport { FormattedHTMLMessage, FormattedMessage } from 'react-intl';\nimport { CheckEmailPageLayoutPropsType } from '../../../../../model/check-email-page';\nimport { InboxImage, ResendEmailButton } from '../components';\nimport { messages } from '../messages';\nimport { Bold, Group, Header, ImageWrapper, Wrapper } from '../styled';\n\nexport function LayoutDefault({\n email,\n shouldEnable,\n baseUrl,\n checkEmailAnalyticsService\n}: CheckEmailPageLayoutPropsType) {\n const { createAnalyticsEvent } = useAnalyticsEvents();\n\n let pageContent = (\n <>\n \n \n {\n ' ' /* without this single space, these two strings sit too close together. */\n }\n \n checkEmailAnalyticsService.contactLinkAnalytics(\n createAnalyticsEvent\n )\n }\n >\n \n \n
\n \n >\n );\n\n if (shouldEnable) {\n pageContent = (\n <>\n \n \n {email}\n \n \n \n \n \n \n \n \n \n \n \n \n \n checkEmailAnalyticsService.navigateBack(e, createAnalyticsEvent)\n }\n >\n \n \n \n >\n );\n }\n\n return (\n \n \n \n \n \n \n {pageContent}\n \n );\n}\n","import React from 'react';\n\nconst EnvelopeImg: React.FC = (props) => (\n \n);\nexport default EnvelopeImg;\n","import React from 'react';\nimport { FormattedHTMLMessage, FormattedMessage } from 'react-intl';\nimport { CheckEmailPageLayoutPropsType } from '../../../../../model/check-email-page';\nimport { ResendEmailButton } from '../components';\nimport EnvelopeImg from '../components/EnvelopeImage';\nimport { messages } from '../messages';\nimport {\n DevopsButtonGroup,\n Devopsgroup,\n DevopsHeader,\n DevopsImageWrapper,\n DevopsText,\n Wrapper\n} from '../styled';\n\nexport function LayoutDevops({\n email,\n baseUrl,\n hideHeader,\n checkEmailAnalyticsService\n}: CheckEmailPageLayoutPropsType) {\n const DevopsResendPage = (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n\n return (\n \n \n {!hideHeader && }\n \n \n\n {DevopsResendPage}\n \n );\n}\n","import React from 'react';\nimport { injectIntl } from 'react-intl';\nimport { useResendEmailData } from '../../../../hook';\nimport { CheckEmailPagePropsType } from '../../../../model/check-email-page';\nimport { getCheckEmailAnalyticsService } from '../../../../service/check-email-page';\nimport { LayoutDefault, LayoutDevops } from './container';\n\n// UA ID detected on current checkemail page\nconst googleAnalyticsId = 'UA-6032469-23';\n\nexport const CheckEmailPage: React.FC = ({\n layout,\n baseUrl,\n analyticsTrack,\n productKeys,\n hideHeader\n}) => {\n const [{ email = '', shouldEnable }, {}] = useResendEmailData();\n const props = Object.assign(\n {},\n {\n baseUrl,\n email,\n shouldEnable,\n hideHeader\n }\n );\n\n const checkEmailAnalyticsService = getCheckEmailAnalyticsService({\n analyticsTrack,\n baseUrl,\n productKeys,\n googleAnalyticsId\n });\n\n return (() => {\n switch (layout) {\n case 'devops':\n return (\n \n );\n case 'default':\n default:\n return (\n \n );\n }\n })();\n};\n\nexport default injectIntl(CheckEmailPage);\n","import React from 'react';\nimport { SvgContainer } from '../components/styled';\n\nexport type UnionIcon = {};\n\nexport function UnionIcon({}: UnionIcon) {\n return (\n \n \n \n );\n}\n","import { useAnalyticsEvents } from '@atlaskit/analytics-next';\nimport Button from '@atlaskit/button';\nimport AppSwitcherIcon from '@atlaskit/icon/glyph/app-switcher';\nimport EmailIcon from '@atlaskit/icon/glyph/email';\nimport { MarieSchemaAnalytics } from '@atlassiansox/bxpkit-core';\nimport styled from '@emotion/styled';\nimport React, { useContext } from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport { UnionIcon } from '../Icons/UnionIcon';\n\nexport type CarouselEndProps = {\n readonly isBundleDevops: boolean;\n readonly goToProduct: string;\n};\n\nexport function CarouselEnd({ isBundleDevops, goToProduct }: CarouselEndProps) {\n const { createAnalyticsEvent } = useAnalyticsEvents();\n const product = isBundleDevops ? 'Jira' : 'Devops';\n const context = useContext(MarieSchemaAnalytics);\n const buttonId = 'go-to-jira-42074419682455333';\n const buttonClick = () => {\n context?.analyticsTrack?.segment(`bxp.formCloudSignup.go-to-jira-button`, {\n eventType: 'track',\n eventContainer: 'carouselEnd',\n event: 'clicked',\n eventComponent: 'button',\n label: `Go to ${product}`,\n uuid: '42074419682455333',\n productKey: context.productKey,\n productsOffered: context.productsOffered,\n loginUserDetected: context.loginUserDetected,\n userEmail: context.userEmail,\n suiteName: context.suiteName,\n productEdition: context.productEdition,\n productPlatform: context.productPlatform,\n schemaVersion: context.schemaVersion\n });\n createAnalyticsEvent({\n eventName: 'bxp.formCloudSignup.go-to-jira-button',\n data: {\n event: 'clicked',\n uuid: '42074419682455333',\n eventType: 'track',\n eventContainer: 'carouselEnd',\n eventComponent: 'button',\n label: `Go to ${product}`,\n productKey: context.productKey,\n productsOffered: context.productsOffered,\n loginUserDetected: context.loginUserDetected,\n userEmail: context.userEmail,\n suiteName: context.suiteName,\n productEdition: context.productEdition,\n productPlatform: context.productPlatform,\n schemaVersion: context.schemaVersion\n }\n }).fire();\n\n window.location.assign(goToProduct);\n };\n return (\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}\nconst DevopsCarouselEndGroup = styled.div`\n display: flex;\n margin: 0 auto 20px auto;\n max-width: 280px;\n`;\nconst DevopsCarouselEndText = styled.div`\n font-size: 14px;\n line-height: 20px;\n margin-left: 15px;\n font-family: Charlie Display, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-style: normal;\n`;\nconst DevOpsCarouselEndHeading = styled.div`\n font-family: Charlie Display;\n font-size: 32px;\n line-height: 30px;\n text-align: center;\n margin-bottom: 60px;\n`;\nconst DevOpsCarouselEndButton = styled.div`\n text-align: center;\n margin-top: 70px;\n`;\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport { messages } from '../../../../../messages/sign-up-form';\nimport { WelcomeDivDevops } from './styled';\n\nexport type FormWelcomeMessageProps = {\n readonly isBundleDevops: boolean;\n readonly isLoggedIn: boolean | undefined;\n readonly welcomeMessage: any;\n readonly username: string | null;\n};\n\nexport function FormWelcomeMessage({\n isBundleDevops,\n isLoggedIn,\n welcomeMessage,\n username\n}: FormWelcomeMessageProps) {\n if (isBundleDevops && isLoggedIn) {\n return (\n \n \n \n );\n }\n return ;\n}\n","import { __assign, __rest } from './_virtual/_tslib.js';\nimport './environment.js';\nimport './utils.js';\nimport './types.js';\nimport { invoke } from './actionTypes.js';\n\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n var simpleSrc = {\n type: src\n };\n\n simpleSrc.toString = function () {\n return src;\n }; // v4 compat - TODO: remove in v5\n\n\n return simpleSrc;\n }\n\n return src;\n}\nfunction toInvokeDefinition(invokeConfig) {\n return __assign(__assign({\n type: invoke\n }, invokeConfig), {\n toJSON: function () {\n var onDone = invokeConfig.onDone,\n onError = invokeConfig.onError,\n invokeDef = __rest(invokeConfig, [\"onDone\", \"onError\"]);\n\n return __assign(__assign({}, invokeDef), {\n type: invoke,\n src: toInvokeSource(invokeConfig.src)\n });\n }\n });\n}\n\nexport { toInvokeDefinition, toInvokeSource };\n","import { __assign, __spreadArray, __read, __values, __rest } from './_virtual/_tslib.js';\nimport { STATE_DELIMITER } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { isFunction, mapValues, isArray, flatten, keys, toArray, toStateValue, isString, getEventType, toSCXMLEvent, matchesState, path, evaluateGuard, mapContext, pathToStateValue, isBuiltInEvent, partition, updateHistoryValue, toStatePath, mapFilterValues, warn, toStatePaths, nestedPath, normalizeTarget, toGuard, toTransitionConfigArray, isMachine, createInvokeId } from './utils.js';\nimport { SpecialTargets } from './types.js';\nimport { getAllStateNodes, getConfiguration, isInFinalState, getTagsFromConfiguration, has, getChildren, getValue, isLeafNode } from './stateUtils.js';\nimport { start as start$1, stop as stop$1, invoke, update, nullEvent, raise as raise$1, send as send$1 } from './actionTypes.js';\nimport { done, start, raise, stop, toActionObjects, resolveActions, doneInvoke, error, toActionObject, toActivityDefinition, after, send, cancel, initEvent } from './actions.js';\nimport { State, stateValuesEqual } from './State.js';\nimport { createInvocableActor } from './Actor.js';\nimport { toInvokeDefinition } from './invokeUtils.js';\n\nvar NULL_EVENT = '';\nvar STATE_IDENTIFIER = '#';\nvar WILDCARD = '*';\nvar EMPTY_OBJECT = {};\n\nvar isStateId = function (str) {\n return str[0] === STATE_IDENTIFIER;\n};\n\nvar createDefaultOptions = function () {\n return {\n actions: {},\n guards: {},\n services: {},\n activities: {},\n delays: {}\n };\n};\n\nvar validateArrayifiedTransitions = function (stateNode, event, transitions) {\n var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {\n return !('cond' in transition) && !('in' in transition) && (isString(transition.target) || isMachine(transition.target));\n });\n var eventText = event === NULL_EVENT ? 'the transient event' : \"event '\".concat(event, \"'\");\n warn(!hasNonLastUnguardedTarget, \"One or more transitions for \".concat(eventText, \" on state '\").concat(stateNode.id, \"' are unreachable. \") + \"Make sure that the default transition is the last one defined.\");\n};\n\nvar StateNode =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function StateNode(\n /**\r\n * The raw config used to create the machine.\r\n */\n config, options,\n /**\r\n * The initial extended state\r\n */\n _context // TODO: this is unsafe, but we're removing it in v5 anyway\n ) {\n var _this = this;\n\n if (_context === void 0) {\n _context = 'context' in config ? config.context : undefined;\n }\n\n var _a;\n\n this.config = config;\n this._context = _context;\n /**\r\n * The order this state node appears. Corresponds to the implicit SCXML document order.\r\n */\n\n this.order = -1;\n this.__xstatenode = true;\n this.__cache = {\n events: undefined,\n relativeValue: new Map(),\n initialStateValue: undefined,\n initialState: undefined,\n on: undefined,\n transitions: undefined,\n candidates: {},\n delayedTransitions: undefined\n };\n this.idMap = {};\n this.tags = [];\n this.options = Object.assign(createDefaultOptions(), options);\n this.parent = this.options._parent;\n this.key = this.config.key || this.options._key || this.config.id || '(machine)';\n this.machine = this.parent ? this.parent.machine : this;\n this.path = this.parent ? this.parent.path.concat(this.key) : [];\n this.delimiter = this.config.delimiter || (this.parent ? this.parent.delimiter : STATE_DELIMITER);\n this.id = this.config.id || __spreadArray([this.machine.key], __read(this.path), false).join(this.delimiter);\n this.version = this.parent ? this.parent.version : this.config.version;\n this.type = this.config.type || (this.config.parallel ? 'parallel' : this.config.states && keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n this.schema = this.parent ? this.machine.schema : (_a = this.config.schema) !== null && _a !== void 0 ? _a : {};\n this.description = this.config.description;\n\n if (!IS_PRODUCTION) {\n warn(!('parallel' in this.config), \"The \\\"parallel\\\" property is deprecated and will be removed in version 4.1. \".concat(this.config.parallel ? \"Replace with `type: 'parallel'`\" : \"Use `type: '\".concat(this.type, \"'`\"), \" in the config for state node '\").concat(this.id, \"' instead.\"));\n }\n\n this.initial = this.config.initial;\n this.states = this.config.states ? mapValues(this.config.states, function (stateConfig, key) {\n var _a;\n\n var stateNode = new StateNode(stateConfig, {\n _parent: _this,\n _key: key\n });\n Object.assign(_this.idMap, __assign((_a = {}, _a[stateNode.id] = stateNode, _a), stateNode.idMap));\n return stateNode;\n }) : EMPTY_OBJECT; // Document order\n\n var order = 0;\n\n function dfs(stateNode) {\n var e_1, _a;\n\n stateNode.order = order++;\n\n try {\n for (var _b = __values(getChildren(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n dfs(child);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n }\n\n dfs(this); // History config\n\n this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function (_a) {\n var event = _a.event;\n return event === NULL_EVENT;\n }) : NULL_EVENT in this.config.on);\n this.strict = !!this.config.strict; // TODO: deprecate (entry)\n\n this.onEntry = toArray(this.config.entry || this.config.onEntry).map(function (action) {\n return toActionObject(action);\n }); // TODO: deprecate (exit)\n\n this.onExit = toArray(this.config.exit || this.config.onExit).map(function (action) {\n return toActionObject(action);\n });\n this.meta = this.config.meta;\n this.doneData = this.type === 'final' ? this.config.data : undefined;\n this.invoke = toArray(this.config.invoke).map(function (invokeConfig, i) {\n var _a, _b;\n\n if (isMachine(invokeConfig)) {\n var invokeId = createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_a = {}, _a[invokeId] = invokeConfig, _a), _this.machine.options.services);\n return toInvokeDefinition({\n src: invokeId,\n id: invokeId\n });\n } else if (isString(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n return toInvokeDefinition(__assign(__assign({}, invokeConfig), {\n id: invokeId,\n src: invokeConfig.src\n }));\n } else if (isMachine(invokeConfig.src) || isFunction(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);\n return toInvokeDefinition(__assign(__assign({\n id: invokeId\n }, invokeConfig), {\n src: invokeId\n }));\n } else {\n var invokeSource = invokeConfig.src;\n return toInvokeDefinition(__assign(__assign({\n id: createInvokeId(_this.id, i)\n }, invokeConfig), {\n src: invokeSource\n }));\n }\n });\n this.activities = toArray(this.config.activities).concat(this.invoke).map(function (activity) {\n return toActivityDefinition(activity);\n });\n this.transition = this.transition.bind(this);\n this.tags = toArray(this.config.tags); // TODO: this is the real fix for initialization once\n // state node getters are deprecated\n // if (!this.parent) {\n // this._init();\n // }\n }\n\n StateNode.prototype._init = function () {\n if (this.__cache.transitions) {\n return;\n }\n\n getAllStateNodes(this).forEach(function (stateNode) {\n return stateNode.on;\n });\n };\n /**\r\n * Clones this state machine with custom options and context.\r\n *\r\n * @param options Options (actions, guards, activities, services) to recursively merge with the existing options.\r\n * @param context Custom context (will override predefined context)\r\n */\n\n\n StateNode.prototype.withConfig = function (options, context) {\n var _a = this.options,\n actions = _a.actions,\n activities = _a.activities,\n guards = _a.guards,\n services = _a.services,\n delays = _a.delays;\n return new StateNode(this.config, {\n actions: __assign(__assign({}, actions), options.actions),\n activities: __assign(__assign({}, activities), options.activities),\n guards: __assign(__assign({}, guards), options.guards),\n services: __assign(__assign({}, services), options.services),\n delays: __assign(__assign({}, delays), options.delays)\n }, context !== null && context !== void 0 ? context : this.context);\n };\n /**\r\n * Clones this state machine with custom context.\r\n *\r\n * @param context Custom context (will override predefined context, not recursive)\r\n */\n\n\n StateNode.prototype.withContext = function (context) {\n return new StateNode(this.config, this.options, context);\n };\n\n Object.defineProperty(StateNode.prototype, \"context\", {\n get: function () {\n return isFunction(this._context) ? this._context() : this._context;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"definition\", {\n /**\r\n * The well-structured state node definition.\r\n */\n get: function () {\n return {\n id: this.id,\n key: this.key,\n version: this.version,\n context: this.context,\n type: this.type,\n initial: this.initial,\n history: this.history,\n states: mapValues(this.states, function (state) {\n return state.definition;\n }),\n on: this.on,\n transitions: this.transitions,\n entry: this.onEntry,\n exit: this.onExit,\n activities: this.activities || [],\n meta: this.meta,\n order: this.order || -1,\n data: this.doneData,\n invoke: this.invoke,\n description: this.description,\n tags: this.tags\n };\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.toJSON = function () {\n return this.definition;\n };\n\n Object.defineProperty(StateNode.prototype, \"on\", {\n /**\r\n * The mapping of events to transitions.\r\n */\n get: function () {\n if (this.__cache.on) {\n return this.__cache.on;\n }\n\n var transitions = this.transitions;\n return this.__cache.on = transitions.reduce(function (map, transition) {\n map[transition.eventType] = map[transition.eventType] || [];\n map[transition.eventType].push(transition);\n return map;\n }, {});\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"after\", {\n get: function () {\n return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"transitions\", {\n /**\r\n * All the transitions that can be taken from this state node.\r\n */\n get: function () {\n return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getCandidates = function (eventName) {\n if (this.__cache.candidates[eventName]) {\n return this.__cache.candidates[eventName];\n }\n\n var transient = eventName === NULL_EVENT;\n var candidates = this.transitions.filter(function (transition) {\n var sameEventType = transition.eventType === eventName; // null events should only match against eventless transitions\n\n return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;\n });\n this.__cache.candidates[eventName] = candidates;\n return candidates;\n };\n /**\r\n * All delayed transitions from the config.\r\n */\n\n\n StateNode.prototype.getDelayedTransitions = function () {\n var _this = this;\n\n var afterConfig = this.config.after;\n\n if (!afterConfig) {\n return [];\n }\n\n var mutateEntryExit = function (delay, i) {\n var delayRef = isFunction(delay) ? \"\".concat(_this.id, \":delay[\").concat(i, \"]\") : delay;\n var eventType = after(delayRef, _this.id);\n\n _this.onEntry.push(send(eventType, {\n delay: delay\n }));\n\n _this.onExit.push(cancel(eventType));\n\n return eventType;\n };\n\n var delayedTransitions = isArray(afterConfig) ? afterConfig.map(function (transition, i) {\n var eventType = mutateEntryExit(transition.delay, i);\n return __assign(__assign({}, transition), {\n event: eventType\n });\n }) : flatten(keys(afterConfig).map(function (delay, i) {\n var configTransition = afterConfig[delay];\n var resolvedTransition = isString(configTransition) ? {\n target: configTransition\n } : configTransition;\n var resolvedDelay = !isNaN(+delay) ? +delay : delay;\n var eventType = mutateEntryExit(resolvedDelay, i);\n return toArray(resolvedTransition).map(function (transition) {\n return __assign(__assign({}, transition), {\n event: eventType,\n delay: resolvedDelay\n });\n });\n }));\n return delayedTransitions.map(function (delayedTransition) {\n var delay = delayedTransition.delay;\n return __assign(__assign({}, _this.formatTransition(delayedTransition)), {\n delay: delay\n });\n });\n };\n /**\r\n * Returns the state nodes represented by the current state value.\r\n *\r\n * @param state The state value or State instance\r\n */\n\n\n StateNode.prototype.getStateNodes = function (state) {\n var _a;\n\n var _this = this;\n\n if (!state) {\n return [];\n }\n\n var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);\n\n if (isString(stateValue)) {\n var initialStateValue = this.getStateNode(stateValue).initial;\n return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this, this.states[stateValue]];\n }\n\n var subStateKeys = keys(stateValue);\n var subStateNodes = [this];\n subStateNodes.push.apply(subStateNodes, __spreadArray([], __read(flatten(subStateKeys.map(function (subStateKey) {\n return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);\n }))), false));\n return subStateNodes;\n };\n /**\r\n * Returns `true` if this state node explicitly handles the given event.\r\n *\r\n * @param event The event in question\r\n */\n\n\n StateNode.prototype.handles = function (event) {\n var eventType = getEventType(event);\n return this.events.includes(eventType);\n };\n /**\r\n * Resolves the given `state` to a new `State` instance relative to this machine.\r\n *\r\n * This ensures that `.events` and `.nextEvents` represent the correct values.\r\n *\r\n * @param state The state to resolve\r\n */\n\n\n StateNode.prototype.resolveState = function (state) {\n var configuration = Array.from(getConfiguration([], this.getStateNodes(state.value)));\n return new State(__assign(__assign({}, state), {\n value: this.resolve(state.value),\n configuration: configuration,\n done: isInFinalState(configuration, this),\n tags: getTagsFromConfiguration(configuration)\n }));\n };\n\n StateNode.prototype.transitionLeafNode = function (stateValue, state, _event) {\n var stateNode = this.getStateNode(stateValue);\n var next = stateNode.next(state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionCompoundNode = function (stateValue, state, _event) {\n var subStateKeys = keys(stateValue);\n var stateNode = this.getStateNode(subStateKeys[0]);\n\n var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionParallelNode = function (stateValue, state, _event) {\n var e_2, _a;\n\n var transitionMap = {};\n\n try {\n for (var _b = __values(keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var subStateKey = _c.value;\n var subStateValue = stateValue[subStateKey];\n\n if (!subStateValue) {\n continue;\n }\n\n var subStateNode = this.getStateNode(subStateKey);\n\n var next = subStateNode._transition(subStateValue, state, _event);\n\n if (next) {\n transitionMap[subStateKey] = next;\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n var stateTransitions = keys(transitionMap).map(function (key) {\n return transitionMap[key];\n });\n var enabledTransitions = flatten(stateTransitions.map(function (st) {\n return st.transitions;\n }));\n var willTransition = stateTransitions.some(function (st) {\n return st.transitions.length > 0;\n });\n\n if (!willTransition) {\n return this.next(state, _event);\n }\n\n var entryNodes = flatten(stateTransitions.map(function (t) {\n return t.entrySet;\n }));\n var configuration = flatten(keys(transitionMap).map(function (key) {\n return transitionMap[key].configuration;\n }));\n return {\n transitions: enabledTransitions,\n entrySet: entryNodes,\n exitSet: flatten(stateTransitions.map(function (t) {\n return t.exitSet;\n })),\n configuration: configuration,\n source: state,\n actions: flatten(keys(transitionMap).map(function (key) {\n return transitionMap[key].actions;\n }))\n };\n };\n\n StateNode.prototype._transition = function (stateValue, state, _event) {\n // leaf node\n if (isString(stateValue)) {\n return this.transitionLeafNode(stateValue, state, _event);\n } // hierarchical node\n\n\n if (keys(stateValue).length === 1) {\n return this.transitionCompoundNode(stateValue, state, _event);\n } // orthogonal node\n\n\n return this.transitionParallelNode(stateValue, state, _event);\n };\n\n StateNode.prototype.getTransitionData = function (state, event) {\n return this._transition(state.value, state, toSCXMLEvent(event));\n };\n\n StateNode.prototype.next = function (state, _event) {\n var e_3, _a;\n\n var _this = this;\n\n var eventName = _event.name;\n var actions = [];\n var nextStateNodes = [];\n var selectedTransition;\n\n try {\n for (var _b = __values(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var candidate = _c.value;\n var cond = candidate.cond,\n stateIn = candidate.in;\n var resolvedContext = state.context;\n var isInState = stateIn ? isString(stateIn) && isStateId(stateIn) ? // Check if in state by ID\n state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent\n matchesState(toStateValue(stateIn, this.delimiter), path(this.path.slice(0, -2))(state.value)) : true;\n var guardPassed = false;\n\n try {\n guardPassed = !cond || evaluateGuard(this.machine, cond, resolvedContext, _event, state);\n } catch (err) {\n throw new Error(\"Unable to evaluate guard '\".concat(cond.name || cond.type, \"' in transition for event '\").concat(eventName, \"' in state node '\").concat(this.id, \"':\\n\").concat(err.message));\n }\n\n if (guardPassed && isInState) {\n if (candidate.target !== undefined) {\n nextStateNodes = candidate.target;\n }\n\n actions.push.apply(actions, __spreadArray([], __read(candidate.actions), false));\n selectedTransition = candidate;\n break;\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n if (!selectedTransition) {\n return undefined;\n }\n\n if (!nextStateNodes.length) {\n return {\n transitions: [selectedTransition],\n entrySet: [],\n exitSet: [],\n configuration: state.value ? [this] : [],\n source: state,\n actions: actions\n };\n }\n\n var allNextStateNodes = flatten(nextStateNodes.map(function (stateNode) {\n return _this.getRelativeStateNodes(stateNode, state.historyValue);\n }));\n var isInternal = !!selectedTransition.internal;\n var reentryNodes = isInternal ? [] : flatten(allNextStateNodes.map(function (n) {\n return _this.nodesFromChild(n);\n }));\n return {\n transitions: [selectedTransition],\n entrySet: reentryNodes,\n exitSet: isInternal ? [] : [this],\n configuration: allNextStateNodes,\n source: state,\n actions: actions\n };\n };\n\n StateNode.prototype.nodesFromChild = function (childStateNode) {\n if (childStateNode.escapes(this)) {\n return [];\n }\n\n var nodes = [];\n var marker = childStateNode;\n\n while (marker && marker !== this) {\n nodes.push(marker);\n marker = marker.parent;\n }\n\n nodes.push(this); // inclusive\n\n return nodes;\n };\n /**\r\n * Whether the given state node \"escapes\" this state node. If the `stateNode` is equal to or the parent of\r\n * this state node, it does not escape.\r\n */\n\n\n StateNode.prototype.escapes = function (stateNode) {\n if (this === stateNode) {\n return false;\n }\n\n var parent = this.parent;\n\n while (parent) {\n if (parent === stateNode) {\n return false;\n }\n\n parent = parent.parent;\n }\n\n return true;\n };\n\n StateNode.prototype.getActions = function (transition, currentContext, _event, prevState) {\n var e_4, _a, e_5, _b;\n\n var prevConfig = getConfiguration([], prevState ? this.getStateNodes(prevState.value) : [this]);\n var resolvedConfig = transition.configuration.length ? getConfiguration(prevConfig, transition.configuration) : prevConfig;\n\n try {\n for (var resolvedConfig_1 = __values(resolvedConfig), resolvedConfig_1_1 = resolvedConfig_1.next(); !resolvedConfig_1_1.done; resolvedConfig_1_1 = resolvedConfig_1.next()) {\n var sn = resolvedConfig_1_1.value;\n\n if (!has(prevConfig, sn)) {\n transition.entrySet.push(sn);\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (resolvedConfig_1_1 && !resolvedConfig_1_1.done && (_a = resolvedConfig_1.return)) _a.call(resolvedConfig_1);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n try {\n for (var prevConfig_1 = __values(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()) {\n var sn = prevConfig_1_1.value;\n\n if (!has(resolvedConfig, sn) || has(transition.exitSet, sn.parent)) {\n transition.exitSet.push(sn);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n var doneEvents = flatten(transition.entrySet.map(function (sn) {\n var events = [];\n\n if (sn.type !== 'final') {\n return events;\n }\n\n var parent = sn.parent;\n\n if (!parent.parent) {\n return events;\n }\n\n events.push(done(sn.id, sn.doneData), // TODO: deprecate - final states should not emit done events for their own state.\n done(parent.id, sn.doneData ? mapContext(sn.doneData, currentContext, _event) : undefined));\n var grandparent = parent.parent;\n\n if (grandparent.type === 'parallel') {\n if (getChildren(grandparent).every(function (parentNode) {\n return isInFinalState(transition.configuration, parentNode);\n })) {\n events.push(done(grandparent.id));\n }\n }\n\n return events;\n }));\n transition.exitSet.sort(function (a, b) {\n return b.order - a.order;\n });\n transition.entrySet.sort(function (a, b) {\n return a.order - b.order;\n });\n var entryStates = new Set(transition.entrySet);\n var exitStates = new Set(transition.exitSet);\n\n var _c = __read([flatten(Array.from(entryStates).map(function (stateNode) {\n return __spreadArray(__spreadArray([], __read(stateNode.activities.map(function (activity) {\n return start(activity);\n })), false), __read(stateNode.onEntry), false);\n })).concat(doneEvents.map(raise)), flatten(Array.from(exitStates).map(function (stateNode) {\n return __spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {\n return stop(activity);\n })), false);\n }))], 2),\n entryActions = _c[0],\n exitActions = _c[1];\n\n var actions = toActionObjects(exitActions.concat(transition.actions).concat(entryActions), this.machine.options.actions);\n return actions;\n };\n /**\r\n * Determines the next state given the current `state` and sent `event`.\r\n *\r\n * @param state The current State instance or state value\r\n * @param event The event that was sent at the current state\r\n * @param context The current context (extended state) of the current state\r\n */\n\n\n StateNode.prototype.transition = function (state, event, context) {\n if (state === void 0) {\n state = this.initialState;\n }\n\n var _event = toSCXMLEvent(event);\n\n var currentState;\n\n if (state instanceof State) {\n currentState = context === undefined ? state : this.resolveState(State.from(state, context));\n } else {\n var resolvedStateValue = isString(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);\n var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;\n currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));\n }\n\n if (!IS_PRODUCTION && _event.name === WILDCARD) {\n throw new Error(\"An event cannot have the wildcard type ('\".concat(WILDCARD, \"')\"));\n }\n\n if (this.strict) {\n if (!this.events.includes(_event.name) && !isBuiltInEvent(_event.name)) {\n throw new Error(\"Machine '\".concat(this.id, \"' does not accept event '\").concat(_event.name, \"'\"));\n }\n }\n\n var stateTransition = this._transition(currentState.value, currentState, _event) || {\n transitions: [],\n configuration: [],\n entrySet: [],\n exitSet: [],\n source: currentState,\n actions: []\n };\n var prevConfig = getConfiguration([], this.getStateNodes(currentState.value));\n var resolvedConfig = stateTransition.configuration.length ? getConfiguration(prevConfig, stateTransition.configuration) : prevConfig;\n stateTransition.configuration = __spreadArray([], __read(resolvedConfig), false);\n return this.resolveTransition(stateTransition, currentState, currentState.context, _event);\n };\n\n StateNode.prototype.resolveRaisedTransition = function (state, _event, originalEvent) {\n var _a;\n\n var currentActions = state.actions;\n state = this.transition(state, _event); // Save original event to state\n // TODO: this should be the raised event! Delete in V5 (breaking)\n\n state._event = originalEvent;\n state.event = originalEvent.data;\n\n (_a = state.actions).unshift.apply(_a, __spreadArray([], __read(currentActions), false));\n\n return state;\n };\n\n StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, _event) {\n var e_6, _a;\n\n var _this = this;\n\n if (_event === void 0) {\n _event = initEvent;\n }\n\n var configuration = stateTransition.configuration; // Transition will \"apply\" if:\n // - this is the initial state (there is no current state)\n // - OR there are transitions\n\n var willTransition = !currentState || stateTransition.transitions.length > 0;\n var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : undefined;\n var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;\n var actions = this.getActions(stateTransition, context, _event, currentState);\n var activities = currentState ? __assign({}, currentState.activities) : {};\n\n try {\n for (var actions_1 = __values(actions), actions_1_1 = actions_1.next(); !actions_1_1.done; actions_1_1 = actions_1.next()) {\n var action = actions_1_1.value;\n\n if (action.type === start$1) {\n activities[action.activity.id || action.activity.type] = action;\n } else if (action.type === stop$1) {\n activities[action.activity.id || action.activity.type] = false;\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (actions_1_1 && !actions_1_1.done && (_a = actions_1.return)) _a.call(actions_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n var _b = __read(resolveActions(this, currentState, context, _event, actions, this.machine.config.preserveActionOrder), 2),\n resolvedActions = _b[0],\n updatedContext = _b[1];\n\n var _c = __read(partition(resolvedActions, function (action) {\n return action.type === raise$1 || action.type === send$1 && action.to === SpecialTargets.Internal;\n }), 2),\n raisedEvents = _c[0],\n nonRaisedActions = _c[1];\n\n var invokeActions = resolvedActions.filter(function (action) {\n var _a;\n\n return action.type === start$1 && ((_a = action.activity) === null || _a === void 0 ? void 0 : _a.type) === invoke;\n });\n var children = invokeActions.reduce(function (acc, action) {\n acc[action.activity.id] = createInvocableActor(action.activity, _this.machine, updatedContext, _event);\n return acc;\n }, currentState ? __assign({}, currentState.children) : {});\n var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];\n var isDone = isInFinalState(resolvedConfiguration, this);\n var nextState = new State({\n value: resolvedStateValue || currentState.value,\n context: updatedContext,\n _event: _event,\n // Persist _sessionid between states\n _sessionid: currentState ? currentState._sessionid : null,\n historyValue: resolvedStateValue ? historyValue ? updateHistoryValue(historyValue, resolvedStateValue) : undefined : currentState ? currentState.historyValue : undefined,\n history: !resolvedStateValue || stateTransition.source ? currentState : undefined,\n actions: resolvedStateValue ? nonRaisedActions : [],\n activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},\n events: [],\n configuration: resolvedConfiguration,\n transitions: stateTransition.transitions,\n children: children,\n done: isDone,\n tags: currentState === null || currentState === void 0 ? void 0 : currentState.tags,\n machine: this\n });\n var didUpdateContext = context !== updatedContext;\n nextState.changed = _event.name === update || didUpdateContext; // Dispose of penultimate histories to prevent memory leaks\n\n var history = nextState.history;\n\n if (history) {\n delete history.history;\n } // There are transient transitions if the machine is not in a final state\n // and if some of the state nodes have transient (\"always\") transitions.\n\n\n var isTransient = !isDone && (this._transient || configuration.some(function (stateNode) {\n return stateNode._transient;\n })); // If there are no enabled transitions, check if there are transient transitions.\n // If there are transient transitions, continue checking for more transitions\n // because an transient transition should be triggered even if there are no\n // enabled transitions.\n //\n // If we're already working on an transient transition (by checking\n // if the event is a NULL_EVENT), then stop to prevent an infinite loop.\n //\n // Otherwise, if there are no enabled nor transient transitions, we are done.\n\n if (!willTransition && (!isTransient || _event.name === NULL_EVENT)) {\n return nextState;\n }\n\n var maybeNextState = nextState;\n\n if (!isDone) {\n if (isTransient) {\n maybeNextState = this.resolveRaisedTransition(maybeNextState, {\n type: nullEvent\n }, _event);\n }\n\n while (raisedEvents.length) {\n var raisedEvent = raisedEvents.shift();\n maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event);\n }\n } // Detect if state changed\n\n\n var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !stateValuesEqual(maybeNextState.value, history.value) : undefined);\n maybeNextState.changed = changed; // Preserve original history after raised events\n\n maybeNextState.history = history;\n maybeNextState.tags = getTagsFromConfiguration(maybeNextState.configuration);\n return maybeNextState;\n };\n /**\r\n * Returns the child state node from its relative `stateKey`, or throws.\r\n */\n\n\n StateNode.prototype.getStateNode = function (stateKey) {\n if (isStateId(stateKey)) {\n return this.machine.getStateNodeById(stateKey);\n }\n\n if (!this.states) {\n throw new Error(\"Unable to retrieve child state '\".concat(stateKey, \"' from '\").concat(this.id, \"'; no child states exist.\"));\n }\n\n var result = this.states[stateKey];\n\n if (!result) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return result;\n };\n /**\r\n * Returns the state node with the given `stateId`, or throws.\r\n *\r\n * @param stateId The state ID. The prefix \"#\" is removed.\r\n */\n\n\n StateNode.prototype.getStateNodeById = function (stateId) {\n var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;\n\n if (resolvedStateId === this.id) {\n return this;\n }\n\n var stateNode = this.machine.idMap[resolvedStateId];\n\n if (!stateNode) {\n throw new Error(\"Child state node '#\".concat(resolvedStateId, \"' does not exist on machine '\").concat(this.id, \"'\"));\n }\n\n return stateNode;\n };\n /**\r\n * Returns the relative state node from the given `statePath`, or throws.\r\n *\r\n * @param statePath The string or string array relative path to the state node.\r\n */\n\n\n StateNode.prototype.getStateNodeByPath = function (statePath) {\n if (typeof statePath === 'string' && isStateId(statePath)) {\n try {\n return this.getStateNodeById(statePath.slice(1));\n } catch (e) {// try individual paths\n // throw e;\n }\n }\n\n var arrayStatePath = toStatePath(statePath, this.delimiter).slice();\n var currentStateNode = this;\n\n while (arrayStatePath.length) {\n var key = arrayStatePath.shift();\n\n if (!key.length) {\n break;\n }\n\n currentStateNode = currentStateNode.getStateNode(key);\n }\n\n return currentStateNode;\n };\n /**\r\n * Resolves a partial state value with its full representation in this machine.\r\n *\r\n * @param stateValue The partial state value to resolve.\r\n */\n\n\n StateNode.prototype.resolve = function (stateValue) {\n var _a;\n\n var _this = this;\n\n if (!stateValue) {\n return this.initialStateValue || EMPTY_OBJECT; // TODO: type-specific properties\n }\n\n switch (this.type) {\n case 'parallel':\n return mapValues(this.initialStateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;\n });\n\n case 'compound':\n if (isString(stateValue)) {\n var subStateNode = this.getStateNode(stateValue);\n\n if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {\n return _a = {}, _a[stateValue] = subStateNode.initialStateValue, _a;\n }\n\n return stateValue;\n }\n\n if (!keys(stateValue).length) {\n return this.initialStateValue || {};\n }\n\n return mapValues(stateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;\n });\n\n default:\n return stateValue || EMPTY_OBJECT;\n }\n };\n\n StateNode.prototype.getResolvedPath = function (stateIdentifier) {\n if (isStateId(stateIdentifier)) {\n var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];\n\n if (!stateNode) {\n throw new Error(\"Unable to find state node '\".concat(stateIdentifier, \"'\"));\n }\n\n return stateNode.path;\n }\n\n return toStatePath(stateIdentifier, this.delimiter);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateValue\", {\n get: function () {\n var _a;\n\n if (this.__cache.initialStateValue) {\n return this.__cache.initialStateValue;\n }\n\n var initialStateValue;\n\n if (this.type === 'parallel') {\n initialStateValue = mapFilterValues(this.states, function (state) {\n return state.initialStateValue || EMPTY_OBJECT;\n }, function (stateNode) {\n return !(stateNode.type === 'history');\n });\n } else if (this.initial !== undefined) {\n if (!this.states[this.initial]) {\n throw new Error(\"Initial state '\".concat(this.initial, \"' not found on '\").concat(this.key, \"'\"));\n }\n\n initialStateValue = isLeafNode(this.states[this.initial]) ? this.initial : (_a = {}, _a[this.initial] = this.states[this.initial].initialStateValue, _a);\n } else {\n // The finite state value of a machine without child states is just an empty object\n initialStateValue = {};\n }\n\n this.__cache.initialStateValue = initialStateValue;\n return this.__cache.initialStateValue;\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getInitialState = function (stateValue, context) {\n var configuration = this.getStateNodes(stateValue);\n return this.resolveTransition({\n configuration: configuration,\n entrySet: configuration,\n exitSet: [],\n transitions: [],\n source: undefined,\n actions: []\n }, undefined, context !== null && context !== void 0 ? context : this.machine.context, undefined);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialState\", {\n /**\r\n * The initial State instance, which includes all actions to be executed from\r\n * entering the initial state.\r\n */\n get: function () {\n this._init(); // TODO: this should be in the constructor (see note in constructor)\n\n\n var initialStateValue = this.initialStateValue;\n\n if (!initialStateValue) {\n throw new Error(\"Cannot retrieve initial state from simple state '\".concat(this.id, \"'.\"));\n }\n\n return this.getInitialState(initialStateValue);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"target\", {\n /**\r\n * The target state value of the history state node, if it exists. This represents the\r\n * default state value to transition to if no history value exists yet.\r\n */\n get: function () {\n var target;\n\n if (this.type === 'history') {\n var historyConfig = this.config;\n\n if (isString(historyConfig.target)) {\n target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;\n } else {\n target = historyConfig.target;\n }\n }\n\n return target;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Returns the leaf nodes from a state path relative to this state node.\r\n *\r\n * @param relativeStateId The relative state path to retrieve the state nodes\r\n * @param history The previous state to retrieve history\r\n * @param resolve Whether state nodes should resolve to initial child state nodes\r\n */\n\n StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {\n if (resolve === void 0) {\n resolve = true;\n }\n\n return resolve ? relativeStateId.type === 'history' ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [relativeStateId];\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateNodes\", {\n get: function () {\n var _this = this;\n\n if (isLeafNode(this)) {\n return [this];\n } // Case when state node is compound but no initial state is defined\n\n\n if (this.type === 'compound' && !this.initial) {\n if (!IS_PRODUCTION) {\n warn(false, \"Compound state node '\".concat(this.id, \"' has no initial state.\"));\n }\n\n return [this];\n }\n\n var initialStateNodePaths = toStatePaths(this.initialStateValue);\n return flatten(initialStateNodePaths.map(function (initialPath) {\n return _this.getFromRelativePath(initialPath);\n }));\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Retrieves state nodes from a relative path to this state node.\r\n *\r\n * @param relativePath The relative path from this state node\r\n * @param historyValue\r\n */\n\n StateNode.prototype.getFromRelativePath = function (relativePath) {\n if (!relativePath.length) {\n return [this];\n }\n\n var _a = __read(relativePath),\n stateKey = _a[0],\n childStatePath = _a.slice(1);\n\n if (!this.states) {\n throw new Error(\"Cannot retrieve subPath '\".concat(stateKey, \"' from node with no states\"));\n }\n\n var childStateNode = this.getStateNode(stateKey);\n\n if (childStateNode.type === 'history') {\n return childStateNode.resolveHistory();\n }\n\n if (!this.states[stateKey]) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return this.states[stateKey].getFromRelativePath(childStatePath);\n };\n\n StateNode.prototype.historyValue = function (relativeStateValue) {\n if (!keys(this.states).length) {\n return undefined;\n }\n\n return {\n current: relativeStateValue || this.initialStateValue,\n states: mapFilterValues(this.states, function (stateNode, key) {\n if (!relativeStateValue) {\n return stateNode.historyValue();\n }\n\n var subStateValue = isString(relativeStateValue) ? undefined : relativeStateValue[key];\n return stateNode.historyValue(subStateValue || stateNode.initialStateValue);\n }, function (stateNode) {\n return !stateNode.history;\n })\n };\n };\n /**\r\n * Resolves to the historical value(s) of the parent state node,\r\n * represented by state nodes.\r\n *\r\n * @param historyValue\r\n */\n\n\n StateNode.prototype.resolveHistory = function (historyValue) {\n var _this = this;\n\n if (this.type !== 'history') {\n return [this];\n }\n\n var parent = this.parent;\n\n if (!historyValue) {\n var historyTarget = this.target;\n return historyTarget ? flatten(toStatePaths(historyTarget).map(function (relativeChildPath) {\n return parent.getFromRelativePath(relativeChildPath);\n })) : parent.initialStateNodes;\n }\n\n var subHistoryValue = nestedPath(parent.path, 'states')(historyValue).current;\n\n if (isString(subHistoryValue)) {\n return [parent.getStateNode(subHistoryValue)];\n }\n\n return flatten(toStatePaths(subHistoryValue).map(function (subStatePath) {\n return _this.history === 'deep' ? parent.getFromRelativePath(subStatePath) : [parent.states[subStatePath[0]]];\n }));\n };\n\n Object.defineProperty(StateNode.prototype, \"stateIds\", {\n /**\r\n * All the state node IDs of this state node and its descendant state nodes.\r\n */\n get: function () {\n var _this = this;\n\n var childStateIds = flatten(keys(this.states).map(function (stateKey) {\n return _this.states[stateKey].stateIds;\n }));\n return [this.id].concat(childStateIds);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"events\", {\n /**\r\n * All the event types accepted by this state node and its descendants.\r\n */\n get: function () {\n var e_7, _a, e_8, _b;\n\n if (this.__cache.events) {\n return this.__cache.events;\n }\n\n var states = this.states;\n var events = new Set(this.ownEvents);\n\n if (states) {\n try {\n for (var _c = __values(keys(states)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var stateId = _d.value;\n var state = states[stateId];\n\n if (state.states) {\n try {\n for (var _e = (e_8 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {\n var event_1 = _f.value;\n events.add(\"\".concat(event_1));\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n }\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n\n return this.__cache.events = Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"ownEvents\", {\n /**\r\n * All the events that have transitions directly from this state node.\r\n *\r\n * Excludes any inert events.\r\n */\n get: function () {\n var events = new Set(this.transitions.filter(function (transition) {\n return !(!transition.target && !transition.actions.length && transition.internal);\n }).map(function (transition) {\n return transition.eventType;\n }));\n return Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.resolveTarget = function (_target) {\n var _this = this;\n\n if (_target === undefined) {\n // an undefined target signals that the state node should not transition from that state when receiving that event\n return undefined;\n }\n\n return _target.map(function (target) {\n if (!isString(target)) {\n return target;\n }\n\n var isInternalTarget = target[0] === _this.delimiter; // If internal target is defined on machine,\n // do not include machine key on target\n\n if (isInternalTarget && !_this.parent) {\n return _this.getStateNodeByPath(target.slice(1));\n }\n\n var resolvedTarget = isInternalTarget ? _this.key + target : target;\n\n if (_this.parent) {\n try {\n var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);\n\n return targetStateNode;\n } catch (err) {\n throw new Error(\"Invalid transition definition for state node '\".concat(_this.id, \"':\\n\").concat(err.message));\n }\n } else {\n return _this.getStateNodeByPath(resolvedTarget);\n }\n });\n };\n\n StateNode.prototype.formatTransition = function (transitionConfig) {\n var _this = this;\n\n var normalizedTarget = normalizeTarget(transitionConfig.target);\n var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {\n return isString(_target) && _target[0] === _this.delimiter;\n }) : true;\n var guards = this.machine.options.guards;\n var target = this.resolveTarget(normalizedTarget);\n\n var transition = __assign(__assign({}, transitionConfig), {\n actions: toActionObjects(toArray(transitionConfig.actions)),\n cond: toGuard(transitionConfig.cond, guards),\n target: target,\n source: this,\n internal: internal,\n eventType: transitionConfig.event,\n toJSON: function () {\n return __assign(__assign({}, transition), {\n target: transition.target ? transition.target.map(function (t) {\n return \"#\".concat(t.id);\n }) : undefined,\n source: \"#\".concat(_this.id)\n });\n }\n });\n\n return transition;\n };\n\n StateNode.prototype.formatTransitions = function () {\n var e_9, _a;\n\n var _this = this;\n\n var onConfig;\n\n if (!this.config.on) {\n onConfig = [];\n } else if (Array.isArray(this.config.on)) {\n onConfig = this.config.on;\n } else {\n var _b = this.config.on,\n _c = WILDCARD,\n _d = _b[_c],\n wildcardConfigs = _d === void 0 ? [] : _d,\n strictTransitionConfigs_1 = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\"]);\n\n onConfig = flatten(keys(strictTransitionConfigs_1).map(function (key) {\n if (!IS_PRODUCTION && key === NULL_EVENT) {\n warn(false, \"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. \" + \"Please check the `on` configuration for \\\"#\".concat(_this.id, \"\\\".\"));\n }\n\n var transitionConfigArray = toTransitionConfigArray(key, strictTransitionConfigs_1[key]);\n\n if (!IS_PRODUCTION) {\n validateArrayifiedTransitions(_this, key, transitionConfigArray);\n }\n\n return transitionConfigArray;\n }).concat(toTransitionConfigArray(WILDCARD, wildcardConfigs)));\n }\n\n var eventlessConfig = this.config.always ? toTransitionConfigArray('', this.config.always) : [];\n var doneConfig = this.config.onDone ? toTransitionConfigArray(String(done(this.id)), this.config.onDone) : [];\n\n if (!IS_PRODUCTION) {\n warn(!(this.config.onDone && !this.parent), \"Root nodes cannot have an \\\".onDone\\\" transition. Please check the config of \\\"\".concat(this.id, \"\\\".\"));\n }\n\n var invokeConfig = flatten(this.invoke.map(function (invokeDef) {\n var settleTransitions = [];\n\n if (invokeDef.onDone) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(doneInvoke(invokeDef.id)), invokeDef.onDone)), false));\n }\n\n if (invokeDef.onError) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(error(invokeDef.id)), invokeDef.onError)), false));\n }\n\n return settleTransitions;\n }));\n var delayedTransitions = this.after;\n var formattedTransitions = flatten(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(doneConfig), false), __read(invokeConfig), false), __read(onConfig), false), __read(eventlessConfig), false).map(function (transitionConfig) {\n return toArray(transitionConfig).map(function (transition) {\n return _this.formatTransition(transition);\n });\n }));\n\n try {\n for (var delayedTransitions_1 = __values(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()) {\n var delayedTransition = delayedTransitions_1_1.value;\n formattedTransitions.push(delayedTransition);\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n\n return formattedTransitions;\n };\n\n return StateNode;\n}();\n\nexport { StateNode };\n","/**\n * Field Progress XState Machine\n */\n\nimport { assign, Machine } from 'xstate';\n\nconst contextArr = ['email', 'password', 'fullName', 'siteName'];\n\n/**\n * Returns a map of all fields (where Enabled = true).\n * If there is a disabled field (false), all\n * subsequent fields are also false\n *\n * @param firstDisabledField - field from contextArr\n */\n\nconst setDisabledField = (\n firstDisabledField?: string\n): { [key: string]: boolean } => {\n // TODO: Analytics event for each time a new field becomes unlocked\n let isDisabled = false;\n\n return Object.assign(\n {},\n ...contextArr.map((field) => {\n if (field === firstDisabledField) {\n isDisabled = true;\n }\n return { [field]: !isDisabled };\n })\n );\n};\n\nexport const machineFieldProgress = Machine({\n id: 'field-progress',\n initial: 'disabled',\n context: setDisabledField(),\n states: {\n disabled: {\n on: {\n ENABLED: {\n target: 'enabled',\n actions: assign(setDisabledField('password'))\n }\n }\n },\n enabled: {\n on: {\n DISABLED: {\n target: 'disabled'\n },\n VALID_EMAIL: {\n actions: assign(setDisabledField('fullName'))\n },\n VALID_PASSWORD: {\n actions: assign(setDisabledField('siteName'))\n },\n VALID_NAME: {\n actions: assign(setDisabledField()),\n target: 'completed'\n }\n }\n },\n completed: {}\n }\n});\n","import { StateNode } from './StateNode.js';\n\nfunction Machine(config, options, initialContext) {\n if (initialContext === void 0) {\n initialContext = config.context;\n }\n\n return new StateNode(config, options, initialContext);\n}\nfunction createMachine(config, options) {\n return new StateNode(config, options);\n}\n\nexport { Machine, createMachine };\n","import React, { SetStateAction } from 'react';\nimport styled from '@emotion/styled';\nimport { N40, N500, B400 } from '@atlaskit/theme/colors';\nimport { Radio } from '@atlaskit/radio';\nimport { useBundles } from '../../../../../../hook';\nimport { useAnalyticsEvents } from '@atlaskit/analytics-next';\nexport interface BundleItemProps {\n isChecked: boolean;\n name: string;\n bundleName: string;\n value: string;\n description?: string;\n edition: string;\n}\n\ntype IsCheckedProp = {\n readonly isChecked: boolean;\n};\n\nconst ItemContainer = styled.div`\n width: 100%;\n box-sizing: border-box;\n border: 1.5px solid ${({ isChecked }) => (isChecked ? B400 : N40)};\n border-radius: 6px;\n padding: 8px 12px;\n margin: 8px 0;\n display: flex;\n flex-direction: row;\n`;\nconst CopyContainer = styled.div`\n flex: 4 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n`;\n\nconst BundleName = styled.label`\n font-family: Charlie Display, -apple-system, BlinkMacSystemFont, Segoe UI,\n Roboto, Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 16px;\n font-weight: 400;\n line-height: 19px;\n margin-bottom: 4px;\n color: ${({ isChecked }) => (isChecked ? B400 : N500)};\n`;\n\nconst BundleDescription = styled.div`\n font-family: Charlie Text, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto,\n Noto Sans, Ubuntu, Droid Sans, Helvetica Neue, sans-serif;\n font-size: 10px;\n line-height: 16px;\n color: ${N500};\n`;\n\nconst RadioContainer = styled.div`\n flex: 1 0;\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n justify-content: center;\n`;\n\nexport const BundleItem = ({\n isChecked,\n name,\n bundleName,\n value: bundle,\n edition,\n description\n}: BundleItemProps) => {\n const { setBundle, setEdition } = useBundles();\n const { createAnalyticsEvent } = useAnalyticsEvents();\n\n const setBundleWithAnalytics = (\n bundleKey: SetStateAction,\n edition: SetStateAction\n ) => {\n setBundle(bundleKey);\n setEdition(edition);\n createAnalyticsEvent({\n name: 'option selected',\n action: 'selected',\n actionSubject: 'option',\n actionSubjectId: 'bundleOption',\n product: 'marketing',\n attributes: {\n selectedBundle: bundleKey\n }\n }).fire();\n };\n\n return (\n setBundleWithAnalytics(bundle, edition)}\n >\n \n \n {bundleName}\n \n {description}\n \n \n \n \n \n );\n};\n","import React from 'react';\nimport styled from '@emotion/styled';\nimport { AtlassianLogo } from '@atlaskit/logo';\nimport { B200, B400 } from '@atlaskit/theme/colors';\n\nexport function FooterLogo() {\n return (\n \n \n \n );\n}\n\nconst LogoWrapper = styled.div`\n width: min-content;\n margin: 0 auto;\n`;\n","import React, { ReactNode, useCallback } from 'react';\nimport { useAnalyticsEvents, UIAnalyticsEvent } from '@atlaskit/analytics-next';\nimport styled from '@emotion/styled';\nimport Button from '@atlaskit/button';\nimport { N700 } from '@atlaskit/theme/colors';\n\nexport type ProductSelectButtonProps = {\n readonly productIcon: ReactNode;\n readonly productName: ReactNode;\n readonly productDescription: ReactNode;\n readonly buttonTitle: ReactNode;\n readonly className: string;\n readonly analyticsId: string;\n readonly analyticsLabel: string | undefined;\n readonly onClick: (\n event: React.MouseEvent,\n analyticsEvent: UIAnalyticsEvent | null\n ) => void;\n readonly testId?: string;\n};\n\nexport function ProductSelectButton({\n productIcon,\n productName,\n productDescription,\n buttonTitle,\n className,\n analyticsId,\n analyticsLabel,\n onClick = () => undefined,\n testId\n}: ProductSelectButtonProps) {\n const { createAnalyticsEvent } = useAnalyticsEvents();\n\n const clickHandler = useCallback(\n (clickEvent) => {\n const analyticsEvent = createAnalyticsEvent({\n event: 'clicked',\n eventComponent: 'button',\n eventName: 'signUpProductSelectButtonClicked',\n uuid: analyticsId,\n label: analyticsLabel\n });\n\n // do what you like with the event, fire / modify / clone\n // this here is the typical usage pattern for atlaskit components\n\n const clonedEvent = analyticsEvent.clone();\n\n // channel name gets passed to fire(), but we aren't using channels, so it's left blank\n analyticsEvent.fire();\n\n // firing is prevented from happening more than once\n // so that's why we pass a clone to be accessed by the parent component\n // which might also want to fire their own event on this ui interaction\n onClick(clickEvent, clonedEvent);\n },\n [createAnalyticsEvent, onClick]\n );\n\n return (\n \n \n {productIcon}\n \n {productName}\n {productDescription}\n \n \n \n {buttonTitle}\n \n \n );\n}\n\nconst Container = styled.div`\n display: flex;\n margin-bottom: 32px;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n`;\n\nconst LogoContent = styled.div`\n display: flex;\n flex-direction: row;\n`;\n\nconst LogoTextContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: space-around;\n margin-left: 11px;\n`;\n\nconst ProductName = styled.div`\n font-family: Charlie Display;\n font-style: normal;\n font-weight: 500;\n font-size: 18px;\n line-height: 16px;\n color: ${N700};\n`;\n\nconst ProductDescription = styled.div`\n font-family: Charlie Text;\n font-style: normal;\n font-weight: normal;\n font-size: 12px;\n line-height: 18px;\n color: ${N700};\n`;\n\nconst StyledButton = styled(Button)`\n font-family: Charlie Text;\n font-size: 16px;\n font-style: normal;\n font-weight: 600;\n line-height: 20px;\n letter-spacing: 0px;\n text-align: center;\n`;\n","import { defineMessagesSimple } from '@atlassiansox/bxpkit-core';\n\nexport const messages = defineMessagesSimple('WacSignupForm.FirstImpressions', {\n noCreditCardRequiredFooter: `No credit card required`,\n firstImpressionsEula:\n \"By signing up, you agree to the Atlassian Cloud Terms of Service and Privacy Policy.
\",\n firstImpressionsRecaptcha:\n 'This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.',\n firstImpressionsLoggedOutFormHeader: 'Get Started',\n firstImpressionsLoggedOutFormSubHeader: 'Free for up to 10 users',\n firstImpressionsLoggedInFormHeader: 'Welcome back, {userName}',\n inputLabelWorkEmail: 'Work email',\n inputLabelWorkEmailError: 'Invalid email address',\n inputLabelFullName: 'Full name',\n inputLabelSiteName: 'Claim your site',\n submitButtonLabel: 'Agree',\n socialSignUpButtonContinueWithGoogle: 'Continue with Google',\n socialSignUpButtonSignUpWithEmail: 'Sign up with email',\n socialSignUpDividerLabel: 'OR',\n inputLabelFullNameLengthError: 'Must be 255 characters or less',\n inputLabelRequired: 'Required',\n firstImpressionsLoggedOutFormSubmitError:\n 'Something went wrong, please try again.',\n firstImpressionsSamlRequired:\n 'You must use single sign-on to access your account and continue signing up for your product. Login to continue',\n firstImpressionsSsoCheckError:\n 'There was an unexpected error validating your email. Please check your network settings.'\n});\n","import Form, { Field, HelperMessage } from '@atlaskit/form';\nimport Textfield from '@atlaskit/textfield';\nimport styled from '@emotion/styled';\nimport React, { Fragment } from 'react';\n\nexport type SwitchAccountsEmailFormProps = {\n readonly email: string;\n readonly switchAccountLink: React.ReactNode;\n};\n\nexport function SwitchAccountsEmailForm({\n email,\n switchAccountLink\n}: SwitchAccountsEmailFormProps) {\n return (\n \n )}\n \n );\n}\n\nconst StyledTextField = styled(Textfield)`\n // force box-sizing: content-box; to prevent styling issues in magnolia\n box-sizing: content-box;\n`;\n","var isMergeableObject = function isMergeableObject(value) {\n\treturn isNonNullObject(value)\n\t\t&& !isSpecial(value)\n};\n\nfunction isNonNullObject(value) {\n\treturn !!value && typeof value === 'object'\n}\n\nfunction isSpecial(value) {\n\tvar stringValue = Object.prototype.toString.call(value);\n\n\treturn stringValue === '[object RegExp]'\n\t\t|| stringValue === '[object Date]'\n\t\t|| isReactElement(value)\n}\n\n// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n\treturn value.$$typeof === REACT_ELEMENT_TYPE\n}\n\nfunction emptyTarget(val) {\n\treturn Array.isArray(val) ? [] : {}\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n\treturn (options.clone !== false && options.isMergeableObject(value))\n\t\t? deepmerge(emptyTarget(value), value, options)\n\t\t: value\n}\n\nfunction defaultArrayMerge(target, source, options) {\n\treturn target.concat(source).map(function(element) {\n\t\treturn cloneUnlessOtherwiseSpecified(element, options)\n\t})\n}\n\nfunction mergeObject(target, source, options) {\n\tvar destination = {};\n\tif (options.isMergeableObject(target)) {\n\t\tObject.keys(target).forEach(function(key) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n\t\t});\n\t}\n\tObject.keys(source).forEach(function(key) {\n\t\tif (!options.isMergeableObject(source[key]) || !target[key]) {\n\t\t\tdestination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n\t\t} else {\n\t\t\tdestination[key] = deepmerge(target[key], source[key], options);\n\t\t}\n\t});\n\treturn destination\n}\n\nfunction deepmerge(target, source, options) {\n\toptions = options || {};\n\toptions.arrayMerge = options.arrayMerge || defaultArrayMerge;\n\toptions.isMergeableObject = options.isMergeableObject || isMergeableObject;\n\n\tvar sourceIsArray = Array.isArray(source);\n\tvar targetIsArray = Array.isArray(target);\n\tvar sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n\tif (!sourceAndTargetTypesMatch) {\n\t\treturn cloneUnlessOtherwiseSpecified(source, options)\n\t} else if (sourceIsArray) {\n\t\treturn options.arrayMerge(target, source, options)\n\t} else {\n\t\treturn mergeObject(target, source, options)\n\t}\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n\tif (!Array.isArray(array)) {\n\t\tthrow new Error('first argument should be an array')\n\t}\n\n\treturn array.reduce(function(prev, next) {\n\t\treturn deepmerge(prev, next, options)\n\t}, {})\n};\n\nvar deepmerge_1 = deepmerge;\n\nexport default deepmerge_1;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nexport default listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nexport default eq;\n","import eq from './eq.js';\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nexport default assocIndexOf;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nexport default listCacheDelete;\n","import listCacheClear from './_listCacheClear.js';\nimport listCacheDelete from './_listCacheDelete.js';\nimport listCacheGet from './_listCacheGet.js';\nimport listCacheHas from './_listCacheHas.js';\nimport listCacheSet from './_listCacheSet.js';\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nexport default ListCache;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nexport default listCacheGet;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nexport default listCacheHas;\n","import assocIndexOf from './_assocIndexOf.js';\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nexport default listCacheSet;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nexport default isObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObject from './isObject.js';\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nexport default isFunction;\n","import root from './_root.js';\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nexport default coreJsData;\n","import coreJsData from './_coreJsData.js';\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nexport default isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nexport default toSource;\n","import isFunction from './isFunction.js';\nimport isMasked from './_isMasked.js';\nimport isObject from './isObject.js';\nimport toSource from './_toSource.js';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nexport default baseIsNative;\n","import baseIsNative from './_baseIsNative.js';\nimport getValue from './_getValue.js';\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nexport default getNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nexport default getValue;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nexport default Map;\n","import getNative from './_getNative.js';\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nexport default nativeCreate;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nexport default hashGet;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nexport default hashHas;\n","import hashClear from './_hashClear.js';\nimport hashDelete from './_hashDelete.js';\nimport hashGet from './_hashGet.js';\nimport hashHas from './_hashHas.js';\nimport hashSet from './_hashSet.js';\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nexport default Hash;\n","import nativeCreate from './_nativeCreate.js';\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nexport default hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default hashDelete;\n","import nativeCreate from './_nativeCreate.js';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nexport default hashSet;\n","import isKeyable from './_isKeyable.js';\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nexport default getMapData;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nexport default isKeyable;\n","import mapCacheClear from './_mapCacheClear.js';\nimport mapCacheDelete from './_mapCacheDelete.js';\nimport mapCacheGet from './_mapCacheGet.js';\nimport mapCacheHas from './_mapCacheHas.js';\nimport mapCacheSet from './_mapCacheSet.js';\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nexport default MapCache;\n","import Hash from './_Hash.js';\nimport ListCache from './_ListCache.js';\nimport Map from './_Map.js';\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nexport default mapCacheClear;\n","import getMapData from './_getMapData.js';\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nexport default mapCacheDelete;\n","import getMapData from './_getMapData.js';\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nexport default mapCacheGet;\n","import getMapData from './_getMapData.js';\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nexport default mapCacheHas;\n","import getMapData from './_getMapData.js';\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nexport default mapCacheSet;\n","import ListCache from './_ListCache.js';\nimport stackClear from './_stackClear.js';\nimport stackDelete from './_stackDelete.js';\nimport stackGet from './_stackGet.js';\nimport stackHas from './_stackHas.js';\nimport stackSet from './_stackSet.js';\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nexport default Stack;\n","import ListCache from './_ListCache.js';\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nexport default stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nexport default stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nexport default stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nexport default stackHas;\n","import ListCache from './_ListCache.js';\nimport Map from './_Map.js';\nimport MapCache from './_MapCache.js';\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nexport default stackSet;\n","import getNative from './_getNative.js';\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nexport default defineProperty;\n","import defineProperty from './_defineProperty.js';\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nexport default baseAssignValue;\n","import baseAssignValue from './_baseAssignValue.js';\nimport eq from './eq.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nexport default assignValue;\n","import assignValue from './_assignValue.js';\nimport baseAssignValue from './_baseAssignValue.js';\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nexport default copyObject;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nexport default baseIsArguments;\n","import baseIsArguments from './_baseIsArguments.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nexport default isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nexport default isArray;\n","import root from './_root.js';\nimport stubFalse from './stubFalse.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nexport default isBuffer;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nexport default stubFalse;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nexport default isIndex;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nexport default isLength;\n","import baseGetTag from './_baseGetTag.js';\nimport isLength from './isLength.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nexport default baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nexport default baseUnary;\n","import freeGlobal from './_freeGlobal.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nexport default nodeUtil;\n","import baseIsTypedArray from './_baseIsTypedArray.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nexport default isTypedArray;\n","import baseTimes from './_baseTimes.js';\nimport isArguments from './isArguments.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isIndex from './_isIndex.js';\nimport isTypedArray from './isTypedArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default arrayLikeKeys;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nexport default baseTimes;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nexport default isPrototype;\n","import overArg from './_overArg.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nexport default nativeKeys;\n","import isPrototype from './_isPrototype.js';\nimport nativeKeys from './_nativeKeys.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeys;\n","import isFunction from './isFunction.js';\nimport isLength from './isLength.js';\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nexport default isArrayLike;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeys from './_baseKeys.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nexport default keys;\n","import isObject from './isObject.js';\nimport isPrototype from './_isPrototype.js';\nimport nativeKeysIn from './_nativeKeysIn.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default baseKeysIn;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nexport default nativeKeysIn;\n","import arrayLikeKeys from './_arrayLikeKeys.js';\nimport baseKeysIn from './_baseKeysIn.js';\nimport isArrayLike from './isArrayLike.js';\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nexport default keysIn;\n","import root from './_root.js';\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nexport default cloneBuffer;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nexport default copyArray;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nexport default stubArray;\n","import arrayFilter from './_arrayFilter.js';\nimport stubArray from './stubArray.js';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nexport default getSymbols;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nexport default arrayFilter;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nexport default arrayPush;\n","import arrayPush from './_arrayPush.js';\nimport getPrototype from './_getPrototype.js';\nimport getSymbols from './_getSymbols.js';\nimport stubArray from './stubArray.js';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nexport default getSymbolsIn;\n","import arrayPush from './_arrayPush.js';\nimport isArray from './isArray.js';\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nexport default baseGetAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbols from './_getSymbols.js';\nimport keys from './keys.js';\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nexport default getAllKeys;\n","import baseGetAllKeys from './_baseGetAllKeys.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\nimport keysIn from './keysIn.js';\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nexport default getAllKeysIn;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nexport default DataView;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nexport default Promise;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nexport default Set;\n","import getNative from './_getNative.js';\nimport root from './_root.js';\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nexport default WeakMap;\n","import DataView from './_DataView.js';\nimport Map from './_Map.js';\nimport Promise from './_Promise.js';\nimport Set from './_Set.js';\nimport WeakMap from './_WeakMap.js';\nimport baseGetTag from './_baseGetTag.js';\nimport toSource from './_toSource.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nexport default getTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nexport default initCloneArray;\n","import root from './_root.js';\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nexport default Uint8Array;\n","import Uint8Array from './_Uint8Array.js';\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nexport default cloneArrayBuffer;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nexport default cloneRegExp;\n","import Symbol from './_Symbol.js';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nexport default cloneSymbol;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\nimport cloneDataView from './_cloneDataView.js';\nimport cloneRegExp from './_cloneRegExp.js';\nimport cloneSymbol from './_cloneSymbol.js';\nimport cloneTypedArray from './_cloneTypedArray.js';\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nexport default initCloneByTag;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nexport default cloneDataView;\n","import cloneArrayBuffer from './_cloneArrayBuffer.js';\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nexport default cloneTypedArray;\n","import isObject from './isObject.js';\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nexport default baseCreate;\n","import baseIsMap from './_baseIsMap.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nexport default isMap;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nexport default baseIsMap;\n","import baseIsSet from './_baseIsSet.js';\nimport baseUnary from './_baseUnary.js';\nimport nodeUtil from './_nodeUtil.js';\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nexport default isSet;\n","import getTag from './_getTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nexport default baseIsSet;\n","import Stack from './_Stack.js';\nimport arrayEach from './_arrayEach.js';\nimport assignValue from './_assignValue.js';\nimport baseAssign from './_baseAssign.js';\nimport baseAssignIn from './_baseAssignIn.js';\nimport cloneBuffer from './_cloneBuffer.js';\nimport copyArray from './_copyArray.js';\nimport copySymbols from './_copySymbols.js';\nimport copySymbolsIn from './_copySymbolsIn.js';\nimport getAllKeys from './_getAllKeys.js';\nimport getAllKeysIn from './_getAllKeysIn.js';\nimport getTag from './_getTag.js';\nimport initCloneArray from './_initCloneArray.js';\nimport initCloneByTag from './_initCloneByTag.js';\nimport initCloneObject from './_initCloneObject.js';\nimport isArray from './isArray.js';\nimport isBuffer from './isBuffer.js';\nimport isMap from './isMap.js';\nimport isObject from './isObject.js';\nimport isSet from './isSet.js';\nimport keys from './keys.js';\nimport keysIn from './keysIn.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nexport default baseClone;\n","import baseCreate from './_baseCreate.js';\nimport getPrototype from './_getPrototype.js';\nimport isPrototype from './_isPrototype.js';\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nexport default initCloneObject;\n","import copyObject from './_copyObject.js';\nimport getSymbolsIn from './_getSymbolsIn.js';\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nexport default copySymbolsIn;\n","import copyObject from './_copyObject.js';\nimport keysIn from './keysIn.js';\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nexport default baseAssignIn;\n","import copyObject from './_copyObject.js';\nimport getSymbols from './_getSymbols.js';\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nexport default copySymbols;\n","import copyObject from './_copyObject.js';\nimport keys from './keys.js';\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nexport default baseAssign;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nexport default arrayEach;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nexport default clone;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nexport default arrayMap;\n","import baseGetTag from './_baseGetTag.js';\nimport isObjectLike from './isObjectLike.js';\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nexport default isSymbol;\n","import MapCache from './_MapCache.js';\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nexport default memoize;\n","import memoizeCapped from './_memoizeCapped.js';\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nexport default stringToPath;\n","import memoize from './memoize.js';\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nexport default memoizeCapped;\n","import isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default toKey;\n","import Symbol from './_Symbol.js';\nimport arrayMap from './_arrayMap.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nexport default baseToString;\n","import baseToString from './_baseToString.js';\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nexport default toString;\n","import arrayMap from './_arrayMap.js';\nimport copyArray from './_copyArray.js';\nimport isArray from './isArray.js';\nimport isSymbol from './isSymbol.js';\nimport stringToPath from './_stringToPath.js';\nimport toKey from './_toKey.js';\nimport toString from './toString.js';\n\n/**\n * Converts `value` to a property path array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Util\n * @param {*} value The value to convert.\n * @returns {Array} Returns the new property path array.\n * @example\n *\n * _.toPath('a.b.c');\n * // => ['a', 'b', 'c']\n *\n * _.toPath('a[0].b.c');\n * // => ['a', '0', 'b', 'c']\n */\nfunction toPath(value) {\n if (isArray(value)) {\n return arrayMap(value, toKey);\n }\n return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));\n}\n\nexport default toPath;\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","import { Children, createContext, useContext, useRef, useEffect, useReducer, useCallback, useMemo, useImperativeHandle, createElement, useLayoutEffect, forwardRef, Component } from 'react';\nimport isEqual from 'react-fast-compare';\nimport deepmerge from 'deepmerge';\nimport isPlainObject from 'lodash-es/isPlainObject';\nimport clone from 'lodash-es/clone';\nimport toPath from 'lodash-es/toPath';\nimport invariant from 'tiny-warning';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport cloneDeep from 'lodash-es/cloneDeep';\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}\n\nfunction _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\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\n return target;\n}\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\n/** @private is the value an empty array? */\n\nvar isEmptyArray = function isEmptyArray(value) {\n return Array.isArray(value) && value.length === 0;\n};\n/** @private is the given object a Function? */\n\nvar isFunction = function isFunction(obj) {\n return typeof obj === 'function';\n};\n/** @private is the given object an Object? */\n\nvar isObject = function isObject(obj) {\n return obj !== null && typeof obj === 'object';\n};\n/** @private is the given object an integer? */\n\nvar isInteger = function isInteger(obj) {\n return String(Math.floor(Number(obj))) === obj;\n};\n/** @private is the given object a string? */\n\nvar isString = function isString(obj) {\n return Object.prototype.toString.call(obj) === '[object String]';\n};\n/** @private is the given object a NaN? */\n// eslint-disable-next-line no-self-compare\n\nvar isNaN$1 = function isNaN(obj) {\n return obj !== obj;\n};\n/** @private Does a React component have exactly 0 children? */\n\nvar isEmptyChildren = function isEmptyChildren(children) {\n return Children.count(children) === 0;\n};\n/** @private is the given object/value a promise? */\n\nvar isPromise = function isPromise(value) {\n return isObject(value) && isFunction(value.then);\n};\n/** @private is the given object/value a type of synthetic event? */\n\nvar isInputEvent = function isInputEvent(value) {\n return value && isObject(value) && isObject(value.target);\n};\n/**\r\n * Same as document.activeElement but wraps in a try-catch block. In IE it is\r\n * not safe to call document.activeElement if there is nothing focused.\r\n *\r\n * The activeElement will be null only if the document or document body is not\r\n * yet defined.\r\n *\r\n * @param {?Document} doc Defaults to current document.\r\n * @return {Element | null}\r\n * @see https://github.com/facebook/fbjs/blob/master/packages/fbjs/src/core/dom/getActiveElement.js\r\n */\n\nfunction getActiveElement(doc) {\n doc = doc || (typeof document !== 'undefined' ? document : undefined);\n\n if (typeof doc === 'undefined') {\n return null;\n }\n\n try {\n return doc.activeElement || doc.body;\n } catch (e) {\n return doc.body;\n }\n}\n/**\r\n * Deeply get a value from an object via its path.\r\n */\n\nfunction getIn(obj, key, def, p) {\n if (p === void 0) {\n p = 0;\n }\n\n var path = toPath(key);\n\n while (obj && p < path.length) {\n obj = obj[path[p++]];\n }\n\n return obj === undefined ? def : obj;\n}\n/**\r\n * Deeply set a value from in object via it's path. If the value at `path`\r\n * has changed, return a shallow copy of obj with `value` set at `path`.\r\n * If `value` has not changed, return the original `obj`.\r\n *\r\n * Existing objects / arrays along `path` are also shallow copied. Sibling\r\n * objects along path retain the same internal js reference. Since new\r\n * objects / arrays are only created along `path`, we can test if anything\r\n * changed in a nested structure by comparing the object's reference in\r\n * the old and new object, similar to how russian doll cache invalidation\r\n * works.\r\n *\r\n * In earlier versions of this function, which used cloneDeep, there were\r\n * issues whereby settings a nested value would mutate the parent\r\n * instead of creating a new object. `clone` avoids that bug making a\r\n * shallow copy of the objects along the update path\r\n * so no object is mutated in place.\r\n *\r\n * Before changing this function, please read through the following\r\n * discussions.\r\n *\r\n * @see https://github.com/developit/linkstate\r\n * @see https://github.com/jaredpalmer/formik/pull/123\r\n */\n\nfunction setIn(obj, path, value) {\n var res = clone(obj); // this keeps inheritance when obj is a class\n\n var resVal = res;\n var i = 0;\n var pathArray = toPath(path);\n\n for (; i < pathArray.length - 1; i++) {\n var currentPath = pathArray[i];\n var currentObj = getIn(obj, pathArray.slice(0, i + 1));\n\n if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {\n resVal = resVal[currentPath] = clone(currentObj);\n } else {\n var nextPath = pathArray[i + 1];\n resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};\n }\n } // Return original object if new value is the same as current\n\n\n if ((i === 0 ? obj : resVal)[pathArray[i]] === value) {\n return obj;\n }\n\n if (value === undefined) {\n delete resVal[pathArray[i]];\n } else {\n resVal[pathArray[i]] = value;\n } // If the path array has a single element, the loop did not run.\n // Deleting on `resVal` had no effect in this scenario, so we delete on the result instead.\n\n\n if (i === 0 && value === undefined) {\n delete res[pathArray[i]];\n }\n\n return res;\n}\n/**\r\n * Recursively a set the same value for all keys and arrays nested object, cloning\r\n * @param object\r\n * @param value\r\n * @param visited\r\n * @param response\r\n */\n\nfunction setNestedObjectValues(object, value, visited, response) {\n if (visited === void 0) {\n visited = new WeakMap();\n }\n\n if (response === void 0) {\n response = {};\n }\n\n for (var _i = 0, _Object$keys = Object.keys(object); _i < _Object$keys.length; _i++) {\n var k = _Object$keys[_i];\n var val = object[k];\n\n if (isObject(val)) {\n if (!visited.get(val)) {\n visited.set(val, true); // In order to keep array values consistent for both dot path and\n // bracket syntax, we need to check if this is an array so that\n // this will output { friends: [true] } and not { friends: { \"0\": true } }\n\n response[k] = Array.isArray(val) ? [] : {};\n setNestedObjectValues(val, value, visited, response[k]);\n }\n } else {\n response[k] = value;\n }\n }\n\n return response;\n}\n\nvar FormikContext = /*#__PURE__*/createContext(undefined);\nFormikContext.displayName = 'FormikContext';\nvar FormikProvider = FormikContext.Provider;\nvar FormikConsumer = FormikContext.Consumer;\nfunction useFormikContext() {\n var formik = useContext(FormikContext);\n !!!formik ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Formik context is undefined, please verify you are calling useFormikContext() as child of a component.\") : invariant(false) : void 0;\n return formik;\n}\n\nfunction formikReducer(state, msg) {\n switch (msg.type) {\n case 'SET_VALUES':\n return _extends({}, state, {\n values: msg.payload\n });\n\n case 'SET_TOUCHED':\n return _extends({}, state, {\n touched: msg.payload\n });\n\n case 'SET_ERRORS':\n if (isEqual(state.errors, msg.payload)) {\n return state;\n }\n\n return _extends({}, state, {\n errors: msg.payload\n });\n\n case 'SET_STATUS':\n return _extends({}, state, {\n status: msg.payload\n });\n\n case 'SET_ISSUBMITTING':\n return _extends({}, state, {\n isSubmitting: msg.payload\n });\n\n case 'SET_ISVALIDATING':\n return _extends({}, state, {\n isValidating: msg.payload\n });\n\n case 'SET_FIELD_VALUE':\n return _extends({}, state, {\n values: setIn(state.values, msg.payload.field, msg.payload.value)\n });\n\n case 'SET_FIELD_TOUCHED':\n return _extends({}, state, {\n touched: setIn(state.touched, msg.payload.field, msg.payload.value)\n });\n\n case 'SET_FIELD_ERROR':\n return _extends({}, state, {\n errors: setIn(state.errors, msg.payload.field, msg.payload.value)\n });\n\n case 'RESET_FORM':\n return _extends({}, state, msg.payload);\n\n case 'SET_FORMIK_STATE':\n return msg.payload(state);\n\n case 'SUBMIT_ATTEMPT':\n return _extends({}, state, {\n touched: setNestedObjectValues(state.values, true),\n isSubmitting: true,\n submitCount: state.submitCount + 1\n });\n\n case 'SUBMIT_FAILURE':\n return _extends({}, state, {\n isSubmitting: false\n });\n\n case 'SUBMIT_SUCCESS':\n return _extends({}, state, {\n isSubmitting: false\n });\n\n default:\n return state;\n }\n} // Initial empty states // objects\n\n\nvar emptyErrors = {};\nvar emptyTouched = {};\nfunction useFormik(_ref) {\n var _ref$validateOnChange = _ref.validateOnChange,\n validateOnChange = _ref$validateOnChange === void 0 ? true : _ref$validateOnChange,\n _ref$validateOnBlur = _ref.validateOnBlur,\n validateOnBlur = _ref$validateOnBlur === void 0 ? true : _ref$validateOnBlur,\n _ref$validateOnMount = _ref.validateOnMount,\n validateOnMount = _ref$validateOnMount === void 0 ? false : _ref$validateOnMount,\n isInitialValid = _ref.isInitialValid,\n _ref$enableReinitiali = _ref.enableReinitialize,\n enableReinitialize = _ref$enableReinitiali === void 0 ? false : _ref$enableReinitiali,\n onSubmit = _ref.onSubmit,\n rest = _objectWithoutPropertiesLoose(_ref, [\"validateOnChange\", \"validateOnBlur\", \"validateOnMount\", \"isInitialValid\", \"enableReinitialize\", \"onSubmit\"]);\n\n var props = _extends({\n validateOnChange: validateOnChange,\n validateOnBlur: validateOnBlur,\n validateOnMount: validateOnMount,\n onSubmit: onSubmit\n }, rest);\n\n var initialValues = useRef(props.initialValues);\n var initialErrors = useRef(props.initialErrors || emptyErrors);\n var initialTouched = useRef(props.initialTouched || emptyTouched);\n var initialStatus = useRef(props.initialStatus);\n var isMounted = useRef(false);\n var fieldRegistry = useRef({});\n\n if (process.env.NODE_ENV !== \"production\") {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(function () {\n !(typeof isInitialValid === 'undefined') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'isInitialValid has been deprecated and will be removed in future versions of Formik. Please use initialErrors or validateOnMount instead.') : invariant(false) : void 0; // eslint-disable-next-line\n }, []);\n }\n\n useEffect(function () {\n isMounted.current = true;\n return function () {\n isMounted.current = false;\n };\n }, []);\n\n var _React$useReducer = useReducer(formikReducer, {\n values: props.initialValues,\n errors: props.initialErrors || emptyErrors,\n touched: props.initialTouched || emptyTouched,\n status: props.initialStatus,\n isSubmitting: false,\n isValidating: false,\n submitCount: 0\n }),\n state = _React$useReducer[0],\n dispatch = _React$useReducer[1];\n\n var runValidateHandler = useCallback(function (values, field) {\n return new Promise(function (resolve, reject) {\n var maybePromisedErrors = props.validate(values, field);\n\n if (maybePromisedErrors == null) {\n // use loose null check here on purpose\n resolve(emptyErrors);\n } else if (isPromise(maybePromisedErrors)) {\n maybePromisedErrors.then(function (errors) {\n resolve(errors || emptyErrors);\n }, function (actualException) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Warning: An unhandled error was caught during validation in \", actualException);\n }\n\n reject(actualException);\n });\n } else {\n resolve(maybePromisedErrors);\n }\n });\n }, [props.validate]);\n /**\r\n * Run validation against a Yup schema and optionally run a function if successful\r\n */\n\n var runValidationSchema = useCallback(function (values, field) {\n var validationSchema = props.validationSchema;\n var schema = isFunction(validationSchema) ? validationSchema(field) : validationSchema;\n var promise = field && schema.validateAt ? schema.validateAt(field, values) : validateYupSchema(values, schema);\n return new Promise(function (resolve, reject) {\n promise.then(function () {\n resolve(emptyErrors);\n }, function (err) {\n // Yup will throw a validation error if validation fails. We catch those and\n // resolve them into Formik errors. We can sniff if something is a Yup error\n // by checking error.name.\n // @see https://github.com/jquense/yup#validationerrorerrors-string--arraystring-value-any-path-string\n if (err.name === 'ValidationError') {\n resolve(yupToFormErrors(err));\n } else {\n // We throw any other errors\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\"Warning: An unhandled error was caught during validation in \", err);\n }\n\n reject(err);\n }\n });\n });\n }, [props.validationSchema]);\n var runSingleFieldLevelValidation = useCallback(function (field, value) {\n return new Promise(function (resolve) {\n return resolve(fieldRegistry.current[field].validate(value));\n });\n }, []);\n var runFieldLevelValidations = useCallback(function (values) {\n var fieldKeysWithValidation = Object.keys(fieldRegistry.current).filter(function (f) {\n return isFunction(fieldRegistry.current[f].validate);\n }); // Construct an array with all of the field validation functions\n\n var fieldValidations = fieldKeysWithValidation.length > 0 ? fieldKeysWithValidation.map(function (f) {\n return runSingleFieldLevelValidation(f, getIn(values, f));\n }) : [Promise.resolve('DO_NOT_DELETE_YOU_WILL_BE_FIRED')]; // use special case ;)\n\n return Promise.all(fieldValidations).then(function (fieldErrorsList) {\n return fieldErrorsList.reduce(function (prev, curr, index) {\n if (curr === 'DO_NOT_DELETE_YOU_WILL_BE_FIRED') {\n return prev;\n }\n\n if (curr) {\n prev = setIn(prev, fieldKeysWithValidation[index], curr);\n }\n\n return prev;\n }, {});\n });\n }, [runSingleFieldLevelValidation]); // Run all validations and return the result\n\n var runAllValidations = useCallback(function (values) {\n return Promise.all([runFieldLevelValidations(values), props.validationSchema ? runValidationSchema(values) : {}, props.validate ? runValidateHandler(values) : {}]).then(function (_ref2) {\n var fieldErrors = _ref2[0],\n schemaErrors = _ref2[1],\n validateErrors = _ref2[2];\n var combinedErrors = deepmerge.all([fieldErrors, schemaErrors, validateErrors], {\n arrayMerge: arrayMerge\n });\n return combinedErrors;\n });\n }, [props.validate, props.validationSchema, runFieldLevelValidations, runValidateHandler, runValidationSchema]); // Run all validations methods and update state accordingly\n\n var validateFormWithHighPriority = useEventCallback(function (values) {\n if (values === void 0) {\n values = state.values;\n }\n\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: true\n });\n return runAllValidations(values).then(function (combinedErrors) {\n if (!!isMounted.current) {\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: false\n });\n dispatch({\n type: 'SET_ERRORS',\n payload: combinedErrors\n });\n }\n\n return combinedErrors;\n });\n });\n useEffect(function () {\n if (validateOnMount && isMounted.current === true && isEqual(initialValues.current, props.initialValues)) {\n validateFormWithHighPriority(initialValues.current);\n }\n }, [validateOnMount, validateFormWithHighPriority]);\n var resetForm = useCallback(function (nextState) {\n var values = nextState && nextState.values ? nextState.values : initialValues.current;\n var errors = nextState && nextState.errors ? nextState.errors : initialErrors.current ? initialErrors.current : props.initialErrors || {};\n var touched = nextState && nextState.touched ? nextState.touched : initialTouched.current ? initialTouched.current : props.initialTouched || {};\n var status = nextState && nextState.status ? nextState.status : initialStatus.current ? initialStatus.current : props.initialStatus;\n initialValues.current = values;\n initialErrors.current = errors;\n initialTouched.current = touched;\n initialStatus.current = status;\n\n var dispatchFn = function dispatchFn() {\n dispatch({\n type: 'RESET_FORM',\n payload: {\n isSubmitting: !!nextState && !!nextState.isSubmitting,\n errors: errors,\n touched: touched,\n status: status,\n values: values,\n isValidating: !!nextState && !!nextState.isValidating,\n submitCount: !!nextState && !!nextState.submitCount && typeof nextState.submitCount === 'number' ? nextState.submitCount : 0\n }\n });\n };\n\n if (props.onReset) {\n var maybePromisedOnReset = props.onReset(state.values, imperativeMethods);\n\n if (isPromise(maybePromisedOnReset)) {\n maybePromisedOnReset.then(dispatchFn);\n } else {\n dispatchFn();\n }\n } else {\n dispatchFn();\n }\n }, [props.initialErrors, props.initialStatus, props.initialTouched]);\n useEffect(function () {\n if (isMounted.current === true && !isEqual(initialValues.current, props.initialValues)) {\n if (enableReinitialize) {\n initialValues.current = props.initialValues;\n resetForm();\n }\n\n if (validateOnMount) {\n validateFormWithHighPriority(initialValues.current);\n }\n }\n }, [enableReinitialize, props.initialValues, resetForm, validateOnMount, validateFormWithHighPriority]);\n useEffect(function () {\n if (enableReinitialize && isMounted.current === true && !isEqual(initialErrors.current, props.initialErrors)) {\n initialErrors.current = props.initialErrors || emptyErrors;\n dispatch({\n type: 'SET_ERRORS',\n payload: props.initialErrors || emptyErrors\n });\n }\n }, [enableReinitialize, props.initialErrors]);\n useEffect(function () {\n if (enableReinitialize && isMounted.current === true && !isEqual(initialTouched.current, props.initialTouched)) {\n initialTouched.current = props.initialTouched || emptyTouched;\n dispatch({\n type: 'SET_TOUCHED',\n payload: props.initialTouched || emptyTouched\n });\n }\n }, [enableReinitialize, props.initialTouched]);\n useEffect(function () {\n if (enableReinitialize && isMounted.current === true && !isEqual(initialStatus.current, props.initialStatus)) {\n initialStatus.current = props.initialStatus;\n dispatch({\n type: 'SET_STATUS',\n payload: props.initialStatus\n });\n }\n }, [enableReinitialize, props.initialStatus, props.initialTouched]);\n var validateField = useEventCallback(function (name) {\n // This will efficiently validate a single field by avoiding state\n // changes if the validation function is synchronous. It's different from\n // what is called when using validateForm.\n if (fieldRegistry.current[name] && isFunction(fieldRegistry.current[name].validate)) {\n var value = getIn(state.values, name);\n var maybePromise = fieldRegistry.current[name].validate(value);\n\n if (isPromise(maybePromise)) {\n // Only flip isValidating if the function is async.\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: true\n });\n return maybePromise.then(function (x) {\n return x;\n }).then(function (error) {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: error\n }\n });\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: false\n });\n });\n } else {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: maybePromise\n }\n });\n return Promise.resolve(maybePromise);\n }\n } else if (props.validationSchema) {\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: true\n });\n return runValidationSchema(state.values, name).then(function (x) {\n return x;\n }).then(function (error) {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: name,\n value: error[name]\n }\n });\n dispatch({\n type: 'SET_ISVALIDATING',\n payload: false\n });\n });\n }\n\n return Promise.resolve();\n });\n var registerField = useCallback(function (name, _ref3) {\n var validate = _ref3.validate;\n fieldRegistry.current[name] = {\n validate: validate\n };\n }, []);\n var unregisterField = useCallback(function (name) {\n delete fieldRegistry.current[name];\n }, []);\n var setTouched = useEventCallback(function (touched, shouldValidate) {\n dispatch({\n type: 'SET_TOUCHED',\n payload: touched\n });\n var willValidate = shouldValidate === undefined ? validateOnBlur : shouldValidate;\n return willValidate ? validateFormWithHighPriority(state.values) : Promise.resolve();\n });\n var setErrors = useCallback(function (errors) {\n dispatch({\n type: 'SET_ERRORS',\n payload: errors\n });\n }, []);\n var setValues = useEventCallback(function (values, shouldValidate) {\n var resolvedValues = isFunction(values) ? values(state.values) : values;\n dispatch({\n type: 'SET_VALUES',\n payload: resolvedValues\n });\n var willValidate = shouldValidate === undefined ? validateOnChange : shouldValidate;\n return willValidate ? validateFormWithHighPriority(resolvedValues) : Promise.resolve();\n });\n var setFieldError = useCallback(function (field, value) {\n dispatch({\n type: 'SET_FIELD_ERROR',\n payload: {\n field: field,\n value: value\n }\n });\n }, []);\n var setFieldValue = useEventCallback(function (field, value, shouldValidate) {\n dispatch({\n type: 'SET_FIELD_VALUE',\n payload: {\n field: field,\n value: value\n }\n });\n var willValidate = shouldValidate === undefined ? validateOnChange : shouldValidate;\n return willValidate ? validateFormWithHighPriority(setIn(state.values, field, value)) : Promise.resolve();\n });\n var executeChange = useCallback(function (eventOrTextValue, maybePath) {\n // By default, assume that the first argument is a string. This allows us to use\n // handleChange with React Native and React Native Web's onChangeText prop which\n // provides just the value of the input.\n var field = maybePath;\n var val = eventOrTextValue;\n var parsed; // If the first argument is not a string though, it has to be a synthetic React Event (or a fake one),\n // so we handle like we would a normal HTML change event.\n\n if (!isString(eventOrTextValue)) {\n // If we can, persist the event\n // @see https://reactjs.org/docs/events.html#event-pooling\n if (eventOrTextValue.persist) {\n eventOrTextValue.persist();\n }\n\n var target = eventOrTextValue.target ? eventOrTextValue.target : eventOrTextValue.currentTarget;\n var type = target.type,\n name = target.name,\n id = target.id,\n value = target.value,\n checked = target.checked,\n outerHTML = target.outerHTML,\n options = target.options,\n multiple = target.multiple;\n field = maybePath ? maybePath : name ? name : id;\n\n if (!field && process.env.NODE_ENV !== \"production\") {\n warnAboutMissingIdentifier({\n htmlContent: outerHTML,\n documentationAnchorLink: 'handlechange-e-reactchangeeventany--void',\n handlerName: 'handleChange'\n });\n }\n\n val = /number|range/.test(type) ? (parsed = parseFloat(value), isNaN(parsed) ? '' : parsed) : /checkbox/.test(type) // checkboxes\n ? getValueForCheckbox(getIn(state.values, field), checked, value) : options && multiple //