{"version":3,"sources":["webpack:///./node_modules/react-transition-group/esm/TransitionGroupContext.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/medium.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/UI.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/handleScroll.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/SideEffect.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/sidecar.js","webpack:///./node_modules/react-remove-scroll/dist/es2015/Combination.js","webpack:///./node_modules/dom-mutator/dist/dom-mutator.esm.js","webpack:///./node_modules/@growthbook/growthbook/dist/esm/util.js","webpack:///./node_modules/@growthbook/growthbook/dist/esm/mongrule.js","webpack:///./node_modules/@growthbook/growthbook/dist/esm/feature-repository.js","webpack:///./node_modules/@growthbook/growthbook/dist/esm/GrowthBook.js","webpack:///./node_modules/@growthbook/growthbook-react/dist/esm/index.js","webpack:///./node_modules/react-dom/client.js","webpack:///./node_modules/shallowequal/index.js","webpack:///./node_modules/react-transition-group/esm/utils/ChildMapping.js","webpack:///./node_modules/react-transition-group/esm/TransitionGroup.js","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///./node_modules/react-intersection-observer/react-intersection-observer.esm.js","webpack:///./node_modules/dom-helpers/esm/removeClass.js","webpack:///./node_modules/react-transition-group/esm/config.js","webpack:///./node_modules/react-transition-group/esm/Transition.js","webpack:///./node_modules/react-transition-group/esm/CSSTransition.js","webpack:///./node_modules/dom-helpers/esm/addClass.js","webpack:///./node_modules/dom-helpers/esm/hasClass.js"],"names":["createContext","effectCar","nothing","RemoveScroll","props","parentRef","ref","_a","onScrollCapture","onWheelCapture","onTouchMoveCapture","callbacks","setCallbacks","forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","_b","as","Container","rest","SideCar","containerRef","useMergeRef","containerProps","lockRef","only","defaultProps","classNames","fullWidth","zeroRight","locationCouldBeScrolled","axis","node","current","ShadowRoot","host","elementCouldBeScrolled","getScrollVariables","parentNode","document","body","styles","window","getComputedStyle","overflowY","overflowX","elementCouldBeVScrolled","type","elementCouldBeHScrolled","scrollTop","scrollHeight","clientHeight","scrollLeft","scrollWidth","clientWidth","getHScrollVariables","passiveSupported","options","Object","defineProperty","get","addEventListener","removeEventListener","err","nonPassive","passive","getTouchXY","event","changedTouches","clientX","clientY","getDeltaXY","deltaX","deltaY","extractRef","generateStyle","id","idCounter","lockStack","shouldPreventQueue","touchStartRef","activeAxis","Style","lastProps","classList","add","allow_1","concat","map","filter","Boolean","forEach","el","remove","shouldCancelEvent","parent","touches","length","currentAxis","touch","touchStart","target","moveDirection","Math","abs","canBeScrolledInMainDirection","cancelingAxis","endTarget","sourceDelta","noOverscroll","delta","targetInLock","contains","shouldCancelScroll","isDeltaPositive","availableScroll","availableScrollTop","position","elementScroll","handleScroll","shouldPrevent","_event","sourceEvent","e","name","x","y","should","preventDefault","shardNodes","shouldCancel","push","setTimeout","scrollTouchStart","undefined","scrollWheel","scrollTouchMove","inst","gapMode","ReactRemoveScroll","validAttributeName","nullController","revert","Map","mutations","Set","getElementRecord","element","record","attributes","set","createElementPropertyRecord","attr","getCurrentValue","setValue","mutationRunner","currentValue","isDirty","originalValue","virtualValue","observer","MutationObserver","observe","childList","subtree","characterData","attributeFilter","getObserverInit","queueIfNeeded","val","currentVal","insertBeforeNode","queueDOMUpdates","htmlMutationRunner","m","mutate","html","transformContainer","createElement","innerHTML","getTransformedHTML","classMutationRunner","split","Array","from","join","attrMutationRunner","positionMutationRunner","newNodes","_ref","parentSelector","insertBeforeSelector","querySelector","_loadDOMNodes","getHTMLValue","setHTMLValue","value","getElementHTMLRecord","elementRecord","getElementPosition","parentElement","nextElementSibling","setElementPosition","insertBefore","getElementPositionRecord","setClassValue","removeAttribute","getClassValue","getElementClassRecord","classes","getAttrValue","attrName","_el$getAttribute","getAttribute","setAttrValue","setAttribute","getElementAttributeRecord","setPropertyValue","_element$html","_element$html$observe","disconnect","_element$classes","_element$classes$obse","_element$position","_element$position$obs","_element$attributes","_element$attributes$a","_element$attributes$a2","deleteElementPropertyRecord","raf","keys","setValues","requestAnimationFrame","stopMutating","mutation","kind","attribute","index","indexOf","splice","refreshElementsSet","existingElements","elements","newElements","querySelectorAll","selector","has","startMutating","refreshAllElementSets","newMutation","clear","test","classnames","mutatedClassnames","c","documentElement","declarative","_ref2","action","hashFnv32a","str","hval","l","i","charCodeAt","hash","seed","version","inRange","n","range","getUrlRegExp","regexString","escaped","replace","RegExp","console","error","_evalSimpleUrlTarget","actual","pattern","expected","URL","comps","pathname","searchParams","v","k","some","data","isPath","_evalSimpleUrlPart","_evalURLTarget","url","parsed","regex","href","substring","origin","getBucketRanges","numVariations","coverage","weights","equal","fill","totalWeight","reduce","w","sum","cumulative","start","base64ToBuf","b","Uint8Array","atob","async","decrypt","encryptedString","decryptionKey","subtle","globalThis","crypto","Error","key","importKey","iv","cipherText","plainTextBuffer","TextDecoder","decode","paddedVersionString","input","parts","match","padStart","_regexCache","evalCondition","obj","condition","evalOr","conditions","evalAnd","entries","evalConditionValue","getPath","path","isArray","isOperatorObject","JSON","stringify","op","evalOperatorCondition","isIn","includes","operator","check","elemMatch","passed","j","t","getType","cacheSettings","staleTTL","cacheKey","backgroundSync","polyfills","fetch","bind","SubtleCrypto","EventSource","localStorage","subscribedInstances","cacheInitialized","cache","activeFetches","streams","supportsSSE","configureCache","overrides","assign","clearAutoRefresh","refreshFeatures","instance","timeout","skipCache","allowStale","updateInstance","getKey","now","Date","getItem","parse","staleAt","initializeCache","existing","fetchFeatures","startAutoRefresh","promise","Promise","resolve","timer","resolved","finish","clearTimeout","then","catch","promiseTimeout","fetchFeaturesWithCache","refreshInstance","updatePersistentCache","setItem","apiHost","clientKey","getApiInfo","onNewFeatureData","dateUpdated","instances","encryptedExperiments","setEncryptedExperiments","setExperiments","experiments","getExperiments","encryptedFeatures","setEncryptedFeatures","setFeatures","features","getFeatures","endpoint","res","headers","json","delete","channel","src","cb","errors","onSSEError","enableChannel","readyState","delay","pow","random","disableChannel","min","onopen","onerror","close","destroyChannel","isBrowser","constructor","context","this","_ctx","_renderer","_trackedExperiments","_trackedFeatures","debug","_subscriptions","_rtQueue","_rtTimer","ready","_assigned","_forcedFeatureValues","_attributeOverrides","_activeAutoExperiments","enableDevMode","_growthbook","dispatchEvent","Event","_updateAllAutoExperiments","_refresh","autoRefresh","subs","subscribe","_render","featuresJSON","experimentsJSON","setAttributes","setAttributeOverrides","setForcedVariations","vars","forcedVariations","setForcedFeatures","setURL","getAttributes","getAllResults","destroy","s","exp","undo","setRenderer","renderer","forceVariation","variation","run","experiment","result","_run","_fireSubscriptions","triggerExperiment","find","manual","_runAutoExperiment","forceManual","forceRerun","valueHash","inExperiment","_undoActiveAutoExperiment","_applyDOMChanges","prev","variationId","_trackFeatureUsage","source","stringifiedValue","onFeatureUsage","on","q","realtimeKey","encodeURIComponent","mode","realtimeInterval","_getFeatureResult","ruleId","ret","off","experimentResult","isOn","evalFeature","isOff","getFeatureValue","defaultValue","feature","rules","rule","_conditionPasses","filters","_isFilteredOut","_isIncludedInRollout","hashAttribute","hashVersion","tracks","_track","force","variations","namespace","meta","ranges","phase","passthrough","hashValue","_getHashAttribute","r","featureId","_getResult","_mergeOverrides","qsOverride","search","kv","parseInt","getQueryStringOverride","_getContextUrl","status","active","inNamespace","include","isIncluded","groups","_hasGroupOverlap","_urlIsValid","urlPatterns","targets","hasIncludeRules","isURLTargeted","assigned","chooseVariation","qaMode","log","msg","ctx","trackingCallback","o","user","variationIndex","hashUsed","bucket","location","urlRegex","pathOnly","expGroups","changes","css","head","appendChild","js","script","domMutations","fn","GrowthBookContext","useFeatureIsOn","growthbook","useGrowthBook","useFeatureValue","fallback","GrowthBookProvider","_","setRenderCount","Provider","exports","createRoot","hydrateRoot","module","objA","objB","compare","compareContext","call","keysA","keysB","bHasOwnProperty","prototype","hasOwnProperty","idx","valueA","valueB","getChildMapping","mapFn","create","child","mapper","getProp","prop","getNextChildMapping","nextProps","prevChildMapping","onExited","nextChildMapping","next","getValueForKey","nextKeysPending","pendingKeys","prevKey","childMapping","nextKey","pendingNextKey","mergeChildMappings","hasPrev","hasNext","prevChild","isLeaving","in","exit","enter","values","_React$Component","TransitionGroup","_this","handleExited","state","contextValue","isMounting","firstRender","_proto","componentDidMount","mounted","setState","componentWillUnmount","getDerivedStateFromProps","appear","currentChildMapping","render","_this$props","Component","component","childFactory","TransitionGroupContext","propTypes","extendStatics","d","setPrototypeOf","__proto__","p","__extends","__","__assign","arguments","apply","__rest","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","reject","fulfilled","step","rejected","done","__generator","f","g","label","sent","trys","ops","verb","Symbol","iterator","TypeError","pop","__createBinding","k2","__exportStar","__values","__read","ar","__spread","__spreadArrays","il","a","jl","__await","__asyncGenerator","asyncIterator","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","__esModule","default","__importDefault","__classPrivateFieldGet","receiver","privateMap","__classPrivateFieldSet","_extends","_setPrototypeOf","observerMap","RootIds","WeakMap","rootId","unsupportedValue","optionsToId","sort","root","toString","callback","fallbackInView","IntersectionObserver","bounds","getBoundingClientRect","isIntersecting","intersectionRatio","threshold","time","boundingClientRect","intersectionRect","rootBounds","_createObserver","thresholds","entry","_elements$get","inView","trackVisibility","isVisible","createObserver","unobserve","size","_excluded","isPlainChildren","useInView","_temp","_state$entry","rootMargin","triggerOnce","skip","initialInView","onChange","_React$useState","setRef","_React$useState2","entryTarget","previousEntryTarget","replaceClassName","origClass","classToRemove","UNMOUNTED","EXITED","ENTERING","ENTERED","EXITING","Transition","initialStatus","appearStatus","unmountOnExit","mountOnEnter","nextCallback","prevState","updateStatus","componentDidUpdate","prevProps","nextStatus","cancelNextCallback","getTimeouts","mounting","performEnter","performExit","_this2","appearing","nodeRef","findDOMNode","maybeNode","maybeAppearing","timeouts","enterTimeout","config","safeSetState","onEntered","onEnter","onEntering","onTransitionEnd","_this3","onExit","onExiting","cancel","nextState","setNextCallback","_this4","handler","doesNotHaveTimeoutOrListener","addEndListener","_ref3","maybeNextCallback","childProps","cloneElement","Children","noop","contextType","baseVal","CSSTransition","_len","args","_key","appliedClasses","_this$resolveArgument","resolveArguments","removeClasses","addClass","_this$resolveArgument2","_this$resolveArgument3","getClassNames","isStringClassNames","baseClassName","activeClassName","doneClassName","hasClass","_addClass","_this$appliedClasses$","base"],"mappings":";8FAAA,yBACe,QAAMA,cAAc,K,0FCAxBC,EAAY,c,YCInBC,EAAU,WAEd,EAIIC,EAAe,cAAiB,SAAUC,EAAOC,GACjD,IAAIC,EAAM,SAAa,MACnBC,EAAK,WAAe,CACpBC,gBAAiBN,EACjBO,eAAgBP,EAChBQ,mBAAoBR,IACpBS,EAAYJ,EAAG,GAAIK,EAAeL,EAAG,GACrCM,EAAeT,EAAMS,aAAcC,EAAWV,EAAMU,SAAUC,EAAYX,EAAMW,UAAWC,EAAkBZ,EAAMY,gBAAiBC,EAAUb,EAAMa,QAASC,EAASd,EAAMc,OAAQC,EAAUf,EAAMe,QAASC,EAAchB,EAAMgB,YAAaC,EAAQjB,EAAMiB,MAAOC,EAAiBlB,EAAMkB,eAAgBC,EAAKnB,EAAMoB,GAAIC,OAAmB,IAAPF,EAAgB,MAAQA,EAAIG,EAAO,SAAetB,EAAO,CAAC,eAAgB,WAAY,YAAa,kBAAmB,UAAW,SAAU,UAAW,cAAe,QAAS,iBAAkB,OACrgBuB,EAAUR,EACVS,EAAe,OAAAC,EAAA,GAAa,CAC5BvB,EACAD,IAEAyB,EAAiB,WAAiB,CAAC,EAAGJ,EAAMf,GAChD,OAAQ,gBAAoB,WAAgB,KACxCM,GAAY,gBAAoBU,EAAS,CAAER,QAASlB,EAAWe,gBAAiBA,EAAiBE,OAAQA,EAAQE,YAAaA,EAAaC,M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AkB2I,EAAS3I,CDKxC,GACF,CA8NMq2B,CAAU70B,EAAMxB,GAEpB,EAEA6oB,EAAO8M,cAAgB,SAAuBn0B,EAAMe,GAClD,IAAI+zB,EAAwB3a,KAAK6Z,eAAejzB,GAC5C0zB,EAAgBK,EAAsBC,KACtCL,EAAkBI,EAAsB5T,OACxCyT,EAAgBG,EAAsBvK,KAC1CpQ,KAAK6Z,eAAejzB,GAAQ,CAAC,EAEzB0zB,GACF,EAAYz0B,EAAMy0B,GAGhBC,GACF,EAAY10B,EAAM00B,GAGhBC,GACF,EAAY30B,EAAM20B,EAEtB,EAEAtN,EAAOQ,OAAS,WACd,IAAIC,EAAc3N,KAAKtc,MAEnBA,GADIiqB,EAAYnoB,WACR,YAA8BmoB,EAAa,CAAC,gBAExD,OAAoB,IAAM5e,cAAc,EAAY,YAAS,CAAC,EAAGrL,EAAO,CACtE00B,QAASpY,KAAKoY,QACdD,UAAWnY,KAAKmY,UAChBE,WAAYrY,KAAKqY,WACjBG,OAAQxY,KAAKwY,OACbC,UAAWzY,KAAKyY,UAChBlN,SAAUvL,KAAKuL,WAEnB,EAEOkO,CACT,CAxLiC,CAwL/B,IAAM7L,WAER,EAAcroB,aAAe,CAC3BC,WAAY,IAEd,EAAcwoB,UAiIT,CAAC,EACS,K","file":"script/chunks/chunk.11.84e8f8c663.js","sourcesContent":["import React from 'react';\nexport default React.createContext(null);","import { createSidecarMedium } from 'use-sidecar';\nexport var effectCar = createSidecarMedium();\n","import * as tslib_1 from \"tslib\";\nimport * as React from 'react';\nimport { fullWidthClassName, zeroRightClassName } from 'react-remove-scroll-bar/constants';\nimport { effectCar } from './medium';\nimport { useMergeRefs } from 'use-callback-ref';\nvar nothing = function () {\n return;\n};\n/**\n * Removes scrollbar from the page and contain the scroll within the Lock\n */\nvar RemoveScroll = React.forwardRef(function (props, parentRef) {\n var ref = React.useRef(null);\n var _a = React.useState({\n onScrollCapture: nothing,\n onWheelCapture: nothing,\n onTouchMoveCapture: nothing\n }), callbacks = _a[0], setCallbacks = _a[1];\n var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, rest = tslib_1.__rest(props, [\"forwardProps\", \"children\", \"className\", \"removeScrollBar\", \"enabled\", \"shards\", \"sideCar\", \"noIsolation\", \"inert\", \"allowPinchZoom\", \"as\"]);\n var SideCar = sideCar;\n var containerRef = useMergeRefs([\n ref,\n parentRef\n ]);\n var containerProps = tslib_1.__assign({}, rest, callbacks);\n return (React.createElement(React.Fragment, null,\n enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref })),\n forwardProps ? (React.cloneElement(React.Children.only(children), tslib_1.__assign({}, containerProps, { ref: containerRef }))) : (React.createElement(Container, tslib_1.__assign({}, containerProps, { className: className, ref: containerRef }), children))));\n});\nRemoveScroll.defaultProps = {\n enabled: true,\n removeScrollBar: true,\n inert: false\n};\nRemoveScroll.classNames = {\n fullWidth: fullWidthClassName,\n zeroRight: zeroRightClassName\n};\nexport { RemoveScroll };\n","var elementCouldBeVScrolled = function (node) {\n var styles = window.getComputedStyle(node);\n return (styles.overflowY !== 'hidden' && // not-not-scrollable\n !(styles.overflowY === styles.overflowX && styles.overflowY === 'visible') // scrollable\n );\n};\nvar elementCouldBeHScrolled = function (node) {\n var styles = window.getComputedStyle(node);\n // we allow horizontal scroll on range elements\n if (node.type === \"range\") {\n return true;\n }\n return (styles.overflowX !== 'hidden' && // not-not-scrollable\n !(styles.overflowY === styles.overflowX && styles.overflowX === 'visible') // scrollable\n );\n};\nexport var locationCouldBeScrolled = function (axis, node) {\n var current = node;\n do {\n // Skip over shadow root\n if (typeof ShadowRoot !== \"undefined\" && current instanceof ShadowRoot) {\n current = current.host;\n }\n var isScrollable = elementCouldBeScrolled(axis, current);\n if (isScrollable) {\n var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];\n if (s > d) {\n return true;\n }\n }\n current = current.parentNode;\n } while (current && current !== document.body);\n return false;\n};\nvar getVScrollVariables = function (_a) {\n var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;\n return [scrollTop, scrollHeight, clientHeight];\n};\nvar getHScrollVariables = function (_a) {\n var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;\n return [scrollLeft, scrollWidth, clientWidth];\n};\nvar elementCouldBeScrolled = function (axis, node) {\n return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);\n};\nvar getScrollVariables = function (axis, node) {\n return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);\n};\nexport var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {\n var delta = sourceDelta;\n // find scrollable target\n var target = event.target;\n var targetInLock = endTarget.contains(target);\n var shouldCancelScroll = false;\n var isDeltaPositive = delta > 0;\n var availableScroll = 0;\n var availableScrollTop = 0;\n do {\n var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];\n var elementScroll = scroll_1 - capacity - position;\n if (position || elementScroll) {\n if (elementCouldBeScrolled(axis, target)) {\n availableScroll += elementScroll;\n availableScrollTop += position;\n }\n }\n target = target.parentNode;\n } while (\n // portaled content\n (!targetInLock && target !== document.body) ||\n // self content\n (targetInLock && (endTarget.contains(target) || endTarget === target)));\n if (isDeltaPositive &&\n ((noOverscroll && availableScroll === 0) ||\n (!noOverscroll && delta > availableScroll))) {\n shouldCancelScroll = true;\n }\n else if (!isDeltaPositive &&\n ((noOverscroll && availableScrollTop === 0) ||\n (!noOverscroll && -delta > availableScrollTop))) {\n shouldCancelScroll = true;\n }\n return shouldCancelScroll;\n};\n","var passiveSupported = false;\nif (typeof window !== 'undefined') {\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveSupported = true;\n return true;\n }\n });\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n}\nexport var nonPassive = passiveSupported ? { passive: false } : false;\n","import * as React from 'react';\nimport { RemoveScrollBar } from 'react-remove-scroll-bar';\nimport { styleSingleton } from 'react-style-singleton';\nimport { handleScroll, locationCouldBeScrolled } from './handleScroll';\nimport { nonPassive } from './aggresiveCapture';\nexport var getTouchXY = function (event) {\n return 'changedTouches' in event\n ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY]\n : [0, 0];\n};\nexport var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };\nvar extractRef = function (ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\nvar deltaCompare = function (x, y) {\n return x[0] === y[0] && x[1] === y[1];\n};\nvar generateStyle = function (id) { return \"\\n .block-interactivity-\" + id + \" {pointer-events: none;}\\n .allow-interactivity-\" + id + \" {pointer-events: all;}\\n\"; };\nvar idCounter = 0;\nvar lockStack = [];\nexport function RemoveScrollSideCar(props) {\n var shouldPreventQueue = React.useRef([]);\n var touchStartRef = React.useRef([0, 0]);\n var activeAxis = React.useRef();\n var id = React.useState(idCounter++)[0];\n var Style = React.useState(function () { return styleSingleton(); })[0];\n var lastProps = React.useRef(props);\n React.useEffect(function () {\n lastProps.current = props;\n }, [props]);\n React.useEffect(function () {\n if (props.inert) {\n document.body.classList.add(\"block-interactivity-\" + id);\n var allow_1 = [\n props.lockRef.current\n ].concat((props.shards || []).map(extractRef)).filter(Boolean);\n allow_1.forEach(function (el) { return el.classList.add(\"allow-interactivity-\" + id); });\n return function () {\n document.body.classList.remove(\"block-interactivity-\" + id);\n allow_1.forEach(function (el) {\n return el.classList.remove(\"allow-interactivity-\" + id);\n });\n };\n }\n return;\n }, [props.inert, props.lockRef.current, props.shards]);\n var shouldCancelEvent = React.useCallback(function (event, parent) {\n if ('touches' in event && event.touches.length === 2) {\n return !lastProps.current.allowPinchZoom;\n }\n var touch = getTouchXY(event);\n var touchStart = touchStartRef.current;\n var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];\n var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];\n var currentAxis;\n var target = event.target;\n var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';\n var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n if (!canBeScrolledInMainDirection) {\n return true;\n }\n if (canBeScrolledInMainDirection) {\n currentAxis = moveDirection;\n }\n else {\n currentAxis = moveDirection === 'v' ? 'h' : 'v';\n canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n // other axis might be not scrollable\n }\n if (!canBeScrolledInMainDirection) {\n return false;\n }\n if (!activeAxis.current &&\n 'changedTouches' in event &&\n (deltaX || deltaY)) {\n activeAxis.current = currentAxis;\n }\n if (!currentAxis) {\n return true;\n }\n var cancelingAxis = activeAxis.current || currentAxis;\n return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);\n }, []);\n var shouldPrevent = React.useCallback(function (_event) {\n var event = _event;\n if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {\n // not the last active\n return;\n }\n var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);\n var sourceEvent = shouldPreventQueue.current.filter(function (e) {\n return e.name === event.type &&\n e.target === event.target &&\n deltaCompare(e.delta, delta);\n })[0];\n // self event, and should be canceled\n if (sourceEvent && sourceEvent.should) {\n event.preventDefault();\n return;\n }\n // outside or shard event\n if (!sourceEvent) {\n var shardNodes = (lastProps.current.shards || [])\n .map(extractRef)\n .filter(Boolean)\n .filter(function (node) { return node.contains(event.target); });\n var shouldStop = shardNodes.length > 0\n ? shouldCancelEvent(event, shardNodes[0])\n : !lastProps.current.noIsolation;\n if (shouldStop) {\n event.preventDefault();\n }\n }\n }, []);\n var shouldCancel = React.useCallback(function (name, delta, target, should) {\n var event = { name: name, delta: delta, target: target, should: should };\n shouldPreventQueue.current.push(event);\n setTimeout(function () {\n shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });\n }, 1);\n }, []);\n var scrollTouchStart = React.useCallback(function (event) {\n touchStartRef.current = getTouchXY(event);\n activeAxis.current = undefined;\n }, []);\n var scrollWheel = React.useCallback(function (event) {\n shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n var scrollTouchMove = React.useCallback(function (event) {\n shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n React.useEffect(function () {\n lockStack.push(Style);\n props.setCallbacks({\n onScrollCapture: scrollWheel,\n onWheelCapture: scrollWheel,\n onTouchMoveCapture: scrollTouchMove\n });\n document.addEventListener('wheel', shouldPrevent, nonPassive);\n document.addEventListener('touchmove', shouldPrevent, nonPassive);\n document.addEventListener('touchstart', scrollTouchStart, nonPassive);\n return function () {\n lockStack = lockStack.filter(function (inst) { return inst !== Style; });\n document.removeEventListener('wheel', shouldPrevent, nonPassive);\n document.removeEventListener('touchmove', shouldPrevent, nonPassive);\n document.removeEventListener('touchstart', scrollTouchStart, nonPassive);\n };\n }, []);\n var removeScrollBar = props.removeScrollBar, inert = props.inert;\n return (React.createElement(React.Fragment, null,\n inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,\n removeScrollBar ? React.createElement(RemoveScrollBar, { gapMode: \"margin\" }) : null));\n}\n","import { exportSidecar } from 'use-sidecar';\nimport { RemoveScrollSideCar } from './SideEffect';\nimport { effectCar } from './medium';\nexport default exportSidecar(effectCar, RemoveScrollSideCar);\n","import * as tslib_1 from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScroll } from './UI';\nimport SideCar from './sidecar';\nvar ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(RemoveScroll, tslib_1.__assign({}, props, { ref: ref, sideCar: SideCar }))); });\nReactRemoveScroll.classNames = RemoveScroll.classNames;\nexport default ReactRemoveScroll;\n","var validAttributeName = /^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/;\nvar nullController = {\n revert: function revert() {}\n};\nvar elements = /*#__PURE__*/new Map();\nvar mutations = /*#__PURE__*/new Set();\n\nfunction getObserverInit(attr) {\n return attr === 'html' ? {\n childList: true,\n subtree: true,\n attributes: true,\n characterData: true\n } : {\n childList: false,\n subtree: false,\n attributes: true,\n attributeFilter: [attr]\n };\n}\n\nfunction getElementRecord(element) {\n var record = elements.get(element);\n\n if (!record) {\n record = {\n element: element,\n attributes: {}\n };\n elements.set(element, record);\n }\n\n return record;\n}\n\nfunction createElementPropertyRecord(el, attr, getCurrentValue, setValue, mutationRunner) {\n var currentValue = getCurrentValue(el);\n var record = {\n isDirty: false,\n originalValue: currentValue,\n virtualValue: currentValue,\n mutations: [],\n el: el,\n observer: new MutationObserver(function () {\n var currentValue = getCurrentValue(el);\n if (currentValue === record.virtualValue) return;\n record.originalValue = currentValue;\n mutationRunner(record);\n }),\n mutationRunner: mutationRunner,\n setValue: setValue,\n getCurrentValue: getCurrentValue\n };\n record.observer.observe(el, getObserverInit(attr));\n return record;\n}\n\nfunction queueIfNeeded(val, record) {\n var currentVal = record.getCurrentValue(record.el);\n record.virtualValue = val;\n\n if (val && typeof val !== 'string') {\n if (!currentVal || val.parentNode !== currentVal.parentNode || val.insertBeforeNode !== currentVal.insertBeforeNode) {\n record.isDirty = true;\n queueDOMUpdates();\n }\n } else if (val !== currentVal) {\n record.isDirty = true;\n queueDOMUpdates();\n }\n}\n\nfunction htmlMutationRunner(record) {\n var val = record.originalValue;\n record.mutations.forEach(function (m) {\n return val = m.mutate(val);\n });\n queueIfNeeded(getTransformedHTML(val), record);\n}\n\nfunction classMutationRunner(record) {\n var val = new Set(record.originalValue.split(/\\s+/).filter(Boolean));\n record.mutations.forEach(function (m) {\n return m.mutate(val);\n });\n queueIfNeeded(Array.from(val).filter(Boolean).join(' '), record);\n}\n\nfunction attrMutationRunner(record) {\n var val = record.originalValue;\n record.mutations.forEach(function (m) {\n return val = m.mutate(val);\n });\n queueIfNeeded(val, record);\n}\n\nfunction _loadDOMNodes(_ref) {\n var parentSelector = _ref.parentSelector,\n insertBeforeSelector = _ref.insertBeforeSelector;\n var parentNode = document.querySelector(parentSelector);\n if (!parentNode) return null;\n var insertBeforeNode = insertBeforeSelector ? document.querySelector(insertBeforeSelector) : null;\n if (insertBeforeSelector && !insertBeforeNode) return null;\n return {\n parentNode: parentNode,\n insertBeforeNode: insertBeforeNode\n };\n}\n\nfunction positionMutationRunner(record) {\n var val = record.originalValue;\n record.mutations.forEach(function (m) {\n var selectors = m.mutate();\n\n var newNodes = _loadDOMNodes(selectors);\n\n val = newNodes || val;\n });\n queueIfNeeded(val, record);\n}\n\nvar getHTMLValue = function getHTMLValue(el) {\n return el.innerHTML;\n};\n\nvar setHTMLValue = function setHTMLValue(el, value) {\n return el.innerHTML = value;\n};\n\nfunction getElementHTMLRecord(element) {\n var elementRecord = getElementRecord(element);\n\n if (!elementRecord.html) {\n elementRecord.html = createElementPropertyRecord(element, 'html', getHTMLValue, setHTMLValue, htmlMutationRunner);\n }\n\n return elementRecord.html;\n}\n\nvar getElementPosition = function getElementPosition(el) {\n return {\n parentNode: el.parentElement,\n insertBeforeNode: el.nextElementSibling\n };\n};\n\nvar setElementPosition = function setElementPosition(el, value) {\n value.parentNode.insertBefore(el, value.insertBeforeNode);\n};\n\nfunction getElementPositionRecord(element) {\n var elementRecord = getElementRecord(element);\n\n if (!elementRecord.position) {\n elementRecord.position = createElementPropertyRecord(element, 'position', getElementPosition, setElementPosition, positionMutationRunner);\n }\n\n return elementRecord.position;\n}\n\nvar setClassValue = function setClassValue(el, val) {\n return val ? el.className = val : el.removeAttribute('class');\n};\n\nvar getClassValue = function getClassValue(el) {\n return el.className;\n};\n\nfunction getElementClassRecord(el) {\n var elementRecord = getElementRecord(el);\n\n if (!elementRecord.classes) {\n elementRecord.classes = createElementPropertyRecord(el, 'class', getClassValue, setClassValue, classMutationRunner);\n }\n\n return elementRecord.classes;\n}\n\nvar getAttrValue = function getAttrValue(attrName) {\n return function (el) {\n var _el$getAttribute;\n\n return (_el$getAttribute = el.getAttribute(attrName)) != null ? _el$getAttribute : null;\n };\n};\n\nvar setAttrValue = function setAttrValue(attrName) {\n return function (el, val) {\n return val !== null ? el.setAttribute(attrName, val) : el.removeAttribute(attrName);\n };\n};\n\nfunction getElementAttributeRecord(el, attr) {\n var elementRecord = getElementRecord(el);\n\n if (!elementRecord.attributes[attr]) {\n elementRecord.attributes[attr] = createElementPropertyRecord(el, attr, getAttrValue(attr), setAttrValue(attr), attrMutationRunner);\n }\n\n return elementRecord.attributes[attr];\n}\n\nfunction deleteElementPropertyRecord(el, attr) {\n var element = elements.get(el);\n if (!element) return;\n\n if (attr === 'html') {\n var _element$html, _element$html$observe;\n\n (_element$html = element.html) == null ? void 0 : (_element$html$observe = _element$html.observer) == null ? void 0 : _element$html$observe.disconnect();\n delete element.html;\n } else if (attr === 'class') {\n var _element$classes, _element$classes$obse;\n\n (_element$classes = element.classes) == null ? void 0 : (_element$classes$obse = _element$classes.observer) == null ? void 0 : _element$classes$obse.disconnect();\n delete element.classes;\n } else if (attr === 'position') {\n var _element$position, _element$position$obs;\n\n (_element$position = element.position) == null ? void 0 : (_element$position$obs = _element$position.observer) == null ? void 0 : _element$position$obs.disconnect();\n delete element.position;\n } else {\n var _element$attributes, _element$attributes$a, _element$attributes$a2;\n\n (_element$attributes = element.attributes) == null ? void 0 : (_element$attributes$a = _element$attributes[attr]) == null ? void 0 : (_element$attributes$a2 = _element$attributes$a.observer) == null ? void 0 : _element$attributes$a2.disconnect();\n delete element.attributes[attr];\n }\n}\n\nvar transformContainer;\n\nfunction getTransformedHTML(html) {\n if (!transformContainer) {\n transformContainer = document.createElement('div');\n }\n\n transformContainer.innerHTML = html;\n return transformContainer.innerHTML;\n}\n\nfunction setPropertyValue(el, attr, m) {\n if (!m.isDirty) return;\n m.isDirty = false;\n var val = m.virtualValue;\n\n if (!m.mutations.length) {\n deleteElementPropertyRecord(el, attr);\n }\n\n m.setValue(el, val);\n}\n\nvar raf = false;\n\nfunction setValue(m, el) {\n m.html && setPropertyValue(el, 'html', m.html);\n m.classes && setPropertyValue(el, 'class', m.classes);\n m.position && setPropertyValue(el, 'position', m.position);\n Object.keys(m.attributes).forEach(function (attr) {\n setPropertyValue(el, attr, m.attributes[attr]);\n });\n}\n\nfunction setValues() {\n raf = false;\n elements.forEach(setValue);\n}\n\nfunction queueDOMUpdates() {\n if (!raf) {\n raf = true;\n requestAnimationFrame(setValues);\n }\n} // find or create ElementPropertyRecord, add mutation to it, then run\n\n\nfunction startMutating(mutation, element) {\n var record = null;\n\n if (mutation.kind === 'html') {\n record = getElementHTMLRecord(element);\n } else if (mutation.kind === 'class') {\n record = getElementClassRecord(element);\n } else if (mutation.kind === 'attribute') {\n record = getElementAttributeRecord(element, mutation.attribute);\n } else if (mutation.kind === 'position') {\n record = getElementPositionRecord(element);\n }\n\n if (!record) return;\n record.mutations.push(mutation);\n record.mutationRunner(record);\n} // get (existing) ElementPropertyRecord, remove mutation from it, then run\n\n\nfunction stopMutating(mutation, el) {\n var record = null;\n\n if (mutation.kind === 'html') {\n record = getElementHTMLRecord(el);\n } else if (mutation.kind === 'class') {\n record = getElementClassRecord(el);\n } else if (mutation.kind === 'attribute') {\n record = getElementAttributeRecord(el, mutation.attribute);\n } else if (mutation.kind === 'position') {\n record = getElementPositionRecord(el);\n }\n\n if (!record) return;\n var index = record.mutations.indexOf(mutation);\n if (index !== -1) record.mutations.splice(index, 1);\n record.mutationRunner(record);\n} // maintain list of elements associated with mutation\n\n\nfunction refreshElementsSet(mutation) {\n var existingElements = new Set(mutation.elements);\n var newElements = new Set();\n var matchingElements = document.querySelectorAll(mutation.selector);\n matchingElements.forEach(function (el) {\n newElements.add(el);\n\n if (!existingElements.has(el)) {\n mutation.elements.add(el);\n startMutating(mutation, el);\n }\n });\n existingElements.forEach(function (el) {\n if (!newElements.has(el)) {\n mutation.elements[\"delete\"](el);\n stopMutating(mutation, el);\n }\n });\n}\n\nfunction revertMutation(mutation) {\n mutation.elements.forEach(function (el) {\n return stopMutating(mutation, el);\n });\n mutation.elements.clear();\n mutations[\"delete\"](mutation);\n}\n\nfunction refreshAllElementSets() {\n mutations.forEach(refreshElementsSet);\n} // Observer for elements that don't exist in the DOM yet\n\n\nvar observer;\nfunction disconnectGlobalObserver() {\n observer && observer.disconnect();\n}\nfunction connectGlobalObserver() {\n if (typeof document === 'undefined') return;\n\n if (!observer) {\n observer = new MutationObserver(function () {\n refreshAllElementSets();\n });\n }\n\n refreshAllElementSets();\n observer.observe(document.documentElement, {\n childList: true,\n subtree: true,\n attributes: false,\n characterData: false\n });\n} // run on init\n\nconnectGlobalObserver();\n\nfunction newMutation(m) {\n // Not in a browser\n if (typeof document === 'undefined') return nullController; // add to global index of mutations\n\n mutations.add(m); // run refresh on init to establish list of elements associated w/ mutation\n\n refreshElementsSet(m);\n return {\n revert: function revert() {\n revertMutation(m);\n }\n };\n}\n\nfunction html(selector, mutate) {\n return newMutation({\n kind: 'html',\n elements: new Set(),\n mutate: mutate,\n selector: selector\n });\n}\n\nfunction position(selector, mutate) {\n return newMutation({\n kind: 'position',\n elements: new Set(),\n mutate: mutate,\n selector: selector\n });\n}\n\nfunction classes(selector, mutate) {\n return newMutation({\n kind: 'class',\n elements: new Set(),\n mutate: mutate,\n selector: selector\n });\n}\n\nfunction attribute(selector, attribute, mutate) {\n if (!validAttributeName.test(attribute)) return nullController;\n\n if (attribute === 'class' || attribute === 'className') {\n return classes(selector, function (classnames) {\n var mutatedClassnames = mutate(Array.from(classnames).join(' '));\n classnames.clear();\n if (!mutatedClassnames) return;\n mutatedClassnames.split(/\\s+/g).filter(Boolean).forEach(function (c) {\n return classnames.add(c);\n });\n });\n }\n\n return newMutation({\n kind: 'attribute',\n attribute: attribute,\n elements: new Set(),\n mutate: mutate,\n selector: selector\n });\n}\n\nfunction declarative(_ref2) {\n var selector = _ref2.selector,\n action = _ref2.action,\n value = _ref2.value,\n attr = _ref2.attribute,\n parentSelector = _ref2.parentSelector,\n insertBeforeSelector = _ref2.insertBeforeSelector;\n\n if (attr === 'html') {\n if (action === 'append') {\n return html(selector, function (val) {\n return val + (value != null ? value : '');\n });\n } else if (action === 'set') {\n return html(selector, function () {\n return value != null ? value : '';\n });\n }\n } else if (attr === 'class') {\n if (action === 'append') {\n return classes(selector, function (val) {\n if (value) val.add(value);\n });\n } else if (action === 'remove') {\n return classes(selector, function (val) {\n if (value) val[\"delete\"](value);\n });\n } else if (action === 'set') {\n return classes(selector, function (val) {\n val.clear();\n if (value) val.add(value);\n });\n }\n } else if (attr === 'position') {\n if (action === 'set' && parentSelector) {\n return position(selector, function () {\n return {\n insertBeforeSelector: insertBeforeSelector,\n parentSelector: parentSelector\n };\n });\n }\n } else {\n if (action === 'append') {\n return attribute(selector, attr, function (val) {\n return val !== null ? val + (value != null ? value : '') : value != null ? value : '';\n });\n } else if (action === 'set') {\n return attribute(selector, attr, function () {\n return value != null ? value : '';\n });\n } else if (action === 'remove') {\n return attribute(selector, attr, function () {\n return null;\n });\n }\n }\n\n return nullController;\n}\n\nvar index = {\n html: html,\n classes: classes,\n attribute: attribute,\n position: position,\n declarative: declarative\n};\n\nexport default index;\nexport { connectGlobalObserver, disconnectGlobalObserver, validAttributeName };\n//# sourceMappingURL=dom-mutator.esm.js.map\n","function hashFnv32a(str) {\n let hval = 0x811c9dc5;\n const l = str.length;\n for (let i = 0; i < l; i++) {\n hval ^= str.charCodeAt(i);\n hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24);\n }\n return hval >>> 0;\n}\nexport function hash(seed, value, version) {\n // New unbiased hashing algorithm\n if (version === 2) {\n return hashFnv32a(hashFnv32a(seed + value) + \"\") % 10000 / 10000;\n }\n // Original biased hashing algorithm (keep for backwards compatibility)\n if (version === 1) {\n return hashFnv32a(value + seed) % 1000 / 1000;\n }\n\n // Unknown hash version\n return null;\n}\nexport function getEqualWeights(n) {\n if (n <= 0) return [];\n return new Array(n).fill(1 / n);\n}\nexport function inRange(n, range) {\n return n >= range[0] && n < range[1];\n}\nexport function inNamespace(hashValue, namespace) {\n const n = hash(\"__\" + namespace[0], hashValue, 1);\n if (n === null) return false;\n return n >= namespace[1] && n < namespace[2];\n}\nexport function chooseVariation(n, ranges) {\n for (let i = 0; i < ranges.length; i++) {\n if (inRange(n, ranges[i])) {\n return i;\n }\n }\n return -1;\n}\nexport function getUrlRegExp(regexString) {\n try {\n const escaped = regexString.replace(/([^\\\\])\\//g, \"$1\\\\/\");\n return new RegExp(escaped);\n } catch (e) {\n console.error(e);\n return undefined;\n }\n}\nexport function isURLTargeted(url, targets) {\n if (!targets.length) return false;\n let hasIncludeRules = false;\n let isIncluded = false;\n for (let i = 0; i < targets.length; i++) {\n const match = _evalURLTarget(url, targets[i].type, targets[i].pattern);\n if (targets[i].include === false) {\n if (match) return false;\n } else {\n hasIncludeRules = true;\n if (match) isIncluded = true;\n }\n }\n return isIncluded || !hasIncludeRules;\n}\nfunction _evalSimpleUrlPart(actual, pattern, isPath) {\n try {\n // Escape special regex characters and change wildcard `_____` to `.*`\n let escaped = pattern.replace(/[*.+?^${}()|[\\]\\\\]/g, \"\\\\$&\").replace(/_____/g, \".*\");\n if (isPath) {\n // When matching pathname, make leading/trailing slashes optional\n escaped = \"\\\\/?\" + escaped.replace(/(^\\/|\\/$)/g, \"\") + \"\\\\/?\";\n }\n const regex = new RegExp(\"^\" + escaped + \"$\", \"i\");\n return regex.test(actual);\n } catch (e) {\n return false;\n }\n}\nfunction _evalSimpleUrlTarget(actual, pattern) {\n try {\n // If a protocol is missing, but a host is specified, add `https://` to the front\n // Use \"_____\" as the wildcard since `*` is not a valid hostname in some browsers\n const expected = new URL(pattern.replace(/^([^:/?]*)\\./i, \"https://$1.\").replace(/\\*/g, \"_____\"), \"https://_____\");\n\n // Compare each part of the URL separately\n const comps = [[actual.host, expected.host, false], [actual.pathname, expected.pathname, true]];\n // We only want to compare hashes if it's explicitly being targeted\n if (expected.hash) {\n comps.push([actual.hash, expected.hash, false]);\n }\n expected.searchParams.forEach((v, k) => {\n comps.push([actual.searchParams.get(k) || \"\", v, false]);\n });\n\n // If any comparisons fail, the whole thing fails\n return !comps.some(data => !_evalSimpleUrlPart(data[0], data[1], data[2]));\n } catch (e) {\n return false;\n }\n}\nfunction _evalURLTarget(url, type, pattern) {\n try {\n const parsed = new URL(url, \"https://_\");\n if (type === \"regex\") {\n const regex = getUrlRegExp(pattern);\n if (!regex) return false;\n return regex.test(parsed.href) || regex.test(parsed.href.substring(parsed.origin.length));\n } else if (type === \"simple\") {\n return _evalSimpleUrlTarget(parsed, pattern);\n }\n return false;\n } catch (e) {\n return false;\n }\n}\nexport function getBucketRanges(numVariations, coverage, weights) {\n coverage = coverage === undefined ? 1 : coverage;\n\n // Make sure coverage is within bounds\n if (coverage < 0) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\"Experiment.coverage must be greater than or equal to 0\");\n }\n coverage = 0;\n } else if (coverage > 1) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\"Experiment.coverage must be less than or equal to 1\");\n }\n coverage = 1;\n }\n\n // Default to equal weights if missing or invalid\n const equal = getEqualWeights(numVariations);\n weights = weights || equal;\n if (weights.length !== numVariations) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\"Experiment.weights array must be the same length as Experiment.variations\");\n }\n weights = equal;\n }\n\n // If weights don't add up to 1 (or close to it), default to equal weights\n const totalWeight = weights.reduce((w, sum) => sum + w, 0);\n if (totalWeight < 0.99 || totalWeight > 1.01) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(\"Experiment.weights must add up to 1\");\n }\n weights = equal;\n }\n\n // Covert weights to ranges\n let cumulative = 0;\n return weights.map(w => {\n const start = cumulative;\n cumulative += w;\n return [start, start + coverage * w];\n });\n}\nexport function getQueryStringOverride(id, url, numVariations) {\n if (!url) {\n return null;\n }\n const search = url.split(\"?\")[1];\n if (!search) {\n return null;\n }\n const match = search.replace(/#.*/, \"\") // Get rid of anchor\n .split(\"&\") // Split into key/value pairs\n .map(kv => kv.split(\"=\", 2)).filter(_ref => {\n let [k] = _ref;\n return k === id;\n }) // Look for key that matches the experiment id\n .map(_ref2 => {\n let [, v] = _ref2;\n return parseInt(v);\n }); // Parse the value into an integer\n\n if (match.length > 0 && match[0] >= 0 && match[0] < numVariations) return match[0];\n return null;\n}\nexport function isIncluded(include) {\n try {\n return include();\n } catch (e) {\n console.error(e);\n return false;\n }\n}\nconst base64ToBuf = b => Uint8Array.from(atob(b), c => c.charCodeAt(0));\nexport async function decrypt(encryptedString, decryptionKey, subtle) {\n decryptionKey = decryptionKey || \"\";\n subtle = subtle || globalThis.crypto && globalThis.crypto.subtle;\n if (!subtle) {\n throw new Error(\"No SubtleCrypto implementation found\");\n }\n try {\n const key = await subtle.importKey(\"raw\", base64ToBuf(decryptionKey), {\n name: \"AES-CBC\",\n length: 128\n }, true, [\"encrypt\", \"decrypt\"]);\n const [iv, cipherText] = encryptedString.split(\".\");\n const plainTextBuffer = await subtle.decrypt({\n name: \"AES-CBC\",\n iv: base64ToBuf(iv)\n }, key, base64ToBuf(cipherText));\n return new TextDecoder().decode(plainTextBuffer);\n } catch (e) {\n throw new Error(\"Failed to decrypt\");\n }\n}\nexport function paddedVersionString(input) {\n // Remove build info and leading `v` if any\n // Split version into parts (both core version numbers and pre-release tags)\n // \"v1.2.3-rc.1+build123\" -> [\"1\",\"2\",\"3\",\"rc\",\"1\"]\n const parts = input.replace(/(^v|\\+.*$)/g, \"\").split(/[-.]/);\n\n // If it's SemVer without a pre-release, add `~` to the end\n // [\"1\",\"0\",\"0\"] -> [\"1\",\"0\",\"0\",\"~\"]\n // \"~\" is the largest ASCII character, so this will make \"1.0.0\" greater than \"1.0.0-beta\" for example\n if (parts.length === 3) {\n parts.push(\"~\");\n }\n\n // Left pad each numeric part with spaces so string comparisons will work (\"9\">\"10\", but \" 9\"<\"10\")\n // Then, join back together into a single string\n return parts.map(v => v.match(/^[0-9]+$/) ? v.padStart(5, \" \") : v).join(\"-\");\n}\n//# sourceMappingURL=util.js.map","/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport { paddedVersionString } from \"./util\";\nconst _regexCache = {};\n\n// The top-level condition evaluation function\nexport function evalCondition(obj, condition) {\n // Recursive condition\n if (\"$or\" in condition) {\n return evalOr(obj, condition[\"$or\"]);\n }\n if (\"$nor\" in condition) {\n return !evalOr(obj, condition[\"$nor\"]);\n }\n if (\"$and\" in condition) {\n return evalAnd(obj, condition[\"$and\"]);\n }\n if (\"$not\" in condition) {\n return !evalCondition(obj, condition[\"$not\"]);\n }\n\n // Condition is an object, keys are object paths, values are the condition for that path\n for (const [k, v] of Object.entries(condition)) {\n if (!evalConditionValue(v, getPath(obj, k))) return false;\n }\n return true;\n}\n\n// Return value at dot-separated path of an object\nfunction getPath(obj, path) {\n const parts = path.split(\".\");\n let current = obj;\n for (let i = 0; i < parts.length; i++) {\n if (current && typeof current === \"object\" && parts[i] in current) {\n current = current[parts[i]];\n } else {\n return null;\n }\n }\n return current;\n}\n\n// Transform a regex string into a real RegExp object\nfunction getRegex(regex) {\n if (!_regexCache[regex]) {\n _regexCache[regex] = new RegExp(regex.replace(/([^\\\\])\\//g, \"$1\\\\/\"));\n }\n return _regexCache[regex];\n}\n\n// Evaluate a single value against a condition\nfunction evalConditionValue(condition, value) {\n // Simple equality comparisons\n if (typeof condition === \"string\") {\n return value + \"\" === condition;\n }\n if (typeof condition === \"number\") {\n return value * 1 === condition;\n }\n if (typeof condition === \"boolean\") {\n return !!value === condition;\n }\n if (condition === null) {\n return value === null;\n }\n if (Array.isArray(condition) || !isOperatorObject(condition)) {\n return JSON.stringify(value) === JSON.stringify(condition);\n }\n\n // This is a special operator condition and we should evaluate each one separately\n for (const op in condition) {\n if (!evalOperatorCondition(op, value, condition[op])) {\n return false;\n }\n }\n return true;\n}\n\n// If the object has only keys that start with '$'\nfunction isOperatorObject(obj) {\n const keys = Object.keys(obj);\n return keys.length > 0 && keys.filter(k => k[0] === \"$\").length === keys.length;\n}\n\n// Return the data type of a value\nfunction getType(v) {\n if (v === null) return \"null\";\n if (Array.isArray(v)) return \"array\";\n const t = typeof v;\n if ([\"string\", \"number\", \"boolean\", \"object\", \"undefined\"].includes(t)) {\n return t;\n }\n return \"unknown\";\n}\n\n// At least one element of actual must match the expected condition/value\nfunction elemMatch(actual, expected) {\n if (!Array.isArray(actual)) return false;\n const check = isOperatorObject(expected) ? v => evalConditionValue(expected, v) : v => evalCondition(v, expected);\n for (let i = 0; i < actual.length; i++) {\n if (actual[i] && check(actual[i])) {\n return true;\n }\n }\n return false;\n}\nfunction isIn(actual, expected) {\n // Do an intersection is attribute is an array\n if (Array.isArray(actual)) {\n return actual.some(el => expected.includes(el));\n }\n return expected.includes(actual);\n}\n\n// Evaluate a single operator condition\nfunction evalOperatorCondition(operator, actual, expected) {\n switch (operator) {\n case \"$veq\":\n return paddedVersionString(actual) === paddedVersionString(expected);\n case \"$vne\":\n return paddedVersionString(actual) !== paddedVersionString(expected);\n case \"$vgt\":\n return paddedVersionString(actual) > paddedVersionString(expected);\n case \"$vgte\":\n return paddedVersionString(actual) >= paddedVersionString(expected);\n case \"$vlt\":\n return paddedVersionString(actual) < paddedVersionString(expected);\n case \"$vlte\":\n return paddedVersionString(actual) <= paddedVersionString(expected);\n case \"$eq\":\n return actual === expected;\n case \"$ne\":\n return actual !== expected;\n case \"$lt\":\n return actual < expected;\n case \"$lte\":\n return actual <= expected;\n case \"$gt\":\n return actual > expected;\n case \"$gte\":\n return actual >= expected;\n case \"$exists\":\n return expected ? actual !== null : actual === null;\n case \"$in\":\n if (!Array.isArray(expected)) return false;\n return isIn(actual, expected);\n case \"$nin\":\n if (!Array.isArray(expected)) return false;\n return !isIn(actual, expected);\n case \"$not\":\n return !evalConditionValue(expected, actual);\n case \"$size\":\n if (!Array.isArray(actual)) return false;\n return evalConditionValue(expected, actual.length);\n case \"$elemMatch\":\n return elemMatch(actual, expected);\n case \"$all\":\n if (!Array.isArray(actual)) return false;\n for (let i = 0; i < expected.length; i++) {\n let passed = false;\n for (let j = 0; j < actual.length; j++) {\n if (evalConditionValue(expected[i], actual[j])) {\n passed = true;\n break;\n }\n }\n if (!passed) return false;\n }\n return true;\n case \"$regex\":\n try {\n return getRegex(expected).test(actual);\n } catch (e) {\n return false;\n }\n case \"$type\":\n return getType(actual) === expected;\n default:\n console.error(\"Unknown operator: \" + operator);\n return false;\n }\n}\n\n// Recursive $or rule\nfunction evalOr(obj, conditions) {\n if (!conditions.length) return true;\n for (let i = 0; i < conditions.length; i++) {\n if (evalCondition(obj, conditions[i])) {\n return true;\n }\n }\n return false;\n}\n\n// Recursive $and rule\nfunction evalAnd(obj, conditions) {\n for (let i = 0; i < conditions.length; i++) {\n if (!evalCondition(obj, conditions[i])) {\n return false;\n }\n }\n return true;\n}\n//# sourceMappingURL=mongrule.js.map","// Config settings\nconst cacheSettings = {\n // Consider a fetch stale after 1 minute\n staleTTL: 1000 * 60,\n cacheKey: \"gbFeaturesCache\",\n backgroundSync: true\n};\nconst polyfills = {\n fetch: globalThis.fetch ? globalThis.fetch.bind(globalThis) : undefined,\n SubtleCrypto: globalThis.crypto ? globalThis.crypto.subtle : undefined,\n EventSource: globalThis.EventSource\n};\ntry {\n if (globalThis.localStorage) {\n polyfills.localStorage = globalThis.localStorage;\n }\n} catch (e) {\n // Ignore localStorage errors\n}\n\n// Global state\nconst subscribedInstances = new Map();\nlet cacheInitialized = false;\nconst cache = new Map();\nconst activeFetches = new Map();\nconst streams = new Map();\nconst supportsSSE = new Set();\n\n// Public functions\nexport function setPolyfills(overrides) {\n Object.assign(polyfills, overrides);\n}\nexport function configureCache(overrides) {\n Object.assign(cacheSettings, overrides);\n if (!cacheSettings.backgroundSync) {\n clearAutoRefresh();\n }\n}\nexport async function clearCache() {\n cache.clear();\n activeFetches.clear();\n clearAutoRefresh();\n cacheInitialized = false;\n await updatePersistentCache();\n}\nexport async function refreshFeatures(instance, timeout, skipCache, allowStale, updateInstance) {\n const data = await fetchFeaturesWithCache(instance, allowStale, timeout, skipCache);\n updateInstance && data && (await refreshInstance(instance, data));\n}\n\n// Subscribe a GrowthBook instance to feature changes\nexport function subscribe(instance) {\n const [key] = getKey(instance);\n const subs = subscribedInstances.get(key) || new Set();\n subs.add(instance);\n subscribedInstances.set(key, subs);\n}\nexport function unsubscribe(instance) {\n subscribedInstances.forEach(s => s.delete(instance));\n}\n\n// Private functions\nasync function updatePersistentCache() {\n try {\n if (!polyfills.localStorage) return;\n await polyfills.localStorage.setItem(cacheSettings.cacheKey, JSON.stringify(Array.from(cache.entries())));\n } catch (e) {\n // Ignore localStorage errors\n }\n}\nasync function fetchFeaturesWithCache(instance, allowStale, timeout, skipCache) {\n const [key] = getKey(instance);\n const now = new Date();\n await initializeCache();\n const existing = cache.get(key);\n if (existing && !skipCache && (allowStale || existing.staleAt > now)) {\n // Reload features in the backgroud if stale\n if (existing.staleAt < now) {\n fetchFeatures(instance);\n }\n // Otherwise, if we don't need to refresh now, start a background sync\n else {\n startAutoRefresh(instance);\n }\n return existing.data;\n } else {\n const data = await promiseTimeout(fetchFeatures(instance), timeout);\n return data;\n }\n}\nfunction getKey(instance) {\n const [apiHost, clientKey] = instance.getApiInfo();\n return [\"\".concat(apiHost, \"||\").concat(clientKey), apiHost, clientKey];\n}\n\n// Guarantee the promise always resolves within {timeout} ms\n// Resolved value will be `null` when there's an error or it takes too long\n// Note: The promise will continue running in the background, even if the timeout is hit\nfunction promiseTimeout(promise, timeout) {\n return new Promise(resolve => {\n let resolved = false;\n let timer;\n const finish = data => {\n if (resolved) return;\n resolved = true;\n timer && clearTimeout(timer);\n resolve(data || null);\n };\n if (timeout) {\n timer = setTimeout(() => finish(), timeout);\n }\n promise.then(data => finish(data)).catch(() => finish());\n });\n}\n\n// Populate cache from localStorage (if available)\nasync function initializeCache() {\n if (cacheInitialized) return;\n cacheInitialized = true;\n try {\n if (polyfills.localStorage) {\n const value = await polyfills.localStorage.getItem(cacheSettings.cacheKey);\n if (value) {\n const parsed = JSON.parse(value);\n if (parsed && Array.isArray(parsed)) {\n parsed.forEach(_ref => {\n let [key, data] = _ref;\n cache.set(key, {\n ...data,\n staleAt: new Date(data.staleAt)\n });\n });\n }\n }\n }\n } catch (e) {\n // Ignore localStorage errors\n }\n}\n\n// Called whenever new features are fetched from the API\nfunction onNewFeatureData(key, data) {\n // If contents haven't changed, ignore the update, extend the stale TTL\n const version = data.dateUpdated || \"\";\n const staleAt = new Date(Date.now() + cacheSettings.staleTTL);\n const existing = cache.get(key);\n if (existing && version && existing.version === version) {\n existing.staleAt = staleAt;\n updatePersistentCache();\n return;\n }\n\n // Update in-memory cache\n cache.set(key, {\n data,\n version,\n staleAt\n });\n // Update local storage (don't await this, just update asynchronously)\n updatePersistentCache();\n\n // Update features for all subscribed GrowthBook instances\n const instances = subscribedInstances.get(key);\n instances && instances.forEach(instance => refreshInstance(instance, data));\n}\nasync function refreshInstance(instance, data) {\n await (data.encryptedExperiments ? instance.setEncryptedExperiments(data.encryptedExperiments, undefined, polyfills.SubtleCrypto) : instance.setExperiments(data.experiments || instance.getExperiments()));\n await (data.encryptedFeatures ? instance.setEncryptedFeatures(data.encryptedFeatures, undefined, polyfills.SubtleCrypto) : instance.setFeatures(data.features || instance.getFeatures()));\n}\nasync function fetchFeatures(instance) {\n const [key, apiHost, clientKey] = getKey(instance);\n const endpoint = apiHost + \"/api/features/\" + clientKey;\n let promise = activeFetches.get(key);\n if (!promise) {\n promise = polyfills.fetch(endpoint)\n // TODO: auto-retry if status code indicates a temporary error\n .then(res => {\n if (res.headers.get(\"x-sse-support\") === \"enabled\") {\n supportsSSE.add(key);\n }\n return res.json();\n }).then(data => {\n onNewFeatureData(key, data);\n startAutoRefresh(instance);\n activeFetches.delete(key);\n return data;\n }).catch(e => {\n process.env.NODE_ENV !== \"production\" && instance.log(\"Error fetching features\", {\n apiHost,\n clientKey,\n error: e ? e.message : null\n });\n activeFetches.delete(key);\n return Promise.resolve({});\n });\n activeFetches.set(key, promise);\n }\n return await promise;\n}\n\n// Watch a feature endpoint for changes\n// Will prefer SSE if enabled, otherwise fall back to cron\nfunction startAutoRefresh(instance) {\n const [key, apiHost, clientKey] = getKey(instance);\n if (cacheSettings.backgroundSync && supportsSSE.has(key) && polyfills.EventSource) {\n if (streams.has(key)) return;\n const channel = {\n src: null,\n cb: event => {\n try {\n const json = JSON.parse(event.data);\n onNewFeatureData(key, json);\n // Reset error count on success\n channel.errors = 0;\n } catch (e) {\n process.env.NODE_ENV !== \"production\" && instance.log(\"SSE Error\", {\n apiHost,\n clientKey,\n error: e ? e.message : null\n });\n onSSEError(channel, apiHost, clientKey);\n }\n },\n errors: 0\n };\n streams.set(key, channel);\n enableChannel(channel, apiHost, clientKey);\n }\n}\nfunction onSSEError(channel, apiHost, clientKey) {\n channel.errors++;\n if (channel.errors > 3 || channel.src && channel.src.readyState === 2) {\n // exponential backoff after 4 errors, with jitter\n const delay = Math.pow(3, channel.errors - 3) * (1000 + Math.random() * 1000);\n disableChannel(channel);\n setTimeout(() => {\n enableChannel(channel, apiHost, clientKey);\n }, Math.min(delay, 300000)); // 5 minutes max\n }\n}\n\nfunction disableChannel(channel) {\n if (!channel.src) return;\n channel.src.onopen = null;\n channel.src.onerror = null;\n channel.src.close();\n channel.src = null;\n}\nfunction enableChannel(channel, apiHost, clientKey) {\n channel.src = new polyfills.EventSource(\"\".concat(apiHost, \"/sub/\").concat(clientKey));\n channel.src.addEventListener(\"features\", channel.cb);\n channel.src.onerror = () => {\n onSSEError(channel, apiHost, clientKey);\n };\n channel.src.onopen = () => {\n channel.errors = 0;\n };\n}\nfunction destroyChannel(channel, key) {\n disableChannel(channel);\n streams.delete(key);\n}\nfunction clearAutoRefresh() {\n // Clear list of which keys are auto-updated\n supportsSSE.clear();\n\n // Stop listening for any SSE events\n streams.forEach(destroyChannel);\n\n // Remove all references to GrowthBook instances\n subscribedInstances.clear();\n}\n//# sourceMappingURL=feature-repository.js.map","import mutate from \"dom-mutator\";\nimport { getUrlRegExp, isIncluded, getBucketRanges, hash, chooseVariation, getQueryStringOverride, inNamespace, inRange, isURLTargeted, decrypt } from \"./util\";\nimport { evalCondition } from \"./mongrule\";\nimport { refreshFeatures, subscribe, unsubscribe } from \"./feature-repository\";\nconst isBrowser = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nexport class GrowthBook {\n // context is technically private, but some tools depend on it so we can't mangle the name\n // _ctx below is a clone of this property that we use internally\n\n // Properties and methods that start with \"_\" are mangled by Terser (saves ~150 bytes)\n\n // eslint-disable-next-line\n\n constructor(context) {\n context = context || {};\n // These properties are all initialized in the constructor instead of above\n // This saves ~80 bytes in the final output\n this._ctx = this.context = context;\n this._renderer = null;\n this._trackedExperiments = new Set();\n this._trackedFeatures = {};\n this.debug = false;\n this._subscriptions = new Set();\n this._rtQueue = [];\n this._rtTimer = 0;\n this.ready = false;\n this._assigned = new Map();\n this._forcedFeatureValues = new Map();\n this._attributeOverrides = {};\n this._activeAutoExperiments = new Map();\n if (context.features) {\n this.ready = true;\n }\n if (isBrowser && context.enableDevMode) {\n window._growthbook = this;\n document.dispatchEvent(new Event(\"gbloaded\"));\n }\n if (context.experiments) {\n this.ready = true;\n this._updateAllAutoExperiments();\n }\n if (context.clientKey) {\n this._refresh({}, true, false);\n }\n }\n async loadFeatures(options) {\n await this._refresh(options, true, true);\n if (options && options.autoRefresh) {\n subscribe(this);\n }\n }\n async refreshFeatures(options) {\n await this._refresh(options, false, true);\n }\n getApiInfo() {\n return [(this._ctx.apiHost || \"https://cdn.growthbook.io\").replace(/\\/*$/, \"\"), this._ctx.clientKey || \"\"];\n }\n async _refresh(options, allowStale, updateInstance) {\n options = options || {};\n if (!this._ctx.clientKey) {\n throw new Error(\"Missing clientKey\");\n }\n await refreshFeatures(this, options.timeout, options.skipCache || this._ctx.enableDevMode, allowStale, updateInstance);\n }\n _render() {\n if (this._renderer) {\n this._renderer();\n }\n }\n setFeatures(features) {\n this._ctx.features = features;\n this.ready = true;\n this._render();\n }\n async setEncryptedFeatures(encryptedString, decryptionKey, subtle) {\n const featuresJSON = await decrypt(encryptedString, decryptionKey || this._ctx.decryptionKey, subtle);\n this.setFeatures(JSON.parse(featuresJSON));\n }\n setExperiments(experiments) {\n this._ctx.experiments = experiments;\n this.ready = true;\n this._updateAllAutoExperiments();\n }\n async setEncryptedExperiments(encryptedString, decryptionKey, subtle) {\n const experimentsJSON = await decrypt(encryptedString, decryptionKey || this._ctx.decryptionKey, subtle);\n this.setExperiments(JSON.parse(experimentsJSON));\n }\n setAttributes(attributes) {\n this._ctx.attributes = attributes;\n this._render();\n this._updateAllAutoExperiments();\n }\n setAttributeOverrides(overrides) {\n this._attributeOverrides = overrides;\n this._render();\n this._updateAllAutoExperiments();\n }\n setForcedVariations(vars) {\n this._ctx.forcedVariations = vars || {};\n this._render();\n this._updateAllAutoExperiments();\n }\n // eslint-disable-next-line\n setForcedFeatures(map) {\n this._forcedFeatureValues = map;\n this._render();\n }\n setURL(url) {\n this._ctx.url = url;\n this._updateAllAutoExperiments(true);\n }\n getAttributes() {\n return {\n ...this._ctx.attributes,\n ...this._attributeOverrides\n };\n }\n getFeatures() {\n return this._ctx.features || {};\n }\n getExperiments() {\n return this._ctx.experiments || [];\n }\n subscribe(cb) {\n this._subscriptions.add(cb);\n return () => {\n this._subscriptions.delete(cb);\n };\n }\n getAllResults() {\n return new Map(this._assigned);\n }\n destroy() {\n // Release references to save memory\n this._subscriptions.clear();\n this._assigned.clear();\n this._trackedExperiments.clear();\n this._trackedFeatures = {};\n this._rtQueue = [];\n if (this._rtTimer) {\n clearTimeout(this._rtTimer);\n }\n unsubscribe(this);\n if (isBrowser && window._growthbook === this) {\n delete window._growthbook;\n }\n\n // Undo any active auto experiments\n this._activeAutoExperiments.forEach(exp => {\n exp.undo();\n });\n this._activeAutoExperiments.clear();\n }\n setRenderer(renderer) {\n this._renderer = renderer;\n }\n forceVariation(key, variation) {\n this._ctx.forcedVariations = this._ctx.forcedVariations || {};\n this._ctx.forcedVariations[key] = variation;\n this._render();\n }\n run(experiment) {\n const result = this._run(experiment, null);\n this._fireSubscriptions(experiment, result);\n return result;\n }\n triggerExperiment(key) {\n if (!this._ctx.experiments) return null;\n const exp = this._ctx.experiments.find(exp => exp.key === key);\n if (!exp || !exp.manual) return null;\n return this._runAutoExperiment(exp, true);\n }\n _runAutoExperiment(experiment, forceManual, forceRerun) {\n const key = experiment.key;\n const existing = this._activeAutoExperiments.get(key);\n\n // If this is a manual experiment and it's not already running, skip\n if (experiment.manual && !forceManual && !existing) return null;\n\n // Run the experiment\n const result = this.run(experiment);\n\n // A hash to quickly tell if the assigned value changed\n const valueHash = JSON.stringify(result.value);\n\n // If the changes are already active, no need to re-apply them\n if (!forceRerun && result.inExperiment && existing && existing.valueHash === valueHash) {\n return result;\n }\n\n // Undo any existing changes\n if (existing) this._undoActiveAutoExperiment(key);\n\n // Apply new changes\n if (result.inExperiment) {\n const undo = this._applyDOMChanges(result.value);\n if (undo) {\n this._activeAutoExperiments.set(experiment.key, {\n undo,\n valueHash\n });\n }\n }\n return result;\n }\n _undoActiveAutoExperiment(key) {\n const exp = this._activeAutoExperiments.get(key);\n if (exp) {\n exp.undo();\n this._activeAutoExperiments.delete(key);\n }\n }\n _updateAllAutoExperiments(forceRerun) {\n const experiments = this._ctx.experiments || [];\n\n // Stop any experiments that are no longer defined\n const keys = new Set(experiments.map(e => e.key));\n this._activeAutoExperiments.forEach((v, k) => {\n if (!keys.has(k)) {\n v.undo();\n this._activeAutoExperiments.delete(k);\n }\n });\n\n // Re-run all new/updated experiments\n experiments.forEach(exp => {\n this._runAutoExperiment(exp, false, forceRerun);\n });\n }\n _fireSubscriptions(experiment, result) {\n const key = experiment.key;\n\n // If assigned variation has changed, fire subscriptions\n const prev = this._assigned.get(key);\n // TODO: what if the experiment definition has changed?\n if (!prev || prev.result.inExperiment !== result.inExperiment || prev.result.variationId !== result.variationId) {\n this._assigned.set(key, {\n experiment,\n result\n });\n this._subscriptions.forEach(cb => {\n try {\n cb(experiment, result);\n } catch (e) {\n console.error(e);\n }\n });\n }\n }\n _trackFeatureUsage(key, res) {\n // Don't track feature usage that was forced via an override\n if (res.source === \"override\") return;\n\n // Only track a feature once, unless the assigned value changed\n const stringifiedValue = JSON.stringify(res.value);\n if (this._trackedFeatures[key] === stringifiedValue) return;\n this._trackedFeatures[key] = stringifiedValue;\n\n // Fire user-supplied callback\n if (this._ctx.onFeatureUsage) {\n try {\n this._ctx.onFeatureUsage(key, res);\n } catch (e) {\n // Ignore feature usage callback errors\n }\n }\n\n // In browser environments, queue up feature usage to be tracked in batches\n if (!isBrowser || !window.fetch) return;\n this._rtQueue.push({\n key,\n on: res.on\n });\n if (!this._rtTimer) {\n this._rtTimer = window.setTimeout(() => {\n // Reset the queue\n this._rtTimer = 0;\n const q = [...this._rtQueue];\n this._rtQueue = [];\n\n // Skip logging if a real-time usage key is not configured\n if (!this._ctx.realtimeKey) return;\n window.fetch(\"https://rt.growthbook.io/?key=\".concat(this._ctx.realtimeKey, \"&events=\").concat(encodeURIComponent(JSON.stringify(q))), {\n cache: \"no-cache\",\n mode: \"no-cors\"\n }).catch(() => {\n // TODO: retry in case of network errors?\n });\n }, this._ctx.realtimeInterval || 2000);\n }\n }\n _getFeatureResult(key, value, source, ruleId, experiment, result) {\n const ret = {\n value,\n on: !!value,\n off: !value,\n source,\n ruleId: ruleId || \"\"\n };\n if (experiment) ret.experiment = experiment;\n if (result) ret.experimentResult = result;\n\n // Track the usage of this feature in real-time\n this._trackFeatureUsage(key, ret);\n return ret;\n }\n isOn(key) {\n return this.evalFeature(key).on;\n }\n isOff(key) {\n return this.evalFeature(key).off;\n }\n getFeatureValue(key, defaultValue) {\n const value = this.evalFeature(key).value;\n return value === null ? defaultValue : value;\n }\n\n /**\n * @deprecated Use {@link evalFeature}\n * @param id\n */\n // eslint-disable-next-line\n feature(id) {\n return this.evalFeature(id);\n }\n evalFeature(id) {\n // Global override\n if (this._forcedFeatureValues.has(id)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Global override\", {\n id,\n value: this._forcedFeatureValues.get(id)\n });\n return this._getFeatureResult(id, this._forcedFeatureValues.get(id), \"override\");\n }\n\n // Unknown feature id\n if (!this._ctx.features || !this._ctx.features[id]) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Unknown feature\", {\n id\n });\n return this._getFeatureResult(id, null, \"unknownFeature\");\n }\n\n // Get the feature\n const feature = this._ctx.features[id];\n\n // Loop through the rules\n if (feature.rules) {\n for (const rule of feature.rules) {\n // If it's a conditional rule, skip if the condition doesn't pass\n if (rule.condition && !this._conditionPasses(rule.condition)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip rule because of condition\", {\n id,\n rule\n });\n continue;\n }\n // If there are filters for who is included (e.g. namespaces)\n if (rule.filters && this._isFilteredOut(rule.filters)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip rule because of filters\", {\n id,\n rule\n });\n continue;\n }\n\n // Feature value is being forced\n if (\"force\" in rule) {\n // If this is a percentage rollout, skip if not included\n if (!this._isIncludedInRollout(rule.seed || id, rule.hashAttribute, rule.range, rule.coverage, rule.hashVersion)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip rule because user not included in rollout\", {\n id,\n rule\n });\n continue;\n }\n process.env.NODE_ENV !== \"production\" && this.log(\"Force value from rule\", {\n id,\n rule\n });\n\n // If this was a remotely evaluated experiment, fire the tracking callbacks\n if (rule.tracks) {\n rule.tracks.forEach(t => {\n this._track(t.experiment, t.result);\n });\n }\n return this._getFeatureResult(id, rule.force, \"force\", rule.id);\n }\n if (!rule.variations) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip invalid rule\", {\n id,\n rule\n });\n continue;\n }\n // For experiment rules, run an experiment\n const exp = {\n variations: rule.variations,\n key: rule.key || id\n };\n if (\"coverage\" in rule) exp.coverage = rule.coverage;\n if (rule.weights) exp.weights = rule.weights;\n if (rule.hashAttribute) exp.hashAttribute = rule.hashAttribute;\n if (rule.namespace) exp.namespace = rule.namespace;\n if (rule.meta) exp.meta = rule.meta;\n if (rule.ranges) exp.ranges = rule.ranges;\n if (rule.name) exp.name = rule.name;\n if (rule.phase) exp.phase = rule.phase;\n if (rule.seed) exp.seed = rule.seed;\n if (rule.hashVersion) exp.hashVersion = rule.hashVersion;\n if (rule.filters) exp.filters = rule.filters;\n\n // Only return a value if the user is part of the experiment\n const res = this._run(exp, id);\n this._fireSubscriptions(exp, res);\n if (res.inExperiment && !res.passthrough) {\n return this._getFeatureResult(id, res.value, \"experiment\", rule.id, exp, res);\n }\n }\n }\n process.env.NODE_ENV !== \"production\" && this.log(\"Use default value\", {\n id,\n value: feature.defaultValue\n });\n\n // Fall back to using the default value\n return this._getFeatureResult(id, feature.defaultValue === undefined ? null : feature.defaultValue, \"defaultValue\");\n }\n _isIncludedInRollout(seed, hashAttribute, range, coverage, hashVersion) {\n if (!range && coverage === undefined) return true;\n const {\n hashValue\n } = this._getHashAttribute(hashAttribute);\n if (!hashValue) {\n return false;\n }\n const n = hash(seed, hashValue, hashVersion || 1);\n if (n === null) return false;\n return range ? inRange(n, range) : coverage !== undefined ? n <= coverage : true;\n }\n _conditionPasses(condition) {\n return evalCondition(this.getAttributes(), condition);\n }\n _isFilteredOut(filters) {\n return filters.some(filter => {\n const {\n hashValue\n } = this._getHashAttribute(filter.attribute);\n if (!hashValue) return true;\n const n = hash(filter.seed, hashValue, filter.hashVersion || 2);\n if (n === null) return true;\n return !filter.ranges.some(r => inRange(n, r));\n });\n }\n _run(experiment, featureId) {\n const key = experiment.key;\n const numVariations = experiment.variations.length;\n\n // 1. If experiment has less than 2 variations, return immediately\n if (numVariations < 2) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Invalid experiment\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 2. If the context is disabled, return immediately\n if (this._ctx.enabled === false) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Context disabled\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 2.5. Merge in experiment overrides from the context\n experiment = this._mergeOverrides(experiment);\n\n // 3. If a variation is forced from a querystring, return the forced variation\n const qsOverride = getQueryStringOverride(key, this._getContextUrl(), numVariations);\n if (qsOverride !== null) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Force via querystring\", {\n id: key,\n variation: qsOverride\n });\n return this._getResult(experiment, qsOverride, false, featureId);\n }\n\n // 4. If a variation is forced in the context, return the forced variation\n if (this._ctx.forcedVariations && key in this._ctx.forcedVariations) {\n const variation = this._ctx.forcedVariations[key];\n process.env.NODE_ENV !== \"production\" && this.log(\"Force via dev tools\", {\n id: key,\n variation\n });\n return this._getResult(experiment, variation, false, featureId);\n }\n\n // 5. Exclude if a draft experiment or not active\n if (experiment.status === \"draft\" || experiment.active === false) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because inactive\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 6. Get the hash attribute and return if empty\n const {\n hashValue\n } = this._getHashAttribute(experiment.hashAttribute);\n if (!hashValue) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because missing hashAttribute\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 7. Exclude if user is filtered out (used to be called \"namespace\")\n if (experiment.filters) {\n if (this._isFilteredOut(experiment.filters)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of filters\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n } else if (experiment.namespace && !inNamespace(hashValue, experiment.namespace)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of namespace\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 7.5. Exclude if experiment.include returns false or throws\n if (experiment.include && !isIncluded(experiment.include)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of include function\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 8. Exclude if condition is false\n if (experiment.condition && !this._conditionPasses(experiment.condition)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of condition\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 8.1. Exclude if user is not in a required group\n if (experiment.groups && !this._hasGroupOverlap(experiment.groups)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of groups\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 8.2. Old style URL targeting\n if (experiment.url && !this._urlIsValid(experiment.url)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of url\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 8.3. New, more powerful URL targeting\n if (experiment.urlPatterns && !isURLTargeted(this._getContextUrl(), experiment.urlPatterns)) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of url targeting\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 9. Get bucket ranges and choose variation\n const n = hash(experiment.seed || key, hashValue, experiment.hashVersion || 1);\n if (n === null) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of invalid hash version\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n const ranges = experiment.ranges || getBucketRanges(numVariations, experiment.coverage === undefined ? 1 : experiment.coverage, experiment.weights);\n const assigned = chooseVariation(n, ranges);\n\n // 10. Return if not in experiment\n if (assigned < 0) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because of coverage\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 11. Experiment has a forced variation\n if (\"force\" in experiment) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Force variation\", {\n id: key,\n variation: experiment.force\n });\n return this._getResult(experiment, experiment.force === undefined ? -1 : experiment.force, false, featureId);\n }\n\n // 12. Exclude if in QA mode\n if (this._ctx.qaMode) {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because QA mode\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 12.5. Exclude if experiment is stopped\n if (experiment.status === \"stopped\") {\n process.env.NODE_ENV !== \"production\" && this.log(\"Skip because stopped\", {\n id: key\n });\n return this._getResult(experiment, -1, false, featureId);\n }\n\n // 13. Build the result object\n const result = this._getResult(experiment, assigned, true, featureId, n);\n\n // 14. Fire the tracking callback\n this._track(experiment, result);\n\n // 15. Return the result\n process.env.NODE_ENV !== \"production\" && this.log(\"In experiment\", {\n id: key,\n variation: result.variationId\n });\n return result;\n }\n log(msg, ctx) {\n if (!this.debug) return;\n if (this._ctx.log) this._ctx.log(msg, ctx);else console.log(msg, ctx);\n }\n _track(experiment, result) {\n if (!this._ctx.trackingCallback) return;\n const key = experiment.key;\n\n // Make sure a tracking callback is only fired once per unique experiment\n const k = result.hashAttribute + result.hashValue + key + result.variationId;\n if (this._trackedExperiments.has(k)) return;\n this._trackedExperiments.add(k);\n try {\n this._ctx.trackingCallback(experiment, result);\n } catch (e) {\n console.error(e);\n }\n }\n _mergeOverrides(experiment) {\n const key = experiment.key;\n const o = this._ctx.overrides;\n if (o && o[key]) {\n experiment = Object.assign({}, experiment, o[key]);\n if (typeof experiment.url === \"string\") {\n experiment.url = getUrlRegExp(\n // eslint-disable-next-line\n experiment.url);\n }\n }\n return experiment;\n }\n _getHashAttribute(attr) {\n const hashAttribute = attr || \"id\";\n let hashValue = \"\";\n if (this._attributeOverrides[hashAttribute]) {\n hashValue = this._attributeOverrides[hashAttribute];\n } else if (this._ctx.attributes) {\n hashValue = this._ctx.attributes[hashAttribute] || \"\";\n } else if (this._ctx.user) {\n hashValue = this._ctx.user[hashAttribute] || \"\";\n }\n return {\n hashAttribute,\n hashValue\n };\n }\n _getResult(experiment, variationIndex, hashUsed, featureId, bucket) {\n let inExperiment = true;\n // If assigned variation is not valid, use the baseline and mark the user as not in the experiment\n if (variationIndex < 0 || variationIndex >= experiment.variations.length) {\n variationIndex = 0;\n inExperiment = false;\n }\n const {\n hashAttribute,\n hashValue\n } = this._getHashAttribute(experiment.hashAttribute);\n const meta = experiment.meta ? experiment.meta[variationIndex] : {};\n const res = {\n key: meta.key || \"\" + variationIndex,\n featureId,\n inExperiment,\n hashUsed,\n variationId: variationIndex,\n value: experiment.variations[variationIndex],\n hashAttribute,\n hashValue\n };\n if (meta.name) res.name = meta.name;\n if (bucket !== undefined) res.bucket = bucket;\n if (meta.passthrough) res.passthrough = meta.passthrough;\n return res;\n }\n _getContextUrl() {\n return this._ctx.url || (isBrowser ? window.location.href : \"\");\n }\n _urlIsValid(urlRegex) {\n const url = this._getContextUrl();\n if (!url) return false;\n const pathOnly = url.replace(/^https?:\\/\\//, \"\").replace(/^[^/]*\\//, \"/\");\n if (urlRegex.test(url)) return true;\n if (urlRegex.test(pathOnly)) return true;\n return false;\n }\n _hasGroupOverlap(expGroups) {\n const groups = this._ctx.groups || {};\n for (let i = 0; i < expGroups.length; i++) {\n if (groups[expGroups[i]]) return true;\n }\n return false;\n }\n _applyDOMChanges(changes) {\n if (!isBrowser) return;\n const undo = [];\n if (changes.css) {\n const s = document.createElement(\"style\");\n s.innerHTML = changes.css;\n document.head.appendChild(s);\n undo.push(() => s.remove());\n }\n if (changes.js) {\n const script = document.createElement(\"script\");\n script.innerHTML = changes.js;\n document.body.appendChild(script);\n undo.push(() => script.remove());\n }\n if (changes.domMutations) {\n changes.domMutations.forEach(mutation => {\n undo.push(mutate.declarative(mutation).revert);\n });\n }\n return () => {\n undo.forEach(fn => fn());\n };\n }\n}\n//# sourceMappingURL=GrowthBook.js.map","import { GrowthBook } from '@growthbook/growthbook';\nexport { GrowthBook, clearCache, configureCache, setPolyfills } from '@growthbook/growthbook';\nimport * as React from 'react';\n\nfunction _extends() {\n _extends = Object.assign ? Object.assign.bind() : function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\nconst GrowthBookContext = /*#__PURE__*/React.createContext({});\nfunction run(exp, growthbook) {\n if (!growthbook) {\n return {\n featureId: null,\n value: exp.variations[0],\n variationId: 0,\n inExperiment: false,\n hashUsed: false,\n hashAttribute: exp.hashAttribute || \"id\",\n hashValue: \"\",\n key: \"\"\n };\n }\n return growthbook.run(exp);\n}\nfunction feature(id, growthbook) {\n if (!growthbook) {\n return {\n value: null,\n on: false,\n off: true,\n source: \"unknownFeature\",\n ruleId: \"\"\n };\n }\n return growthbook.evalFeature(id);\n}\n\n// Get features from API and targeting attributes during SSR\nasync function getGrowthBookSSRData(context) {\n // Server-side GrowthBook instance\n const gb = new GrowthBook({\n ...context\n });\n\n // Load feature flags from network if needed\n if (context.clientKey) {\n await gb.loadFeatures();\n }\n const data = {\n attributes: gb.getAttributes(),\n features: gb.getFeatures()\n };\n gb.destroy();\n return data;\n}\n\n// Populate the GrowthBook instance in context from the SSR props\nfunction useGrowthBookSSR(data) {\n const gb = useGrowthBook();\n\n // Only do this once to avoid infinite loops\n const isFirst = React.useRef(true);\n if (gb && isFirst.current) {\n gb.setFeatures(data.features);\n gb.setAttributes(data.attributes);\n isFirst.current = false;\n }\n}\nfunction useExperiment(exp) {\n const {\n growthbook\n } = React.useContext(GrowthBookContext);\n return run(exp, growthbook);\n}\nfunction useFeature(id) {\n const growthbook = useGrowthBook();\n return feature(id, growthbook);\n}\nfunction useFeatureIsOn(id) {\n const growthbook = useGrowthBook();\n return growthbook ? growthbook.isOn(id) : false;\n}\nfunction useFeatureValue(id, fallback) {\n const growthbook = useGrowthBook();\n return growthbook ? growthbook.getFeatureValue(id, fallback) : fallback;\n}\nfunction useGrowthBook() {\n const {\n growthbook\n } = React.useContext(GrowthBookContext);\n return growthbook;\n}\nfunction FeaturesReady({\n children,\n timeout,\n fallback\n}) {\n const gb = useGrowthBook();\n const [hitTimeout, setHitTimeout] = React.useState(false);\n const ready = gb ? gb.ready : false;\n React.useEffect(() => {\n if (timeout && !ready) {\n const timer = setTimeout(() => {\n gb && gb.log(\"FeaturesReady timed out waiting for features to load\", {\n timeout\n });\n setHitTimeout(true);\n }, timeout);\n return () => clearTimeout(timer);\n }\n }, [timeout, ready, gb]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, ready || hitTimeout ? children : fallback || null);\n}\nfunction IfFeatureEnabled({\n children,\n feature\n}) {\n return useFeature(feature).on ? /*#__PURE__*/React.createElement(React.Fragment, null, children) : null;\n}\nfunction FeatureString(props) {\n const value = useFeature(props.feature).value;\n if (value !== null) {\n return /*#__PURE__*/React.createElement(React.Fragment, null, value);\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, props.default);\n}\nconst withRunExperiment = Component => {\n // eslint-disable-next-line\n const withRunExperimentWrapper = props => /*#__PURE__*/React.createElement(GrowthBookContext.Consumer, null, ({\n growthbook\n }) => {\n return /*#__PURE__*/React.createElement(Component, _extends({}, props, {\n runExperiment: exp => run(exp, growthbook)\n }));\n });\n return withRunExperimentWrapper;\n};\nwithRunExperiment.displayName = \"WithRunExperiment\";\nconst GrowthBookProvider = ({\n children,\n growthbook\n}) => {\n // Tell growthbook how to re-render our app (for dev mode integration)\n // eslint-disable-next-line\n const [_, setRenderCount] = React.useState(0);\n React.useEffect(() => {\n if (!growthbook || !growthbook.setRenderer) return;\n growthbook.setRenderer(() => {\n setRenderCount(v => v + 1);\n });\n return () => {\n growthbook.setRenderer(() => {\n // do nothing\n });\n };\n }, [growthbook]);\n return /*#__PURE__*/React.createElement(GrowthBookContext.Provider, {\n value: {\n growthbook\n }\n }, children);\n};\n\nexport { FeatureString, FeaturesReady, GrowthBookContext, GrowthBookProvider, IfFeatureEnabled, getGrowthBookSSRData, useExperiment, useFeature, useFeatureIsOn, useFeatureValue, useGrowthBook, useGrowthBookSSR, withRunExperiment };\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nvar m = require('react-dom');\nif (process.env.NODE_ENV === 'production') {\n exports.createRoot = m.createRoot;\n exports.hydrateRoot = m.hydrateRoot;\n} else {\n var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n exports.createRoot = function(c, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.createRoot(c, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n exports.hydrateRoot = function(c, h, o) {\n i.usingClientEntryPoint = true;\n try {\n return m.hydrateRoot(c, h, o);\n } finally {\n i.usingClientEntryPoint = false;\n }\n };\n}\n","//\n\nmodule.exports = function shallowEqual(objA, objB, compare, compareContext) {\n var ret = compare ? compare.call(compareContext, objA, objB) : void 0;\n\n if (ret !== void 0) {\n return !!ret;\n }\n\n if (objA === objB) {\n return true;\n }\n\n if (typeof objA !== \"object\" || !objA || typeof objB !== \"object\" || !objB) {\n return false;\n }\n\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n\n if (keysA.length !== keysB.length) {\n return false;\n }\n\n var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);\n\n // Test for A's keys different from B.\n for (var idx = 0; idx < keysA.length; idx++) {\n var key = keysA[idx];\n\n if (!bHasOwnProperty(key)) {\n return false;\n }\n\n var valueA = objA[key];\n var valueB = objB[key];\n\n ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;\n\n if (ret === false || (ret === void 0 && valueA !== valueB)) {\n return false;\n }\n }\n\n return true;\n};\n","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","/*! *****************************************************************************\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/* global Reflect, Promise */\r\n\r\nvar 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 (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\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\nexport var __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\nexport function __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\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(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\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __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\nexport function __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\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import * as React from 'react';\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\n _setPrototypeOf(subClass, superClass);\n}\n\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\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\nvar observerMap = new Map();\nvar RootIds = new WeakMap();\nvar rootId = 0;\nvar unsupportedValue = undefined;\n/**\r\n * What should be the default behavior if the IntersectionObserver is unsupported?\r\n * Ideally the polyfill has been loaded, you can have the following happen:\r\n * - `undefined`: Throw an error\r\n * - `true` or `false`: Set the `inView` value to this regardless of intersection state\r\n * **/\n\nfunction defaultFallbackInView(inView) {\n unsupportedValue = inView;\n}\n/**\r\n * Generate a unique ID for the root element\r\n * @param root\r\n */\n\nfunction getRootId(root) {\n if (!root) return '0';\n if (RootIds.has(root)) return RootIds.get(root);\n rootId += 1;\n RootIds.set(root, rootId.toString());\n return RootIds.get(root);\n}\n/**\r\n * Convert the options to a string Id, based on the values.\r\n * Ensures we can reuse the same observer when observing elements with the same options.\r\n * @param options\r\n */\n\n\nfunction optionsToId(options) {\n return Object.keys(options).sort().filter(function (key) {\n return options[key] !== undefined;\n }).map(function (key) {\n return key + \"_\" + (key === 'root' ? getRootId(options.root) : options[key]);\n }).toString();\n}\n\nfunction createObserver(options) {\n // Create a unique ID for this observer instance, based on the root, root margin and threshold.\n var id = optionsToId(options);\n var instance = observerMap.get(id);\n\n if (!instance) {\n // Create a map of elements this observer is going to observe. Each element has a list of callbacks that should be triggered, once it comes into view.\n var elements = new Map();\n var thresholds;\n var observer = new IntersectionObserver(function (entries) {\n entries.forEach(function (entry) {\n var _elements$get;\n\n // While it would be nice if you could just look at isIntersecting to determine if the component is inside the viewport, browsers can't agree on how to use it.\n // -Firefox ignores `threshold` when considering `isIntersecting`, so it will never be false again if `threshold` is > 0\n var inView = entry.isIntersecting && thresholds.some(function (threshold) {\n return entry.intersectionRatio >= threshold;\n }); // @ts-ignore support IntersectionObserver v2\n\n if (options.trackVisibility && typeof entry.isVisible === 'undefined') {\n // The browser doesn't support Intersection Observer v2, falling back to v1 behavior.\n // @ts-ignore\n entry.isVisible = inView;\n }\n\n (_elements$get = elements.get(entry.target)) == null ? void 0 : _elements$get.forEach(function (callback) {\n callback(inView, entry);\n });\n });\n }, options); // Ensure we have a valid thresholds array. If not, use the threshold from the options\n\n thresholds = observer.thresholds || (Array.isArray(options.threshold) ? options.threshold : [options.threshold || 0]);\n instance = {\n id: id,\n observer: observer,\n elements: elements\n };\n observerMap.set(id, instance);\n }\n\n return instance;\n}\n/**\r\n * @param element - DOM Element to observe\r\n * @param callback - Callback function to trigger when intersection status changes\r\n * @param options - Intersection Observer options\r\n * @param fallbackInView - Fallback inView value.\r\n * @return Function - Cleanup function that should be triggered to unregister the observer\r\n */\n\n\nfunction observe(element, callback, options, fallbackInView) {\n if (options === void 0) {\n options = {};\n }\n\n if (fallbackInView === void 0) {\n fallbackInView = unsupportedValue;\n }\n\n if (typeof window.IntersectionObserver === 'undefined' && fallbackInView !== undefined) {\n var bounds = element.getBoundingClientRect();\n callback(fallbackInView, {\n isIntersecting: fallbackInView,\n target: element,\n intersectionRatio: typeof options.threshold === 'number' ? options.threshold : 0,\n time: 0,\n boundingClientRect: bounds,\n intersectionRect: bounds,\n rootBounds: bounds\n });\n return function () {// Nothing to cleanup\n };\n } // An observer with the same options can be reused, so lets use this fact\n\n\n var _createObserver = createObserver(options),\n id = _createObserver.id,\n observer = _createObserver.observer,\n elements = _createObserver.elements; // Register the callback listener for this element\n\n\n var callbacks = elements.get(element) || [];\n\n if (!elements.has(element)) {\n elements.set(element, callbacks);\n }\n\n callbacks.push(callback);\n observer.observe(element);\n return function unobserve() {\n // Remove the callback from the callback list\n callbacks.splice(callbacks.indexOf(callback), 1);\n\n if (callbacks.length === 0) {\n // No more callback exists for element, so destroy it\n elements[\"delete\"](element);\n observer.unobserve(element);\n }\n\n if (elements.size === 0) {\n // No more elements are being observer by this instance, so destroy it\n observer.disconnect();\n observerMap[\"delete\"](id);\n }\n };\n}\n\nvar _excluded = [\"children\", \"as\", \"triggerOnce\", \"threshold\", \"root\", \"rootMargin\", \"onChange\", \"skip\", \"trackVisibility\", \"delay\", \"initialInView\", \"fallbackInView\"];\n\nfunction isPlainChildren(props) {\n return typeof props.children !== 'function';\n}\n/**\r\n ## Render props\r\n\n To use the `` component, you pass it a function. It will be called\r\n whenever the state changes, with the new value of `inView`. In addition to the\r\n `inView` prop, children also receive a `ref` that should be set on the\r\n containing DOM element. This is the element that the IntersectionObserver will\r\n monitor.\r\n\n If you need it, you can also access the\r\n [`IntersectionObserverEntry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry)\r\n on `entry`, giving you access to all the details about the current intersection\r\n state.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n \r\n {({ inView, ref, entry }) => (\r\n
\r\n

{`Header inside viewport ${inView}.`}

\r\n
\r\n )}\r\n
\r\n );\r\n\n export default Component;\r\n ```\r\n\n ## Plain children\r\n\n You can pass any element to the ``, and it will handle creating the\r\n wrapping DOM element. Add a handler to the `onChange` method, and control the\r\n state in your own component. Any extra props you add to `` will be\r\n passed to the HTML element, allowing you set the `className`, `style`, etc.\r\n\n ```jsx\r\n import { InView } from 'react-intersection-observer';\r\n\n const Component = () => (\r\n console.log('Inview:', inView)}>\r\n

Plain children are always rendered. Use onChange to monitor state.

\r\n
\r\n );\r\n\n export default Component;\r\n ```\r\n */\n\n\nvar InView = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(InView, _React$Component);\n\n function InView(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.node = null;\n _this._unobserveCb = null;\n\n _this.handleNode = function (node) {\n if (_this.node) {\n // Clear the old observer, before we start observing a new element\n _this.unobserve();\n\n if (!node && !_this.props.triggerOnce && !_this.props.skip) {\n // Reset the state if we get a new node, and we aren't ignoring updates\n _this.setState({\n inView: !!_this.props.initialInView,\n entry: undefined\n });\n }\n }\n\n _this.node = node ? node : null;\n\n _this.observeNode();\n };\n\n _this.handleChange = function (inView, entry) {\n if (inView && _this.props.triggerOnce) {\n // If `triggerOnce` is true, we should stop observing the element.\n _this.unobserve();\n }\n\n if (!isPlainChildren(_this.props)) {\n // Store the current State, so we can pass it to the children in the next render update\n // There's no reason to update the state for plain children, since it's not used in the rendering.\n _this.setState({\n inView: inView,\n entry: entry\n });\n }\n\n if (_this.props.onChange) {\n // If the user is actively listening for onChange, always trigger it\n _this.props.onChange(inView, entry);\n }\n };\n\n _this.state = {\n inView: !!props.initialInView,\n entry: undefined\n };\n return _this;\n }\n\n var _proto = InView.prototype;\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n // If a IntersectionObserver option changed, reinit the observer\n if (prevProps.rootMargin !== this.props.rootMargin || prevProps.root !== this.props.root || prevProps.threshold !== this.props.threshold || prevProps.skip !== this.props.skip || prevProps.trackVisibility !== this.props.trackVisibility || prevProps.delay !== this.props.delay) {\n this.unobserve();\n this.observeNode();\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.unobserve();\n this.node = null;\n };\n\n _proto.observeNode = function observeNode() {\n if (!this.node || this.props.skip) return;\n var _this$props = this.props,\n threshold = _this$props.threshold,\n root = _this$props.root,\n rootMargin = _this$props.rootMargin,\n trackVisibility = _this$props.trackVisibility,\n delay = _this$props.delay,\n fallbackInView = _this$props.fallbackInView;\n this._unobserveCb = observe(this.node, this.handleChange, {\n threshold: threshold,\n root: root,\n rootMargin: rootMargin,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n };\n\n _proto.unobserve = function unobserve() {\n if (this._unobserveCb) {\n this._unobserveCb();\n\n this._unobserveCb = null;\n }\n };\n\n _proto.render = function render() {\n if (!isPlainChildren(this.props)) {\n var _this$state = this.state,\n inView = _this$state.inView,\n entry = _this$state.entry;\n return this.props.children({\n inView: inView,\n entry: entry,\n ref: this.handleNode\n });\n }\n\n var _this$props2 = this.props,\n children = _this$props2.children,\n as = _this$props2.as,\n props = _objectWithoutPropertiesLoose(_this$props2, _excluded);\n\n return React.createElement(as || 'div', _extends({\n ref: this.handleNode\n }, props), children);\n };\n\n return InView;\n}(React.Component);\n\n/**\r\n * React Hooks make it easy to monitor the `inView` state of your components. Call\r\n * the `useInView` hook with the (optional) [options](#options) you need. It will\r\n * return an array containing a `ref`, the `inView` status and the current\r\n * [`entry`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserverEntry).\r\n * Assign the `ref` to the DOM element you want to monitor, and the hook will\r\n * report the status.\r\n *\r\n * @example\r\n * ```jsx\r\n * import React from 'react';\r\n * import { useInView } from 'react-intersection-observer';\r\n *\r\n * const Component = () => {\r\n * const { ref, inView, entry } = useInView({\r\n * threshold: 0,\r\n * });\r\n *\r\n * return (\r\n *
\r\n *

{`Header inside viewport ${inView}.`}

\r\n *
\r\n * );\r\n * };\r\n * ```\r\n */\n\nfunction useInView(_temp) {\n var _state$entry;\n\n var _ref = _temp === void 0 ? {} : _temp,\n threshold = _ref.threshold,\n delay = _ref.delay,\n trackVisibility = _ref.trackVisibility,\n rootMargin = _ref.rootMargin,\n root = _ref.root,\n triggerOnce = _ref.triggerOnce,\n skip = _ref.skip,\n initialInView = _ref.initialInView,\n fallbackInView = _ref.fallbackInView,\n onChange = _ref.onChange;\n\n var _React$useState = React.useState(null),\n ref = _React$useState[0],\n setRef = _React$useState[1];\n\n var callback = React.useRef();\n\n var _React$useState2 = React.useState({\n inView: !!initialInView,\n entry: undefined\n }),\n state = _React$useState2[0],\n setState = _React$useState2[1]; // Store the onChange callback in a `ref`, so we can access the latest instance\n // inside the `useEffect`, but without triggering a rerender.\n\n\n callback.current = onChange;\n React.useEffect(function () {\n // Ensure we have node ref, and that we shouldn't skip observing\n if (skip || !ref) return;\n var unobserve;\n unobserve = observe(ref, function (inView, entry) {\n setState({\n inView: inView,\n entry: entry\n });\n if (callback.current) callback.current(inView, entry);\n\n if (entry.isIntersecting && triggerOnce && unobserve) {\n // If it should only trigger once, unobserve the element after it's inView\n unobserve();\n unobserve = undefined;\n }\n }, {\n root: root,\n rootMargin: rootMargin,\n threshold: threshold,\n // @ts-ignore\n trackVisibility: trackVisibility,\n // @ts-ignore\n delay: delay\n }, fallbackInView);\n return function () {\n if (unobserve) {\n unobserve();\n }\n };\n }, // We break the rule here, because we aren't including the actual `threshold` variable\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [// If the threshold is an array, convert it to a string, so it won't change between renders.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n Array.isArray(threshold) ? threshold.toString() : threshold, ref, root, rootMargin, triggerOnce, skip, trackVisibility, fallbackInView, delay]);\n var entryTarget = (_state$entry = state.entry) == null ? void 0 : _state$entry.target;\n var previousEntryTarget = React.useRef();\n\n if (!ref && entryTarget && !triggerOnce && !skip && previousEntryTarget.current !== entryTarget) {\n // If we don't have a node ref, then reset the state (unless the hook is set to only `triggerOnce` or `skip`)\n // This ensures we correctly reflect the current state - If you aren't observing anything, then nothing is inView\n previousEntryTarget.current = entryTarget;\n setState({\n inView: !!initialInView,\n entry: undefined\n });\n }\n\n var result = [setRef, state.inView, state.entry]; // Support object destructuring, by adding the specific values.\n\n result.ref = result[0];\n result.inView = result[1];\n result.entry = result[2];\n return result;\n}\n\nexport { InView, defaultFallbackInView, observe, useInView };\n//# sourceMappingURL=react-intersection-observer.esm.js.map\n","function replaceClassName(origClass, classToRemove) {\n return origClass.replace(new RegExp(\"(^|\\\\s)\" + classToRemove + \"(?:\\\\s|$)\", 'g'), '$1').replace(/\\s+/g, ' ').replace(/^\\s*|\\s*$/g, '');\n}\n/**\n * Removes a CSS class from a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\n\nexport default function removeClass(element, className) {\n if (element.classList) {\n element.classList.remove(className);\n } else if (typeof element.className === 'string') {\n element.className = replaceClassName(element.className, className);\n } else {\n element.setAttribute('class', replaceClassName(element.className && element.className.baseVal || '', className));\n }\n}","export default {\n disabled: false\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n *
\n * I'm a fade Transition!\n *
\n * )}\n *
\n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : function (propValue, key, componentName, location, propFullName, secret) {\n var value = propValue[key];\n return PropTypes.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret);\n }\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\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 pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport addOneClass from 'dom-helpers/addClass';\nimport removeOneClass from 'dom-helpers/removeClass';\nimport React from 'react';\nimport Transition from './Transition';\nimport { classNamesShape } from './utils/PropTypes';\n\nvar _addClass = function addClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return addOneClass(node, c);\n });\n};\n\nvar removeClass = function removeClass(node, classes) {\n return node && classes && classes.split(' ').forEach(function (c) {\n return removeOneClass(node, c);\n });\n};\n/**\n * A transition component inspired by the excellent\n * [ng-animate](https://docs.angularjs.org/api/ngAnimate) library, you should\n * use it if you're using CSS transitions or animations. It's built upon the\n * [`Transition`](https://reactcommunity.org/react-transition-group/transition)\n * component, so it inherits all of its props.\n *\n * `CSSTransition` applies a pair of class names during the `appear`, `enter`,\n * and `exit` states of the transition. The first class is applied and then a\n * second `*-active` class in order to activate the CSS transition. After the\n * transition, matching `*-done` class names are applied to persist the\n * transition state.\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n *
\n * \n *
\n * {\"I'll receive my-node-* classes\"}\n *
\n *
\n * \n *
\n * );\n * }\n * ```\n *\n * When the `in` prop is set to `true`, the child component will first receive\n * the class `example-enter`, then the `example-enter-active` will be added in\n * the next tick. `CSSTransition` [forces a\n * reflow](https://github.com/reactjs/react-transition-group/blob/5007303e729a74be66a21c3e2205e4916821524b/src/CSSTransition.js#L208-L215)\n * between before adding the `example-enter-active`. This is an important trick\n * because it allows us to transition between `example-enter` and\n * `example-enter-active` even though they were added immediately one after\n * another. Most notably, this is what makes it possible for us to animate\n * _appearance_.\n *\n * ```css\n * .my-node-enter {\n * opacity: 0;\n * }\n * .my-node-enter-active {\n * opacity: 1;\n * transition: opacity 200ms;\n * }\n * .my-node-exit {\n * opacity: 1;\n * }\n * .my-node-exit-active {\n * opacity: 0;\n * transition: opacity 200ms;\n * }\n * ```\n *\n * `*-active` classes represent which styles you want to animate **to**, so it's\n * important to add `transition` declaration only to them, otherwise transitions\n * might not behave as intended! This might not be obvious when the transitions\n * are symmetrical, i.e. when `*-enter-active` is the same as `*-exit`, like in\n * the example above (minus `transition`), but it becomes apparent in more\n * complex transitions.\n *\n * **Note**: If you're using the\n * [`appear`](http://reactcommunity.org/react-transition-group/transition#Transition-prop-appear)\n * prop, make sure to define styles for `.appear-*` classes as well.\n */\n\n\nvar CSSTransition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CSSTransition, _React$Component);\n\n function CSSTransition() {\n var _this;\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 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n _this.appliedClasses = {\n appear: {},\n enter: {},\n exit: {}\n };\n\n _this.onEnter = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument[0],\n appearing = _this$resolveArgument[1];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, appearing ? 'appear' : 'enter', 'base');\n\n if (_this.props.onEnter) {\n _this.props.onEnter(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntering = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument2 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument2[0],\n appearing = _this$resolveArgument2[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.addClass(node, type, 'active');\n\n if (_this.props.onEntering) {\n _this.props.onEntering(maybeNode, maybeAppearing);\n }\n };\n\n _this.onEntered = function (maybeNode, maybeAppearing) {\n var _this$resolveArgument3 = _this.resolveArguments(maybeNode, maybeAppearing),\n node = _this$resolveArgument3[0],\n appearing = _this$resolveArgument3[1];\n\n var type = appearing ? 'appear' : 'enter';\n\n _this.removeClasses(node, type);\n\n _this.addClass(node, type, 'done');\n\n if (_this.props.onEntered) {\n _this.props.onEntered(maybeNode, maybeAppearing);\n }\n };\n\n _this.onExit = function (maybeNode) {\n var _this$resolveArgument4 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument4[0];\n\n _this.removeClasses(node, 'appear');\n\n _this.removeClasses(node, 'enter');\n\n _this.addClass(node, 'exit', 'base');\n\n if (_this.props.onExit) {\n _this.props.onExit(maybeNode);\n }\n };\n\n _this.onExiting = function (maybeNode) {\n var _this$resolveArgument5 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument5[0];\n\n _this.addClass(node, 'exit', 'active');\n\n if (_this.props.onExiting) {\n _this.props.onExiting(maybeNode);\n }\n };\n\n _this.onExited = function (maybeNode) {\n var _this$resolveArgument6 = _this.resolveArguments(maybeNode),\n node = _this$resolveArgument6[0];\n\n _this.removeClasses(node, 'exit');\n\n _this.addClass(node, 'exit', 'done');\n\n if (_this.props.onExited) {\n _this.props.onExited(maybeNode);\n }\n };\n\n _this.resolveArguments = function (maybeNode, maybeAppearing) {\n return _this.props.nodeRef ? [_this.props.nodeRef.current, maybeNode] // here `maybeNode` is actually `appearing`\n : [maybeNode, maybeAppearing];\n };\n\n _this.getClassNames = function (type) {\n var classNames = _this.props.classNames;\n var isStringClassNames = typeof classNames === 'string';\n var prefix = isStringClassNames && classNames ? classNames + \"-\" : '';\n var baseClassName = isStringClassNames ? \"\" + prefix + type : classNames[type];\n var activeClassName = isStringClassNames ? baseClassName + \"-active\" : classNames[type + \"Active\"];\n var doneClassName = isStringClassNames ? baseClassName + \"-done\" : classNames[type + \"Done\"];\n return {\n baseClassName: baseClassName,\n activeClassName: activeClassName,\n doneClassName: doneClassName\n };\n };\n\n return _this;\n }\n\n var _proto = CSSTransition.prototype;\n\n _proto.addClass = function addClass(node, type, phase) {\n var className = this.getClassNames(type)[phase + \"ClassName\"];\n\n var _this$getClassNames = this.getClassNames('enter'),\n doneClassName = _this$getClassNames.doneClassName;\n\n if (type === 'appear' && phase === 'done' && doneClassName) {\n className += \" \" + doneClassName;\n } // This is to force a repaint,\n // which is necessary in order to transition styles when adding a class name.\n\n\n if (phase === 'active') {\n /* eslint-disable no-unused-expressions */\n node && node.scrollTop;\n }\n\n if (className) {\n this.appliedClasses[type][phase] = className;\n\n _addClass(node, className);\n }\n };\n\n _proto.removeClasses = function removeClasses(node, type) {\n var _this$appliedClasses$ = this.appliedClasses[type],\n baseClassName = _this$appliedClasses$.base,\n activeClassName = _this$appliedClasses$.active,\n doneClassName = _this$appliedClasses$.done;\n this.appliedClasses[type] = {};\n\n if (baseClassName) {\n removeClass(node, baseClassName);\n }\n\n if (activeClassName) {\n removeClass(node, activeClassName);\n }\n\n if (doneClassName) {\n removeClass(node, doneClassName);\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n _ = _this$props.classNames,\n props = _objectWithoutPropertiesLoose(_this$props, [\"classNames\"]);\n\n return /*#__PURE__*/React.createElement(Transition, _extends({}, props, {\n onEnter: this.onEnter,\n onEntered: this.onEntered,\n onEntering: this.onEntering,\n onExit: this.onExit,\n onExiting: this.onExiting,\n onExited: this.onExited\n }));\n };\n\n return CSSTransition;\n}(React.Component);\n\nCSSTransition.defaultProps = {\n classNames: ''\n};\nCSSTransition.propTypes = process.env.NODE_ENV !== \"production\" ? _extends({}, Transition.propTypes, {\n /**\n * The animation classNames applied to the component as it appears, enters,\n * exits or has finished the transition. A single name can be provided, which\n * will be suffixed for each stage, e.g. `classNames=\"fade\"` applies:\n *\n * - `fade-appear`, `fade-appear-active`, `fade-appear-done`\n * - `fade-enter`, `fade-enter-active`, `fade-enter-done`\n * - `fade-exit`, `fade-exit-active`, `fade-exit-done`\n *\n * A few details to note about how these classes are applied:\n *\n * 1. They are _joined_ with the ones that are already defined on the child\n * component, so if you want to add some base styles, you can use\n * `className` without worrying that it will be overridden.\n *\n * 2. If the transition component mounts with `in={false}`, no classes are\n * applied yet. You might be expecting `*-exit-done`, but if you think\n * about it, a component cannot finish exiting if it hasn't entered yet.\n *\n * 2. `fade-appear-done` and `fade-enter-done` will _both_ be applied. This\n * allows you to define different behavior for when appearing is done and\n * when regular entering is done, using selectors like\n * `.fade-enter-done:not(.fade-appear-done)`. For example, you could apply\n * an epic entrance animation when element first appears in the DOM using\n * [Animate.css](https://daneden.github.io/animate.css/). Otherwise you can\n * simply use `fade-enter-done` for defining both cases.\n *\n * Each individual classNames can also be specified independently like:\n *\n * ```js\n * classNames={{\n * appear: 'my-appear',\n * appearActive: 'my-active-appear',\n * appearDone: 'my-done-appear',\n * enter: 'my-enter',\n * enterActive: 'my-active-enter',\n * enterDone: 'my-done-enter',\n * exit: 'my-exit',\n * exitActive: 'my-active-exit',\n * exitDone: 'my-done-exit',\n * }}\n * ```\n *\n * If you want to set these classes using CSS Modules:\n *\n * ```js\n * import styles from './styles.css';\n * ```\n *\n * you might want to use camelCase in your CSS file, that way could simply\n * spread them instead of listing them one by one:\n *\n * ```js\n * classNames={{ ...styles }}\n * ```\n *\n * @type {string | {\n * appear?: string,\n * appearActive?: string,\n * appearDone?: string,\n * enter?: string,\n * enterActive?: string,\n * enterDone?: string,\n * exit?: string,\n * exitActive?: string,\n * exitDone?: string,\n * }}\n */\n classNames: classNamesShape,\n\n /**\n * A `` callback fired immediately after the 'enter' or 'appear' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEnter: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter-active' or\n * 'appear-active' class is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'enter' or\n * 'appear' classes are **removed** and the `done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntered: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' class is\n * applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExit: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit-active' is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExiting: PropTypes.func,\n\n /**\n * A `` callback fired immediately after the 'exit' classes\n * are **removed** and the `exit-done` class is added to the DOM node.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement)\n */\n onExited: PropTypes.func\n}) : {};\nexport default CSSTransition;","import hasClass from './hasClass';\n/**\n * Adds a CSS class to a given element.\n * \n * @param element the element\n * @param className the CSS class name\n */\n\nexport default function addClass(element, className) {\n if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + \" \" + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + \" \" + className);\n}","/**\n * Checks if a given element has a CSS class.\n * \n * @param element the element\n * @param className the CSS class name\n */\nexport default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}"],"sourceRoot":""}