{"version":3,"file":"defaultVendors-packages_cad-core_src_cad-view_cad-loading-page_tsx-packages_cad-core_src_use--dab281.057694adb2dc1433.prod.js","mappings":"2WAEA,IAAK,EAAAA,SACD,MAAM,IAAIC,MAAM,qDAEpB,IAAK,KACD,MAAM,IAAIA,MAAM,sE,6CCLb,SAASC,EAAiBC,GAC7BA,GACJ,CCHA,IAAIC,EAA4D,oBAAzBC,0BAAuCC,EAAYD,qBCAnF,SAASE,EAAmBC,GAO/B,MANmB,CACfA,SAAUA,EACVC,SAAS,EACTC,oBAAoB,EACpBC,QAASC,KAAKC,MAAQC,EAG9B,CAOO,IAAIA,EAAwC,ICfnD,IAAIC,EAAsC,SAASC,GAC/C,IAAIC,EAAsB,mBAAXC,QAAyBA,OAAOC,SAAUC,EAAIH,GAAKD,EAAEC,GAAII,EAAI,EAC5E,GAAID,EAAG,OAAOA,EAAEE,KAAKN,GACrB,GAAIA,GAAyB,iBAAbA,EAAEO,OAAqB,MAAO,CAC1CC,KAAM,WAEF,OADIR,GAAKK,GAAKL,EAAEO,SAAQP,OAAI,GACrB,CAAES,MAAOT,GAAKA,EAAEK,KAAMK,MAAOV,EACxC,GAEJ,MAAM,IAAIW,UAAUV,EAAI,0BAA4B,kCACxD,ECPA,IAAIW,EAAK,ECCF,SAAgEvB,GACnE,IAAIwB,EAAoC,IAAIC,IACxCC,EAA6B,EAC7BC,EAAW,IAAI3B,GAAqB,SAAyB4B,GAC7D,IAAIC,EAAkBL,EAAkCM,IAAIF,GACxDC,IACAA,EAAgB1B,SAAS4B,UACzBP,EAAkCQ,OAAOJ,GAEjD,IACA,MAAO,CACHK,mBAAoB,SAAUC,EAAqB/B,EAAUgC,GACzD,IAAIP,EAAQF,IAKZ,OAJAC,EAASS,SAASD,EAAuBP,EAAOM,GAChDA,EAAoBG,QAAUnC,EAAmBC,GACjD+B,EAAoBG,QAAQC,iCAAmCV,EAC/DJ,EAAkCe,IAAIX,EAAOM,EAAoBG,SAC1DH,EAAoBG,OAC/B,E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F,GAExB,IAAIG,GADJ5rD,EAAUA,GAAW,CAAC,GACH6rD,SAAW7rD,EAAQmrD,KAAOA,KAK7C,GAHAS,EAAK,GAAe,GAAVA,EAAK,GAAY,GAC3BA,EAAK,GAAe,GAAVA,EAAK,GAAY,IAEvBD,EAAK,CACPF,EAASA,GAAU,EAEnB,IAAK,IAAI95D,EAAI,EAAGA,EAAI,KAAMA,EACxBg6D,EAAIF,EAAS95D,GAAKi6D,EAAKj6D,GAGzB,OAAOg6D,CACT,CAEA,OAAO,EAAUC,EACnB,C","sources":["webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/assertEnvironment.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/observerBatching.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/FinalizationRegistryWrapper.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/reactionCleanupTrackingCommon.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/createTimerBasedReactionCleanupTracking.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/reactionCleanupTracking.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/utils/createReactionCleanupTrackingUsingFinalizationRegister.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/observer.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/useLocalObservable.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/useAsObservableSource.js","webpack://aurora-new-frontend/./node_modules/mobx-react-lite/es/index.js","webpack://aurora-new-frontend/./node_modules/mobx/dist/mobx.esm.js","webpack://aurora-new-frontend/./packages/cad-core/src/cad-view/loading-animation.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/cad-view/cad-loading-page.tsx","webpack://aurora-new-frontend/./packages/cad-state/src/use-once-ref.ts","webpack://aurora-new-frontend/./packages/cad-state/src/use-reactive.ts","webpack://aurora-new-frontend/./packages/cad-core/src/cad-viewport/cad-page-viewports-state.tsx","webpack://aurora-new-frontend/./packages/cad-state/src/reactive-setup.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/cad-viewport/cad-viewport-action-scheduler.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/cad-viewport/constants.ts","webpack://aurora-new-frontend/./packages/cad-core/src/use-cad/cad-context.tsx","webpack://aurora-new-frontend/./packages/common/packages/cad-data-service/src/data-service.generated.tsx","webpack://aurora-new-frontend/./packages/common/packages/cad-data-service/src/data-service.ts","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/utils.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/acceleration.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/angle.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/apparentPower.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/area.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/charge.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/current.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/digital.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/each.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/energy.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/force.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/frequency.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/illuminance.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/length.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/mass.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/pace.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/partsPer.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/power.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/pressure.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/reactiveEnergy.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/reactivePower.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/speed.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/temperature.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/time.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/voltage.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/volume.js","webpack://aurora-new-frontend/./node_modules/units-converter/dist/es/units/volumeFlowRate.js","webpack://aurora-new-frontend/./packages/common/packages/numeric-conversion/src/numeric-conversion-util.ts","webpack://aurora-new-frontend/./packages/common/packages/cad-data-service/src/build-units-fns.ts","webpack://aurora-new-frontend/./packages/common/packages/module-loader/src/module-definitions/interfaces/CAD.ts","webpack://aurora-new-frontend/./packages/cad-core/src/types.ts","webpack://aurora-new-frontend/./packages/cad-core/src/use-cad/lead-capture-geodata-service.ts","webpack://aurora-new-frontend/./packages/cad-preferences/src/preference-descriptor-types.ts","webpack://aurora-new-frontend/./packages/cad-preferences/src/preference-providers.ts","webpack://aurora-new-frontend/./packages/cad-preferences/src/preference-manager.ts","webpack://aurora-new-frontend/./packages/cad-preferences/src/preference-utils.ts","webpack://aurora-new-frontend/./packages/cad-preferences/src/cad-preference-descriptors.ts","webpack://aurora-new-frontend/./packages/cad-state/src/active-tab-data/active-tab-state.tsx","webpack://aurora-new-frontend/./packages/cad-state/src/auto-designer-state/auto-designer-state.tsx","webpack://aurora-new-frontend/./packages/cad-state/src/modal-state/modal-state.tsx","webpack://aurora-new-frontend/./packages/cad-state/src/save-state/save-state.tsx","webpack://aurora-new-frontend/./packages/cad-state/src/cad-state.ts","webpack://aurora-new-frontend/./packages/cad-state/src/selected-types/selected-types-state.ts","webpack://aurora-new-frontend/./packages/cad-state/src/prism-state/prism-state.tsx","webpack://aurora-new-frontend/./packages/common/packages/data-store/src/redux/CAD/events.ts","webpack://aurora-new-frontend/./packages/common/packages/notifications/src/global-channels.ts","webpack://aurora-new-frontend/./packages/file-uploader/src/file-uploader.generated.tsx","webpack://aurora-new-frontend/./packages/file-uploader/src/hooks/use-create-bss-upload-urls.ts","webpack://aurora-new-frontend/./packages/file-uploader/src/hooks/use-upload-file-async-job.ts","webpack://aurora-new-frontend/./packages/file-uploader/src/hooks/use-upload-files.ts","webpack://aurora-new-frontend/./packages/cad-core/src/cad.generated.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/cad-save-callback/cad-save-callback.generated.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/cad-save-callback/take-save-screenshot.ts","webpack://aurora-new-frontend/./packages/cad-core/src/cad-save-callback/cad-save-callback-core.ts","webpack://aurora-new-frontend/./packages/cad-core/src/cad-save-callback/check-cad-can-save.ts","webpack://aurora-new-frontend/./packages/cad-core/src/cad-save-callback/get-cad-save-callback.ts","webpack://aurora-new-frontend/./packages/common/packages/core/src/utils/download-utils.ts","webpack://aurora-new-frontend/./packages/cad-core/src/downloads/download-dxf.ts","webpack://aurora-new-frontend/./packages/cad-core/src/downloads/asset.generated.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/downloads/download-png.ts","webpack://aurora-new-frontend/./packages/cad-core/src/webgl-check.ts","webpack://aurora-new-frontend/./packages/cad-core/src/provide-cad/event-handler.ts","webpack://aurora-new-frontend/./packages/cad-core/src/use-cad/use-cad.tsx","webpack://aurora-new-frontend/./packages/common/packages/core/src/hooks/use-evict-cache/use-evict-cache.ts","webpack://aurora-new-frontend/./packages/cad-core/src/provide-cad/cleanup-cad.ts","webpack://aurora-new-frontend/./packages/cad-core/src/use-cad/use-lead-capture-cad.generated.tsx","webpack://aurora-new-frontend/./packages/cad-core/src/use-cad/use-lead-capture-cad.ts","webpack://aurora-new-frontend/./packages/cad-state/src/framework-deep.ts","webpack://aurora-new-frontend/./packages/cad-state/src/framework.ts","webpack://aurora-new-frontend/./packages/common/packages/core/src/utils/uuid.ts","webpack://aurora-new-frontend/./packages/common/packages/shared-domain/src/use-intercept-mouse/use-intercept-mouse.tsx","webpack://aurora-new-frontend/./packages/file-uploader/src/common/types.ts","webpack://aurora-new-frontend/./packages/file-uploader/src/common/utils.ts","webpack://aurora-new-frontend/./node_modules/uuid/dist/esm-browser/rng.js","webpack://aurora-new-frontend/./node_modules/uuid/dist/esm-browser/regex.js","webpack://aurora-new-frontend/./node_modules/uuid/dist/esm-browser/validate.js","webpack://aurora-new-frontend/./node_modules/uuid/dist/esm-browser/stringify.js","webpack://aurora-new-frontend/./node_modules/uuid/dist/esm-browser/v4.js"],"sourcesContent":["import { makeObservable } from \"mobx\";\nimport { useState } from \"react\";\nif (!useState) {\n throw new Error(\"mobx-react-lite requires React with Hooks support\");\n}\nif (!makeObservable) {\n throw new Error(\"mobx-react-lite@3 requires mobx at least version 6 to be available\");\n}\n//# sourceMappingURL=assertEnvironment.js.map","import { configure } from \"mobx\";\nexport function defaultNoopBatch(callback) {\n callback();\n}\nexport function observerBatching(reactionScheduler) {\n if (!reactionScheduler) {\n reactionScheduler = defaultNoopBatch;\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\"[MobX] Failed to get unstable_batched updates from react-dom / react-native\");\n }\n }\n configure({ reactionScheduler: reactionScheduler });\n}\nexport var isObserverBatched = function () {\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\"[MobX] Deprecated\");\n }\n return true;\n};\n//# sourceMappingURL=observerBatching.js.map","var FinalizationRegistryLocal = typeof FinalizationRegistry === \"undefined\" ? undefined : FinalizationRegistry;\nexport { FinalizationRegistryLocal as FinalizationRegistry };\n//# sourceMappingURL=FinalizationRegistryWrapper.js.map","export function createTrackingData(reaction) {\n var trackingData = {\n reaction: reaction,\n mounted: false,\n changedBeforeMount: false,\n cleanAt: Date.now() + CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS\n };\n return trackingData;\n}\n/**\n * The minimum time before we'll clean up a Reaction created in a render\n * for a component that hasn't managed to run its effects. This needs to\n * be big enough to ensure that a component won't turn up and have its\n * effects run without being re-rendered.\n */\nexport var CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS = 10000;\n/**\n * The frequency with which we'll check for leaked reactions.\n */\nexport var CLEANUP_TIMER_LOOP_MILLIS = 10000;\n//# sourceMappingURL=reactionCleanupTrackingCommon.js.map","var __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nimport { CLEANUP_TIMER_LOOP_MILLIS, createTrackingData } from \"./reactionCleanupTrackingCommon\";\n/**\n * timers, gc-style, uncommitted reaction cleanup\n */\nexport function createTimerBasedReactionCleanupTracking() {\n /**\n * Reactions created by components that have yet to be fully mounted.\n */\n var uncommittedReactionRefs = new Set();\n /**\n * Latest 'uncommitted reactions' cleanup timer handle.\n */\n var reactionCleanupHandle;\n /* istanbul ignore next */\n /**\n * Only to be used by test functions; do not export outside of mobx-react-lite\n */\n function forceCleanupTimerToRunNowForTests() {\n // This allows us to control the execution of the cleanup timer\n // to force it to run at awkward times in unit tests.\n if (reactionCleanupHandle) {\n clearTimeout(reactionCleanupHandle);\n cleanUncommittedReactions();\n }\n }\n /* istanbul ignore next */\n function resetCleanupScheduleForTests() {\n var e_1, _a;\n if (uncommittedReactionRefs.size > 0) {\n try {\n for (var uncommittedReactionRefs_1 = __values(uncommittedReactionRefs), uncommittedReactionRefs_1_1 = uncommittedReactionRefs_1.next(); !uncommittedReactionRefs_1_1.done; uncommittedReactionRefs_1_1 = uncommittedReactionRefs_1.next()) {\n var ref = uncommittedReactionRefs_1_1.value;\n var tracking = ref.current;\n if (tracking) {\n tracking.reaction.dispose();\n ref.current = null;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (uncommittedReactionRefs_1_1 && !uncommittedReactionRefs_1_1.done && (_a = uncommittedReactionRefs_1.return)) _a.call(uncommittedReactionRefs_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n uncommittedReactionRefs.clear();\n }\n if (reactionCleanupHandle) {\n clearTimeout(reactionCleanupHandle);\n reactionCleanupHandle = undefined;\n }\n }\n function ensureCleanupTimerRunning() {\n if (reactionCleanupHandle === undefined) {\n reactionCleanupHandle = setTimeout(cleanUncommittedReactions, CLEANUP_TIMER_LOOP_MILLIS);\n }\n }\n function scheduleCleanupOfReactionIfLeaked(ref) {\n uncommittedReactionRefs.add(ref);\n ensureCleanupTimerRunning();\n }\n function recordReactionAsCommitted(reactionRef) {\n uncommittedReactionRefs.delete(reactionRef);\n }\n /**\n * Run by the cleanup timer to dispose any outstanding reactions\n */\n function cleanUncommittedReactions() {\n reactionCleanupHandle = undefined;\n // Loop through all the candidate leaked reactions; those older\n // than CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS get tidied.\n var now = Date.now();\n uncommittedReactionRefs.forEach(function (ref) {\n var tracking = ref.current;\n if (tracking) {\n if (now >= tracking.cleanAt) {\n // It's time to tidy up this leaked reaction.\n tracking.reaction.dispose();\n ref.current = null;\n uncommittedReactionRefs.delete(ref);\n }\n }\n });\n if (uncommittedReactionRefs.size > 0) {\n // We've just finished a round of cleanups but there are still\n // some leak candidates outstanding.\n ensureCleanupTimerRunning();\n }\n }\n return {\n addReactionToTrack: function (reactionTrackingRef, reaction, \n /**\n * On timer based implementation we don't really need this object,\n * but we keep the same api\n */\n objectRetainedByReact) {\n reactionTrackingRef.current = createTrackingData(reaction);\n scheduleCleanupOfReactionIfLeaked(reactionTrackingRef);\n return reactionTrackingRef.current;\n },\n recordReactionAsCommitted: recordReactionAsCommitted,\n forceCleanupTimerToRunNowForTests: forceCleanupTimerToRunNowForTests,\n resetCleanupScheduleForTests: resetCleanupScheduleForTests\n };\n}\n//# sourceMappingURL=createTimerBasedReactionCleanupTracking.js.map","import { FinalizationRegistry as FinalizationRegistryMaybeUndefined } from \"./FinalizationRegistryWrapper\";\nimport { createReactionCleanupTrackingUsingFinalizationRegister } from \"./createReactionCleanupTrackingUsingFinalizationRegister\";\nimport { createTimerBasedReactionCleanupTracking } from \"./createTimerBasedReactionCleanupTracking\";\nvar _a = FinalizationRegistryMaybeUndefined\n ? createReactionCleanupTrackingUsingFinalizationRegister(FinalizationRegistryMaybeUndefined)\n : createTimerBasedReactionCleanupTracking(), addReactionToTrack = _a.addReactionToTrack, recordReactionAsCommitted = _a.recordReactionAsCommitted, resetCleanupScheduleForTests = _a.resetCleanupScheduleForTests, forceCleanupTimerToRunNowForTests = _a.forceCleanupTimerToRunNowForTests;\nexport { addReactionToTrack, recordReactionAsCommitted, resetCleanupScheduleForTests, forceCleanupTimerToRunNowForTests };\n//# sourceMappingURL=reactionCleanupTracking.js.map","import { createTrackingData } from \"./reactionCleanupTrackingCommon\";\n/**\n * FinalizationRegistry-based uncommitted reaction cleanup\n */\nexport function createReactionCleanupTrackingUsingFinalizationRegister(FinalizationRegistry) {\n var cleanupTokenToReactionTrackingMap = new Map();\n var globalCleanupTokensCounter = 1;\n var registry = new FinalizationRegistry(function cleanupFunction(token) {\n var trackedReaction = cleanupTokenToReactionTrackingMap.get(token);\n if (trackedReaction) {\n trackedReaction.reaction.dispose();\n cleanupTokenToReactionTrackingMap.delete(token);\n }\n });\n return {\n addReactionToTrack: function (reactionTrackingRef, reaction, objectRetainedByReact) {\n var token = globalCleanupTokensCounter++;\n registry.register(objectRetainedByReact, token, reactionTrackingRef);\n reactionTrackingRef.current = createTrackingData(reaction);\n reactionTrackingRef.current.finalizationRegistryCleanupToken = token;\n cleanupTokenToReactionTrackingMap.set(token, reactionTrackingRef.current);\n return reactionTrackingRef.current;\n },\n recordReactionAsCommitted: function (reactionRef) {\n registry.unregister(reactionRef);\n if (reactionRef.current && reactionRef.current.finalizationRegistryCleanupToken) {\n cleanupTokenToReactionTrackingMap.delete(reactionRef.current.finalizationRegistryCleanupToken);\n }\n },\n forceCleanupTimerToRunNowForTests: function () {\n // When FinalizationRegistry in use, this this is no-op\n },\n resetCleanupScheduleForTests: function () {\n // When FinalizationRegistry in use, this this is no-op\n }\n };\n}\n//# sourceMappingURL=createReactionCleanupTrackingUsingFinalizationRegister.js.map","import { forwardRef, memo } from \"react\";\nimport { isUsingStaticRendering } from \"./staticRendering\";\nimport { useObserver } from \"./useObserver\";\nvar warnObserverOptionsDeprecated = true;\nvar hasSymbol = typeof Symbol === \"function\" && Symbol.for;\n// Using react-is had some issues (and operates on elements, not on types), see #608 / #609\nvar ReactForwardRefSymbol = hasSymbol\n ? Symbol.for(\"react.forward_ref\")\n : typeof forwardRef === \"function\" && forwardRef(function (props) { return null; })[\"$$typeof\"];\nvar ReactMemoSymbol = hasSymbol\n ? Symbol.for(\"react.memo\")\n : typeof memo === \"function\" && memo(function (props) { return null; })[\"$$typeof\"];\n// n.b. base case is not used for actual typings or exported in the typing files\nexport function observer(baseComponent, \n// TODO remove in next major\noptions) {\n var _a;\n if (process.env.NODE_ENV !== \"production\" && warnObserverOptionsDeprecated && options) {\n warnObserverOptionsDeprecated = false;\n console.warn(\"[mobx-react-lite] `observer(fn, { forwardRef: true })` is deprecated, use `observer(React.forwardRef(fn))`\");\n }\n if (ReactMemoSymbol && baseComponent[\"$$typeof\"] === ReactMemoSymbol) {\n throw new Error(\"[mobx-react-lite] You are trying to use `observer` on a function component wrapped in either another `observer` or `React.memo`. The observer already applies 'React.memo' for you.\");\n }\n // The working of observer is explained step by step in this talk: https://www.youtube.com/watch?v=cPF4iBedoF0&feature=youtu.be&t=1307\n if (isUsingStaticRendering()) {\n return baseComponent;\n }\n var useForwardRef = (_a = options === null || options === void 0 ? void 0 : options.forwardRef) !== null && _a !== void 0 ? _a : false;\n var render = baseComponent;\n var baseComponentName = baseComponent.displayName || baseComponent.name;\n // If already wrapped with forwardRef, unwrap,\n // so we can patch render and apply memo\n if (ReactForwardRefSymbol && baseComponent[\"$$typeof\"] === ReactForwardRefSymbol) {\n useForwardRef = true;\n render = baseComponent[\"render\"];\n if (typeof render !== \"function\") {\n throw new Error(\"[mobx-react-lite] `render` property of ForwardRef was not a function\");\n }\n }\n var observerComponent = function (props, ref) {\n return useObserver(function () { return render(props, ref); }, baseComponentName);\n };\n // Don't set `displayName` for anonymous components,\n // so the `displayName` can be customized by user, see #3192.\n if (baseComponentName !== \"\") {\n ;\n observerComponent.displayName = baseComponentName;\n }\n // Support legacy context: `contextTypes` must be applied before `memo`\n if (baseComponent.contextTypes) {\n ;\n observerComponent.contextTypes = baseComponent.contextTypes;\n }\n if (useForwardRef) {\n // `forwardRef` must be applied prior `memo`\n // `forwardRef(observer(cmp))` throws:\n // \"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))\"\n observerComponent = forwardRef(observerComponent);\n }\n // memo; we are not interested in deep updates\n // in props; we assume that if deep objects are changed,\n // this is in observables, which would have been tracked anyway\n observerComponent = memo(observerComponent);\n copyStaticProperties(baseComponent, observerComponent);\n if (\"production\" !== process.env.NODE_ENV) {\n Object.defineProperty(observerComponent, \"contextTypes\", {\n set: function () {\n var _a;\n throw new Error(\"[mobx-react-lite] `\".concat(this.displayName || ((_a = this.type) === null || _a === void 0 ? void 0 : _a.displayName) || \"Component\", \".contextTypes` must be set before applying `observer`.\"));\n }\n });\n }\n return observerComponent;\n}\n// based on https://github.com/mridgway/hoist-non-react-statics/blob/master/src/index.js\nvar hoistBlackList = {\n $$typeof: true,\n render: true,\n compare: true,\n type: true,\n // Don't redefine `displayName`,\n // it's defined as getter-setter pair on `memo` (see #3192).\n displayName: true\n};\nfunction copyStaticProperties(base, target) {\n Object.keys(base).forEach(function (key) {\n if (!hoistBlackList[key]) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(base, key));\n }\n });\n}\n//# sourceMappingURL=observer.js.map","import { observable } from \"mobx\";\nimport { useState } from \"react\";\nexport function useLocalObservable(initializer, annotations) {\n return useState(function () { return observable(initializer(), annotations, { autoBind: true }); })[0];\n}\n//# sourceMappingURL=useLocalObservable.js.map","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { useDeprecated } from \"./utils/utils\";\nimport { observable, runInAction } from \"mobx\";\nimport { useState } from \"react\";\nexport function useAsObservableSource(current) {\n if (\"production\" !== process.env.NODE_ENV)\n useDeprecated(\"[mobx-react-lite] 'useAsObservableSource' is deprecated, please store the values directly in an observable, for example by using 'useLocalObservable', and sync future updates using 'useEffect' when needed. See the README for examples.\");\n var _a = __read(useState(function () { return observable(current, {}, { deep: false }); }), 1), res = _a[0];\n runInAction(function () {\n Object.assign(res, current);\n });\n return res;\n}\n//# sourceMappingURL=useAsObservableSource.js.map","import \"./utils/assertEnvironment\";\nimport { unstable_batchedUpdates as batch } from \"./utils/reactBatchedUpdates\";\nimport { observerBatching } from \"./utils/observerBatching\";\nimport { useDeprecated } from \"./utils/utils\";\nimport { useObserver as useObserverOriginal } from \"./useObserver\";\nimport { enableStaticRendering } from \"./staticRendering\";\nobserverBatching(batch);\nexport { isUsingStaticRendering, enableStaticRendering } from \"./staticRendering\";\nexport { observer } from \"./observer\";\nexport { Observer } from \"./ObserverComponent\";\nexport { useLocalObservable } from \"./useLocalObservable\";\nexport { useLocalStore } from \"./useLocalStore\";\nexport { useAsObservableSource } from \"./useAsObservableSource\";\nexport { resetCleanupScheduleForTests as clearTimers } from \"./utils/reactionCleanupTracking\";\nexport function useObserver(fn, baseComponentName) {\n if (baseComponentName === void 0) { baseComponentName = \"observed\"; }\n if (\"production\" !== process.env.NODE_ENV) {\n useDeprecated(\"[mobx-react-lite] 'useObserver(fn)' is deprecated. Use `{fn}` instead, or wrap the entire component in `observer`.\");\n }\n return useObserverOriginal(fn, baseComponentName);\n}\nexport { isObserverBatched, observerBatching } from \"./utils/observerBatching\";\nexport function useStaticRendering(enable) {\n if (\"production\" !== process.env.NODE_ENV) {\n console.warn(\"[mobx-react-lite] 'useStaticRendering' is deprecated, use 'enableStaticRendering' instead\");\n }\n enableStaticRendering(enable);\n}\n//# sourceMappingURL=index.js.map","var niceErrors = {\n 0: \"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'\",\n 1: function _(annotationType, key) {\n return \"Cannot apply '\" + annotationType + \"' to '\" + key.toString() + \"': Field not found.\";\n },\n\n /*\r\n 2(prop) {\r\n return `invalid decorator for '${prop.toString()}'`\r\n },\r\n 3(prop) {\r\n return `Cannot decorate '${prop.toString()}': action can only be used on properties with a function value.`\r\n },\r\n 4(prop) {\r\n return `Cannot decorate '${prop.toString()}': computed can only be used on getter properties.`\r\n },\r\n */\n 5: \"'keys()' can only be used on observable objects, arrays, sets and maps\",\n 6: \"'values()' can only be used on observable objects, arrays, sets and maps\",\n 7: \"'entries()' can only be used on observable objects, arrays and maps\",\n 8: \"'set()' can only be used on observable objects, arrays and maps\",\n 9: \"'remove()' can only be used on observable objects, arrays and maps\",\n 10: \"'has()' can only be used on observable objects, arrays and maps\",\n 11: \"'get()' can only be used on observable objects, arrays and maps\",\n 12: \"Invalid annotation\",\n 13: \"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 14: \"Intercept handlers should return nothing or a change object\",\n 15: \"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)\",\n 16: \"Modification exception: the internal structure of an observable array was changed.\",\n 17: function _(index, length) {\n return \"[mobx.array] Index out of bounds, \" + index + \" is larger than \" + length;\n },\n 18: \"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js\",\n 19: function _(other) {\n return \"Cannot initialize from classes that inherit from Map: \" + other.constructor.name;\n },\n 20: function _(other) {\n return \"Cannot initialize map from \" + other;\n },\n 21: function _(dataStructure) {\n return \"Cannot convert to map from '\" + dataStructure + \"'\";\n },\n 22: \"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js\",\n 23: \"It is not possible to get index atoms from arrays\",\n 24: function _(thing) {\n return \"Cannot obtain administration from \" + thing;\n },\n 25: function _(property, name) {\n return \"the entry '\" + property + \"' does not exist in the observable map '\" + name + \"'\";\n },\n 26: \"please specify a property\",\n 27: function _(property, name) {\n return \"no observable property '\" + property.toString() + \"' found on the observable object '\" + name + \"'\";\n },\n 28: function _(thing) {\n return \"Cannot obtain atom from \" + thing;\n },\n 29: \"Expecting some object\",\n 30: \"invalid action stack. did you forget to finish an action?\",\n 31: \"missing option for computed: get\",\n 32: function _(name, derivation) {\n return \"Cycle detected in computation \" + name + \": \" + derivation;\n },\n 33: function _(name) {\n return \"The setter of computed value '\" + name + \"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?\";\n },\n 34: function _(name) {\n return \"[ComputedValue '\" + name + \"'] It is not possible to assign a new value to a computed value.\";\n },\n 35: \"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`\",\n 36: \"isolateGlobalState should be called before MobX is running any reactions\",\n 37: function _(method) {\n return \"[mobx] `observableArray.\" + method + \"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice().\" + method + \"()` instead\";\n },\n 38: \"'ownKeys()' can only be used on observable objects\",\n 39: \"'defineProperty()' can only be used on observable objects\"\n};\nvar errors = process.env.NODE_ENV !== \"production\" ? niceErrors : {};\nfunction die(error) {\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 if (process.env.NODE_ENV !== \"production\") {\n var e = typeof error === \"string\" ? error : errors[error];\n if (typeof e === \"function\") e = e.apply(null, args);\n throw new Error(\"[MobX] \" + e);\n }\n\n throw new Error(typeof error === \"number\" ? \"[MobX] minified error nr: \" + error + (args.length ? \" \" + args.map(String).join(\",\") : \"\") + \". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts\" : \"[MobX] \" + error);\n}\n\nvar mockGlobal = {};\nfunction getGlobal() {\n if (typeof globalThis !== \"undefined\") {\n return globalThis;\n }\n\n if (typeof window !== \"undefined\") {\n return window;\n }\n\n if (typeof global !== \"undefined\") {\n return global;\n }\n\n if (typeof self !== \"undefined\") {\n return self;\n }\n\n return mockGlobal;\n}\n\nvar assign = Object.assign;\nvar getDescriptor = Object.getOwnPropertyDescriptor;\nvar defineProperty = Object.defineProperty;\nvar objectPrototype = Object.prototype;\nvar EMPTY_ARRAY = [];\nObject.freeze(EMPTY_ARRAY);\nvar EMPTY_OBJECT = {};\nObject.freeze(EMPTY_OBJECT);\nvar hasProxy = typeof Proxy !== \"undefined\";\nvar plainObjectString = /*#__PURE__*/Object.toString();\nfunction assertProxies() {\n if (!hasProxy) {\n die(process.env.NODE_ENV !== \"production\" ? \"`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`\" : \"Proxy not available\");\n }\n}\nfunction warnAboutProxyRequirement(msg) {\n if (process.env.NODE_ENV !== \"production\" && globalState.verifyProxies) {\n die(\"MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to \" + msg);\n }\n}\nfunction getNextId() {\n return ++globalState.mobxGuid;\n}\n/**\r\n * Makes sure that the provided function is invoked at most once.\r\n */\n\nfunction once(func) {\n var invoked = false;\n return function () {\n if (invoked) {\n return;\n }\n\n invoked = true;\n return func.apply(this, arguments);\n };\n}\nvar noop = function noop() {};\nfunction isFunction(fn) {\n return typeof fn === \"function\";\n}\nfunction isStringish(value) {\n var t = typeof value;\n\n switch (t) {\n case \"string\":\n case \"symbol\":\n case \"number\":\n return true;\n }\n\n return false;\n}\nfunction isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nfunction isPlainObject(value) {\n if (!isObject(value)) {\n return false;\n }\n\n var proto = Object.getPrototypeOf(value);\n\n if (proto == null) {\n return true;\n }\n\n var protoConstructor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n return typeof protoConstructor === \"function\" && protoConstructor.toString() === plainObjectString;\n} // https://stackoverflow.com/a/37865170\n\nfunction isGenerator(obj) {\n var constructor = obj == null ? void 0 : obj.constructor;\n\n if (!constructor) {\n return false;\n }\n\n if (\"GeneratorFunction\" === constructor.name || \"GeneratorFunction\" === constructor.displayName) {\n return true;\n }\n\n return false;\n}\nfunction addHiddenProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: true,\n configurable: true,\n value: value\n });\n}\nfunction addHiddenFinalProp(object, propName, value) {\n defineProperty(object, propName, {\n enumerable: false,\n writable: false,\n configurable: true,\n value: value\n });\n}\nfunction createInstanceofPredicate(name, theClass) {\n var propName = \"isMobX\" + name;\n theClass.prototype[propName] = true;\n return function (x) {\n return isObject(x) && x[propName] === true;\n };\n}\nfunction isES6Map(thing) {\n return thing instanceof Map;\n}\nfunction isES6Set(thing) {\n return thing instanceof Set;\n}\nvar hasGetOwnPropertySymbols = typeof Object.getOwnPropertySymbols !== \"undefined\";\n/**\r\n * Returns the following: own enumerable keys and symbols.\r\n */\n\nfunction getPlainObjectKeys(object) {\n var keys = Object.keys(object); // Not supported in IE, so there are not going to be symbol props anyway...\n\n if (!hasGetOwnPropertySymbols) {\n return keys;\n }\n\n var symbols = Object.getOwnPropertySymbols(object);\n\n if (!symbols.length) {\n return keys;\n }\n\n return [].concat(keys, symbols.filter(function (s) {\n return objectPrototype.propertyIsEnumerable.call(object, s);\n }));\n} // From Immer utils\n// Returns all own keys, including non-enumerable and symbolic\n\nvar ownKeys = typeof Reflect !== \"undefined\" && Reflect.ownKeys ? Reflect.ownKeys : hasGetOwnPropertySymbols ? function (obj) {\n return Object.getOwnPropertyNames(obj).concat(Object.getOwnPropertySymbols(obj));\n} :\n/* istanbul ignore next */\nObject.getOwnPropertyNames;\nfunction stringifyKey(key) {\n if (typeof key === \"string\") {\n return key;\n }\n\n if (typeof key === \"symbol\") {\n return key.toString();\n }\n\n return new String(key).toString();\n}\nfunction toPrimitive(value) {\n return value === null ? null : typeof value === \"object\" ? \"\" + value : value;\n}\nfunction hasProp(target, prop) {\n return objectPrototype.hasOwnProperty.call(target, prop);\n} // From Immer utils\n\nvar getOwnPropertyDescriptors = Object.getOwnPropertyDescriptors || function getOwnPropertyDescriptors(target) {\n // Polyfill needed for Hermes and IE, see https://github.com/facebook/hermes/issues/274\n var res = {}; // Note: without polyfill for ownKeys, symbols won't be picked up\n\n ownKeys(target).forEach(function (key) {\n res[key] = getDescriptor(target, key);\n });\n return res;\n};\n\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\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 _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _createForOfIteratorHelperLoose(o, allowArrayLike) {\n var it = typeof Symbol !== \"undefined\" && o[Symbol.iterator] || o[\"@@iterator\"];\n if (it) return (it = it.call(o)).next.bind(it);\n\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n return function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nvar storedAnnotationsSymbol = /*#__PURE__*/Symbol(\"mobx-stored-annotations\");\n/**\r\n * Creates a function that acts as\r\n * - decorator\r\n * - annotation object\r\n */\n\nfunction createDecoratorAnnotation(annotation) {\n function decorator(target, property) {\n storeAnnotation(target, property, annotation);\n }\n\n return Object.assign(decorator, annotation);\n}\n/**\r\n * Stores annotation to prototype,\r\n * so it can be inspected later by `makeObservable` called from constructor\r\n */\n\nfunction storeAnnotation(prototype, key, annotation) {\n if (!hasProp(prototype, storedAnnotationsSymbol)) {\n addHiddenProp(prototype, storedAnnotationsSymbol, _extends({}, prototype[storedAnnotationsSymbol]));\n } // @override must override something\n\n\n if (process.env.NODE_ENV !== \"production\" && isOverride(annotation) && !hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n die(\"'\" + fieldName + \"' is decorated with 'override', \" + \"but no such decorated member was found on prototype.\");\n } // Cannot re-decorate\n\n\n assertNotDecorated(prototype, annotation, key); // Ignore override\n\n if (!isOverride(annotation)) {\n prototype[storedAnnotationsSymbol][key] = annotation;\n }\n}\n\nfunction assertNotDecorated(prototype, annotation, key) {\n if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(prototype[storedAnnotationsSymbol], key)) {\n var fieldName = prototype.constructor.name + \".prototype.\" + key.toString();\n var currentAnnotationType = prototype[storedAnnotationsSymbol][key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '@\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already decorated with '@\" + currentAnnotationType + \"'.\") + \"\\nRe-decorating fields is not allowed.\" + \"\\nUse '@override' decorator for methods overridden by subclass.\");\n }\n}\n/**\r\n * Collects annotations from prototypes and stores them on target (instance)\r\n */\n\n\nfunction collectStoredAnnotations(target) {\n if (!hasProp(target, storedAnnotationsSymbol)) {\n if (process.env.NODE_ENV !== \"production\" && !target[storedAnnotationsSymbol]) {\n die(\"No annotations were passed to makeObservable, but no decorated members have been found either\");\n } // We need a copy as we will remove annotation from the list once it's applied.\n\n\n addHiddenProp(target, storedAnnotationsSymbol, _extends({}, target[storedAnnotationsSymbol]));\n }\n\n return target[storedAnnotationsSymbol];\n}\n\nvar $mobx = /*#__PURE__*/Symbol(\"mobx administration\");\nvar Atom = /*#__PURE__*/function () {\n // for effective unobserving. BaseAtom has true, for extra optimization, so its onBecomeUnobserved never gets called, because it's not needed\n\n /**\r\n * Create a new atom. For debugging purposes it is recommended to give it a name.\r\n * The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management.\r\n */\n function Atom(name_) {\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"Atom@\" + getNextId() : \"Atom\";\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.NOT_TRACKING_;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n this.name_ = name_;\n } // onBecomeObservedListeners\n\n\n var _proto = Atom.prototype;\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Invoke this method to notify mobx that your atom has been used somehow.\r\n * Returns true if there is currently a reactive context.\r\n */\n ;\n\n _proto.reportObserved = function reportObserved$1() {\n return reportObserved(this);\n }\n /**\r\n * Invoke this method _after_ this method has changed to signal mobx that all its observers should invalidate.\r\n */\n ;\n\n _proto.reportChanged = function reportChanged() {\n startBatch();\n propagateChanged(this);\n endBatch();\n };\n\n _proto.toString = function toString() {\n return this.name_;\n };\n\n return Atom;\n}();\nvar isAtom = /*#__PURE__*/createInstanceofPredicate(\"Atom\", Atom);\nfunction createAtom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {\n if (onBecomeObservedHandler === void 0) {\n onBecomeObservedHandler = noop;\n }\n\n if (onBecomeUnobservedHandler === void 0) {\n onBecomeUnobservedHandler = noop;\n }\n\n var atom = new Atom(name); // default `noop` listener will not initialize the hook Set\n\n if (onBecomeObservedHandler !== noop) {\n onBecomeObserved(atom, onBecomeObservedHandler);\n }\n\n if (onBecomeUnobservedHandler !== noop) {\n onBecomeUnobserved(atom, onBecomeUnobservedHandler);\n }\n\n return atom;\n}\n\nfunction identityComparer(a, b) {\n return a === b;\n}\n\nfunction structuralComparer(a, b) {\n return deepEqual(a, b);\n}\n\nfunction shallowComparer(a, b) {\n return deepEqual(a, b, 1);\n}\n\nfunction defaultComparer(a, b) {\n if (Object.is) {\n return Object.is(a, b);\n }\n\n return a === b ? a !== 0 || 1 / a === 1 / b : a !== a && b !== b;\n}\n\nvar comparer = {\n identity: identityComparer,\n structural: structuralComparer,\n \"default\": defaultComparer,\n shallow: shallowComparer\n};\n\nfunction deepEnhancer(v, _, name) {\n // it is an observable already, done\n if (isObservable(v)) {\n return v;\n } // something that can be converted and mutated?\n\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name\n });\n }\n\n if (typeof v === \"function\" && !isAction(v) && !isFlow(v)) {\n if (isGenerator(v)) {\n return flow(v);\n } else {\n return autoAction(name, v);\n }\n }\n\n return v;\n}\nfunction shallowEnhancer(v, _, name) {\n if (v === undefined || v === null) {\n return v;\n }\n\n if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v) || isObservableSet(v)) {\n return v;\n }\n\n if (Array.isArray(v)) {\n return observable.array(v, {\n name: name,\n deep: false\n });\n }\n\n if (isPlainObject(v)) {\n return observable.object(v, undefined, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Map(v)) {\n return observable.map(v, {\n name: name,\n deep: false\n });\n }\n\n if (isES6Set(v)) {\n return observable.set(v, {\n name: name,\n deep: false\n });\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n die(\"The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets\");\n }\n}\nfunction referenceEnhancer(newValue) {\n // never turn into an observable\n return newValue;\n}\nfunction refStructEnhancer(v, oldValue) {\n if (process.env.NODE_ENV !== \"production\" && isObservable(v)) {\n die(\"observable.struct should not be used with observable values\");\n }\n\n if (deepEqual(v, oldValue)) {\n return oldValue;\n }\n\n return v;\n}\n\nvar OVERRIDE = \"override\";\nvar override = /*#__PURE__*/createDecoratorAnnotation({\n annotationType_: OVERRIDE,\n make_: make_,\n extend_: extend_\n});\nfunction isOverride(annotation) {\n return annotation.annotationType_ === OVERRIDE;\n}\n\nfunction make_(adm, key) {\n // Must not be plain object\n if (process.env.NODE_ENV !== \"production\" && adm.isPlainObject_) {\n die(\"Cannot apply '\" + this.annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + this.annotationType_ + \"' cannot be used on plain objects.\"));\n } // Must override something\n\n\n if (process.env.NODE_ENV !== \"production\" && !hasProp(adm.appliedAnnotations_, key)) {\n die(\"'\" + adm.name_ + \".\" + key.toString() + \"' is annotated with '\" + this.annotationType_ + \"', \" + \"but no such annotated member was found on prototype.\");\n }\n\n return 0\n /* Cancel */\n ;\n}\n\nfunction extend_(adm, key, descriptor, proxyTrap) {\n die(\"'\" + this.annotationType_ + \"' can only be used with 'makeObservable'\");\n}\n\nfunction createActionAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$1,\n extend_: extend_$1\n };\n}\n\nfunction make_$1(adm, key, descriptor, source) {\n var _this$options_;\n\n // bound\n if ((_this$options_ = this.options_) != null && _this$options_.bound) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n } // own\n\n\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n\n\n if (isAction(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor, false);\n defineProperty(source, key, actionDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$1(adm, key, descriptor, proxyTrap) {\n var actionDescriptor = createActionDescriptor(adm, this, key, descriptor);\n return adm.defineProperty_(key, actionDescriptor, proxyTrap);\n}\n\nfunction assertActionDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a function value.\"));\n }\n}\n\nfunction createActionDescriptor(adm, annotation, key, descriptor, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n var _annotation$options_, _annotation$options_$, _annotation$options_2, _annotation$options_$2, _annotation$options_3, _annotation$options_4, _adm$proxy_2;\n\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertActionDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value;\n\n if ((_annotation$options_ = annotation.options_) != null && _annotation$options_.bound) {\n var _adm$proxy_;\n\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return {\n value: createAction((_annotation$options_$ = (_annotation$options_2 = annotation.options_) == null ? void 0 : _annotation$options_2.name) != null ? _annotation$options_$ : key.toString(), value, (_annotation$options_$2 = (_annotation$options_3 = annotation.options_) == null ? void 0 : _annotation$options_3.autoAction) != null ? _annotation$options_$2 : false, // https://github.com/mobxjs/mobx/discussions/3140\n (_annotation$options_4 = annotation.options_) != null && _annotation$options_4.bound ? (_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_ : undefined),\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createFlowAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$2,\n extend_: extend_$2\n };\n}\n\nfunction make_$2(adm, key, descriptor, source) {\n var _this$options_;\n\n // own\n if (source === adm.target_) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // prototype\n // bound - must annotate protos to support super.flow()\n\n\n if ((_this$options_ = this.options_) != null && _this$options_.bound && (!hasProp(adm.target_, key) || !isFlow(adm.target_[key]))) {\n if (this.extend_(adm, key, descriptor, false) === null) {\n return 0\n /* Cancel */\n ;\n }\n }\n\n if (isFlow(descriptor.value)) {\n // A prototype could have been annotated already by other constructor,\n // rest of the proto chain must be annotated already\n return 1\n /* Break */\n ;\n }\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, false, false);\n defineProperty(source, key, flowDescriptor);\n return 2\n /* Continue */\n ;\n}\n\nfunction extend_$2(adm, key, descriptor, proxyTrap) {\n var _this$options_2;\n\n var flowDescriptor = createFlowDescriptor(adm, this, key, descriptor, (_this$options_2 = this.options_) == null ? void 0 : _this$options_2.bound);\n return adm.defineProperty_(key, flowDescriptor, proxyTrap);\n}\n\nfunction assertFlowDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var value = _ref2.value;\n\n if (process.env.NODE_ENV !== \"production\" && !isFunction(value)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on properties with a generator function value.\"));\n }\n}\n\nfunction createFlowDescriptor(adm, annotation, key, descriptor, bound, // provides ability to disable safeDescriptors for prototypes\nsafeDescriptors) {\n if (safeDescriptors === void 0) {\n safeDescriptors = globalState.safeDescriptors;\n }\n\n assertFlowDescriptor(adm, annotation, key, descriptor);\n var value = descriptor.value; // In case of flow.bound, the descriptor can be from already annotated prototype\n\n if (!isFlow(value)) {\n value = flow(value);\n }\n\n if (bound) {\n var _adm$proxy_;\n\n // We do not keep original function around, so we bind the existing flow\n value = value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_); // This is normally set by `flow`, but `bind` returns new function...\n\n value.isMobXFlow = true;\n }\n\n return {\n value: value,\n // Non-configurable for classes\n // prevents accidental field redefinition in subclass\n configurable: safeDescriptors ? adm.isPlainObject_ : true,\n // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058\n enumerable: false,\n // Non-obsevable, therefore non-writable\n // Also prevents rewriting in subclass constructor\n writable: safeDescriptors ? false : true\n };\n}\n\nfunction createComputedAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$3,\n extend_: extend_$3\n };\n}\n\nfunction make_$3(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$3(adm, key, descriptor, proxyTrap) {\n assertComputedDescriptor(adm, this, key, descriptor);\n return adm.defineComputedProperty_(key, _extends({}, this.options_, {\n get: descriptor.get,\n set: descriptor.set\n }), proxyTrap);\n}\n\nfunction assertComputedDescriptor(adm, _ref, key, _ref2) {\n var annotationType_ = _ref.annotationType_;\n var get = _ref2.get;\n\n if (process.env.NODE_ENV !== \"production\" && !get) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' can only be used on getter(+setter) properties.\"));\n }\n}\n\nfunction createObservableAnnotation(name, options) {\n return {\n annotationType_: name,\n options_: options,\n make_: make_$4,\n extend_: extend_$4\n };\n}\n\nfunction make_$4(adm, key, descriptor) {\n return this.extend_(adm, key, descriptor, false) === null ? 0\n /* Cancel */\n : 1\n /* Break */\n ;\n}\n\nfunction extend_$4(adm, key, descriptor, proxyTrap) {\n var _this$options_$enhanc, _this$options_;\n\n assertObservableDescriptor(adm, this, key, descriptor);\n return adm.defineObservableProperty_(key, descriptor.value, (_this$options_$enhanc = (_this$options_ = this.options_) == null ? void 0 : _this$options_.enhancer) != null ? _this$options_$enhanc : deepEnhancer, proxyTrap);\n}\n\nfunction assertObservableDescriptor(adm, _ref, key, descriptor) {\n var annotationType_ = _ref.annotationType_;\n\n if (process.env.NODE_ENV !== \"production\" && !(\"value\" in descriptor)) {\n die(\"Cannot apply '\" + annotationType_ + \"' to '\" + adm.name_ + \".\" + key.toString() + \"':\" + (\"\\n'\" + annotationType_ + \"' cannot be used on getter/setter properties\"));\n }\n}\n\nvar AUTO = \"true\";\nvar autoAnnotation = /*#__PURE__*/createAutoAnnotation();\nfunction createAutoAnnotation(options) {\n return {\n annotationType_: AUTO,\n options_: options,\n make_: make_$5,\n extend_: extend_$5\n };\n}\n\nfunction make_$5(adm, key, descriptor, source) {\n var _this$options_3, _this$options_4;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.make_(adm, key, descriptor, source);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.make_\n var set = createAction(key.toString(), descriptor.set); // own\n\n if (source === adm.target_) {\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: set\n }) === null ? 0\n /* Cancel */\n : 2\n /* Continue */\n ;\n } // proto\n\n\n defineProperty(source, key, {\n configurable: true,\n set: set\n });\n return 2\n /* Continue */\n ;\n } // function on proto -> autoAction/flow\n\n\n if (source !== adm.target_ && typeof descriptor.value === \"function\") {\n var _this$options_2;\n\n if (isGenerator(descriptor.value)) {\n var _this$options_;\n\n var flowAnnotation = (_this$options_ = this.options_) != null && _this$options_.autoBind ? flow.bound : flow;\n return flowAnnotation.make_(adm, key, descriptor, source);\n }\n\n var actionAnnotation = (_this$options_2 = this.options_) != null && _this$options_2.autoBind ? autoAction.bound : autoAction;\n return actionAnnotation.make_(adm, key, descriptor, source);\n } // other -> observable\n // Copy props from proto as well, see test:\n // \"decorate should work with Object.create\"\n\n\n var observableAnnotation = ((_this$options_3 = this.options_) == null ? void 0 : _this$options_3.deep) === false ? observable.ref : observable; // if function respect autoBind option\n\n if (typeof descriptor.value === \"function\" && (_this$options_4 = this.options_) != null && _this$options_4.autoBind) {\n var _adm$proxy_;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_ = adm.proxy_) != null ? _adm$proxy_ : adm.target_);\n }\n\n return observableAnnotation.make_(adm, key, descriptor, source);\n}\n\nfunction extend_$5(adm, key, descriptor, proxyTrap) {\n var _this$options_5, _this$options_6;\n\n // getter -> computed\n if (descriptor.get) {\n return computed.extend_(adm, key, descriptor, proxyTrap);\n } // lone setter -> action setter\n\n\n if (descriptor.set) {\n // TODO make action applicable to setter and delegate to action.extend_\n return adm.defineProperty_(key, {\n configurable: globalState.safeDescriptors ? adm.isPlainObject_ : true,\n set: createAction(key.toString(), descriptor.set)\n }, proxyTrap);\n } // other -> observable\n // if function respect autoBind option\n\n\n if (typeof descriptor.value === \"function\" && (_this$options_5 = this.options_) != null && _this$options_5.autoBind) {\n var _adm$proxy_2;\n\n descriptor.value = descriptor.value.bind((_adm$proxy_2 = adm.proxy_) != null ? _adm$proxy_2 : adm.target_);\n }\n\n var observableAnnotation = ((_this$options_6 = this.options_) == null ? void 0 : _this$options_6.deep) === false ? observable.ref : observable;\n return observableAnnotation.extend_(adm, key, descriptor, proxyTrap);\n}\n\nvar OBSERVABLE = \"observable\";\nvar OBSERVABLE_REF = \"observable.ref\";\nvar OBSERVABLE_SHALLOW = \"observable.shallow\";\nvar OBSERVABLE_STRUCT = \"observable.struct\"; // Predefined bags of create observable options, to avoid allocating temporarily option objects\n// in the majority of cases\n\nvar defaultCreateObservableOptions = {\n deep: true,\n name: undefined,\n defaultDecorator: undefined,\n proxy: true\n};\nObject.freeze(defaultCreateObservableOptions);\nfunction asCreateObservableOptions(thing) {\n return thing || defaultCreateObservableOptions;\n}\nvar observableAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE);\nvar observableRefAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_REF, {\n enhancer: referenceEnhancer\n});\nvar observableShallowAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_SHALLOW, {\n enhancer: shallowEnhancer\n});\nvar observableStructAnnotation = /*#__PURE__*/createObservableAnnotation(OBSERVABLE_STRUCT, {\n enhancer: refStructEnhancer\n});\nvar observableDecoratorAnnotation = /*#__PURE__*/createDecoratorAnnotation(observableAnnotation);\nfunction getEnhancerFromOptions(options) {\n return options.deep === true ? deepEnhancer : options.deep === false ? referenceEnhancer : getEnhancerFromAnnotation(options.defaultDecorator);\n}\nfunction getAnnotationFromOptions(options) {\n var _options$defaultDecor;\n\n return options ? (_options$defaultDecor = options.defaultDecorator) != null ? _options$defaultDecor : createAutoAnnotation(options) : undefined;\n}\nfunction getEnhancerFromAnnotation(annotation) {\n var _annotation$options_$, _annotation$options_;\n\n return !annotation ? deepEnhancer : (_annotation$options_$ = (_annotation$options_ = annotation.options_) == null ? void 0 : _annotation$options_.enhancer) != null ? _annotation$options_$ : deepEnhancer;\n}\n/**\r\n * Turns an object, array or function into a reactive structure.\r\n * @param v the value which should become observable.\r\n */\n\nfunction createObservable(v, arg2, arg3) {\n // @observable someProp;\n if (isStringish(arg2)) {\n storeAnnotation(v, arg2, observableAnnotation);\n return;\n } // already observable - ignore\n\n\n if (isObservable(v)) {\n return v;\n } // plain object\n\n\n if (isPlainObject(v)) {\n return observable.object(v, arg2, arg3);\n } // Array\n\n\n if (Array.isArray(v)) {\n return observable.array(v, arg2);\n } // Map\n\n\n if (isES6Map(v)) {\n return observable.map(v, arg2);\n } // Set\n\n\n if (isES6Set(v)) {\n return observable.set(v, arg2);\n } // other object - ignore\n\n\n if (typeof v === \"object\" && v !== null) {\n return v;\n } // anything else\n\n\n return observable.box(v, arg2);\n}\n\nObject.assign(createObservable, observableDecoratorAnnotation);\nvar observableFactories = {\n box: function box(value, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableValue(value, getEnhancerFromOptions(o), o.name, true, o.equals);\n },\n array: function array(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return (globalState.useProxies === false || o.proxy === false ? createLegacyArray : createObservableArray)(initialValues, getEnhancerFromOptions(o), o.name);\n },\n map: function map(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableMap(initialValues, getEnhancerFromOptions(o), o.name);\n },\n set: function set(initialValues, options) {\n var o = asCreateObservableOptions(options);\n return new ObservableSet(initialValues, getEnhancerFromOptions(o), o.name);\n },\n object: function object(props, decorators, options) {\n return extendObservable(globalState.useProxies === false || (options == null ? void 0 : options.proxy) === false ? asObservableObject({}, options) : asDynamicObservableObject({}, options), props, decorators);\n },\n ref: /*#__PURE__*/createDecoratorAnnotation(observableRefAnnotation),\n shallow: /*#__PURE__*/createDecoratorAnnotation(observableShallowAnnotation),\n deep: observableDecoratorAnnotation,\n struct: /*#__PURE__*/createDecoratorAnnotation(observableStructAnnotation)\n}; // eslint-disable-next-line\n\nvar observable = /*#__PURE__*/assign(createObservable, observableFactories);\n\nvar COMPUTED = \"computed\";\nvar COMPUTED_STRUCT = \"computed.struct\";\nvar computedAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED);\nvar computedStructAnnotation = /*#__PURE__*/createComputedAnnotation(COMPUTED_STRUCT, {\n equals: comparer.structural\n});\n/**\r\n * Decorator for class properties: @computed get value() { return expr; }.\r\n * For legacy purposes also invokable as ES5 observable created: `computed(() => expr)`;\r\n */\n\nvar computed = function computed(arg1, arg2) {\n if (isStringish(arg2)) {\n // @computed\n return storeAnnotation(arg1, arg2, computedAnnotation);\n }\n\n if (isPlainObject(arg1)) {\n // @computed({ options })\n return createDecoratorAnnotation(createComputedAnnotation(COMPUTED, arg1));\n } // computed(expr, options?)\n\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(arg1)) {\n die(\"First argument to `computed` should be an expression.\");\n }\n\n if (isFunction(arg2)) {\n die(\"A setter as second argument is no longer supported, use `{ set: fn }` option instead\");\n }\n }\n\n var opts = isPlainObject(arg2) ? arg2 : {};\n opts.get = arg1;\n opts.name || (opts.name = arg1.name || \"\");\n /* for generated name */\n\n return new ComputedValue(opts);\n};\nObject.assign(computed, computedAnnotation);\ncomputed.struct = /*#__PURE__*/createDecoratorAnnotation(computedStructAnnotation);\n\nvar _getDescriptor$config, _getDescriptor;\n// mobx versions\n\nvar currentActionId = 0;\nvar nextActionId = 1;\nvar isFunctionNameConfigurable = (_getDescriptor$config = (_getDescriptor = /*#__PURE__*/getDescriptor(function () {}, \"name\")) == null ? void 0 : _getDescriptor.configurable) != null ? _getDescriptor$config : false; // we can safely recycle this object\n\nvar tmpNameDescriptor = {\n value: \"action\",\n configurable: true,\n writable: false,\n enumerable: false\n};\nfunction createAction(actionName, fn, autoAction, ref) {\n if (autoAction === void 0) {\n autoAction = false;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(fn)) {\n die(\"`action` can only be invoked on functions\");\n }\n\n if (typeof actionName !== \"string\" || !actionName) {\n die(\"actions should have valid names, got: '\" + actionName + \"'\");\n }\n }\n\n function res() {\n return executeAction(actionName, autoAction, fn, ref || this, arguments);\n }\n\n res.isMobxAction = true;\n\n if (isFunctionNameConfigurable) {\n tmpNameDescriptor.value = actionName;\n Object.defineProperty(res, \"name\", tmpNameDescriptor);\n }\n\n return res;\n}\nfunction executeAction(actionName, canRunAsDerivation, fn, scope, args) {\n var runInfo = _startAction(actionName, canRunAsDerivation, scope, args);\n\n try {\n return fn.apply(scope, args);\n } catch (err) {\n runInfo.error_ = err;\n throw err;\n } finally {\n _endAction(runInfo);\n }\n}\nfunction _startAction(actionName, canRunAsDerivation, // true for autoAction\nscope, args) {\n var notifySpy_ = process.env.NODE_ENV !== \"production\" && isSpyEnabled() && !!actionName;\n var startTime_ = 0;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy_) {\n startTime_ = Date.now();\n var flattenedArgs = args ? Array.from(args) : EMPTY_ARRAY;\n spyReportStart({\n type: ACTION,\n name: actionName,\n object: scope,\n arguments: flattenedArgs\n });\n }\n\n var prevDerivation_ = globalState.trackingDerivation;\n var runAsAction = !canRunAsDerivation || !prevDerivation_;\n startBatch();\n var prevAllowStateChanges_ = globalState.allowStateChanges; // by default preserve previous allow\n\n if (runAsAction) {\n untrackedStart();\n prevAllowStateChanges_ = allowStateChangesStart(true);\n }\n\n var prevAllowStateReads_ = allowStateReadsStart(true);\n var runInfo = {\n runAsAction_: runAsAction,\n prevDerivation_: prevDerivation_,\n prevAllowStateChanges_: prevAllowStateChanges_,\n prevAllowStateReads_: prevAllowStateReads_,\n notifySpy_: notifySpy_,\n startTime_: startTime_,\n actionId_: nextActionId++,\n parentActionId_: currentActionId\n };\n currentActionId = runInfo.actionId_;\n return runInfo;\n}\nfunction _endAction(runInfo) {\n if (currentActionId !== runInfo.actionId_) {\n die(30);\n }\n\n currentActionId = runInfo.parentActionId_;\n\n if (runInfo.error_ !== undefined) {\n globalState.suppressReactionErrors = true;\n }\n\n allowStateChangesEnd(runInfo.prevAllowStateChanges_);\n allowStateReadsEnd(runInfo.prevAllowStateReads_);\n endBatch();\n\n if (runInfo.runAsAction_) {\n untrackedEnd(runInfo.prevDerivation_);\n }\n\n if (process.env.NODE_ENV !== \"production\" && runInfo.notifySpy_) {\n spyReportEnd({\n time: Date.now() - runInfo.startTime_\n });\n }\n\n globalState.suppressReactionErrors = false;\n}\nfunction allowStateChanges(allowStateChanges, func) {\n var prev = allowStateChangesStart(allowStateChanges);\n\n try {\n return func();\n } finally {\n allowStateChangesEnd(prev);\n }\n}\nfunction allowStateChangesStart(allowStateChanges) {\n var prev = globalState.allowStateChanges;\n globalState.allowStateChanges = allowStateChanges;\n return prev;\n}\nfunction allowStateChangesEnd(prev) {\n globalState.allowStateChanges = prev;\n}\n\nvar _Symbol$toPrimitive;\nvar CREATE = \"create\";\n_Symbol$toPrimitive = Symbol.toPrimitive;\nvar ObservableValue = /*#__PURE__*/function (_Atom) {\n _inheritsLoose(ObservableValue, _Atom);\n\n function ObservableValue(value, enhancer, name_, notifySpy, equals) {\n var _this;\n\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableValue@\" + getNextId() : \"ObservableValue\";\n }\n\n if (notifySpy === void 0) {\n notifySpy = true;\n }\n\n if (equals === void 0) {\n equals = comparer[\"default\"];\n }\n\n _this = _Atom.call(this, name_) || this;\n _this.enhancer = void 0;\n _this.name_ = void 0;\n _this.equals = void 0;\n _this.hasUnreportedChange_ = false;\n _this.interceptors_ = void 0;\n _this.changeListeners_ = void 0;\n _this.value_ = void 0;\n _this.dehancer = void 0;\n _this.enhancer = enhancer;\n _this.name_ = name_;\n _this.equals = equals;\n _this.value_ = enhancer(value, undefined, name_);\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy && isSpyEnabled()) {\n // only notify spy if this is a stand-alone observable\n spyReport({\n type: CREATE,\n object: _assertThisInitialized(_this),\n observableKind: \"value\",\n debugObjectName: _this.name_,\n newValue: \"\" + _this.value_\n });\n }\n\n return _this;\n }\n\n var _proto = ObservableValue.prototype;\n\n _proto.dehanceValue = function dehanceValue(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.set = function set(newValue) {\n var oldValue = this.value_;\n newValue = this.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart({\n type: UPDATE,\n object: this,\n observableKind: \"value\",\n debugObjectName: this.name_,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n\n this.setNewValue_(newValue);\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.prepareNewValue_ = function prepareNewValue_(newValue) {\n checkIfStateModificationsAreAllowed(this);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this,\n type: UPDATE,\n newValue: newValue\n });\n\n if (!change) {\n return globalState.UNCHANGED;\n }\n\n newValue = change.newValue;\n } // apply modifier\n\n\n newValue = this.enhancer(newValue, this.value_, this.name_);\n return this.equals(this.value_, newValue) ? globalState.UNCHANGED : newValue;\n };\n\n _proto.setNewValue_ = function setNewValue_(newValue) {\n var oldValue = this.value_;\n this.value_ = newValue;\n this.reportChanged();\n\n if (hasListeners(this)) {\n notifyListeners(this, {\n type: UPDATE,\n object: this,\n newValue: newValue,\n oldValue: oldValue\n });\n }\n };\n\n _proto.get = function get() {\n this.reportObserved();\n return this.dehanceValue(this.value_);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately) {\n listener({\n observableKind: \"value\",\n debugObjectName: this.name_,\n object: this,\n type: UPDATE,\n newValue: this.value_,\n oldValue: undefined\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.raw = function raw() {\n // used by MST ot get undehanced value\n return this.value_;\n };\n\n _proto.toJSON = function toJSON() {\n return this.get();\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.value_ + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive] = function () {\n return this.valueOf();\n };\n\n return ObservableValue;\n}(Atom);\nvar isObservableValue = /*#__PURE__*/createInstanceofPredicate(\"ObservableValue\", ObservableValue);\n\nvar _Symbol$toPrimitive$1;\n/**\r\n * A node in the state dependency root that observes other nodes, and can be observed itself.\r\n *\r\n * ComputedValue will remember the result of the computation for the duration of the batch, or\r\n * while being observed.\r\n *\r\n * During this time it will recompute only when one of its direct dependencies changed,\r\n * but only when it is being accessed with `ComputedValue.get()`.\r\n *\r\n * Implementation description:\r\n * 1. First time it's being accessed it will compute and remember result\r\n * give back remembered result until 2. happens\r\n * 2. First time any deep dependency change, propagate POSSIBLY_STALE to all observers, wait for 3.\r\n * 3. When it's being accessed, recompute if any shallow dependency changed.\r\n * if result changed: propagate STALE to all observers, that were POSSIBLY_STALE from the last step.\r\n * go to step 2. either way\r\n *\r\n * If at any point it's outside batch and it isn't observed: reset everything and go to 1.\r\n */\n\n_Symbol$toPrimitive$1 = Symbol.toPrimitive;\nvar ComputedValue = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n // during tracking it's an array with new observed observers\n // to check for cycles\n // N.B: unminified as it is used by MST\n\n /**\r\n * Create a new computed value based on a function expression.\r\n *\r\n * The `name` property is for debug purposes only.\r\n *\r\n * The `equals` property specifies the comparer function to use to determine if a newly produced\r\n * value differs from the previous value. Two comparers are provided in the library; `defaultComparer`\r\n * compares based on identity comparison (===), and `structuralComparer` deeply compares the structure.\r\n * Structural comparison can be convenient if you always produce a new aggregated object and\r\n * don't want to notify observers if it is structurally the same.\r\n * This is useful for working with vectors, mouse coordinates etc.\r\n */\n function ComputedValue(options) {\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.observing_ = [];\n this.newObserving_ = null;\n this.isBeingObserved_ = false;\n this.isPendingUnobservation_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.lastAccessedBy_ = 0;\n this.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n this.unboundDepsCount_ = 0;\n this.value_ = new CaughtException(null);\n this.name_ = void 0;\n this.triggeredBy_ = void 0;\n this.isComputing_ = false;\n this.isRunningSetter_ = false;\n this.derivation = void 0;\n this.setter_ = void 0;\n this.isTracing_ = TraceMode.NONE;\n this.scope_ = void 0;\n this.equals_ = void 0;\n this.requiresReaction_ = void 0;\n this.keepAlive_ = void 0;\n this.onBOL = void 0;\n this.onBUOL = void 0;\n\n if (!options.get) {\n die(31);\n }\n\n this.derivation = options.get;\n this.name_ = options.name || (process.env.NODE_ENV !== \"production\" ? \"ComputedValue@\" + getNextId() : \"ComputedValue\");\n\n if (options.set) {\n this.setter_ = createAction(process.env.NODE_ENV !== \"production\" ? this.name_ + \"-setter\" : \"ComputedValue-setter\", options.set);\n }\n\n this.equals_ = options.equals || (options.compareStructural || options.struct ? comparer.structural : comparer[\"default\"]);\n this.scope_ = options.context;\n this.requiresReaction_ = options.requiresReaction;\n this.keepAlive_ = !!options.keepAlive;\n }\n\n var _proto = ComputedValue.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n propagateMaybeChanged(this);\n };\n\n _proto.onBO = function onBO() {\n if (this.onBOL) {\n this.onBOL.forEach(function (listener) {\n return listener();\n });\n }\n };\n\n _proto.onBUO = function onBUO() {\n if (this.onBUOL) {\n this.onBUOL.forEach(function (listener) {\n return listener();\n });\n }\n }\n /**\r\n * Returns the current value of this computed value.\r\n * Will evaluate its computation first if needed.\r\n */\n ;\n\n _proto.get = function get() {\n if (this.isComputing_) {\n die(32, this.name_, this.derivation);\n }\n\n if (globalState.inBatch === 0 && // !globalState.trackingDerivatpion &&\n this.observers_.size === 0 && !this.keepAlive_) {\n if (shouldCompute(this)) {\n this.warnAboutUntrackedRead_();\n startBatch(); // See perf test 'computed memoization'\n\n this.value_ = this.computeValue_(false);\n endBatch();\n }\n } else {\n reportObserved(this);\n\n if (shouldCompute(this)) {\n var prevTrackingContext = globalState.trackingContext;\n\n if (this.keepAlive_ && !prevTrackingContext) {\n globalState.trackingContext = this;\n }\n\n if (this.trackAndCompute()) {\n propagateChangeConfirmed(this);\n }\n\n globalState.trackingContext = prevTrackingContext;\n }\n }\n\n var result = this.value_;\n\n if (isCaughtException(result)) {\n throw result.cause;\n }\n\n return result;\n };\n\n _proto.set = function set(value) {\n if (this.setter_) {\n if (this.isRunningSetter_) {\n die(33, this.name_);\n }\n\n this.isRunningSetter_ = true;\n\n try {\n this.setter_.call(this.scope_, value);\n } finally {\n this.isRunningSetter_ = false;\n }\n } else {\n die(34, this.name_);\n }\n };\n\n _proto.trackAndCompute = function trackAndCompute() {\n // N.B: unminified as it is used by MST\n var oldValue = this.value_;\n var wasSuspended =\n /* see #1208 */\n this.dependenciesState_ === IDerivationState_.NOT_TRACKING_;\n var newValue = this.computeValue_(true);\n var changed = wasSuspended || isCaughtException(oldValue) || isCaughtException(newValue) || !this.equals_(oldValue, newValue);\n\n if (changed) {\n this.value_ = newValue;\n\n if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n spyReport({\n observableKind: \"computed\",\n debugObjectName: this.name_,\n object: this.scope_,\n type: \"update\",\n oldValue: oldValue,\n newValue: newValue\n });\n }\n }\n\n return changed;\n };\n\n _proto.computeValue_ = function computeValue_(track) {\n this.isComputing_ = true; // don't allow state changes during computation\n\n var prev = allowStateChangesStart(false);\n var res;\n\n if (track) {\n res = trackDerivedFunction(this, this.derivation, this.scope_);\n } else {\n if (globalState.disableErrorBoundaries === true) {\n res = this.derivation.call(this.scope_);\n } else {\n try {\n res = this.derivation.call(this.scope_);\n } catch (e) {\n res = new CaughtException(e);\n }\n }\n }\n\n allowStateChangesEnd(prev);\n this.isComputing_ = false;\n return res;\n };\n\n _proto.suspend_ = function suspend_() {\n if (!this.keepAlive_) {\n clearObserving(this);\n this.value_ = undefined; // don't hold on to computed value!\n\n if (process.env.NODE_ENV !== \"production\" && this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' was suspended and it will recompute on the next access.\");\n }\n }\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n var _this = this;\n\n var firstTime = true;\n var prevValue = undefined;\n return autorun(function () {\n // TODO: why is this in a different place than the spyReport() function? in all other observables it's called in the same place\n var newValue = _this.get();\n\n if (!firstTime || fireImmediately) {\n var prevU = untrackedStart();\n listener({\n observableKind: \"computed\",\n debugObjectName: _this.name_,\n type: UPDATE,\n object: _this,\n newValue: newValue,\n oldValue: prevValue\n });\n untrackedEnd(prevU);\n }\n\n firstTime = false;\n prevValue = newValue;\n });\n };\n\n _proto.warnAboutUntrackedRead_ = function warnAboutUntrackedRead_() {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n\n if (this.isTracing_ !== TraceMode.NONE) {\n console.log(\"[mobx.trace] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n\n if (typeof this.requiresReaction_ === \"boolean\" ? this.requiresReaction_ : globalState.computedRequiresReaction) {\n console.warn(\"[mobx] Computed value '\" + this.name_ + \"' is being read outside a reactive context. Doing a full recompute.\");\n }\n };\n\n _proto.toString = function toString() {\n return this.name_ + \"[\" + this.derivation.toString() + \"]\";\n };\n\n _proto.valueOf = function valueOf() {\n return toPrimitive(this.get());\n };\n\n _proto[_Symbol$toPrimitive$1] = function () {\n return this.valueOf();\n };\n\n return ComputedValue;\n}();\nvar isComputedValue = /*#__PURE__*/createInstanceofPredicate(\"ComputedValue\", ComputedValue);\n\nvar IDerivationState_;\n\n(function (IDerivationState_) {\n // before being run or (outside batch and not being observed)\n // at this point derivation is not holding any data about dependency tree\n IDerivationState_[IDerivationState_[\"NOT_TRACKING_\"] = -1] = \"NOT_TRACKING_\"; // no shallow dependency changed since last computation\n // won't recalculate derivation\n // this is what makes mobx fast\n\n IDerivationState_[IDerivationState_[\"UP_TO_DATE_\"] = 0] = \"UP_TO_DATE_\"; // some deep dependency changed, but don't know if shallow dependency changed\n // will require to check first if UP_TO_DATE or POSSIBLY_STALE\n // currently only ComputedValue will propagate POSSIBLY_STALE\n //\n // having this state is second big optimization:\n // don't have to recompute on every dependency change, but only when it's needed\n\n IDerivationState_[IDerivationState_[\"POSSIBLY_STALE_\"] = 1] = \"POSSIBLY_STALE_\"; // A shallow dependency has changed since last computation and the derivation\n // will need to recompute when it's needed next.\n\n IDerivationState_[IDerivationState_[\"STALE_\"] = 2] = \"STALE_\";\n})(IDerivationState_ || (IDerivationState_ = {}));\n\nvar TraceMode;\n\n(function (TraceMode) {\n TraceMode[TraceMode[\"NONE\"] = 0] = \"NONE\";\n TraceMode[TraceMode[\"LOG\"] = 1] = \"LOG\";\n TraceMode[TraceMode[\"BREAK\"] = 2] = \"BREAK\";\n})(TraceMode || (TraceMode = {}));\n\nvar CaughtException = function CaughtException(cause) {\n this.cause = void 0;\n this.cause = cause; // Empty\n};\nfunction isCaughtException(e) {\n return e instanceof CaughtException;\n}\n/**\r\n * Finds out whether any dependency of the derivation has actually changed.\r\n * If dependenciesState is 1 then it will recalculate dependencies,\r\n * if any dependency changed it will propagate it by changing dependenciesState to 2.\r\n *\r\n * By iterating over the dependencies in the same order that they were reported and\r\n * stopping on the first change, all the recalculations are only called for ComputedValues\r\n * that will be tracked by derivation. That is because we assume that if the first x\r\n * dependencies of the derivation doesn't change then the derivation should run the same way\r\n * up until accessing x-th dependency.\r\n */\n\nfunction shouldCompute(derivation) {\n switch (derivation.dependenciesState_) {\n case IDerivationState_.UP_TO_DATE_:\n return false;\n\n case IDerivationState_.NOT_TRACKING_:\n case IDerivationState_.STALE_:\n return true;\n\n case IDerivationState_.POSSIBLY_STALE_:\n {\n // state propagation can occur outside of action/reactive context #2195\n var prevAllowStateReads = allowStateReadsStart(true);\n var prevUntracked = untrackedStart(); // no need for those computeds to be reported, they will be picked up in trackDerivedFunction.\n\n var obs = derivation.observing_,\n l = obs.length;\n\n for (var i = 0; i < l; i++) {\n var obj = obs[i];\n\n if (isComputedValue(obj)) {\n if (globalState.disableErrorBoundaries) {\n obj.get();\n } else {\n try {\n obj.get();\n } catch (e) {\n // we are not interested in the value *or* exception at this moment, but if there is one, notify all\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n } // if ComputedValue `obj` actually changed it will be computed and propagated to its observers.\n // and `derivation` is an observer of `obj`\n // invariantShouldCompute(derivation)\n\n\n if (derivation.dependenciesState_ === IDerivationState_.STALE_) {\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return true;\n }\n }\n }\n\n changeDependenciesStateTo0(derivation);\n untrackedEnd(prevUntracked);\n allowStateReadsEnd(prevAllowStateReads);\n return false;\n }\n }\n}\nfunction isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}\nfunction checkIfStateModificationsAreAllowed(atom) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n\n var hasObservers = atom.observers_.size > 0; // Should not be possible to change observed state outside strict mode, except during initialization, see #563\n\n if (!globalState.allowStateChanges && (hasObservers || globalState.enforceActions === \"always\")) {\n console.warn(\"[MobX] \" + (globalState.enforceActions ? \"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: \" : \"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: \") + atom.name_);\n }\n}\nfunction checkIfStateReadsAreAllowed(observable) {\n if (process.env.NODE_ENV !== \"production\" && !globalState.allowStateReads && globalState.observableRequiresReaction) {\n console.warn(\"[mobx] Observable '\" + observable.name_ + \"' being read outside a reactive context.\");\n }\n}\n/**\r\n * Executes the provided function `f` and tracks which observables are being accessed.\r\n * The tracking information is stored on the `derivation` object and the derivation is registered\r\n * as observer of any of the accessed observables.\r\n */\n\nfunction trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true); // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n\n changeDependenciesStateTo0(derivation);\n derivation.newObserving_ = new Array(derivation.observing_.length + 100);\n derivation.unboundDepsCount_ = 0;\n derivation.runId_ = ++globalState.runId;\n var prevTracking = globalState.trackingDerivation;\n globalState.trackingDerivation = derivation;\n globalState.inBatch++;\n var result;\n\n if (globalState.disableErrorBoundaries === true) {\n result = f.call(context);\n } else {\n try {\n result = f.call(context);\n } catch (e) {\n result = new CaughtException(e);\n }\n }\n\n globalState.inBatch--;\n globalState.trackingDerivation = prevTracking;\n bindDependencies(derivation);\n warnAboutDerivationWithoutDependencies(derivation);\n allowStateReadsEnd(prevAllowStateReads);\n return result;\n}\n\nfunction warnAboutDerivationWithoutDependencies(derivation) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n\n if (derivation.observing_.length !== 0) {\n return;\n }\n\n if (typeof derivation.requiresObservable_ === \"boolean\" ? derivation.requiresObservable_ : globalState.reactionRequiresObservable) {\n console.warn(\"[mobx] Derivation '\" + derivation.name_ + \"' is created/updated without reading any observable value.\");\n }\n}\n/**\r\n * diffs newObserving with observing.\r\n * update observing to be newObserving with unique observables\r\n * notify observers that become observed/unobserved\r\n */\n\n\nfunction bindDependencies(derivation) {\n // invariant(derivation.dependenciesState !== IDerivationState.NOT_TRACKING, \"INTERNAL ERROR bindDependencies expects derivation.dependenciesState !== -1\");\n var prevObserving = derivation.observing_;\n var observing = derivation.observing_ = derivation.newObserving_;\n var lowestNewObservingDerivationState = IDerivationState_.UP_TO_DATE_; // Go through all new observables and check diffValue: (this list can contain duplicates):\n // 0: first occurrence, change to 1 and keep it\n // 1: extra occurrence, drop it\n\n var i0 = 0,\n l = derivation.unboundDepsCount_;\n\n for (var i = 0; i < l; i++) {\n var dep = observing[i];\n\n if (dep.diffValue_ === 0) {\n dep.diffValue_ = 1;\n\n if (i0 !== i) {\n observing[i0] = dep;\n }\n\n i0++;\n } // Upcast is 'safe' here, because if dep is IObservable, `dependenciesState` will be undefined,\n // not hitting the condition\n\n\n if (dep.dependenciesState_ > lowestNewObservingDerivationState) {\n lowestNewObservingDerivationState = dep.dependenciesState_;\n }\n }\n\n observing.length = i0;\n derivation.newObserving_ = null; // newObserving shouldn't be needed outside tracking (statement moved down to work around FF bug, see #614)\n // Go through all old observables and check diffValue: (it is unique after last bindDependencies)\n // 0: it's not in new observables, unobserve it\n // 1: it keeps being observed, don't want to notify it. change to 0\n\n l = prevObserving.length;\n\n while (l--) {\n var _dep = prevObserving[l];\n\n if (_dep.diffValue_ === 0) {\n removeObserver(_dep, derivation);\n }\n\n _dep.diffValue_ = 0;\n } // Go through all new observables and check diffValue: (now it should be unique)\n // 0: it was set to 0 in last loop. don't need to do anything.\n // 1: it wasn't observed, let's observe it. set back to 0\n\n\n while (i0--) {\n var _dep2 = observing[i0];\n\n if (_dep2.diffValue_ === 1) {\n _dep2.diffValue_ = 0;\n addObserver(_dep2, derivation);\n }\n } // Some new observed derivations may become stale during this derivation computation\n // so they have had no chance to propagate staleness (#916)\n\n\n if (lowestNewObservingDerivationState !== IDerivationState_.UP_TO_DATE_) {\n derivation.dependenciesState_ = lowestNewObservingDerivationState;\n derivation.onBecomeStale_();\n }\n}\n\nfunction clearObserving(derivation) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR clearObserving should be called only inside batch\");\n var obs = derivation.observing_;\n derivation.observing_ = [];\n var i = obs.length;\n\n while (i--) {\n removeObserver(obs[i], derivation);\n }\n\n derivation.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n}\nfunction untracked(action) {\n var prev = untrackedStart();\n\n try {\n return action();\n } finally {\n untrackedEnd(prev);\n }\n}\nfunction untrackedStart() {\n var prev = globalState.trackingDerivation;\n globalState.trackingDerivation = null;\n return prev;\n}\nfunction untrackedEnd(prev) {\n globalState.trackingDerivation = prev;\n}\nfunction allowStateReadsStart(allowStateReads) {\n var prev = globalState.allowStateReads;\n globalState.allowStateReads = allowStateReads;\n return prev;\n}\nfunction allowStateReadsEnd(prev) {\n globalState.allowStateReads = prev;\n}\n/**\r\n * needed to keep `lowestObserverState` correct. when changing from (2 or 1) to 0\r\n *\r\n */\n\nfunction changeDependenciesStateTo0(derivation) {\n if (derivation.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n derivation.dependenciesState_ = IDerivationState_.UP_TO_DATE_;\n var obs = derivation.observing_;\n var i = obs.length;\n\n while (i--) {\n obs[i].lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n}\n\n/**\r\n * These values will persist if global state is reset\r\n */\n\nvar persistentKeys = [\"mobxGuid\", \"spyListeners\", \"enforceActions\", \"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"allowStateReads\", \"disableErrorBoundaries\", \"runId\", \"UNCHANGED\", \"useProxies\"];\nvar MobXGlobals = function MobXGlobals() {\n this.version = 6;\n this.UNCHANGED = {};\n this.trackingDerivation = null;\n this.trackingContext = null;\n this.runId = 0;\n this.mobxGuid = 0;\n this.inBatch = 0;\n this.pendingUnobservations = [];\n this.pendingReactions = [];\n this.isRunningReactions = false;\n this.allowStateChanges = false;\n this.allowStateReads = true;\n this.enforceActions = true;\n this.spyListeners = [];\n this.globalReactionErrorHandlers = [];\n this.computedRequiresReaction = false;\n this.reactionRequiresObservable = false;\n this.observableRequiresReaction = false;\n this.disableErrorBoundaries = false;\n this.suppressReactionErrors = false;\n this.useProxies = true;\n this.verifyProxies = false;\n this.safeDescriptors = true;\n};\nvar canMergeGlobalState = true;\nvar isolateCalled = false;\nvar globalState = /*#__PURE__*/function () {\n var global = /*#__PURE__*/getGlobal();\n\n if (global.__mobxInstanceCount > 0 && !global.__mobxGlobals) {\n canMergeGlobalState = false;\n }\n\n if (global.__mobxGlobals && global.__mobxGlobals.version !== new MobXGlobals().version) {\n canMergeGlobalState = false;\n }\n\n if (!canMergeGlobalState) {\n // Because this is a IIFE we need to let isolateCalled a chance to change\n // so we run it after the event loop completed at least 1 iteration\n setTimeout(function () {\n if (!isolateCalled) {\n die(35);\n }\n }, 1);\n return new MobXGlobals();\n } else if (global.__mobxGlobals) {\n global.__mobxInstanceCount += 1;\n\n if (!global.__mobxGlobals.UNCHANGED) {\n global.__mobxGlobals.UNCHANGED = {};\n } // make merge backward compatible\n\n\n return global.__mobxGlobals;\n } else {\n global.__mobxInstanceCount = 1;\n return global.__mobxGlobals = /*#__PURE__*/new MobXGlobals();\n }\n}();\nfunction isolateGlobalState() {\n if (globalState.pendingReactions.length || globalState.inBatch || globalState.isRunningReactions) {\n die(36);\n }\n\n isolateCalled = true;\n\n if (canMergeGlobalState) {\n var global = getGlobal();\n\n if (--global.__mobxInstanceCount === 0) {\n global.__mobxGlobals = undefined;\n }\n\n globalState = new MobXGlobals();\n }\n}\nfunction getGlobalState() {\n return globalState;\n}\n/**\r\n * For testing purposes only; this will break the internal state of existing observables,\r\n * but can be used to get back at a stable state after throwing errors\r\n */\n\nfunction resetGlobalState() {\n var defaultGlobals = new MobXGlobals();\n\n for (var key in defaultGlobals) {\n if (persistentKeys.indexOf(key) === -1) {\n globalState[key] = defaultGlobals[key];\n }\n }\n\n globalState.allowStateChanges = !globalState.enforceActions;\n}\n\nfunction hasObservers(observable) {\n return observable.observers_ && observable.observers_.size > 0;\n}\nfunction getObservers(observable) {\n return observable.observers_;\n} // function invariantObservers(observable: IObservable) {\n// const list = observable.observers\n// const map = observable.observersIndexes\n// const l = list.length\n// for (let i = 0; i < l; i++) {\n// const id = list[i].__mapid\n// if (i) {\n// invariant(map[id] === i, \"INTERNAL ERROR maps derivation.__mapid to index in list\") // for performance\n// } else {\n// invariant(!(id in map), \"INTERNAL ERROR observer on index 0 shouldn't be held in map.\") // for performance\n// }\n// }\n// invariant(\n// list.length === 0 || Object.keys(map).length === list.length - 1,\n// \"INTERNAL ERROR there is no junk in map\"\n// )\n// }\n\nfunction addObserver(observable, node) {\n // invariant(node.dependenciesState !== -1, \"INTERNAL ERROR, can add only dependenciesState !== -1\");\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR add already added node\");\n // invariantObservers(observable);\n observable.observers_.add(node);\n\n if (observable.lowestObserverState_ > node.dependenciesState_) {\n observable.lowestObserverState_ = node.dependenciesState_;\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR didn't add node\");\n\n}\nfunction removeObserver(observable, node) {\n // invariant(globalState.inBatch > 0, \"INTERNAL ERROR, remove should be called only inside batch\");\n // invariant(observable._observers.indexOf(node) !== -1, \"INTERNAL ERROR remove already removed node\");\n // invariantObservers(observable);\n observable.observers_[\"delete\"](node);\n\n if (observable.observers_.size === 0) {\n // deleting last observer\n queueForUnobservation(observable);\n } // invariantObservers(observable);\n // invariant(observable._observers.indexOf(node) === -1, \"INTERNAL ERROR remove already removed node2\");\n\n}\nfunction queueForUnobservation(observable) {\n if (observable.isPendingUnobservation_ === false) {\n // invariant(observable._observers.length === 0, \"INTERNAL ERROR, should only queue for unobservation unobserved observables\");\n observable.isPendingUnobservation_ = true;\n globalState.pendingUnobservations.push(observable);\n }\n}\n/**\r\n * Batch starts a transaction, at least for purposes of memoizing ComputedValues when nothing else does.\r\n * During a batch `onBecomeUnobserved` will be called at most once per observable.\r\n * Avoids unnecessary recalculations.\r\n */\n\nfunction startBatch() {\n globalState.inBatch++;\n}\nfunction endBatch() {\n if (--globalState.inBatch === 0) {\n runReactions(); // the batch is actually about to finish, all unobserving should happen here.\n\n var list = globalState.pendingUnobservations;\n\n for (var i = 0; i < list.length; i++) {\n var observable = list[i];\n observable.isPendingUnobservation_ = false;\n\n if (observable.observers_.size === 0) {\n if (observable.isBeingObserved_) {\n // if this observable had reactive observers, trigger the hooks\n observable.isBeingObserved_ = false;\n observable.onBUO();\n }\n\n if (observable instanceof ComputedValue) {\n // computed values are automatically teared down when the last observer leaves\n // this process happens recursively, this computed might be the last observabe of another, etc..\n observable.suspend_();\n }\n }\n }\n\n globalState.pendingUnobservations = [];\n }\n}\nfunction reportObserved(observable) {\n checkIfStateReadsAreAllowed(observable);\n var derivation = globalState.trackingDerivation;\n\n if (derivation !== null) {\n /**\r\n * Simple optimization, give each derivation run an unique id (runId)\r\n * Check if last time this observable was accessed the same runId is used\r\n * if this is the case, the relation is already known\r\n */\n if (derivation.runId_ !== observable.lastAccessedBy_) {\n observable.lastAccessedBy_ = derivation.runId_; // Tried storing newObserving, or observing, or both as Set, but performance didn't come close...\n\n derivation.newObserving_[derivation.unboundDepsCount_++] = observable;\n\n if (!observable.isBeingObserved_ && globalState.trackingContext) {\n observable.isBeingObserved_ = true;\n observable.onBO();\n }\n }\n\n return true;\n } else if (observable.observers_.size === 0 && globalState.inBatch > 0) {\n queueForUnobservation(observable);\n }\n\n return false;\n} // function invariantLOS(observable: IObservable, msg: string) {\n// // it's expensive so better not run it in produciton. but temporarily helpful for testing\n// const min = getObservers(observable).reduce((a, b) => Math.min(a, b.dependenciesState), 2)\n// if (min >= observable.lowestObserverState) return // <- the only assumption about `lowestObserverState`\n// throw new Error(\n// \"lowestObserverState is wrong for \" +\n// msg +\n// \" because \" +\n// min +\n// \" < \" +\n// observable.lowestObserverState\n// )\n// }\n\n/**\r\n * NOTE: current propagation mechanism will in case of self reruning autoruns behave unexpectedly\r\n * It will propagate changes to observers from previous run\r\n * It's hard or maybe impossible (with reasonable perf) to get it right with current approach\r\n * Hopefully self reruning autoruns aren't a feature people should depend on\r\n * Also most basic use cases should be ok\r\n */\n// Called by Atom when its value changes\n\nfunction propagateChanged(observable) {\n // invariantLOS(observable, \"changed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_; // Ideally we use for..of here, but the downcompiled version is really slow...\n\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n\n d.onBecomeStale_();\n }\n\n d.dependenciesState_ = IDerivationState_.STALE_;\n }); // invariantLOS(observable, \"changed end\");\n} // Called by ComputedValue when it recalculate and its value changed\n\nfunction propagateChangeConfirmed(observable) {\n // invariantLOS(observable, \"confirmed start\");\n if (observable.lowestObserverState_ === IDerivationState_.STALE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.POSSIBLY_STALE_) {\n d.dependenciesState_ = IDerivationState_.STALE_;\n\n if (process.env.NODE_ENV !== \"production\" && d.isTracing_ !== TraceMode.NONE) {\n logTraceInfo(d, observable);\n }\n } else if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_ // this happens during computing of `d`, just keep lowestObserverState up to date.\n ) {\n observable.lowestObserverState_ = IDerivationState_.UP_TO_DATE_;\n }\n }); // invariantLOS(observable, \"confirmed end\");\n} // Used by computed when its dependency changed, but we don't wan't to immediately recompute.\n\nfunction propagateMaybeChanged(observable) {\n // invariantLOS(observable, \"maybe start\");\n if (observable.lowestObserverState_ !== IDerivationState_.UP_TO_DATE_) {\n return;\n }\n\n observable.lowestObserverState_ = IDerivationState_.POSSIBLY_STALE_;\n observable.observers_.forEach(function (d) {\n if (d.dependenciesState_ === IDerivationState_.UP_TO_DATE_) {\n d.dependenciesState_ = IDerivationState_.POSSIBLY_STALE_;\n d.onBecomeStale_();\n }\n }); // invariantLOS(observable, \"maybe end\");\n}\n\nfunction logTraceInfo(derivation, observable) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' is invalidated due to a change in: '\" + observable.name_ + \"'\");\n\n if (derivation.isTracing_ === TraceMode.BREAK) {\n var lines = [];\n printDepTree(getDependencyTree(derivation), lines, 1); // prettier-ignore\n\n new Function(\"debugger;\\n/*\\nTracing '\" + derivation.name_ + \"'\\n\\nYou are entering this break point because derivation '\" + derivation.name_ + \"' is being traced and '\" + observable.name_ + \"' is now forcing it to update.\\nJust follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update\\nThe stackframe you are looking for is at least ~6-8 stack-frames up.\\n\\n\" + (derivation instanceof ComputedValue ? derivation.derivation.toString().replace(/[*]\\//g, \"/\") : \"\") + \"\\n\\nThe dependencies for this derivation are:\\n\\n\" + lines.join(\"\\n\") + \"\\n*/\\n \")();\n }\n}\n\nfunction printDepTree(tree, lines, depth) {\n if (lines.length >= 1000) {\n lines.push(\"(and many more)\");\n return;\n }\n\n lines.push(\"\" + \"\\t\".repeat(depth - 1) + tree.name);\n\n if (tree.dependencies) {\n tree.dependencies.forEach(function (child) {\n return printDepTree(child, lines, depth + 1);\n });\n }\n}\n\nvar Reaction = /*#__PURE__*/function () {\n // nodes we are looking at. Our value depends on these nodes\n function Reaction(name_, onInvalidate_, errorHandler_, requiresObservable_) {\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n }\n\n this.name_ = void 0;\n this.onInvalidate_ = void 0;\n this.errorHandler_ = void 0;\n this.requiresObservable_ = void 0;\n this.observing_ = [];\n this.newObserving_ = [];\n this.dependenciesState_ = IDerivationState_.NOT_TRACKING_;\n this.diffValue_ = 0;\n this.runId_ = 0;\n this.unboundDepsCount_ = 0;\n this.isDisposed_ = false;\n this.isScheduled_ = false;\n this.isTrackPending_ = false;\n this.isRunning_ = false;\n this.isTracing_ = TraceMode.NONE;\n this.name_ = name_;\n this.onInvalidate_ = onInvalidate_;\n this.errorHandler_ = errorHandler_;\n this.requiresObservable_ = requiresObservable_;\n }\n\n var _proto = Reaction.prototype;\n\n _proto.onBecomeStale_ = function onBecomeStale_() {\n this.schedule_();\n };\n\n _proto.schedule_ = function schedule_() {\n if (!this.isScheduled_) {\n this.isScheduled_ = true;\n globalState.pendingReactions.push(this);\n runReactions();\n }\n };\n\n _proto.isScheduled = function isScheduled() {\n return this.isScheduled_;\n }\n /**\r\n * internal, use schedule() if you intend to kick off a reaction\r\n */\n ;\n\n _proto.runReaction_ = function runReaction_() {\n if (!this.isDisposed_) {\n startBatch();\n this.isScheduled_ = false;\n var prev = globalState.trackingContext;\n globalState.trackingContext = this;\n\n if (shouldCompute(this)) {\n this.isTrackPending_ = true;\n\n try {\n this.onInvalidate_();\n\n if (process.env.NODE_ENV !== \"production\" && this.isTrackPending_ && isSpyEnabled()) {\n // onInvalidate didn't trigger track right away..\n spyReport({\n name: this.name_,\n type: \"scheduled-reaction\"\n });\n }\n } catch (e) {\n this.reportExceptionInDerivation_(e);\n }\n }\n\n globalState.trackingContext = prev;\n endBatch();\n }\n };\n\n _proto.track = function track(fn) {\n if (this.isDisposed_) {\n return; // console.warn(\"Reaction already disposed\") // Note: Not a warning / error in mobx 4 either\n }\n\n startBatch();\n var notify = isSpyEnabled();\n var startTime;\n\n if (process.env.NODE_ENV !== \"production\" && notify) {\n startTime = Date.now();\n spyReportStart({\n name: this.name_,\n type: \"reaction\"\n });\n }\n\n this.isRunning_ = true;\n var prevReaction = globalState.trackingContext; // reactions could create reactions...\n\n globalState.trackingContext = this;\n var result = trackDerivedFunction(this, fn, undefined);\n globalState.trackingContext = prevReaction;\n this.isRunning_ = false;\n this.isTrackPending_ = false;\n\n if (this.isDisposed_) {\n // disposed during last run. Clean up everything that was bound after the dispose call.\n clearObserving(this);\n }\n\n if (isCaughtException(result)) {\n this.reportExceptionInDerivation_(result.cause);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notify) {\n spyReportEnd({\n time: Date.now() - startTime\n });\n }\n\n endBatch();\n };\n\n _proto.reportExceptionInDerivation_ = function reportExceptionInDerivation_(error) {\n var _this = this;\n\n if (this.errorHandler_) {\n this.errorHandler_(error, this);\n return;\n }\n\n if (globalState.disableErrorBoundaries) {\n throw error;\n }\n\n var message = process.env.NODE_ENV !== \"production\" ? \"[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '\" + this + \"'\" : \"[mobx] uncaught error in '\" + this + \"'\";\n\n if (!globalState.suppressReactionErrors) {\n console.error(message, error);\n /** If debugging brought you here, please, read the above message :-). Tnx! */\n } else if (process.env.NODE_ENV !== \"production\") {\n console.warn(\"[mobx] (error in reaction '\" + this.name_ + \"' suppressed, fix error of causing action below)\");\n } // prettier-ignore\n\n\n if (process.env.NODE_ENV !== \"production\" && isSpyEnabled()) {\n spyReport({\n type: \"error\",\n name: this.name_,\n message: message,\n error: \"\" + error\n });\n }\n\n globalState.globalReactionErrorHandlers.forEach(function (f) {\n return f(error, _this);\n });\n };\n\n _proto.dispose = function dispose() {\n if (!this.isDisposed_) {\n this.isDisposed_ = true;\n\n if (!this.isRunning_) {\n // if disposed while running, clean up later. Maybe not optimal, but rare case\n startBatch();\n clearObserving(this);\n endBatch();\n }\n }\n };\n\n _proto.getDisposer_ = function getDisposer_() {\n var r = this.dispose.bind(this);\n r[$mobx] = this;\n return r;\n };\n\n _proto.toString = function toString() {\n return \"Reaction[\" + this.name_ + \"]\";\n };\n\n _proto.trace = function trace$1(enterBreakPoint) {\n if (enterBreakPoint === void 0) {\n enterBreakPoint = false;\n }\n\n trace(this, enterBreakPoint);\n };\n\n return Reaction;\n}();\nfunction onReactionError(handler) {\n globalState.globalReactionErrorHandlers.push(handler);\n return function () {\n var idx = globalState.globalReactionErrorHandlers.indexOf(handler);\n\n if (idx >= 0) {\n globalState.globalReactionErrorHandlers.splice(idx, 1);\n }\n };\n}\n/**\r\n * Magic number alert!\r\n * Defines within how many times a reaction is allowed to re-trigger itself\r\n * until it is assumed that this is gonna be a never ending loop...\r\n */\n\nvar MAX_REACTION_ITERATIONS = 100;\n\nvar reactionScheduler = function reactionScheduler(f) {\n return f();\n};\n\nfunction runReactions() {\n // Trampolining, if runReactions are already running, new reactions will be picked up\n if (globalState.inBatch > 0 || globalState.isRunningReactions) {\n return;\n }\n\n reactionScheduler(runReactionsHelper);\n}\n\nfunction runReactionsHelper() {\n globalState.isRunningReactions = true;\n var allReactions = globalState.pendingReactions;\n var iterations = 0; // While running reactions, new reactions might be triggered.\n // Hence we work with two variables and check whether\n // we converge to no remaining reactions after a while.\n\n while (allReactions.length > 0) {\n if (++iterations === MAX_REACTION_ITERATIONS) {\n console.error(process.env.NODE_ENV !== \"production\" ? \"Reaction doesn't converge to a stable state after \" + MAX_REACTION_ITERATIONS + \" iterations.\" + (\" Probably there is a cycle in the reactive function: \" + allReactions[0]) : \"[mobx] cycle in reaction: \" + allReactions[0]);\n allReactions.splice(0); // clear reactions\n }\n\n var remainingReactions = allReactions.splice(0);\n\n for (var i = 0, l = remainingReactions.length; i < l; i++) {\n remainingReactions[i].runReaction_();\n }\n }\n\n globalState.isRunningReactions = false;\n}\n\nvar isReaction = /*#__PURE__*/createInstanceofPredicate(\"Reaction\", Reaction);\nfunction setReactionScheduler(fn) {\n var baseScheduler = reactionScheduler;\n\n reactionScheduler = function reactionScheduler(f) {\n return fn(function () {\n return baseScheduler(f);\n });\n };\n}\n\nfunction isSpyEnabled() {\n return process.env.NODE_ENV !== \"production\" && !!globalState.spyListeners.length;\n}\nfunction spyReport(event) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n } // dead code elimination can do the rest\n\n\n if (!globalState.spyListeners.length) {\n return;\n }\n\n var listeners = globalState.spyListeners;\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](event);\n }\n}\nfunction spyReportStart(event) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n\n var change = _extends({}, event, {\n spyReportStart: true\n });\n\n spyReport(change);\n}\nvar END_EVENT = {\n type: \"report-end\",\n spyReportEnd: true\n};\nfunction spyReportEnd(change) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n return;\n }\n\n if (change) {\n spyReport(_extends({}, change, {\n type: \"report-end\",\n spyReportEnd: true\n }));\n } else {\n spyReport(END_EVENT);\n }\n}\nfunction spy(listener) {\n if (!(process.env.NODE_ENV !== \"production\")) {\n console.warn(\"[mobx.spy] Is a no-op in production builds\");\n return function () {};\n } else {\n globalState.spyListeners.push(listener);\n return once(function () {\n globalState.spyListeners = globalState.spyListeners.filter(function (l) {\n return l !== listener;\n });\n });\n }\n}\n\nvar ACTION = \"action\";\nvar ACTION_BOUND = \"action.bound\";\nvar AUTOACTION = \"autoAction\";\nvar AUTOACTION_BOUND = \"autoAction.bound\";\nvar DEFAULT_ACTION_NAME = \"\";\nvar actionAnnotation = /*#__PURE__*/createActionAnnotation(ACTION);\nvar actionBoundAnnotation = /*#__PURE__*/createActionAnnotation(ACTION_BOUND, {\n bound: true\n});\nvar autoActionAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION, {\n autoAction: true\n});\nvar autoActionBoundAnnotation = /*#__PURE__*/createActionAnnotation(AUTOACTION_BOUND, {\n autoAction: true,\n bound: true\n});\n\nfunction createActionFactory(autoAction) {\n var res = function action(arg1, arg2) {\n // action(fn() {})\n if (isFunction(arg1)) {\n return createAction(arg1.name || DEFAULT_ACTION_NAME, arg1, autoAction);\n } // action(\"name\", fn() {})\n\n\n if (isFunction(arg2)) {\n return createAction(arg1, arg2, autoAction);\n } // @action\n\n\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, autoAction ? autoActionAnnotation : actionAnnotation);\n } // action(\"name\") & @action(\"name\")\n\n\n if (isStringish(arg1)) {\n return createDecoratorAnnotation(createActionAnnotation(autoAction ? AUTOACTION : ACTION, {\n name: arg1,\n autoAction: autoAction\n }));\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n die(\"Invalid arguments for `action`\");\n }\n };\n\n return res;\n}\n\nvar action = /*#__PURE__*/createActionFactory(false);\nObject.assign(action, actionAnnotation);\nvar autoAction = /*#__PURE__*/createActionFactory(true);\nObject.assign(autoAction, autoActionAnnotation);\naction.bound = /*#__PURE__*/createDecoratorAnnotation(actionBoundAnnotation);\nautoAction.bound = /*#__PURE__*/createDecoratorAnnotation(autoActionBoundAnnotation);\nfunction runInAction(fn) {\n return executeAction(fn.name || DEFAULT_ACTION_NAME, false, fn, this, undefined);\n}\nfunction isAction(thing) {\n return isFunction(thing) && thing.isMobxAction === true;\n}\n\n/**\r\n * Creates a named reactive view and keeps it alive, so that the view is always\r\n * updated if one of the dependencies changes, even when the view is not further used by something else.\r\n * @param view The reactive view\r\n * @returns disposer function, which can be used to stop the view from being updated in the future.\r\n */\n\nfunction autorun(view, opts) {\n var _opts$name, _opts;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(view)) {\n die(\"Autorun expects a function as first argument\");\n }\n\n if (isAction(view)) {\n die(\"Autorun does not accept actions since actions are untrackable\");\n }\n }\n\n var name = (_opts$name = (_opts = opts) == null ? void 0 : _opts.name) != null ? _opts$name : process.env.NODE_ENV !== \"production\" ? view.name || \"Autorun@\" + getNextId() : \"Autorun\";\n var runSync = !opts.scheduler && !opts.delay;\n var reaction;\n\n if (runSync) {\n // normal autorun\n reaction = new Reaction(name, function () {\n this.track(reactionRunner);\n }, opts.onError, opts.requiresObservable);\n } else {\n var scheduler = createSchedulerFromOptions(opts); // debounced autorun\n\n var isScheduled = false;\n reaction = new Reaction(name, function () {\n if (!isScheduled) {\n isScheduled = true;\n scheduler(function () {\n isScheduled = false;\n\n if (!reaction.isDisposed_) {\n reaction.track(reactionRunner);\n }\n });\n }\n }, opts.onError, opts.requiresObservable);\n }\n\n function reactionRunner() {\n view(reaction);\n }\n\n reaction.schedule_();\n return reaction.getDisposer_();\n}\n\nvar run = function run(f) {\n return f();\n};\n\nfunction createSchedulerFromOptions(opts) {\n return opts.scheduler ? opts.scheduler : opts.delay ? function (f) {\n return setTimeout(f, opts.delay);\n } : run;\n}\n\nfunction reaction(expression, effect, opts) {\n var _opts$name2;\n\n if (opts === void 0) {\n opts = EMPTY_OBJECT;\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isFunction(expression) || !isFunction(effect)) {\n die(\"First and second argument to reaction should be functions\");\n }\n\n if (!isPlainObject(opts)) {\n die(\"Third argument of reactions should be an object\");\n }\n }\n\n var name = (_opts$name2 = opts.name) != null ? _opts$name2 : process.env.NODE_ENV !== \"production\" ? \"Reaction@\" + getNextId() : \"Reaction\";\n var effectAction = action(name, opts.onError ? wrapErrorHandler(opts.onError, effect) : effect);\n var runSync = !opts.scheduler && !opts.delay;\n var scheduler = createSchedulerFromOptions(opts);\n var firstTime = true;\n var isScheduled = false;\n var value;\n var oldValue;\n var equals = opts.compareStructural ? comparer.structural : opts.equals || comparer[\"default\"];\n var r = new Reaction(name, function () {\n if (firstTime || runSync) {\n reactionRunner();\n } else if (!isScheduled) {\n isScheduled = true;\n scheduler(reactionRunner);\n }\n }, opts.onError, opts.requiresObservable);\n\n function reactionRunner() {\n isScheduled = false;\n\n if (r.isDisposed_) {\n return;\n }\n\n var changed = false;\n r.track(function () {\n var nextValue = allowStateChanges(false, function () {\n return expression(r);\n });\n changed = firstTime || !equals(value, nextValue);\n oldValue = value;\n value = nextValue;\n });\n\n if (firstTime && opts.fireImmediately) {\n effectAction(value, oldValue, r);\n } else if (!firstTime && changed) {\n effectAction(value, oldValue, r);\n }\n\n firstTime = false;\n }\n\n r.schedule_();\n return r.getDisposer_();\n}\n\nfunction wrapErrorHandler(errorHandler, baseFn) {\n return function () {\n try {\n return baseFn.apply(this, arguments);\n } catch (e) {\n errorHandler.call(this, e);\n }\n };\n}\n\nvar ON_BECOME_OBSERVED = \"onBO\";\nvar ON_BECOME_UNOBSERVED = \"onBUO\";\nfunction onBecomeObserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_OBSERVED, thing, arg2, arg3);\n}\nfunction onBecomeUnobserved(thing, arg2, arg3) {\n return interceptHook(ON_BECOME_UNOBSERVED, thing, arg2, arg3);\n}\n\nfunction interceptHook(hook, thing, arg2, arg3) {\n var atom = typeof arg3 === \"function\" ? getAtom(thing, arg2) : getAtom(thing);\n var cb = isFunction(arg3) ? arg3 : arg2;\n var listenersKey = hook + \"L\";\n\n if (atom[listenersKey]) {\n atom[listenersKey].add(cb);\n } else {\n atom[listenersKey] = new Set([cb]);\n }\n\n return function () {\n var hookListeners = atom[listenersKey];\n\n if (hookListeners) {\n hookListeners[\"delete\"](cb);\n\n if (hookListeners.size === 0) {\n delete atom[listenersKey];\n }\n }\n };\n}\n\nvar NEVER = \"never\";\nvar ALWAYS = \"always\";\nvar OBSERVED = \"observed\"; // const IF_AVAILABLE = \"ifavailable\"\n\nfunction configure(options) {\n if (options.isolateGlobalState === true) {\n isolateGlobalState();\n }\n\n var useProxies = options.useProxies,\n enforceActions = options.enforceActions;\n\n if (useProxies !== undefined) {\n globalState.useProxies = useProxies === ALWAYS ? true : useProxies === NEVER ? false : typeof Proxy !== \"undefined\";\n }\n\n if (useProxies === \"ifavailable\") {\n globalState.verifyProxies = true;\n }\n\n if (enforceActions !== undefined) {\n var ea = enforceActions === ALWAYS ? ALWAYS : enforceActions === OBSERVED;\n globalState.enforceActions = ea;\n globalState.allowStateChanges = ea === true || ea === ALWAYS ? false : true;\n }\n [\"computedRequiresReaction\", \"reactionRequiresObservable\", \"observableRequiresReaction\", \"disableErrorBoundaries\", \"safeDescriptors\"].forEach(function (key) {\n if (key in options) {\n globalState[key] = !!options[key];\n }\n });\n globalState.allowStateReads = !globalState.observableRequiresReaction;\n\n if (process.env.NODE_ENV !== \"production\" && globalState.disableErrorBoundaries === true) {\n console.warn(\"WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled.\");\n }\n\n if (options.reactionScheduler) {\n setReactionScheduler(options.reactionScheduler);\n }\n}\n\nfunction extendObservable(target, properties, annotations, options) {\n if (process.env.NODE_ENV !== \"production\") {\n if (arguments.length > 4) {\n die(\"'extendObservable' expected 2-4 arguments\");\n }\n\n if (typeof target !== \"object\") {\n die(\"'extendObservable' expects an object as first argument\");\n }\n\n if (isObservableMap(target)) {\n die(\"'extendObservable' should not be used on maps, use map.merge instead\");\n }\n\n if (!isPlainObject(properties)) {\n die(\"'extendObservable' only accepts plain objects as second argument\");\n }\n\n if (isObservable(properties) || isObservable(annotations)) {\n die(\"Extending an object with another observable (object) is not supported\");\n }\n } // Pull descriptors first, so we don't have to deal with props added by administration ($mobx)\n\n\n var descriptors = getOwnPropertyDescriptors(properties);\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n ownKeys(descriptors).forEach(function (key) {\n adm.extend_(key, descriptors[key], // must pass \"undefined\" for { key: undefined }\n !annotations ? true : key in annotations ? annotations[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nfunction getDependencyTree(thing, property) {\n return nodeToDependencyTree(getAtom(thing, property));\n}\n\nfunction nodeToDependencyTree(node) {\n var result = {\n name: node.name_\n };\n\n if (node.observing_ && node.observing_.length > 0) {\n result.dependencies = unique(node.observing_).map(nodeToDependencyTree);\n }\n\n return result;\n}\n\nfunction getObserverTree(thing, property) {\n return nodeToObserverTree(getAtom(thing, property));\n}\n\nfunction nodeToObserverTree(node) {\n var result = {\n name: node.name_\n };\n\n if (hasObservers(node)) {\n result.observers = Array.from(getObservers(node)).map(nodeToObserverTree);\n }\n\n return result;\n}\n\nfunction unique(list) {\n return Array.from(new Set(list));\n}\n\nvar generatorId = 0;\nfunction FlowCancellationError() {\n this.message = \"FLOW_CANCELLED\";\n}\nFlowCancellationError.prototype = /*#__PURE__*/Object.create(Error.prototype);\nfunction isFlowCancellationError(error) {\n return error instanceof FlowCancellationError;\n}\nvar flowAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow\");\nvar flowBoundAnnotation = /*#__PURE__*/createFlowAnnotation(\"flow.bound\", {\n bound: true\n});\nvar flow = /*#__PURE__*/Object.assign(function flow(arg1, arg2) {\n // @flow\n if (isStringish(arg2)) {\n return storeAnnotation(arg1, arg2, flowAnnotation);\n } // flow(fn)\n\n\n if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n die(\"Flow expects single argument with generator function\");\n }\n\n var generator = arg1;\n var name = generator.name || \"\"; // Implementation based on https://github.com/tj/co/blob/master/index.js\n\n var res = function res() {\n var ctx = this;\n var args = arguments;\n var runId = ++generatorId;\n var gen = action(name + \" - runid: \" + runId + \" - init\", generator).apply(ctx, args);\n var rejector;\n var pendingPromise = undefined;\n var promise = new Promise(function (resolve, reject) {\n var stepId = 0;\n rejector = reject;\n\n function onFulfilled(res) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen.next).call(gen, res);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function onRejected(err) {\n pendingPromise = undefined;\n var ret;\n\n try {\n ret = action(name + \" - runid: \" + runId + \" - yield \" + stepId++, gen[\"throw\"]).call(gen, err);\n } catch (e) {\n return reject(e);\n }\n\n next(ret);\n }\n\n function next(ret) {\n if (isFunction(ret == null ? void 0 : ret.then)) {\n // an async iterator\n ret.then(next, reject);\n return;\n }\n\n if (ret.done) {\n return resolve(ret.value);\n }\n\n pendingPromise = Promise.resolve(ret.value);\n return pendingPromise.then(onFulfilled, onRejected);\n }\n\n onFulfilled(undefined); // kick off the process\n });\n promise.cancel = action(name + \" - runid: \" + runId + \" - cancel\", function () {\n try {\n if (pendingPromise) {\n cancelPromise(pendingPromise);\n } // Finally block can return (or yield) stuff..\n\n\n var _res = gen[\"return\"](undefined); // eat anything that promise would do, it's cancelled!\n\n\n var yieldedPromise = Promise.resolve(_res.value);\n yieldedPromise.then(noop, noop);\n cancelPromise(yieldedPromise); // maybe it can be cancelled :)\n // reject our original promise\n\n rejector(new FlowCancellationError());\n } catch (e) {\n rejector(e); // there could be a throwing finally block\n }\n });\n return promise;\n };\n\n res.isMobXFlow = true;\n return res;\n}, flowAnnotation);\nflow.bound = /*#__PURE__*/createDecoratorAnnotation(flowBoundAnnotation);\n\nfunction cancelPromise(promise) {\n if (isFunction(promise.cancel)) {\n promise.cancel();\n }\n}\n\nfunction flowResult(result) {\n return result; // just tricking TypeScript :)\n}\nfunction isFlow(fn) {\n return (fn == null ? void 0 : fn.isMobXFlow) === true;\n}\n\nfunction interceptReads(thing, propOrHandler, handler) {\n var target;\n\n if (isObservableMap(thing) || isObservableArray(thing) || isObservableValue(thing)) {\n target = getAdministration(thing);\n } else if (isObservableObject(thing)) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propOrHandler)) {\n return die(\"InterceptReads can only be used with a specific property, not with an object in general\");\n }\n\n target = getAdministration(thing, propOrHandler);\n } else if (process.env.NODE_ENV !== \"production\") {\n return die(\"Expected observable map, object or array as first array\");\n }\n\n if (process.env.NODE_ENV !== \"production\" && target.dehancer !== undefined) {\n return die(\"An intercept reader was already established\");\n }\n\n target.dehancer = typeof propOrHandler === \"function\" ? propOrHandler : handler;\n return function () {\n target.dehancer = undefined;\n };\n}\n\nfunction intercept(thing, propOrHandler, handler) {\n if (isFunction(handler)) {\n return interceptProperty(thing, propOrHandler, handler);\n } else {\n return interceptInterceptable(thing, propOrHandler);\n }\n}\n\nfunction interceptInterceptable(thing, handler) {\n return getAdministration(thing).intercept_(handler);\n}\n\nfunction interceptProperty(thing, property, handler) {\n return getAdministration(thing, property).intercept_(handler);\n}\n\nfunction _isComputed(value, property) {\n if (property === undefined) {\n return isComputedValue(value);\n }\n\n if (isObservableObject(value) === false) {\n return false;\n }\n\n if (!value[$mobx].values_.has(property)) {\n return false;\n }\n\n var atom = getAtom(value, property);\n return isComputedValue(atom);\n}\nfunction isComputed(value) {\n if (process.env.NODE_ENV !== \"production\" && arguments.length > 1) {\n return die(\"isComputed expects only 1 argument. Use isComputedProp to inspect the observability of a property\");\n }\n\n return _isComputed(value);\n}\nfunction isComputedProp(value, propName) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n return die(\"isComputed expected a property name as second argument\");\n }\n\n return _isComputed(value, propName);\n}\n\nfunction _isObservable(value, property) {\n if (!value) {\n return false;\n }\n\n if (property !== undefined) {\n if (process.env.NODE_ENV !== \"production\" && (isObservableMap(value) || isObservableArray(value))) {\n return die(\"isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.\");\n }\n\n if (isObservableObject(value)) {\n return value[$mobx].values_.has(property);\n }\n\n return false;\n } // For first check, see #701\n\n\n return isObservableObject(value) || !!value[$mobx] || isAtom(value) || isReaction(value) || isComputedValue(value);\n}\n\nfunction isObservable(value) {\n if (process.env.NODE_ENV !== \"production\" && arguments.length !== 1) {\n die(\"isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property\");\n }\n\n return _isObservable(value);\n}\nfunction isObservableProp(value, propName) {\n if (process.env.NODE_ENV !== \"production\" && !isStringish(propName)) {\n return die(\"expected a property name as second argument\");\n }\n\n return _isObservable(value, propName);\n}\n\nfunction keys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].keys_();\n }\n\n if (isObservableMap(obj) || isObservableSet(obj)) {\n return Array.from(obj.keys());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (_, index) {\n return index;\n });\n }\n\n die(5);\n}\nfunction values(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return obj[key];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return obj.get(key);\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.values());\n }\n\n if (isObservableArray(obj)) {\n return obj.slice();\n }\n\n die(6);\n}\nfunction entries(obj) {\n if (isObservableObject(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj[key]];\n });\n }\n\n if (isObservableMap(obj)) {\n return keys(obj).map(function (key) {\n return [key, obj.get(key)];\n });\n }\n\n if (isObservableSet(obj)) {\n return Array.from(obj.entries());\n }\n\n if (isObservableArray(obj)) {\n return obj.map(function (key, index) {\n return [index, key];\n });\n }\n\n die(7);\n}\nfunction set(obj, key, value) {\n if (arguments.length === 2 && !isObservableSet(obj)) {\n startBatch();\n var _values = key;\n\n try {\n for (var _key in _values) {\n set(obj, _key, _values[_key]);\n }\n } finally {\n endBatch();\n }\n\n return;\n }\n\n if (isObservableObject(obj)) {\n obj[$mobx].set_(key, value);\n } else if (isObservableMap(obj)) {\n obj.set(key, value);\n } else if (isObservableSet(obj)) {\n obj.add(key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n if (key < 0) {\n die(\"Invalid index: '\" + key + \"'\");\n }\n\n startBatch();\n\n if (key >= obj.length) {\n obj.length = key + 1;\n }\n\n obj[key] = value;\n endBatch();\n } else {\n die(8);\n }\n}\nfunction remove(obj, key) {\n if (isObservableObject(obj)) {\n obj[$mobx].delete_(key);\n } else if (isObservableMap(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableSet(obj)) {\n obj[\"delete\"](key);\n } else if (isObservableArray(obj)) {\n if (typeof key !== \"number\") {\n key = parseInt(key, 10);\n }\n\n obj.splice(key, 1);\n } else {\n die(9);\n }\n}\nfunction has(obj, key) {\n if (isObservableObject(obj)) {\n return obj[$mobx].has_(key);\n } else if (isObservableMap(obj)) {\n return obj.has(key);\n } else if (isObservableSet(obj)) {\n return obj.has(key);\n } else if (isObservableArray(obj)) {\n return key >= 0 && key < obj.length;\n }\n\n die(10);\n}\nfunction get(obj, key) {\n if (!has(obj, key)) {\n return undefined;\n }\n\n if (isObservableObject(obj)) {\n return obj[$mobx].get_(key);\n } else if (isObservableMap(obj)) {\n return obj.get(key);\n } else if (isObservableArray(obj)) {\n return obj[key];\n }\n\n die(11);\n}\nfunction apiDefineProperty(obj, key, descriptor) {\n if (isObservableObject(obj)) {\n return obj[$mobx].defineProperty_(key, descriptor);\n }\n\n die(39);\n}\nfunction apiOwnKeys(obj) {\n if (isObservableObject(obj)) {\n return obj[$mobx].ownKeys_();\n }\n\n die(38);\n}\n\nfunction observe(thing, propOrCb, cbOrFire, fireImmediately) {\n if (isFunction(cbOrFire)) {\n return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);\n } else {\n return observeObservable(thing, propOrCb, cbOrFire);\n }\n}\n\nfunction observeObservable(thing, listener, fireImmediately) {\n return getAdministration(thing).observe_(listener, fireImmediately);\n}\n\nfunction observeObservableProperty(thing, property, listener, fireImmediately) {\n return getAdministration(thing, property).observe_(listener, fireImmediately);\n}\n\nfunction cache(map, key, value) {\n map.set(key, value);\n return value;\n}\n\nfunction toJSHelper(source, __alreadySeen) {\n if (source == null || typeof source !== \"object\" || source instanceof Date || !isObservable(source)) {\n return source;\n }\n\n if (isObservableValue(source) || isComputedValue(source)) {\n return toJSHelper(source.get(), __alreadySeen);\n }\n\n if (__alreadySeen.has(source)) {\n return __alreadySeen.get(source);\n }\n\n if (isObservableArray(source)) {\n var res = cache(__alreadySeen, source, new Array(source.length));\n source.forEach(function (value, idx) {\n res[idx] = toJSHelper(value, __alreadySeen);\n });\n return res;\n }\n\n if (isObservableSet(source)) {\n var _res = cache(__alreadySeen, source, new Set());\n\n source.forEach(function (value) {\n _res.add(toJSHelper(value, __alreadySeen));\n });\n return _res;\n }\n\n if (isObservableMap(source)) {\n var _res2 = cache(__alreadySeen, source, new Map());\n\n source.forEach(function (value, key) {\n _res2.set(key, toJSHelper(value, __alreadySeen));\n });\n return _res2;\n } else {\n // must be observable object\n var _res3 = cache(__alreadySeen, source, {});\n\n apiOwnKeys(source).forEach(function (key) {\n if (objectPrototype.propertyIsEnumerable.call(source, key)) {\n _res3[key] = toJSHelper(source[key], __alreadySeen);\n }\n });\n return _res3;\n }\n}\n/**\r\n * Recursively converts an observable to it's non-observable native counterpart.\r\n * It does NOT recurse into non-observables, these are left as they are, even if they contain observables.\r\n * Computed and other non-enumerable properties are completely ignored.\r\n * Complex scenarios require custom solution, eg implementing `toJSON` or using `serializr` lib.\r\n */\n\n\nfunction toJS(source, options) {\n if (process.env.NODE_ENV !== \"production\" && options) {\n die(\"toJS no longer supports options\");\n }\n\n return toJSHelper(source, new Map());\n}\n\nfunction trace() {\n if (!(process.env.NODE_ENV !== \"production\")) {\n die(\"trace() is not available in production builds\");\n }\n\n var enterBreakPoint = false;\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (typeof args[args.length - 1] === \"boolean\") {\n enterBreakPoint = args.pop();\n }\n\n var derivation = getAtomFromArgs(args);\n\n if (!derivation) {\n return die(\"'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly\");\n }\n\n if (derivation.isTracing_ === TraceMode.NONE) {\n console.log(\"[mobx.trace] '\" + derivation.name_ + \"' tracing enabled\");\n }\n\n derivation.isTracing_ = enterBreakPoint ? TraceMode.BREAK : TraceMode.LOG;\n}\n\nfunction getAtomFromArgs(args) {\n switch (args.length) {\n case 0:\n return globalState.trackingDerivation;\n\n case 1:\n return getAtom(args[0]);\n\n case 2:\n return getAtom(args[0], args[1]);\n }\n}\n\n/**\r\n * During a transaction no views are updated until the end of the transaction.\r\n * The transaction will be run synchronously nonetheless.\r\n *\r\n * @param action a function that updates some reactive state\r\n * @returns any value that was returned by the 'action' parameter.\r\n */\n\nfunction transaction(action, thisArg) {\n if (thisArg === void 0) {\n thisArg = undefined;\n }\n\n startBatch();\n\n try {\n return action.apply(thisArg);\n } finally {\n endBatch();\n }\n}\n\nfunction when(predicate, arg1, arg2) {\n if (arguments.length === 1 || arg1 && typeof arg1 === \"object\") {\n return whenPromise(predicate, arg1);\n }\n\n return _when(predicate, arg1, arg2 || {});\n}\n\nfunction _when(predicate, effect, opts) {\n var timeoutHandle;\n\n if (typeof opts.timeout === \"number\") {\n var error = new Error(\"WHEN_TIMEOUT\");\n timeoutHandle = setTimeout(function () {\n if (!disposer[$mobx].isDisposed_) {\n disposer();\n\n if (opts.onError) {\n opts.onError(error);\n } else {\n throw error;\n }\n }\n }, opts.timeout);\n }\n\n opts.name = process.env.NODE_ENV !== \"production\" ? opts.name || \"When@\" + getNextId() : \"When\";\n var effectAction = createAction(process.env.NODE_ENV !== \"production\" ? opts.name + \"-effect\" : \"When-effect\", effect); // eslint-disable-next-line\n\n var disposer = autorun(function (r) {\n // predicate should not change state\n var cond = allowStateChanges(false, predicate);\n\n if (cond) {\n r.dispose();\n\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n\n effectAction();\n }\n }, opts);\n return disposer;\n}\n\nfunction whenPromise(predicate, opts) {\n if (process.env.NODE_ENV !== \"production\" && opts && opts.onError) {\n return die(\"the options 'onError' and 'promise' cannot be combined\");\n }\n\n var cancel;\n var res = new Promise(function (resolve, reject) {\n var disposer = _when(predicate, resolve, _extends({}, opts, {\n onError: reject\n }));\n\n cancel = function cancel() {\n disposer();\n reject(new Error(\"WHEN_CANCELLED\"));\n };\n });\n res.cancel = cancel;\n return res;\n}\n\nfunction getAdm(target) {\n return target[$mobx];\n} // Optimization: we don't need the intermediate objects and could have a completely custom administration for DynamicObjects,\n// and skip either the internal values map, or the base object with its property descriptors!\n\n\nvar objectProxyTraps = {\n has: function has(target, name) {\n if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"detect new properties using the 'in' operator. Use 'has' from 'mobx' instead.\");\n }\n\n return getAdm(target).has_(name);\n },\n get: function get(target, name) {\n return getAdm(target).get_(name);\n },\n set: function set(target, name, value) {\n var _getAdm$set_;\n\n if (!isStringish(name)) {\n return false;\n }\n\n if (process.env.NODE_ENV !== \"production\" && !getAdm(target).values_.has(name)) {\n warnAboutProxyRequirement(\"add a new observable property through direct assignment. Use 'set' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$set_ = getAdm(target).set_(name, value, true)) != null ? _getAdm$set_ : true;\n },\n deleteProperty: function deleteProperty(target, name) {\n var _getAdm$delete_;\n\n if (process.env.NODE_ENV !== \"production\") {\n warnAboutProxyRequirement(\"delete properties from an observable object. Use 'remove' from 'mobx' instead.\");\n }\n\n if (!isStringish(name)) {\n return false;\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$delete_ = getAdm(target).delete_(name, true)) != null ? _getAdm$delete_ : true;\n },\n defineProperty: function defineProperty(target, name, descriptor) {\n var _getAdm$definePropert;\n\n if (process.env.NODE_ENV !== \"production\") {\n warnAboutProxyRequirement(\"define property on an observable object. Use 'defineProperty' from 'mobx' instead.\");\n } // null (intercepted) -> true (success)\n\n\n return (_getAdm$definePropert = getAdm(target).defineProperty_(name, descriptor)) != null ? _getAdm$definePropert : true;\n },\n ownKeys: function ownKeys(target) {\n if (process.env.NODE_ENV !== \"production\" && globalState.trackingDerivation) {\n warnAboutProxyRequirement(\"iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead.\");\n }\n\n return getAdm(target).ownKeys_();\n },\n preventExtensions: function preventExtensions(target) {\n die(13);\n }\n};\nfunction asDynamicObservableObject(target, options) {\n var _target$$mobx, _target$$mobx$proxy_;\n\n assertProxies();\n target = asObservableObject(target, options);\n return (_target$$mobx$proxy_ = (_target$$mobx = target[$mobx]).proxy_) != null ? _target$$mobx$proxy_ : _target$$mobx.proxy_ = new Proxy(target, objectProxyTraps);\n}\n\nfunction hasInterceptors(interceptable) {\n return interceptable.interceptors_ !== undefined && interceptable.interceptors_.length > 0;\n}\nfunction registerInterceptor(interceptable, handler) {\n var interceptors = interceptable.interceptors_ || (interceptable.interceptors_ = []);\n interceptors.push(handler);\n return once(function () {\n var idx = interceptors.indexOf(handler);\n\n if (idx !== -1) {\n interceptors.splice(idx, 1);\n }\n });\n}\nfunction interceptChange(interceptable, change) {\n var prevU = untrackedStart();\n\n try {\n // Interceptor can modify the array, copy it to avoid concurrent modification, see #1950\n var interceptors = [].concat(interceptable.interceptors_ || []);\n\n for (var i = 0, l = interceptors.length; i < l; i++) {\n change = interceptors[i](change);\n\n if (change && !change.type) {\n die(14);\n }\n\n if (!change) {\n break;\n }\n }\n\n return change;\n } finally {\n untrackedEnd(prevU);\n }\n}\n\nfunction hasListeners(listenable) {\n return listenable.changeListeners_ !== undefined && listenable.changeListeners_.length > 0;\n}\nfunction registerListener(listenable, handler) {\n var listeners = listenable.changeListeners_ || (listenable.changeListeners_ = []);\n listeners.push(handler);\n return once(function () {\n var idx = listeners.indexOf(handler);\n\n if (idx !== -1) {\n listeners.splice(idx, 1);\n }\n });\n}\nfunction notifyListeners(listenable, change) {\n var prevU = untrackedStart();\n var listeners = listenable.changeListeners_;\n\n if (!listeners) {\n return;\n }\n\n listeners = listeners.slice();\n\n for (var i = 0, l = listeners.length; i < l; i++) {\n listeners[i](change);\n }\n\n untrackedEnd(prevU);\n}\n\nfunction makeObservable(target, annotations, options) {\n var adm = asObservableObject(target, options)[$mobx];\n startBatch();\n\n try {\n var _annotations;\n\n if (process.env.NODE_ENV !== \"production\" && annotations && target[storedAnnotationsSymbol]) {\n die(\"makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported.\");\n } // Default to decorators\n\n\n (_annotations = annotations) != null ? _annotations : annotations = collectStoredAnnotations(target); // Annotate\n\n ownKeys(annotations).forEach(function (key) {\n return adm.make_(key, annotations[key]);\n });\n } finally {\n endBatch();\n }\n\n return target;\n} // proto[keysSymbol] = new Set()\n\nvar keysSymbol = /*#__PURE__*/Symbol(\"mobx-keys\");\nfunction makeAutoObservable(target, overrides, options) {\n if (process.env.NODE_ENV !== \"production\") {\n if (!isPlainObject(target) && !isPlainObject(Object.getPrototypeOf(target))) {\n die(\"'makeAutoObservable' can only be used for classes that don't have a superclass\");\n }\n\n if (isObservableObject(target)) {\n die(\"makeAutoObservable can only be used on objects not already made observable\");\n }\n } // Optimization: avoid visiting protos\n // Assumes that annotation.make_/.extend_ works the same for plain objects\n\n\n if (isPlainObject(target)) {\n return extendObservable(target, target, overrides, options);\n }\n\n var adm = asObservableObject(target, options)[$mobx]; // Optimization: cache keys on proto\n // Assumes makeAutoObservable can be called only once per object and can't be used in subclass\n\n if (!target[keysSymbol]) {\n var proto = Object.getPrototypeOf(target);\n var keys = new Set([].concat(ownKeys(target), ownKeys(proto)));\n keys[\"delete\"](\"constructor\");\n keys[\"delete\"]($mobx);\n addHiddenProp(proto, keysSymbol, keys);\n }\n\n startBatch();\n\n try {\n target[keysSymbol].forEach(function (key) {\n return adm.make_(key, // must pass \"undefined\" for { key: undefined }\n !overrides ? true : key in overrides ? overrides[key] : true);\n });\n } finally {\n endBatch();\n }\n\n return target;\n}\n\nvar SPLICE = \"splice\";\nvar UPDATE = \"update\";\nvar MAX_SPLICE_SIZE = 10000; // See e.g. https://github.com/mobxjs/mobx/issues/859\n\nvar arrayTraps = {\n get: function get(target, name) {\n var adm = target[$mobx];\n\n if (name === $mobx) {\n return adm;\n }\n\n if (name === \"length\") {\n return adm.getArrayLength_();\n }\n\n if (typeof name === \"string\" && !isNaN(name)) {\n return adm.get_(parseInt(name));\n }\n\n if (hasProp(arrayExtensions, name)) {\n return arrayExtensions[name];\n }\n\n return target[name];\n },\n set: function set(target, name, value) {\n var adm = target[$mobx];\n\n if (name === \"length\") {\n adm.setArrayLength_(value);\n }\n\n if (typeof name === \"symbol\" || isNaN(name)) {\n target[name] = value;\n } else {\n // numeric string\n adm.set_(parseInt(name), value);\n }\n\n return true;\n },\n preventExtensions: function preventExtensions() {\n die(15);\n }\n};\nvar ObservableArrayAdministration = /*#__PURE__*/function () {\n // this is the prop that gets proxied, so can't replace it!\n function ObservableArrayAdministration(name, enhancer, owned_, legacyMode_) {\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n\n this.owned_ = void 0;\n this.legacyMode_ = void 0;\n this.atom_ = void 0;\n this.values_ = [];\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.enhancer_ = void 0;\n this.dehancer = void 0;\n this.proxy_ = void 0;\n this.lastKnownLength_ = 0;\n this.owned_ = owned_;\n this.legacyMode_ = legacyMode_;\n this.atom_ = new Atom(name);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, process.env.NODE_ENV !== \"production\" ? name + \"[..]\" : \"ObservableArray[..]\");\n };\n }\n\n var _proto = ObservableArrayAdministration.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.dehanceValues_ = function dehanceValues_(values) {\n if (this.dehancer !== undefined && values.length > 0) {\n return values.map(this.dehancer);\n }\n\n return values;\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (fireImmediately === void 0) {\n fireImmediately = false;\n }\n\n if (fireImmediately) {\n listener({\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: \"splice\",\n index: 0,\n added: this.values_.slice(),\n addedCount: this.values_.length,\n removed: [],\n removedCount: 0\n });\n }\n\n return registerListener(this, listener);\n };\n\n _proto.getArrayLength_ = function getArrayLength_() {\n this.atom_.reportObserved();\n return this.values_.length;\n };\n\n _proto.setArrayLength_ = function setArrayLength_(newLength) {\n if (typeof newLength !== \"number\" || isNaN(newLength) || newLength < 0) {\n die(\"Out of range: \" + newLength);\n }\n\n var currentLength = this.values_.length;\n\n if (newLength === currentLength) {\n return;\n } else if (newLength > currentLength) {\n var newItems = new Array(newLength - currentLength);\n\n for (var i = 0; i < newLength - currentLength; i++) {\n newItems[i] = undefined;\n } // No Array.fill everywhere...\n\n\n this.spliceWithArray_(currentLength, 0, newItems);\n } else {\n this.spliceWithArray_(newLength, currentLength - newLength);\n }\n };\n\n _proto.updateArrayLength_ = function updateArrayLength_(oldLength, delta) {\n if (oldLength !== this.lastKnownLength_) {\n die(16);\n }\n\n this.lastKnownLength_ += delta;\n\n if (this.legacyMode_ && delta > 0) {\n reserveArrayBuffer(oldLength + delta + 1);\n }\n };\n\n _proto.spliceWithArray_ = function spliceWithArray_(index, deleteCount, newItems) {\n var _this = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n var length = this.values_.length;\n\n if (index === undefined) {\n index = 0;\n } else if (index > length) {\n index = length;\n } else if (index < 0) {\n index = Math.max(0, length + index);\n }\n\n if (arguments.length === 1) {\n deleteCount = length - index;\n } else if (deleteCount === undefined || deleteCount === null) {\n deleteCount = 0;\n } else {\n deleteCount = Math.max(0, Math.min(deleteCount, length - index));\n }\n\n if (newItems === undefined) {\n newItems = EMPTY_ARRAY;\n }\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_,\n type: SPLICE,\n index: index,\n removedCount: deleteCount,\n added: newItems\n });\n\n if (!change) {\n return EMPTY_ARRAY;\n }\n\n deleteCount = change.removedCount;\n newItems = change.added;\n }\n\n newItems = newItems.length === 0 ? newItems : newItems.map(function (v) {\n return _this.enhancer_(v, undefined);\n });\n\n if (this.legacyMode_ || process.env.NODE_ENV !== \"production\") {\n var lengthDelta = newItems.length - deleteCount;\n this.updateArrayLength_(length, lengthDelta); // checks if internal array wasn't modified\n }\n\n var res = this.spliceItemsIntoValues_(index, deleteCount, newItems);\n\n if (deleteCount !== 0 || newItems.length !== 0) {\n this.notifyArraySplice_(index, newItems, res);\n }\n\n return this.dehanceValues_(res);\n };\n\n _proto.spliceItemsIntoValues_ = function spliceItemsIntoValues_(index, deleteCount, newItems) {\n if (newItems.length < MAX_SPLICE_SIZE) {\n var _this$values_;\n\n return (_this$values_ = this.values_).splice.apply(_this$values_, [index, deleteCount].concat(newItems));\n } else {\n // The items removed by the splice\n var res = this.values_.slice(index, index + deleteCount); // The items that that should remain at the end of the array\n\n var oldItems = this.values_.slice(index + deleteCount); // New length is the previous length + addition count - deletion count\n\n this.values_.length += newItems.length - deleteCount;\n\n for (var i = 0; i < newItems.length; i++) {\n this.values_[index + i] = newItems[i];\n }\n\n for (var _i = 0; _i < oldItems.length; _i++) {\n this.values_[index + newItems.length + _i] = oldItems[_i];\n }\n\n return res;\n }\n };\n\n _proto.notifyArrayChildUpdate_ = function notifyArrayChildUpdate_(index, newValue, oldValue) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n type: UPDATE,\n debugObjectName: this.atom_.name_,\n index: index,\n newValue: newValue,\n oldValue: oldValue\n } : null; // The reason why this is on right hand side here (and not above), is this way the uglifier will drop it, but it won't\n // cause any runtime overhead in development mode without NODE_ENV set, unless spying is enabled\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged();\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.notifyArraySplice_ = function notifyArraySplice_(index, added, removed) {\n var notifySpy = !this.owned_ && isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"array\",\n object: this.proxy_,\n debugObjectName: this.atom_.name_,\n type: SPLICE,\n index: index,\n removed: removed,\n added: added,\n removedCount: removed.length,\n addedCount: added.length\n } : null;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n\n this.atom_.reportChanged(); // conform: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get_ = function get_(index) {\n if (index < this.values_.length) {\n this.atom_.reportObserved();\n return this.dehanceValue_(this.values_[index]);\n }\n\n console.warn(process.env.NODE_ENV !== \"production\" ? \"[mobx] Out of bounds read: \" + index : \"[mobx.array] Attempt to read an array index (\" + index + \") that is out of bounds (\" + this.values_.length + \"). Please check length first. Out of bound indices will not be tracked by MobX\");\n };\n\n _proto.set_ = function set_(index, newValue) {\n var values = this.values_;\n\n if (index < values.length) {\n // update at index in range\n checkIfStateModificationsAreAllowed(this.atom_);\n var oldValue = values[index];\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_,\n index: index,\n newValue: newValue\n });\n\n if (!change) {\n return;\n }\n\n newValue = change.newValue;\n }\n\n newValue = this.enhancer_(newValue, oldValue);\n var changed = newValue !== oldValue;\n\n if (changed) {\n values[index] = newValue;\n this.notifyArrayChildUpdate_(index, newValue, oldValue);\n }\n } else if (index === values.length) {\n // add a new item\n this.spliceWithArray_(index, 0, [newValue]);\n } else {\n // out of bounds\n die(17, index, values.length);\n }\n };\n\n return ObservableArrayAdministration;\n}();\nfunction createObservableArray(initialValues, enhancer, name, owned) {\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n assertProxies();\n var adm = new ObservableArrayAdministration(name, enhancer, owned, false);\n addHiddenFinalProp(adm.values_, $mobx, adm);\n var proxy = new Proxy(adm.values_, arrayTraps);\n adm.proxy_ = proxy;\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true);\n adm.spliceWithArray_(0, 0, initialValues);\n allowStateChangesEnd(prev);\n }\n\n return proxy;\n} // eslint-disable-next-line\n\nvar arrayExtensions = {\n clear: function clear() {\n return this.splice(0);\n },\n replace: function replace(newItems) {\n var adm = this[$mobx];\n return adm.spliceWithArray_(0, adm.values_.length, newItems);\n },\n // Used by JSON.stringify\n toJSON: function toJSON() {\n return this.slice();\n },\n\n /*\r\n * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)\r\n * since these functions alter the inner structure of the array, the have side effects.\r\n * Because the have side effects, they should not be used in computed function,\r\n * and for that reason the do not call dependencyState.notifyObserved\r\n */\n splice: function splice(index, deleteCount) {\n for (var _len = arguments.length, newItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n newItems[_key - 2] = arguments[_key];\n }\n\n var adm = this[$mobx];\n\n switch (arguments.length) {\n case 0:\n return [];\n\n case 1:\n return adm.spliceWithArray_(index);\n\n case 2:\n return adm.spliceWithArray_(index, deleteCount);\n }\n\n return adm.spliceWithArray_(index, deleteCount, newItems);\n },\n spliceWithArray: function spliceWithArray(index, deleteCount, newItems) {\n return this[$mobx].spliceWithArray_(index, deleteCount, newItems);\n },\n push: function push() {\n var adm = this[$mobx];\n\n for (var _len2 = arguments.length, items = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n items[_key2] = arguments[_key2];\n }\n\n adm.spliceWithArray_(adm.values_.length, 0, items);\n return adm.values_.length;\n },\n pop: function pop() {\n return this.splice(Math.max(this[$mobx].values_.length - 1, 0), 1)[0];\n },\n shift: function shift() {\n return this.splice(0, 1)[0];\n },\n unshift: function unshift() {\n var adm = this[$mobx];\n\n for (var _len3 = arguments.length, items = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n items[_key3] = arguments[_key3];\n }\n\n adm.spliceWithArray_(0, 0, items);\n return adm.values_.length;\n },\n reverse: function reverse() {\n // reverse by default mutates in place before returning the result\n // which makes it both a 'derivation' and a 'mutation'.\n if (globalState.trackingDerivation) {\n die(37, \"reverse\");\n }\n\n this.replace(this.slice().reverse());\n return this;\n },\n sort: function sort() {\n // sort by default mutates in place before returning the result\n // which goes against all good practices. Let's not change the array in place!\n if (globalState.trackingDerivation) {\n die(37, \"sort\");\n }\n\n var copy = this.slice();\n copy.sort.apply(copy, arguments);\n this.replace(copy);\n return this;\n },\n remove: function remove(value) {\n var adm = this[$mobx];\n var idx = adm.dehanceValues_(adm.values_).indexOf(value);\n\n if (idx > -1) {\n this.splice(idx, 1);\n return true;\n }\n\n return false;\n }\n};\n/**\r\n * Wrap function from prototype\r\n * Without this, everything works as well, but this works\r\n * faster as everything works on unproxied values\r\n */\n\naddArrayExtension(\"concat\", simpleFunc);\naddArrayExtension(\"flat\", simpleFunc);\naddArrayExtension(\"includes\", simpleFunc);\naddArrayExtension(\"indexOf\", simpleFunc);\naddArrayExtension(\"join\", simpleFunc);\naddArrayExtension(\"lastIndexOf\", simpleFunc);\naddArrayExtension(\"slice\", simpleFunc);\naddArrayExtension(\"toString\", simpleFunc);\naddArrayExtension(\"toLocaleString\", simpleFunc); // map\n\naddArrayExtension(\"every\", mapLikeFunc);\naddArrayExtension(\"filter\", mapLikeFunc);\naddArrayExtension(\"find\", mapLikeFunc);\naddArrayExtension(\"findIndex\", mapLikeFunc);\naddArrayExtension(\"flatMap\", mapLikeFunc);\naddArrayExtension(\"forEach\", mapLikeFunc);\naddArrayExtension(\"map\", mapLikeFunc);\naddArrayExtension(\"some\", mapLikeFunc); // reduce\n\naddArrayExtension(\"reduce\", reduceLikeFunc);\naddArrayExtension(\"reduceRight\", reduceLikeFunc);\n\nfunction addArrayExtension(funcName, funcFactory) {\n if (typeof Array.prototype[funcName] === \"function\") {\n arrayExtensions[funcName] = funcFactory(funcName);\n }\n} // Report and delegate to dehanced array\n\n\nfunction simpleFunc(funcName) {\n return function () {\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction mapLikeFunc(funcName) {\n return function (callback, thisArg) {\n var _this2 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_);\n return dehancedValues[funcName](function (element, index) {\n return callback.call(thisArg, element, index, _this2);\n });\n };\n} // Make sure callbacks recieve correct array arg #2326\n\n\nfunction reduceLikeFunc(funcName) {\n return function () {\n var _this3 = this;\n\n var adm = this[$mobx];\n adm.atom_.reportObserved();\n var dehancedValues = adm.dehanceValues_(adm.values_); // #2432 - reduce behavior depends on arguments.length\n\n var callback = arguments[0];\n\n arguments[0] = function (accumulator, currentValue, index) {\n return callback(accumulator, currentValue, index, _this3);\n };\n\n return dehancedValues[funcName].apply(dehancedValues, arguments);\n };\n}\n\nvar isObservableArrayAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableArrayAdministration\", ObservableArrayAdministration);\nfunction isObservableArray(thing) {\n return isObject(thing) && isObservableArrayAdministration(thing[$mobx]);\n}\n\nvar _Symbol$iterator, _Symbol$toStringTag;\nvar ObservableMapMarker = {};\nvar ADD = \"add\";\nvar DELETE = \"delete\"; // just extend Map? See also https://gist.github.com/nestharus/13b4d74f2ef4a2f4357dbd3fc23c1e54\n// But: https://github.com/mobxjs/mobx/issues/1556\n\n_Symbol$iterator = Symbol.iterator;\n_Symbol$toStringTag = Symbol.toStringTag;\nvar ObservableMap = /*#__PURE__*/function () {\n // hasMap, not hashMap >-).\n function ObservableMap(initialData, enhancer_, name_) {\n var _this = this;\n\n if (enhancer_ === void 0) {\n enhancer_ = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableMap@\" + getNextId() : \"ObservableMap\";\n }\n\n this.enhancer_ = void 0;\n this.name_ = void 0;\n this[$mobx] = ObservableMapMarker;\n this.data_ = void 0;\n this.hasMap_ = void 0;\n this.keysAtom_ = void 0;\n this.interceptors_ = void 0;\n this.changeListeners_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = enhancer_;\n this.name_ = name_;\n\n if (!isFunction(Map)) {\n die(18);\n }\n\n this.keysAtom_ = createAtom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys()\" : \"ObservableMap.keys()\");\n this.data_ = new Map();\n this.hasMap_ = new Map();\n allowStateChanges(true, function () {\n _this.merge(initialData);\n });\n }\n\n var _proto = ObservableMap.prototype;\n\n _proto.has_ = function has_(key) {\n return this.data_.has(key);\n };\n\n _proto.has = function has(key) {\n var _this2 = this;\n\n if (!globalState.trackingDerivation) {\n return this.has_(key);\n }\n\n var entry = this.hasMap_.get(key);\n\n if (!entry) {\n var newEntry = entry = new ObservableValue(this.has_(key), referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableMap.key?\", false);\n this.hasMap_.set(key, newEntry);\n onBecomeUnobserved(newEntry, function () {\n return _this2.hasMap_[\"delete\"](key);\n });\n }\n\n return entry.get();\n };\n\n _proto.set = function set(key, value) {\n var hasKey = this.has_(key);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: hasKey ? UPDATE : ADD,\n object: this,\n newValue: value,\n name: key\n });\n\n if (!change) {\n return this;\n }\n\n value = change.newValue;\n }\n\n if (hasKey) {\n this.updateValue_(key, value);\n } else {\n this.addValue_(key, value);\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(key) {\n var _this3 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n name: key\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has_(key)) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: this.data_.get(key).value_,\n name: key\n } : null;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change);\n } // TODO fix type\n\n\n transaction(function () {\n var _this3$hasMap_$get;\n\n _this3.keysAtom_.reportChanged();\n\n (_this3$hasMap_$get = _this3.hasMap_.get(key)) == null ? void 0 : _this3$hasMap_$get.setNewValue_(false);\n\n var observable = _this3.data_.get(key);\n\n observable.setNewValue_(undefined);\n\n _this3.data_[\"delete\"](key);\n });\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.updateValue_ = function updateValue_(key, newValue) {\n var observable = this.data_.get(key);\n newValue = observable.prepareNewValue_(newValue);\n\n if (newValue !== globalState.UNCHANGED) {\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: UPDATE,\n object: this,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n };\n\n _proto.addValue_ = function addValue_(key, newValue) {\n var _this4 = this;\n\n checkIfStateModificationsAreAllowed(this.keysAtom_);\n transaction(function () {\n var _this4$hasMap_$get;\n\n var observable = new ObservableValue(newValue, _this4.enhancer_, process.env.NODE_ENV !== \"production\" ? _this4.name_ + \".\" + stringifyKey(key) : \"ObservableMap.key\", false);\n\n _this4.data_.set(key, observable);\n\n newValue = observable.value_; // value might have been changed\n\n (_this4$hasMap_$get = _this4.hasMap_.get(key)) == null ? void 0 : _this4$hasMap_$get.setNewValue_(true);\n\n _this4.keysAtom_.reportChanged();\n });\n var notifySpy = isSpyEnabled();\n var notify = hasListeners(this);\n var change = notify || notifySpy ? {\n observableKind: \"map\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n name: key,\n newValue: newValue\n } : null;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n } // TODO fix type\n\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n };\n\n _proto.get = function get(key) {\n if (this.has(key)) {\n return this.dehanceValue_(this.data_.get(key).get());\n }\n\n return this.dehanceValue_(undefined);\n };\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.keys = function keys() {\n this.keysAtom_.reportObserved();\n return this.data_.keys();\n };\n\n _proto.values = function values() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next = keys.next(),\n done = _keys$next.done,\n value = _keys$next.value;\n\n return {\n done: done,\n value: done ? undefined : self.get(value)\n };\n }\n });\n };\n\n _proto.entries = function entries() {\n var self = this;\n var keys = this.keys();\n return makeIterable({\n next: function next() {\n var _keys$next2 = keys.next(),\n done = _keys$next2.done,\n value = _keys$next2.value;\n\n return {\n done: done,\n value: done ? undefined : [value, self.get(value)]\n };\n }\n });\n };\n\n _proto[_Symbol$iterator] = function () {\n return this.entries();\n };\n\n _proto.forEach = function forEach(callback, thisArg) {\n for (var _iterator = _createForOfIteratorHelperLoose(this), _step; !(_step = _iterator()).done;) {\n var _step$value = _step.value,\n key = _step$value[0],\n value = _step$value[1];\n callback.call(thisArg, value, key, this);\n }\n }\n /** Merge another object into this object, returns this. */\n ;\n\n _proto.merge = function merge(other) {\n var _this5 = this;\n\n if (isObservableMap(other)) {\n other = new Map(other);\n }\n\n transaction(function () {\n if (isPlainObject(other)) {\n getPlainObjectKeys(other).forEach(function (key) {\n return _this5.set(key, other[key]);\n });\n } else if (Array.isArray(other)) {\n other.forEach(function (_ref) {\n var key = _ref[0],\n value = _ref[1];\n return _this5.set(key, value);\n });\n } else if (isES6Map(other)) {\n if (other.constructor !== Map) {\n die(19, other);\n }\n\n other.forEach(function (value, key) {\n return _this5.set(key, value);\n });\n } else if (other !== null && other !== undefined) {\n die(20, other);\n }\n });\n return this;\n };\n\n _proto.clear = function clear() {\n var _this6 = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator2 = _createForOfIteratorHelperLoose(_this6.keys()), _step2; !(_step2 = _iterator2()).done;) {\n var key = _step2.value;\n\n _this6[\"delete\"](key);\n }\n });\n });\n };\n\n _proto.replace = function replace(values) {\n var _this7 = this;\n\n // Implementation requirements:\n // - respect ordering of replacement map\n // - allow interceptors to run and potentially prevent individual operations\n // - don't recreate observables that already exist in original map (so we don't destroy existing subscriptions)\n // - don't _keysAtom.reportChanged if the keys of resulting map are indentical (order matters!)\n // - note that result map may differ from replacement map due to the interceptors\n transaction(function () {\n // Convert to map so we can do quick key lookups\n var replacementMap = convertToMap(values);\n var orderedData = new Map(); // Used for optimization\n\n var keysReportChangedCalled = false; // Delete keys that don't exist in replacement map\n // if the key deletion is prevented by interceptor\n // add entry at the beginning of the result map\n\n for (var _iterator3 = _createForOfIteratorHelperLoose(_this7.data_.keys()), _step3; !(_step3 = _iterator3()).done;) {\n var key = _step3.value;\n\n // Concurrently iterating/deleting keys\n // iterator should handle this correctly\n if (!replacementMap.has(key)) {\n var deleted = _this7[\"delete\"](key); // Was the key removed?\n\n\n if (deleted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n } else {\n // Delete prevented by interceptor\n var value = _this7.data_.get(key);\n\n orderedData.set(key, value);\n }\n }\n } // Merge entries\n\n\n for (var _iterator4 = _createForOfIteratorHelperLoose(replacementMap.entries()), _step4; !(_step4 = _iterator4()).done;) {\n var _step4$value = _step4.value,\n _key = _step4$value[0],\n _value = _step4$value[1];\n\n // We will want to know whether a new key is added\n var keyExisted = _this7.data_.has(_key); // Add or update value\n\n\n _this7.set(_key, _value); // The addition could have been prevent by interceptor\n\n\n if (_this7.data_.has(_key)) {\n // The update could have been prevented by interceptor\n // and also we want to preserve existing values\n // so use value from _data map (instead of replacement map)\n var _value2 = _this7.data_.get(_key);\n\n orderedData.set(_key, _value2); // Was a new key added?\n\n if (!keyExisted) {\n // _keysAtom.reportChanged() was already called\n keysReportChangedCalled = true;\n }\n }\n } // Check for possible key order change\n\n\n if (!keysReportChangedCalled) {\n if (_this7.data_.size !== orderedData.size) {\n // If size differs, keys are definitely modified\n _this7.keysAtom_.reportChanged();\n } else {\n var iter1 = _this7.data_.keys();\n\n var iter2 = orderedData.keys();\n var next1 = iter1.next();\n var next2 = iter2.next();\n\n while (!next1.done) {\n if (next1.value !== next2.value) {\n _this7.keysAtom_.reportChanged();\n\n break;\n }\n\n next1 = iter1.next();\n next2 = iter2.next();\n }\n }\n } // Use correctly ordered map\n\n\n _this7.data_ = orderedData;\n });\n return this;\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableMap]\";\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n _proto.observe_ = function observe_(listener, fireImmediately) {\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with maps.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _createClass(ObservableMap, [{\n key: \"size\",\n get: function get() {\n this.keysAtom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Map\";\n }\n }]);\n\n return ObservableMap;\n}(); // eslint-disable-next-line\n\nvar isObservableMap = /*#__PURE__*/createInstanceofPredicate(\"ObservableMap\", ObservableMap);\n\nfunction convertToMap(dataStructure) {\n if (isES6Map(dataStructure) || isObservableMap(dataStructure)) {\n return dataStructure;\n } else if (Array.isArray(dataStructure)) {\n return new Map(dataStructure);\n } else if (isPlainObject(dataStructure)) {\n var map = new Map();\n\n for (var key in dataStructure) {\n map.set(key, dataStructure[key]);\n }\n\n return map;\n } else {\n return die(21, dataStructure);\n }\n}\n\nvar _Symbol$iterator$1, _Symbol$toStringTag$1;\nvar ObservableSetMarker = {};\n_Symbol$iterator$1 = Symbol.iterator;\n_Symbol$toStringTag$1 = Symbol.toStringTag;\nvar ObservableSet = /*#__PURE__*/function () {\n function ObservableSet(initialData, enhancer, name_) {\n if (enhancer === void 0) {\n enhancer = deepEnhancer;\n }\n\n if (name_ === void 0) {\n name_ = process.env.NODE_ENV !== \"production\" ? \"ObservableSet@\" + getNextId() : \"ObservableSet\";\n }\n\n this.name_ = void 0;\n this[$mobx] = ObservableSetMarker;\n this.data_ = new Set();\n this.atom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.dehancer = void 0;\n this.enhancer_ = void 0;\n this.name_ = name_;\n\n if (!isFunction(Set)) {\n die(22);\n }\n\n this.atom_ = createAtom(this.name_);\n\n this.enhancer_ = function (newV, oldV) {\n return enhancer(newV, oldV, name_);\n };\n\n if (initialData) {\n this.replace(initialData);\n }\n }\n\n var _proto = ObservableSet.prototype;\n\n _proto.dehanceValue_ = function dehanceValue_(value) {\n if (this.dehancer !== undefined) {\n return this.dehancer(value);\n }\n\n return value;\n };\n\n _proto.clear = function clear() {\n var _this = this;\n\n transaction(function () {\n untracked(function () {\n for (var _iterator = _createForOfIteratorHelperLoose(_this.data_.values()), _step; !(_step = _iterator()).done;) {\n var value = _step.value;\n\n _this[\"delete\"](value);\n }\n });\n });\n };\n\n _proto.forEach = function forEach(callbackFn, thisArg) {\n for (var _iterator2 = _createForOfIteratorHelperLoose(this), _step2; !(_step2 = _iterator2()).done;) {\n var value = _step2.value;\n callbackFn.call(thisArg, value, value, this);\n }\n };\n\n _proto.add = function add(value) {\n var _this2 = this;\n\n checkIfStateModificationsAreAllowed(this.atom_);\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: ADD,\n object: this,\n newValue: value\n });\n\n if (!change) {\n return this;\n } // ideally, value = change.value would be done here, so that values can be\n // changed by interceptor. Same applies for other Set and Map api's.\n\n }\n\n if (!this.has(value)) {\n transaction(function () {\n _this2.data_.add(_this2.enhancer_(value, undefined));\n\n _this2.atom_.reportChanged();\n });\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: ADD,\n object: this,\n newValue: value\n } : null;\n\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart(_change);\n }\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd();\n }\n }\n\n return this;\n };\n\n _proto[\"delete\"] = function _delete(value) {\n var _this3 = this;\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: DELETE,\n object: this,\n oldValue: value\n });\n\n if (!change) {\n return false;\n }\n }\n\n if (this.has(value)) {\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var notify = hasListeners(this);\n\n var _change2 = notify || notifySpy ? {\n observableKind: \"set\",\n debugObjectName: this.name_,\n type: DELETE,\n object: this,\n oldValue: value\n } : null;\n\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportStart(_change2);\n }\n\n transaction(function () {\n _this3.atom_.reportChanged();\n\n _this3.data_[\"delete\"](value);\n });\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (notifySpy && process.env.NODE_ENV !== \"production\") {\n spyReportEnd();\n }\n\n return true;\n }\n\n return false;\n };\n\n _proto.has = function has(value) {\n this.atom_.reportObserved();\n return this.data_.has(this.dehanceValue_(value));\n };\n\n _proto.entries = function entries() {\n var nextIndex = 0;\n var keys = Array.from(this.keys());\n var values = Array.from(this.values());\n return makeIterable({\n next: function next() {\n var index = nextIndex;\n nextIndex += 1;\n return index < values.length ? {\n value: [keys[index], values[index]],\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.keys = function keys() {\n return this.values();\n };\n\n _proto.values = function values() {\n this.atom_.reportObserved();\n var self = this;\n var nextIndex = 0;\n var observableValues = Array.from(this.data_.values());\n return makeIterable({\n next: function next() {\n return nextIndex < observableValues.length ? {\n value: self.dehanceValue_(observableValues[nextIndex++]),\n done: false\n } : {\n done: true\n };\n }\n });\n };\n\n _proto.replace = function replace(other) {\n var _this4 = this;\n\n if (isObservableSet(other)) {\n other = new Set(other);\n }\n\n transaction(function () {\n if (Array.isArray(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (isES6Set(other)) {\n _this4.clear();\n\n other.forEach(function (value) {\n return _this4.add(value);\n });\n } else if (other !== null && other !== undefined) {\n die(\"Cannot initialize set from \" + other);\n }\n });\n return this;\n };\n\n _proto.observe_ = function observe_(listener, fireImmediately) {\n // ... 'fireImmediately' could also be true?\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support fireImmediately=true in combination with sets.\");\n }\n\n return registerListener(this, listener);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.toJSON = function toJSON() {\n return Array.from(this);\n };\n\n _proto.toString = function toString() {\n return \"[object ObservableSet]\";\n };\n\n _proto[_Symbol$iterator$1] = function () {\n return this.values();\n };\n\n _createClass(ObservableSet, [{\n key: \"size\",\n get: function get() {\n this.atom_.reportObserved();\n return this.data_.size;\n }\n }, {\n key: _Symbol$toStringTag$1,\n get: function get() {\n return \"Set\";\n }\n }]);\n\n return ObservableSet;\n}(); // eslint-disable-next-line\n\nvar isObservableSet = /*#__PURE__*/createInstanceofPredicate(\"ObservableSet\", ObservableSet);\n\nvar descriptorCache = /*#__PURE__*/Object.create(null);\nvar REMOVE = \"remove\";\nvar ObservableObjectAdministration = /*#__PURE__*/function () {\n function ObservableObjectAdministration(target_, values_, name_, // Used anytime annotation is not explicitely provided\n defaultAnnotation_) {\n if (values_ === void 0) {\n values_ = new Map();\n }\n\n if (defaultAnnotation_ === void 0) {\n defaultAnnotation_ = autoAnnotation;\n }\n\n this.target_ = void 0;\n this.values_ = void 0;\n this.name_ = void 0;\n this.defaultAnnotation_ = void 0;\n this.keysAtom_ = void 0;\n this.changeListeners_ = void 0;\n this.interceptors_ = void 0;\n this.proxy_ = void 0;\n this.isPlainObject_ = void 0;\n this.appliedAnnotations_ = void 0;\n this.pendingKeys_ = void 0;\n this.target_ = target_;\n this.values_ = values_;\n this.name_ = name_;\n this.defaultAnnotation_ = defaultAnnotation_;\n this.keysAtom_ = new Atom(process.env.NODE_ENV !== \"production\" ? this.name_ + \".keys\" : \"ObservableObject.keys\"); // Optimization: we use this frequently\n\n this.isPlainObject_ = isPlainObject(this.target_);\n\n if (process.env.NODE_ENV !== \"production\" && !isAnnotation(this.defaultAnnotation_)) {\n die(\"defaultAnnotation must be valid annotation\");\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n // Prepare structure for tracking which fields were already annotated\n this.appliedAnnotations_ = {};\n }\n }\n\n var _proto = ObservableObjectAdministration.prototype;\n\n _proto.getObservablePropValue_ = function getObservablePropValue_(key) {\n return this.values_.get(key).get();\n };\n\n _proto.setObservablePropValue_ = function setObservablePropValue_(key, newValue) {\n var observable = this.values_.get(key);\n\n if (observable instanceof ComputedValue) {\n observable.set(newValue);\n return true;\n } // intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n type: UPDATE,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: newValue\n });\n\n if (!change) {\n return null;\n }\n\n newValue = change.newValue;\n }\n\n newValue = observable.prepareNewValue_(newValue); // notify spy & observers\n\n if (newValue !== globalState.UNCHANGED) {\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n\n var _change = notify || notifySpy ? {\n type: UPDATE,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n oldValue: observable.value_,\n name: key,\n newValue: newValue\n } : null;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change);\n }\n observable.setNewValue_(newValue);\n\n if (notify) {\n notifyListeners(this, _change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n\n return true;\n };\n\n _proto.get_ = function get_(key) {\n if (globalState.trackingDerivation && !hasProp(this.target_, key)) {\n // Key doesn't exist yet, subscribe for it in case it's added later\n this.has_(key);\n }\n\n return this.target_[key];\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {any} value\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.set_ = function set_(key, value, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // Don't use .has(key) - we care about own\n if (hasProp(this.target_, key)) {\n // Existing prop\n if (this.values_.has(key)) {\n // Observable (can be intercepted)\n return this.setObservablePropValue_(key, value);\n } else if (proxyTrap) {\n // Non-observable - proxy\n return Reflect.set(this.target_, key, value);\n } else {\n // Non-observable\n this.target_[key] = value;\n return true;\n }\n } else {\n // New prop\n return this.extend_(key, {\n value: value,\n enumerable: true,\n writable: true,\n configurable: true\n }, this.defaultAnnotation_, proxyTrap);\n }\n } // Trap for \"in\"\n ;\n\n _proto.has_ = function has_(key) {\n if (!globalState.trackingDerivation) {\n // Skip key subscription outside derivation\n return key in this.target_;\n }\n\n this.pendingKeys_ || (this.pendingKeys_ = new Map());\n var entry = this.pendingKeys_.get(key);\n\n if (!entry) {\n entry = new ObservableValue(key in this.target_, referenceEnhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + stringifyKey(key) + \"?\" : \"ObservableObject.key?\", false);\n this.pendingKeys_.set(key, entry);\n }\n\n return entry.get();\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - ignore prop\r\n */\n ;\n\n _proto.make_ = function make_(key, annotation) {\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return;\n }\n\n assertAnnotable(this, annotation, key);\n\n if (!(key in this.target_)) {\n var _this$target_$storedA;\n\n // Throw on missing key, except for decorators:\n // Decorator annotations are collected from whole prototype chain.\n // When called from super() some props may not exist yet.\n // However we don't have to worry about missing prop,\n // because the decorator must have been applied to something.\n if ((_this$target_$storedA = this.target_[storedAnnotationsSymbol]) != null && _this$target_$storedA[key]) {\n return; // will be annotated by subclass constructor\n } else {\n die(1, annotation.annotationType_, this.name_ + \".\" + key.toString());\n }\n }\n\n var source = this.target_;\n\n while (source && source !== objectPrototype) {\n var descriptor = getDescriptor(source, key);\n\n if (descriptor) {\n var outcome = annotation.make_(this, key, descriptor, source);\n\n if (outcome === 0\n /* Cancel */\n ) {\n return;\n }\n\n if (outcome === 1\n /* Break */\n ) {\n break;\n }\n }\n\n source = Object.getPrototypeOf(source);\n }\n\n recordAnnotationApplied(this, annotation, key);\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {Annotation|boolean} annotation true - use default annotation, false - copy as is\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.extend_ = function extend_(key, descriptor, annotation, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n if (annotation === true) {\n annotation = this.defaultAnnotation_;\n }\n\n if (annotation === false) {\n return this.defineProperty_(key, descriptor, proxyTrap);\n }\n\n assertAnnotable(this, annotation, key);\n var outcome = annotation.extend_(this, key, descriptor, proxyTrap);\n\n if (outcome) {\n recordAnnotationApplied(this, annotation, key);\n }\n\n return outcome;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.defineProperty_ = function defineProperty_(key, descriptor, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: descriptor.value\n });\n\n if (!change) {\n return null;\n }\n\n var newValue = change.newValue;\n\n if (descriptor.value !== newValue) {\n descriptor = _extends({}, descriptor, {\n value: newValue\n });\n }\n } // Define\n\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n } // Notify\n\n\n this.notifyPropertyAddition_(key, descriptor.value);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineObservableProperty_ = function defineObservableProperty_(key, value, enhancer, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: value\n });\n\n if (!change) {\n return null;\n }\n\n value = change.newValue;\n }\n\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: true,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n var observable = new ObservableValue(value, enhancer, process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\", false);\n this.values_.set(key, observable); // Notify (value possibly changed by ObservableValue)\n\n this.notifyPropertyAddition_(key, observable.value_);\n } finally {\n endBatch();\n }\n\n return true;\n } // If original descriptor becomes relevant, move this to annotation directly\n ;\n\n _proto.defineComputedProperty_ = function defineComputedProperty_(key, options, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n try {\n startBatch(); // Delete\n\n var deleteOutcome = this.delete_(key);\n\n if (!deleteOutcome) {\n // Failure or intercepted\n return deleteOutcome;\n } // ADD interceptor\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: ADD,\n newValue: undefined\n });\n\n if (!change) {\n return null;\n }\n }\n\n options.name || (options.name = process.env.NODE_ENV !== \"production\" ? this.name_ + \".\" + key.toString() : \"ObservableObject.key\");\n options.context = this.proxy_ || this.target_;\n var cachedDescriptor = getCachedObservablePropDescriptor(key);\n var descriptor = {\n configurable: globalState.safeDescriptors ? this.isPlainObject_ : true,\n enumerable: false,\n get: cachedDescriptor.get,\n set: cachedDescriptor.set\n }; // Define\n\n if (proxyTrap) {\n if (!Reflect.defineProperty(this.target_, key, descriptor)) {\n return false;\n }\n } else {\n defineProperty(this.target_, key, descriptor);\n }\n\n this.values_.set(key, new ComputedValue(options)); // Notify\n\n this.notifyPropertyAddition_(key, undefined);\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * @param {PropertyKey} key\r\n * @param {PropertyDescriptor} descriptor\r\n * @param {boolean} proxyTrap whether it's called from proxy trap\r\n * @returns {boolean|null} true on success, false on failure (proxyTrap + non-configurable), null when cancelled by interceptor\r\n */\n ;\n\n _proto.delete_ = function delete_(key, proxyTrap) {\n if (proxyTrap === void 0) {\n proxyTrap = false;\n }\n\n // No such prop\n if (!hasProp(this.target_, key)) {\n return true;\n } // Intercept\n\n\n if (hasInterceptors(this)) {\n var change = interceptChange(this, {\n object: this.proxy_ || this.target_,\n name: key,\n type: REMOVE\n }); // Cancelled\n\n if (!change) {\n return null;\n }\n } // Delete\n\n\n try {\n var _this$pendingKeys_, _this$pendingKeys_$ge;\n\n startBatch();\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n var observable = this.values_.get(key); // Value needed for spies/listeners\n\n var value = undefined; // Optimization: don't pull the value unless we will need it\n\n if (!observable && (notify || notifySpy)) {\n var _getDescriptor;\n\n value = (_getDescriptor = getDescriptor(this.target_, key)) == null ? void 0 : _getDescriptor.value;\n } // delete prop (do first, may fail)\n\n\n if (proxyTrap) {\n if (!Reflect.deleteProperty(this.target_, key)) {\n return false;\n }\n } else {\n delete this.target_[key];\n } // Allow re-annotating this field\n\n\n if (process.env.NODE_ENV !== \"production\") {\n delete this.appliedAnnotations_[key];\n } // Clear observable\n\n\n if (observable) {\n this.values_[\"delete\"](key); // for computed, value is undefined\n\n if (observable instanceof ObservableValue) {\n value = observable.value_;\n } // Notify: autorun(() => obj[key]), see #1796\n\n\n propagateChanged(observable);\n } // Notify \"keys/entries/values\" observers\n\n\n this.keysAtom_.reportChanged(); // Notify \"has\" observers\n // \"in\" as it may still exist in proto\n\n (_this$pendingKeys_ = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_$ge = _this$pendingKeys_.get(key)) == null ? void 0 : _this$pendingKeys_$ge.set(key in this.target_); // Notify spies/listeners\n\n if (notify || notifySpy) {\n var _change2 = {\n type: REMOVE,\n observableKind: \"object\",\n object: this.proxy_ || this.target_,\n debugObjectName: this.name_,\n oldValue: value,\n name: key\n };\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(_change2);\n }\n\n if (notify) {\n notifyListeners(this, _change2);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n } finally {\n endBatch();\n }\n\n return true;\n }\n /**\r\n * Observes this object. Triggers for the events 'add', 'update' and 'delete'.\r\n * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/observe\r\n * for callback details\r\n */\n ;\n\n _proto.observe_ = function observe_(callback, fireImmediately) {\n if (process.env.NODE_ENV !== \"production\" && fireImmediately === true) {\n die(\"`observe` doesn't support the fire immediately property for observable objects.\");\n }\n\n return registerListener(this, callback);\n };\n\n _proto.intercept_ = function intercept_(handler) {\n return registerInterceptor(this, handler);\n };\n\n _proto.notifyPropertyAddition_ = function notifyPropertyAddition_(key, value) {\n var _this$pendingKeys_2, _this$pendingKeys_2$g;\n\n var notify = hasListeners(this);\n var notifySpy = process.env.NODE_ENV !== \"production\" && isSpyEnabled();\n\n if (notify || notifySpy) {\n var change = notify || notifySpy ? {\n type: ADD,\n observableKind: \"object\",\n debugObjectName: this.name_,\n object: this.proxy_ || this.target_,\n name: key,\n newValue: value\n } : null;\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportStart(change);\n }\n\n if (notify) {\n notifyListeners(this, change);\n }\n\n if (process.env.NODE_ENV !== \"production\" && notifySpy) {\n spyReportEnd();\n }\n }\n\n (_this$pendingKeys_2 = this.pendingKeys_) == null ? void 0 : (_this$pendingKeys_2$g = _this$pendingKeys_2.get(key)) == null ? void 0 : _this$pendingKeys_2$g.set(true); // Notify \"keys/entries/values\" observers\n\n this.keysAtom_.reportChanged();\n };\n\n _proto.ownKeys_ = function ownKeys_() {\n this.keysAtom_.reportObserved();\n return ownKeys(this.target_);\n };\n\n _proto.keys_ = function keys_() {\n // Returns enumerable && own, but unfortunately keysAtom will report on ANY key change.\n // There is no way to distinguish between Object.keys(object) and Reflect.ownKeys(object) - both are handled by ownKeys trap.\n // We can either over-report in Object.keys(object) or under-report in Reflect.ownKeys(object)\n // We choose to over-report in Object.keys(object), because:\n // - typically it's used with simple data objects\n // - when symbolic/non-enumerable keys are relevant Reflect.ownKeys works as expected\n this.keysAtom_.reportObserved();\n return Object.keys(this.target_);\n };\n\n return ObservableObjectAdministration;\n}();\nfunction asObservableObject(target, options) {\n var _options$name;\n\n if (process.env.NODE_ENV !== \"production\" && options && isObservableObject(target)) {\n die(\"Options can't be provided for already observable objects.\");\n }\n\n if (hasProp(target, $mobx)) {\n if (process.env.NODE_ENV !== \"production\" && !(getAdministration(target) instanceof ObservableObjectAdministration)) {\n die(\"Cannot convert '\" + getDebugName(target) + \"' into observable object:\" + \"\\nThe target is already observable of different type.\" + \"\\nExtending builtins is not supported.\");\n }\n\n return target;\n }\n\n if (process.env.NODE_ENV !== \"production\" && !Object.isExtensible(target)) {\n die(\"Cannot make the designated object observable; it is not extensible\");\n }\n\n var name = (_options$name = options == null ? void 0 : options.name) != null ? _options$name : process.env.NODE_ENV !== \"production\" ? (isPlainObject(target) ? \"ObservableObject\" : target.constructor.name) + \"@\" + getNextId() : \"ObservableObject\";\n var adm = new ObservableObjectAdministration(target, new Map(), String(name), getAnnotationFromOptions(options));\n addHiddenProp(target, $mobx, adm);\n return target;\n}\nvar isObservableObjectAdministration = /*#__PURE__*/createInstanceofPredicate(\"ObservableObjectAdministration\", ObservableObjectAdministration);\n\nfunction getCachedObservablePropDescriptor(key) {\n return descriptorCache[key] || (descriptorCache[key] = {\n get: function get() {\n return this[$mobx].getObservablePropValue_(key);\n },\n set: function set(value) {\n return this[$mobx].setObservablePropValue_(key, value);\n }\n });\n}\n\nfunction isObservableObject(thing) {\n if (isObject(thing)) {\n return isObservableObjectAdministration(thing[$mobx]);\n }\n\n return false;\n}\nfunction recordAnnotationApplied(adm, annotation, key) {\n var _adm$target_$storedAn;\n\n if (process.env.NODE_ENV !== \"production\") {\n adm.appliedAnnotations_[key] = annotation;\n } // Remove applied decorator annotation so we don't try to apply it again in subclass constructor\n\n\n (_adm$target_$storedAn = adm.target_[storedAnnotationsSymbol]) == null ? true : delete _adm$target_$storedAn[key];\n}\n\nfunction assertAnnotable(adm, annotation, key) {\n // Valid annotation\n if (process.env.NODE_ENV !== \"production\" && !isAnnotation(annotation)) {\n die(\"Cannot annotate '\" + adm.name_ + \".\" + key.toString() + \"': Invalid annotation.\");\n }\n /*\r\n // Configurable, not sealed, not frozen\r\n // Possibly not needed, just a little better error then the one thrown by engine.\r\n // Cases where this would be useful the most (subclass field initializer) are not interceptable by this.\r\n if (__DEV__) {\r\n const configurable = getDescriptor(adm.target_, key)?.configurable\r\n const frozen = Object.isFrozen(adm.target_)\r\n const sealed = Object.isSealed(adm.target_)\r\n if (!configurable || frozen || sealed) {\r\n const fieldName = `${adm.name_}.${key.toString()}`\r\n const requestedAnnotationType = annotation.annotationType_\r\n let error = `Cannot apply '${requestedAnnotationType}' to '${fieldName}':`\r\n if (frozen) {\r\n error += `\\nObject is frozen.`\r\n }\r\n if (sealed) {\r\n error += `\\nObject is sealed.`\r\n }\r\n if (!configurable) {\r\n error += `\\nproperty is not configurable.`\r\n // Mention only if caused by us to avoid confusion\r\n if (hasProp(adm.appliedAnnotations!, key)) {\r\n error += `\\nTo prevent accidental re-definition of a field by a subclass, `\r\n error += `all annotated fields of non-plain objects (classes) are not configurable.`\r\n }\r\n }\r\n die(error)\r\n }\r\n }\r\n */\n // Not annotated\n\n\n if (process.env.NODE_ENV !== \"production\" && !isOverride(annotation) && hasProp(adm.appliedAnnotations_, key)) {\n var fieldName = adm.name_ + \".\" + key.toString();\n var currentAnnotationType = adm.appliedAnnotations_[key].annotationType_;\n var requestedAnnotationType = annotation.annotationType_;\n die(\"Cannot apply '\" + requestedAnnotationType + \"' to '\" + fieldName + \"':\" + (\"\\nThe field is already annotated with '\" + currentAnnotationType + \"'.\") + \"\\nRe-annotating fields is not allowed.\" + \"\\nUse 'override' annotation for methods overridden by subclass.\");\n }\n}\n\nvar ENTRY_0 = /*#__PURE__*/createArrayEntryDescriptor(0);\n/**\r\n * This array buffer contains two lists of properties, so that all arrays\r\n * can recycle their property definitions, which significantly improves performance of creating\r\n * properties on the fly.\r\n */\n\n\nvar OBSERVABLE_ARRAY_BUFFER_SIZE = 0; // Typescript workaround to make sure ObservableArray extends Array\n\nvar StubArray = function StubArray() {};\n\nfunction inherit(ctor, proto) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(ctor.prototype, proto);\n } else if (ctor.prototype.__proto__ !== undefined) {\n ctor.prototype.__proto__ = proto;\n } else {\n ctor.prototype = proto;\n }\n}\n\ninherit(StubArray, Array.prototype); // Weex proto freeze protection was here,\n// but it is unclear why the hack is need as MobX never changed the prototype\n// anyway, so removed it in V6\n\nvar LegacyObservableArray = /*#__PURE__*/function (_StubArray, _Symbol$toStringTag, _Symbol$iterator) {\n _inheritsLoose(LegacyObservableArray, _StubArray);\n\n function LegacyObservableArray(initialValues, enhancer, name, owned) {\n var _this;\n\n if (name === void 0) {\n name = process.env.NODE_ENV !== \"production\" ? \"ObservableArray@\" + getNextId() : \"ObservableArray\";\n }\n\n if (owned === void 0) {\n owned = false;\n }\n\n _this = _StubArray.call(this) || this;\n var adm = new ObservableArrayAdministration(name, enhancer, owned, true);\n adm.proxy_ = _assertThisInitialized(_this);\n addHiddenFinalProp(_assertThisInitialized(_this), $mobx, adm);\n\n if (initialValues && initialValues.length) {\n var prev = allowStateChangesStart(true); // @ts-ignore\n\n _this.spliceWithArray(0, 0, initialValues);\n\n allowStateChangesEnd(prev);\n }\n\n {\n // Seems that Safari won't use numeric prototype setter untill any * numeric property is\n // defined on the instance. After that it works fine, even if this property is deleted.\n Object.defineProperty(_assertThisInitialized(_this), \"0\", ENTRY_0);\n }\n\n return _this;\n }\n\n var _proto = LegacyObservableArray.prototype;\n\n _proto.concat = function concat() {\n this[$mobx].atom_.reportObserved();\n\n for (var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++) {\n arrays[_key] = arguments[_key];\n }\n\n return Array.prototype.concat.apply(this.slice(), //@ts-ignore\n arrays.map(function (a) {\n return isObservableArray(a) ? a.slice() : a;\n }));\n };\n\n _proto[_Symbol$iterator] = function () {\n var self = this;\n var nextIndex = 0;\n return makeIterable({\n next: function next() {\n return nextIndex < self.length ? {\n value: self[nextIndex++],\n done: false\n } : {\n done: true,\n value: undefined\n };\n }\n });\n };\n\n _createClass(LegacyObservableArray, [{\n key: \"length\",\n get: function get() {\n return this[$mobx].getArrayLength_();\n },\n set: function set(newLength) {\n this[$mobx].setArrayLength_(newLength);\n }\n }, {\n key: _Symbol$toStringTag,\n get: function get() {\n return \"Array\";\n }\n }]);\n\n return LegacyObservableArray;\n}(StubArray, Symbol.toStringTag, Symbol.iterator);\n\nObject.entries(arrayExtensions).forEach(function (_ref) {\n var prop = _ref[0],\n fn = _ref[1];\n\n if (prop !== \"concat\") {\n addHiddenProp(LegacyObservableArray.prototype, prop, fn);\n }\n});\n\nfunction createArrayEntryDescriptor(index) {\n return {\n enumerable: false,\n configurable: true,\n get: function get() {\n return this[$mobx].get_(index);\n },\n set: function set(value) {\n this[$mobx].set_(index, value);\n }\n };\n}\n\nfunction createArrayBufferItem(index) {\n defineProperty(LegacyObservableArray.prototype, \"\" + index, createArrayEntryDescriptor(index));\n}\n\nfunction reserveArrayBuffer(max) {\n if (max > OBSERVABLE_ARRAY_BUFFER_SIZE) {\n for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max + 100; index++) {\n createArrayBufferItem(index);\n }\n\n OBSERVABLE_ARRAY_BUFFER_SIZE = max;\n }\n}\nreserveArrayBuffer(1000);\nfunction createLegacyArray(initialValues, enhancer, name) {\n return new LegacyObservableArray(initialValues, enhancer, name);\n}\n\nfunction getAtom(thing, property) {\n if (typeof thing === \"object\" && thing !== null) {\n if (isObservableArray(thing)) {\n if (property !== undefined) {\n die(23);\n }\n\n return thing[$mobx].atom_;\n }\n\n if (isObservableSet(thing)) {\n return thing[$mobx];\n }\n\n if (isObservableMap(thing)) {\n if (property === undefined) {\n return thing.keysAtom_;\n }\n\n var observable = thing.data_.get(property) || thing.hasMap_.get(property);\n\n if (!observable) {\n die(25, property, getDebugName(thing));\n }\n\n return observable;\n }\n\n\n if (isObservableObject(thing)) {\n if (!property) {\n return die(26);\n }\n\n var _observable = thing[$mobx].values_.get(property);\n\n if (!_observable) {\n die(27, property, getDebugName(thing));\n }\n\n return _observable;\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n } else if (isFunction(thing)) {\n if (isReaction(thing[$mobx])) {\n // disposer function\n return thing[$mobx];\n }\n }\n\n die(28);\n}\nfunction getAdministration(thing, property) {\n if (!thing) {\n die(29);\n }\n\n if (property !== undefined) {\n return getAdministration(getAtom(thing, property));\n }\n\n if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) {\n return thing;\n }\n\n if (isObservableMap(thing) || isObservableSet(thing)) {\n return thing;\n }\n\n if (thing[$mobx]) {\n return thing[$mobx];\n }\n\n die(24, thing);\n}\nfunction getDebugName(thing, property) {\n var named;\n\n if (property !== undefined) {\n named = getAtom(thing, property);\n } else if (isAction(thing)) {\n return thing.name;\n } else if (isObservableObject(thing) || isObservableMap(thing) || isObservableSet(thing)) {\n named = getAdministration(thing);\n } else {\n // valid for arrays as well\n named = getAtom(thing);\n }\n\n return named.name_;\n}\n\nvar toString = objectPrototype.toString;\nfunction deepEqual(a, b, depth) {\n if (depth === void 0) {\n depth = -1;\n }\n\n return eq(a, b, depth);\n} // Copied from https://github.com/jashkenas/underscore/blob/5c237a7c682fb68fd5378203f0bf22dce1624854/underscore.js#L1186-L1289\n// Internal recursive comparison function for `isEqual`.\n\nfunction eq(a, b, depth, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) {\n return a !== 0 || 1 / a === 1 / b;\n } // `null` or `undefined` only equal to itself (strict comparison).\n\n\n if (a == null || b == null) {\n return false;\n } // `NaN`s are equivalent, but non-reflexive.\n\n\n if (a !== a) {\n return b !== b;\n } // Exhaust primitive checks\n\n\n var type = typeof a;\n\n if (type !== \"function\" && type !== \"object\" && typeof b != \"object\") {\n return false;\n } // Compare `[[Class]]` names.\n\n\n var className = toString.call(a);\n\n if (className !== toString.call(b)) {\n return false;\n }\n\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case \"[object RegExp]\": // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n\n case \"[object String]\":\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return \"\" + a === \"\" + b;\n\n case \"[object Number]\":\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) {\n return +b !== +b;\n } // An `egal` comparison is performed for other numeric values.\n\n\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n\n case \"[object Date]\":\n case \"[object Boolean]\":\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n\n case \"[object Symbol]\":\n return typeof Symbol !== \"undefined\" && Symbol.valueOf.call(a) === Symbol.valueOf.call(b);\n\n case \"[object Map]\":\n case \"[object Set]\":\n // Maps and Sets are unwrapped to arrays of entry-pairs, adding an incidental level.\n // Hide this extra level by increasing the depth.\n if (depth >= 0) {\n depth++;\n }\n\n break;\n } // Unwrap any wrapped objects.\n\n\n a = unwrap(a);\n b = unwrap(b);\n var areArrays = className === \"[object Array]\";\n\n if (!areArrays) {\n if (typeof a != \"object\" || typeof b != \"object\") {\n return false;\n } // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n\n\n var aCtor = a.constructor,\n bCtor = b.constructor;\n\n if (aCtor !== bCtor && !(isFunction(aCtor) && aCtor instanceof aCtor && isFunction(bCtor) && bCtor instanceof bCtor) && \"constructor\" in a && \"constructor\" in b) {\n return false;\n }\n }\n\n if (depth === 0) {\n return false;\n } else if (depth < 0) {\n depth = -1;\n } // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n\n\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) {\n return bStack[length] === b;\n }\n } // Add the first object to the stack of traversed objects.\n\n\n aStack.push(a);\n bStack.push(b); // Recursively compare objects and arrays.\n\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n\n if (length !== b.length) {\n return false;\n } // Deep compare the contents, ignoring non-numeric properties.\n\n\n while (length--) {\n if (!eq(a[length], b[length], depth - 1, aStack, bStack)) {\n return false;\n }\n }\n } else {\n // Deep compare objects.\n var keys = Object.keys(a);\n var key;\n length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality.\n\n if (Object.keys(b).length !== length) {\n return false;\n }\n\n while (length--) {\n // Deep compare each member\n key = keys[length];\n\n if (!(hasProp(b, key) && eq(a[key], b[key], depth - 1, aStack, bStack))) {\n return false;\n }\n }\n } // Remove the first object from the stack of traversed objects.\n\n\n aStack.pop();\n bStack.pop();\n return true;\n}\n\nfunction unwrap(a) {\n if (isObservableArray(a)) {\n return a.slice();\n }\n\n if (isES6Map(a) || isObservableMap(a)) {\n return Array.from(a.entries());\n }\n\n if (isES6Set(a) || isObservableSet(a)) {\n return Array.from(a.entries());\n }\n\n return a;\n}\n\nfunction makeIterable(iterator) {\n iterator[Symbol.iterator] = getSelf;\n return iterator;\n}\n\nfunction getSelf() {\n return this;\n}\n\nfunction isAnnotation(thing) {\n return (// Can be function\n thing instanceof Object && typeof thing.annotationType_ === \"string\" && isFunction(thing.make_) && isFunction(thing.extend_)\n );\n}\n\n/**\r\n * (c) Michel Weststrate 2015 - 2020\r\n * MIT Licensed\r\n *\r\n * Welcome to the mobx sources! To get a global overview of how MobX internally works,\r\n * this is a good place to start:\r\n * https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.xvbh6qd74\r\n *\r\n * Source folders:\r\n * ===============\r\n *\r\n * - api/ Most of the public static methods exposed by the module can be found here.\r\n * - core/ Implementation of the MobX algorithm; atoms, derivations, reactions, dependency trees, optimizations. Cool stuff can be found here.\r\n * - types/ All the magic that is need to have observable objects, arrays and values is in this folder. Including the modifiers like `asFlat`.\r\n * - utils/ Utility stuff.\r\n *\r\n */\n[\"Symbol\", \"Map\", \"Set\"].forEach(function (m) {\n var g = getGlobal();\n\n if (typeof g[m] === \"undefined\") {\n die(\"MobX requires global '\" + m + \"' to be available or polyfilled\");\n }\n});\n\nif (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === \"object\") {\n // See: https://github.com/andykog/mobx-devtools/\n __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({\n spy: spy,\n extras: {\n getDebugName: getDebugName\n },\n $mobx: $mobx\n });\n}\n\nexport { $mobx, FlowCancellationError, ObservableMap, ObservableSet, Reaction, allowStateChanges as _allowStateChanges, runInAction as _allowStateChangesInsideComputed, allowStateReadsEnd as _allowStateReadsEnd, allowStateReadsStart as _allowStateReadsStart, autoAction as _autoAction, _endAction, getAdministration as _getAdministration, getGlobalState as _getGlobalState, interceptReads as _interceptReads, isComputingDerivation as _isComputingDerivation, resetGlobalState as _resetGlobalState, _startAction, action, autorun, comparer, computed, configure, createAtom, apiDefineProperty as defineProperty, entries, extendObservable, flow, flowResult, get, getAtom, getDebugName, getDependencyTree, getObserverTree, has, intercept, isAction, isObservableValue as isBoxedObservable, isComputed, isComputedProp, isFlow, isFlowCancellationError, isObservable, isObservableArray, isObservableMap, isObservableObject, isObservableProp, isObservableSet, keys, makeAutoObservable, makeObservable, observable, observe, onBecomeObserved, onBecomeUnobserved, onReactionError, override, apiOwnKeys as ownKeys, reaction, remove, runInAction, set, spy, toJS, trace, transaction, untracked, values, when };\n//# sourceMappingURL=mobx.esm.js.map\n","import { FC, lazy, memo, Suspense, useEffect, useState } from 'react';\n\nconst lazyLoadLottie: () => Promise = async () => {\n const lottie = (\n await import(\n /* webpackChunkName: 'cad-animations' */\n /* webpackPrefetch: true */\n `./loading-animation.lottie`\n )\n ).default;\n return lottie;\n};\n\nexport const LoadingAnimation: FC<{}> = memo(() => {\n const Lottie = lazy(() => import('react-lottie-player/dist/LottiePlayerLight'));\n\n const [path, setPath] = useState();\n\n useEffect(() => {\n const loadpath = async () => {\n const pathData = await lazyLoadLottie();\n setPath(pathData);\n };\n\n loadpath();\n }, [path]);\n\n return (\n \n \n \n );\n});\n","import { FC } from 'react';\n\nimport * as DS from '@aurorasolar/ds';\nimport { styled, x } from '@xstyled/styled-components';\n\nimport { LoadingAnimation } from './loading-animation';\n\nconst LoadingText = styled.h1Box`\n &::after {\n display: inline-block;\n animation: ellipsis 1s ease infinite;\n content: '.';\n width: 1em;\n text-align: left;\n }\n\n @keyframes ellipsis {\n 0% {\n content: '.';\n }\n\n 33% {\n content: '..';\n }\n\n 66% {\n content: '...';\n }\n }\n`;\n\nexport const CadLoadingPage: FC = () => {\n return (\n \n \n \n \n\n Coming right up\n\n \n Please wait while we load the design engine\n \n \n );\n};\n","import { useRef } from 'react';\n\nexport const useOnceRef = (fn: () => T) => {\n const isInitialized = useRef(false);\n const value = useRef(isInitialized.current ? (null as unknown as T) : fn());\n isInitialized.current = true;\n return value;\n};\n","/* eslint-disable react-hooks/exhaustive-deps */\nimport { useLocalObservable } from 'mobx-react-lite';\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport { effect } from './framework';\nimport { useOnceRef } from './use-once-ref';\n\n/**\n * `useReactive` is a hook that enables easy subscription to any MobX state.\n * The react component using the hook will subscribe to any reactive properties\n * accessed in `getReactive`, as well as deeply subscribe to any reactive objects\n * returned from it. Additionally, the hook can take a dependency array, shallow\n * changes to which will force `getReactive` to rerun and update the component's\n * reactive dependencies\n */\nexport const useReactive = (\n getReactive: () => T,\n dependencyArray: ReadonlyArray = [],\n) => {\n const isWithinRender = useRef(true);\n isWithinRender.current = true;\n\n // `result` is a React ref holding the value returned from `getReactive`.\n // `as unknown as T` here is safe because `result` will always initialize during the effect\n const result = useRef(null as unknown as T);\n const [, rerender] = useState(Symbol('useReactive'));\n\n // Since `getReactive` is wrapped in `useCallback` with a dependency array, it'll change\n // only when the dependency array is changed\n const reactiveCallback = useCallback(getReactive, dependencyArray);\n const lastReactiveCallbackRef = useRef(reactiveCallback);\n\n // An observable for `getReactive` function which will be used in the effect\n const reactiveObservable = useLocalObservable(() => ({\n reactiveCallback,\n setReactiveCallback: (newReactiveCallback: () => T) => {\n reactiveObservable.reactiveCallback = newReactiveCallback;\n },\n }));\n\n const stopEffect = useOnceRef(() =>\n effect(\n // Since we access `reactiveCallback` in this effect, when it is changed via\n // `setReactiveCallback`, e.g. when the dependency array is modified, this effect\n // will rerun as well\n () => reactiveObservable.reactiveCallback(),\n (value) => {\n result.current = value;\n // If the result is first initialized or changes due to the dependency array change\n // during render, we do not need to rerender, but is rerendered upon other changes\n if (!isWithinRender.current) {\n rerender(Symbol('useReactive'));\n }\n },\n ),\n );\n\n // The effect is stopped when component unmounts\n useEffect(() => {\n return () => {\n stopEffect.current();\n };\n }, []);\n\n // Upon dependency array change, if the callback is different, it'll recalculate\n // the effect since it depends on it\n if (lastReactiveCallbackRef.current !== reactiveCallback) {\n lastReactiveCallbackRef.current = reactiveCallback;\n reactiveObservable.setReactiveCallback(reactiveCallback);\n }\n\n isWithinRender.current = false;\n\n // Returning the current value from `getReactive` since it'll be kept\n // up to date due to rerendering\n return result.current;\n};\n","import { createReactiveSetup, ViewSettingsLayers } from '@aurorasolar/cad-state';\nimport { DEFAULT_CAD_VIEWPORT_NAME } from './constants';\nimport {\n CadViewportActionsScheduler,\n createCadViewportActionsScheduler,\n} from './cad-viewport-action-scheduler';\nimport { CadViewCamera } from './camera-utils';\n\nconst createCadContainer = () => document.createElement('div');\n\nexport type CadViewportsData = {\n // Default camera and layers are for storing camera and layer settings\n // that have been provided upon CAD initialization. Final view settings\n // for a given viewport will come from merging default settings with\n // settings for that viewport\n defaultCamera: null | CadViewCamera;\n defaultLayers: null | ViewSettingsLayers;\n\n // An array of all viewport names currently registered on the page\n // to ensure only a single viewport of the same name is registered and\n // to map a given viewport to a CAD container\n viewports: Array;\n\n // When exclusive viewport name exists, all other CAD viewports are hidden\n exclusiveViewportName: string | null;\n};\n\nexport type CadContainersData = {\n // CAD containers for viewports specified in `CadViewportsData.viewports`.\n // The index of the CAD containers matches the indices in `CadViewportsData.viewports`\n cadContainers: Array;\n\n // CAD container for a default viewport. Default viewport is the one with\n // the name specified in DEFAULT_CAD_VIEWPORT_NAME. CAD always needs to have\n // at least one viewport, and the viewport the engine is initialized with\n // is the default viewport. The default viewport name can (and should) be reused\n // just like any other viewport name, with the exception that it does not need\n // to be explicitly added and removed from CAD because it'll always exist\n defaultCadContainer: HTMLElement;\n};\n\nexport type CadPageViewportsActions = ReturnType;\n\nconst createCadViewportsData = (): CadViewportsData => {\n return {\n defaultCamera: null,\n defaultLayers: null,\n exclusiveViewportName: null,\n viewports: [],\n };\n};\n\n/**\n * Creates data for CAD containers. This needs to be separate from `CadViewportsData`\n * because we should avoid having HTML elements as part of reactive MobX data\n */\nconst createCadContainersData = (): CadContainersData => {\n return {\n cadContainers: [],\n defaultCadContainer: createCadContainer(),\n };\n};\n\nconst createCadPageViewportsActions = (\n scheduler: CadViewportActionsScheduler,\n data: CadViewportsData,\n cadContainersData: CadContainersData,\n) => {\n return {\n addViewport: (name: string) => {\n scheduler.scheduleAddViewport(() => {\n if (data.viewports.indexOf(name) >= 0) {\n throw new Error('Only one CAD view with the same \"name\" can be registered at once');\n }\n\n const { cadContainers, defaultCadContainer } = cadContainersData;\n\n cadContainers.push(\n name === DEFAULT_CAD_VIEWPORT_NAME ? defaultCadContainer : createCadContainer(),\n );\n data.viewports.push(name);\n });\n },\n\n removeViewport: (name: string) => {\n scheduler.scheduleRemoveViewport(() => {\n const viewportIndex = data.viewports.indexOf(name);\n\n if (viewportIndex >= 0) {\n cadContainersData.cadContainers.splice(viewportIndex, 1);\n data.viewports.splice(viewportIndex, 1);\n }\n });\n },\n\n setDefaultViewSettings: ({\n camera,\n layers,\n }: {\n camera?: null | CadViewCamera;\n layers?: null | ViewSettingsLayers;\n }) => {\n if (layers !== undefined) {\n data.defaultLayers = layers;\n }\n if (camera !== undefined) {\n data.defaultCamera = camera;\n }\n },\n\n setExclusiveViewportName: (newExclusiveViewportName: string | null) => {\n data.exclusiveViewportName = newExclusiveViewportName;\n },\n };\n};\n\nexport const {\n ReactiveContextProvider: CadPageViewportsStateProvider,\n useReactiveState: useCadPageViewportsState,\n} = createReactiveSetup((makeReactive) => {\n const data = makeReactive(createCadViewportsData());\n const cadContainersData = createCadContainersData();\n const scheduler = createCadViewportActionsScheduler(makeReactive);\n const actions = makeReactive(createCadPageViewportsActions(scheduler, data, cadContainersData));\n return {\n actions,\n cadContainersData,\n data,\n };\n});\n","import { createContext, FC, useContext } from 'react';\nimport { makeReactive, MakeReactive } from './framework';\nimport { useOnceRef } from './use-once-ref';\nimport { useReactive } from './use-reactive';\n\n/**\n * Creates hooks and providers that organize an instance of MobX state.\n * The state will be created when the provider mounts using the provided\n * `createState` function. `createState` takes `makeReactive` function as\n * an argument, which can be used to wrap objects and make them reactive.\n * The `useReactiveState` hook can be used to retrieve and automatically\n * subscribe to parts of the reactive state. `useReactiveState` takes a\n * function, whose first argument refers to the state; the component will\n * subscribe to anything accessed inside the function and deeply subscribe\n * to anything returned from the function. `useReactiveState` optionally\n * takes a dependency array, shallow changes to which will force\n * recalculation of the state and the component's dependencies\n */\nexport const createReactiveSetup = (\n createState: (makeReactive: MakeReactive) => State,\n) => {\n const ReactiveContext = createContext(null);\n\n const useReactiveContext = () => {\n const result = useContext(ReactiveContext);\n if (!result) {\n throw new Error('Cannot use reactive context outside of corresponding reactive context');\n }\n return result;\n };\n\n const ReactiveContextProvider: FC = ({ children }) => {\n const reactiveContextRef = useOnceRef(() => createState(makeReactive));\n return (\n \n {children}\n \n );\n };\n\n const useReactiveState = (\n fn: (state: State) => T,\n dependencyArray: ReadonlyArray = [],\n ) => {\n const reactiveContext = useReactiveContext();\n return useReactive(() => fn(reactiveContext), dependencyArray);\n };\n\n return { ReactiveContextProvider, useReactiveState };\n};\n","export type CadViewportActionsScheduler = ReturnType;\n\n/**\n * This is a workaround that ensures that `addViewport` is not called in the same\n * frame as `removeViewport`. This prevents a bug in CAD where, if the viewport\n * with the same `viewportName` is first removed, then added back in the same frame,\n * it would cause the viewport to break and not display anything\n */\nexport const createCadViewportActionsScheduler = (\n makeReactive: (value: T) => T,\n) => {\n const scheduledActions: Array<{ action: () => void; done: boolean; type: 'add' | 'remove' }> = [];\n\n const { processActions } = makeReactive({\n processActions: () => {\n // Finding the first action that hasn't been done yet\n let currentActionIndex = scheduledActions.findIndex(\n (scheduledAction) => !scheduledAction.done,\n );\n\n if (currentActionIndex >= 0) {\n const currentActionType = scheduledActions[currentActionIndex].type;\n\n // Running all consecutive actions of the same type\n for (; currentActionIndex < scheduledActions.length; currentActionIndex += 1) {\n const scheduledAction = scheduledActions[currentActionIndex];\n if (scheduledAction.type !== currentActionType) {\n break;\n } else {\n scheduledAction.action();\n scheduledAction.done = true;\n }\n }\n\n // Removing all actions that have been done\n scheduledActions.splice(0, currentActionIndex);\n } else {\n scheduledActions.splice(0, scheduledActions.length);\n }\n\n // All remaining actions should be run in the next frame\n if (scheduledActions.length > 0) {\n requestAnimationFrame(processActions);\n }\n },\n });\n\n return makeReactive({\n scheduleAddViewport: (action: () => void) => {\n if (scheduledActions.length === 0) {\n requestAnimationFrame(processActions);\n }\n if (\n scheduledActions.some(\n (scheduledAction) => !scheduledAction.done || scheduledAction.type === 'remove',\n )\n ) {\n scheduledActions.push({ action, done: false, type: 'add' });\n } else {\n action();\n scheduledActions.push({ action, done: true, type: 'add' });\n }\n },\n\n scheduleRemoveViewport: (action: () => void) => {\n if (scheduledActions.length === 0) {\n requestAnimationFrame(processActions);\n }\n if (\n scheduledActions.some(\n (scheduledAction) => !scheduledAction.done || scheduledAction.type === 'add',\n )\n ) {\n scheduledActions.push({ action, done: false, type: 'remove' });\n } else {\n action();\n scheduledActions.push({ action, done: true, type: 'remove' });\n }\n },\n });\n};\n","export const DEFAULT_CAD_VIEWPORT_NAME = 'design-3d';\nexport const CAD_VIEWPORT_MIN_HEIGHT = '268px';\n","import { createContext, FC, useContext } from 'react';\nimport { Subject } from 'rxjs';\n\nimport { CadPreferences } from '@aurorasolar/cad-preferences';\nimport { CadState, useLocalObservable, useReactive } from '@aurorasolar/cad-state';\nimport { CadEvent, CadEventTypes } from '@aurorasolar/common-data-store';\nimport { CadEngine } from '@aurorasolar/common-module-loader';\nimport { CadPageViewportsStateProvider } from '../cad-viewport/cad-page-viewports-state';\n\ntype CadContextLoadedValue = {\n designId: string;\n engine: CadEngine;\n engineSaveFn: null | ((options?: { saveScreenshot?: boolean }) => Promise);\n eventStream: Subject> | null;\n domNode: HTMLElement;\n state: CadState;\n preferences: CadPreferences;\n};\n\ntype CadContextInitialValue = {\n [K in keyof CadContextLoadedValue]?: null;\n};\n\ntype CadInitializerContextValue = {\n setCadContext: (cadContext: CadContextLoadedValue) => void;\n clearCadContext: () => void;\n setCadError: (error: Error) => void;\n};\n\ntype CadInitializerContextType = null | CadInitializerContextValue;\n\nexport enum CadStatus {\n Loading,\n Loaded,\n Error,\n}\n\nexport type CadContextValue =\n | ({\n status: CadStatus.Loaded;\n error: null;\n isLoaded: true;\n } & CadContextLoadedValue)\n | ({\n status: CadStatus.Loading;\n error: null;\n isLoaded: false;\n } & CadContextInitialValue)\n | ({\n status: CadStatus.Error;\n error: Error;\n isLoaded: false;\n } & CadContextInitialValue);\n\nexport type CadContextType = null | CadContextValue;\n\nexport const CadContext = createContext(null);\n\nconst CadInitializerContext = createContext(null);\n\nexport const useOptionalCadContext = () => {\n const context = useContext(CadContext);\n // Making sure component rerenders when `status` changes:\n useReactive(() => context?.status, [context]);\n return context;\n};\n\nexport const useCadContext = () => {\n const context = useOptionalCadContext();\n if (!context) {\n throw new Error('Cad context is not provided');\n }\n return context;\n};\n\n/**\n * Only for use in `useCad` hook. Exposes functions to initialize and clear\n * cad context\n */\nexport const useCadInitializerContext = () => {\n const context = useContext(CadInitializerContext);\n\n if (!context) {\n throw new Error('Cad context is not provided');\n }\n\n return context;\n};\n\nconst initialCadContext: Required = {\n designId: null,\n domNode: null,\n engine: null,\n engineSaveFn: null,\n eventStream: null,\n preferences: null,\n state: null,\n};\n\nexport const CadContextProvider: FC = ({ children }) => {\n const cadContext: CadContextValue = useLocalObservable(() => ({\n error: null,\n isLoaded: false,\n status: CadStatus.Loading,\n ...initialCadContext,\n }));\n const cadContextInitializer = useLocalObservable(() => ({\n clearCadContext() {\n const fullContext: CadContextValue = {\n error: null,\n isLoaded: false,\n status: CadStatus.Loading,\n ...initialCadContext,\n };\n Object.assign(cadContext, fullContext);\n },\n setCadContext(newCadContext) {\n const fullContext: CadContextValue = {\n error: null,\n isLoaded: true,\n status: CadStatus.Loaded,\n ...newCadContext,\n };\n Object.assign(cadContext, fullContext);\n },\n setCadError(error) {\n const fullContext: CadContextValue = {\n error,\n isLoaded: false,\n status: CadStatus.Error,\n ...initialCadContext,\n };\n Object.assign(cadContext, fullContext);\n },\n }));\n return (\n \n \n {children}\n \n \n );\n};\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport { CadRequiredComponentPropertiesFragmentDoc } from '../../data-access-layer/src/graphql/cad-electrical-components-fragment.generated';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type IsLidarAvailableQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type IsLidarAvailableQuery = { __typename: 'Query', lidarController?: { __typename: 'LidarController', lidarAvailable?: boolean | null | undefined } | null | undefined };\n\nexport type CadProvideTenantInfoQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type CadProvideTenantInfoQuery = { __typename: 'Query', apiInfo: { __typename: 'ApiInfo', tenant: { __typename: 'Tenant', id: string, temperatureUnit: Types.TemperatureUnit, units: Types.UnitSystem } } };\n\nexport type CadProvideProjectIdQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideProjectIdQuery = { __typename: 'Query', designById: { __typename: 'Design', project: { __typename: 'Project', id: string } } };\n\nexport type CadProvideProjectTypeQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideProjectTypeQuery = { __typename: 'Query', designById: { __typename: 'Design', project: { __typename: 'Project', projectType: Types.ProjectType } } };\n\nexport type CadProvideModuleSpacingSettingsQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideModuleSpacingSettingsQuery = { __typename: 'Query', design: { __typename: 'Design', rowSpacing?: number | null | undefined, interModuleSpacingX?: number | null | undefined, interModuleSpacingY?: number | null | undefined }, tenantSettings: { __typename: 'TenantConfigurationSettings', pitchedX?: { __typename: 'ConfigurationSettingFloat', value?: number | null | undefined } | null | undefined, pitchedY?: { __typename: 'ConfigurationSettingFloat', value?: number | null | undefined } | null | undefined, flatX?: { __typename: 'ConfigurationSettingFloat', value?: number | null | undefined } | null | undefined, flatY?: { __typename: 'ConfigurationSettingFloat', value?: number | null | undefined } | null | undefined, pitchedThreshold?: { __typename: 'ConfigurationSettingFloat', value?: number | null | undefined } | null | undefined } };\n\nexport type CadProvideTenantIdQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideTenantIdQuery = { __typename: 'Query', userById: { __typename: 'User', tenant?: { __typename: 'Tenant', id: string } | null | undefined } };\n\nexport type CadProvideDesignQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideDesignQuery = { __typename: 'Query', designById: { __typename: 'Design', longitude: number, latitude: number, savedFromNewCad: boolean, irradianceMapId?: string | null | undefined, irradianceMapStatus?: string | null | undefined, irradiancePanelsId?: string | null | undefined, irradiancePanelsStatus?: string | null | undefined, temperatureMax?: number | null | undefined, temperatureMin?: number | null | undefined, geodataBaseUrl?: string | null | undefined, geodataParentId?: number | null | undefined } };\n\nexport type CadProvideLeadCaptureDataQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideLeadCaptureDataQuery = { __typename: 'Query', getLeadCaptureProjectData: { __typename: 'LeadCaptureProject', id: string, location?: { __typename: 'LeadCaptureLocation', latitude: number, longitude: number } | null | undefined, pointCloud?: { __typename: 'LeadCapturePointCloud', id: string, data?: any | null | undefined } | null | undefined, image?: { __typename: 'LeadCaptureImage', id: string, dataUrl: string, worldfile: { __typename: 'Worldfile', a?: number | null | undefined, b?: number | null | undefined, c?: number | null | undefined, e?: number | null | undefined, d?: number | null | undefined, f?: number | null | undefined }, dimensions: { __typename: 'GeodataDimensions', height?: number | null | undefined, width?: number | null | undefined }, orthoImage: { __typename: 'OrthoImage', id: string, source: Types.OrthoImageSource, url?: string | null | undefined, name: string, active: boolean, opacity?: number | null | undefined, width?: number | null | undefined, height?: number | null | undefined, worldfileA?: number | null | undefined, worldfileB?: number | null | undefined, worldfileC?: number | null | undefined, worldfileD?: number | null | undefined, worldfileE?: number | null | undefined, worldfileF?: number | null | undefined, resource?: { __typename: 'GeodataResource', id?: string | null | undefined, source: string, url?: string | null | undefined, type: Types.GeodataResourceType, worldfile?: { __typename: 'Worldfile', a?: number | null | undefined, b?: number | null | undefined, c?: number | null | undefined, e?: number | null | undefined, d?: number | null | undefined, f?: number | null | undefined } | null | undefined, dimensions?: { __typename: 'GeodataDimensions', width?: number | null | undefined, height?: number | null | undefined } | null | undefined, metadata?: { __typename: 'GeodataMeta', opacity?: number | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined } } | null | undefined, site?: { __typename: 'LeadCaptureSite', id: string, data?: { __typename: 'LeadCaptureCadSite', baseElevation: number, centerLat: number, centerLng: number, roofPlanes: Array<{ __typename: 'LeadCaptureCadRoofPlane', height: number, pitch: number, azimuthEdgeIndex: number, shell: Array<{ __typename: 'LeadCaptureCadRoofPlaneNode', x: number, y: number, edgeType: string }>, holes: Array | null | undefined> }>, obstructions: Array<{ __typename: 'LeadCaptureCadObstruction', shape: string, center: Array, azimuthVector: Array, radius?: number | null | undefined, width?: number | null | undefined, length?: number | null | undefined, flush: boolean, heightAbove?: number | null | undefined, confidence: number }> } | null | undefined } | null | undefined, irradianceMap?: { __typename: 'LeadCaptureIrradianceMap', id: string, annualUrl?: string | null | undefined, monthlyUrl?: string | null | undefined, metaUrl?: string | null | undefined } | null | undefined, scenarios: Array<{ __typename: 'LeadCaptureScenario', energyTarget?: number | null | undefined, design?: { __typename: 'LeadCaptureDesign', id: string, data?: any | null | undefined } | null | undefined, irradiancePanels?: { __typename: 'LeadCaptureIrradiancePanels', id: string, annualUrl?: string | null | undefined, monthlyUrl?: string | null | undefined, metaUrl?: string | null | undefined } | null | undefined }> } };\n\nexport type CadProvidePricePerWattQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvidePricePerWattQuery = { __typename: 'Query', designById: { __typename: 'Design', pricePerWatt?: number | null | undefined } };\n\nexport type CadProvideTimeZoneOffsetQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideTimeZoneOffsetQuery = { __typename: 'Query', designById: { __typename: 'Design', project: { __typename: 'Project', timeZoneOffset?: number | null | undefined } } };\n\nexport type CadProvideTemplatesJsonQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideTemplatesJsonQuery = { __typename: 'Query', designById: { __typename: 'Design', templatesJson?: any | null | undefined } };\n\nexport type CadProvideSolarPanelQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideSolarPanelQuery = { __typename: 'Query', component?: { __typename: 'SolarPanel', efficiency?: number | null | undefined, height?: number | null | undefined, imp?: number | null | undefined, isc?: number | null | undefined, length?: number | null | undefined, noct?: number | null | undefined, panelType?: string | null | undefined, price?: number | null | undefined, ratingPtc?: number | null | undefined, ratingStc?: number | null | undefined, tempCoeffIsc?: number | null | undefined, tempCoeffPmax?: number | null | undefined, tempCoeffVoc?: number | null | undefined, vmp?: number | null | undefined, voc?: number | null | undefined, width?: number | null | undefined, id: string, name?: string | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined, mlpe?: { __typename: 'MLPE', id: string, type?: string | null | undefined, isSolarInverter?: boolean | null | undefined, isDcOptimizer?: boolean | null | undefined, isCellStringOptimizer?: boolean | null | undefined, solarInverter?: { __typename: 'SolarInverter', id: string, efficiencyCec?: number | null | undefined, efficiencyEuropean?: number | null | undefined, efficiencyMax?: number | null | undefined, hasExternalMppt?: boolean | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputVoltageMax?: number | null | undefined, inputVoltageMin?: number | null | undefined, inputVoltageSE?: number | null | undefined, isHuawei?: boolean | null | undefined, isSolarEdge?: boolean | null | undefined, isMicroinverter?: boolean | null | undefined, mpptRatedPowerVoltageMax?: number | null | undefined, mpptRatedPowerVoltageMin?: number | null | undefined, mppts?: number | null | undefined, name?: string | null | undefined, numPhases?: number | null | undefined, numPhysicalDcInputs?: number | null | undefined, outputCurrent?: number | null | undefined, outputVoltageNominal?: number | null | undefined, price?: number | null | undefined, ratedPower?: number | null | undefined, usableInputCurrentMax?: number | null | undefined, usableInputPowerMax?: number | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined, dcOptimizer?: { __typename: 'DcOptimizer', id: string, efficiency?: number | null | undefined, efficiencyMax?: number | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputShortCircuitCurrentMax?: number | null | undefined, inputVoltageMax?: number | null | undefined, isExternalMppt?: boolean | null | undefined, isLongString?: boolean | null | undefined, isHuawei?: boolean | null | undefined, isSolarEdge?: boolean | null | undefined, maxInputCurrent?: number | null | undefined, mpptOperatingVoltageMax?: number | null | undefined, mpptOperatingVoltageMin?: number | null | undefined, mpptRangeMax?: number | null | undefined, mpptRangeMin?: number | null | undefined, name?: string | null | undefined, numInputs?: number | null | undefined, operatingModel?: string | null | undefined, optimizationBehavior?: string | null | undefined, outputCurrentMax?: number | null | undefined, outputVoltageMax?: number | null | undefined, price?: number | null | undefined, stcInputPowerMax?: number | null | undefined, systemVoltageMax?: number | null | undefined, usesSelectiveOptimization?: boolean | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined, cellStringOptimizer?: { __typename: 'CellStringOptimizer', id: string, name?: string | null | undefined, voltageLimit?: boolean | null | undefined, maxOutputVoltage?: number | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined } | null | undefined } | null | undefined };\n\nexport type CadProvideSolarInverterQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideSolarInverterQuery = { __typename: 'Query', component?: { __typename: 'SolarInverter', efficiencyCec?: number | null | undefined, efficiencyEuropean?: number | null | undefined, efficiencyMax?: number | null | undefined, hasExternalMppt?: boolean | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputVoltageMax?: number | null | undefined, inputVoltageMin?: number | null | undefined, inputVoltageSE?: number | null | undefined, isHuawei?: boolean | null | undefined, isSolarEdge?: boolean | null | undefined, isMicroinverter?: boolean | null | undefined, mpptRatedPowerVoltageMax?: number | null | undefined, mpptRatedPowerVoltageMin?: number | null | undefined, mppts?: number | null | undefined, name?: string | null | undefined, numPhases?: number | null | undefined, numPhysicalDcInputs?: number | null | undefined, outputCurrent?: number | null | undefined, outputVoltageNominal?: number | null | undefined, price?: number | null | undefined, ratedPower?: number | null | undefined, usableInputCurrentMax?: number | null | undefined, usableInputPowerMax?: number | null | undefined, id: string, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined };\n\nexport type CadProvideDcOptimizerQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideDcOptimizerQuery = { __typename: 'Query', component: { __typename: 'DcOptimizer', efficiency?: number | null | undefined, efficiencyMax?: number | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputShortCircuitCurrentMax?: number | null | undefined, inputVoltageMax?: number | null | undefined, isExternalMppt?: boolean | null | undefined, isLongString?: boolean | null | undefined, isHuawei?: boolean | null | undefined, isSolarEdge?: boolean | null | undefined, maxInputCurrent?: number | null | undefined, mpptOperatingVoltageMax?: number | null | undefined, mpptOperatingVoltageMin?: number | null | undefined, mpptRangeMax?: number | null | undefined, mpptRangeMin?: number | null | undefined, name?: string | null | undefined, numInputs?: number | null | undefined, operatingModel?: string | null | undefined, optimizationBehavior?: string | null | undefined, outputCurrentMax?: number | null | undefined, outputVoltageMax?: number | null | undefined, price?: number | null | undefined, stcInputPowerMax?: number | null | undefined, systemVoltageMax?: number | null | undefined, usesSelectiveOptimization?: boolean | null | undefined, id: string, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } };\n\nexport type CadProvideCombinerBoxQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideCombinerBoxQuery = { __typename: 'Query', component: { __typename: 'CombinerBox', id: string, voltageRating?: number | null | undefined, fuseRating?: number | null | undefined, nemaRating?: string | null | undefined } };\n\nexport type CadProvideDisconnectQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideDisconnectQuery = { __typename: 'Query', component: { __typename: 'Disconnect', fused?: boolean | null | undefined, fuseRating?: number | null | undefined, currentRating?: number | null | undefined, voltageRating?: number | null | undefined, id: string, name?: string | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, name?: string | null | undefined, displayName?: string | null | undefined } | null | undefined } };\n\nexport type CadProvideLoadCenterQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideLoadCenterQuery = { __typename: 'Query', component: { __typename: 'LoadCenter', mainBreakerRating?: number | null | undefined, busRating?: number | null | undefined, isBreaker?: boolean | null | undefined, id: string, name?: string | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, name?: string | null | undefined, displayName?: string | null | undefined } | null | undefined } };\n\nexport type CadProvideMeterQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideMeterQuery = { __typename: 'Query', component: { __typename: 'Meter', currentRating?: number | null | undefined, id: string, name?: string | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, name?: string | null | undefined, displayName?: string | null | undefined } | null | undefined } };\n\nexport type CadProvideServicePanelQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type CadProvideServicePanelQuery = { __typename: 'Query', component?: { __typename: 'ServicePanel', breakerRating?: number | null | undefined, busRating?: number | null | undefined, main?: boolean | null | undefined, id: string, name?: string | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, name?: string | null | undefined, displayName?: string | null | undefined } | null | undefined } | null | undefined };\n\nexport type PanelIrradianceProgressQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type PanelIrradianceProgressQuery = { __typename: 'Query', CAD: { __typename: 'CAD', irradianceState: { __typename: 'IrradianceState', panels: { __typename: 'IrradianceStateType', progress: number } } } };\n\nexport type RoofIrradianceProgressQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type RoofIrradianceProgressQuery = { __typename: 'Query', CAD: { __typename: 'CAD', irradianceState: { __typename: 'IrradianceState', roof: { __typename: 'IrradianceStateType', progress: number } } } };\n\n\nexport const IsLidarAvailableDocument = gql`\n query IsLidarAvailable @trace_info(traceInfo: {pod: cad}) {\n lidarController @client {\n lidarAvailable\n }\n}\n `;\n\n/**\n * __useIsLidarAvailableQuery__\n *\n * To run a query within a React component, call `useIsLidarAvailableQuery` and pass it any options that fit your needs.\n * When your component renders, `useIsLidarAvailableQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useIsLidarAvailableQuery({\n * variables: {\n * },\n * });\n */\nexport function useIsLidarAvailableQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(IsLidarAvailableDocument, options);\n }\nexport function useIsLidarAvailableLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(IsLidarAvailableDocument, options);\n }\nexport type IsLidarAvailableQueryHookResult = ReturnType;\nexport type IsLidarAvailableLazyQueryHookResult = ReturnType;\nexport type IsLidarAvailableQueryResult = Apollo.QueryResult;\nexport const CadProvideTenantInfoDocument = gql`\n query CadProvideTenantInfo @trace_info(traceInfo: {pod: cad}) {\n apiInfo {\n tenant {\n id\n temperatureUnit\n units\n }\n }\n}\n `;\n\n/**\n * __useCadProvideTenantInfoQuery__\n *\n * To run a query within a React component, call `useCadProvideTenantInfoQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideTenantInfoQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideTenantInfoQuery({\n * variables: {\n * },\n * });\n */\nexport function useCadProvideTenantInfoQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideTenantInfoDocument, options);\n }\nexport function useCadProvideTenantInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideTenantInfoDocument, options);\n }\nexport type CadProvideTenantInfoQueryHookResult = ReturnType;\nexport type CadProvideTenantInfoLazyQueryHookResult = ReturnType;\nexport type CadProvideTenantInfoQueryResult = Apollo.QueryResult;\nexport const CadProvideProjectIdDocument = gql`\n query CadProvideProjectId($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n project {\n id\n }\n }\n}\n `;\n\n/**\n * __useCadProvideProjectIdQuery__\n *\n * To run a query within a React component, call `useCadProvideProjectIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideProjectIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideProjectIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideProjectIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideProjectIdDocument, options);\n }\nexport function useCadProvideProjectIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideProjectIdDocument, options);\n }\nexport type CadProvideProjectIdQueryHookResult = ReturnType;\nexport type CadProvideProjectIdLazyQueryHookResult = ReturnType;\nexport type CadProvideProjectIdQueryResult = Apollo.QueryResult;\nexport const CadProvideProjectTypeDocument = gql`\n query CadProvideProjectType($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n project {\n projectType\n }\n }\n}\n `;\n\n/**\n * __useCadProvideProjectTypeQuery__\n *\n * To run a query within a React component, call `useCadProvideProjectTypeQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideProjectTypeQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideProjectTypeQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideProjectTypeQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideProjectTypeDocument, options);\n }\nexport function useCadProvideProjectTypeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideProjectTypeDocument, options);\n }\nexport type CadProvideProjectTypeQueryHookResult = ReturnType;\nexport type CadProvideProjectTypeLazyQueryHookResult = ReturnType;\nexport type CadProvideProjectTypeQueryResult = Apollo.QueryResult;\nexport const CadProvideModuleSpacingSettingsDocument = gql`\n query CadProvideModuleSpacingSettings($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n design: designById(id: $id) {\n rowSpacing\n interModuleSpacingX\n interModuleSpacingY\n }\n tenantSettings {\n pitchedX: autoDesignerOptionsColumnSpacingMDefault {\n value\n }\n pitchedY: autoDesignerOptionsRowSpacingMDefault {\n value\n }\n flatX: autoDesignerOptionsFlatFaceColumnSpacingMDefault {\n value\n }\n flatY: autoDesignerOptionsFlatFaceRowSpacingMDefault {\n value\n }\n pitchedThreshold: autoDesignerOptionsPitchedFaceTiltThresholdDeg {\n value\n }\n }\n}\n `;\n\n/**\n * __useCadProvideModuleSpacingSettingsQuery__\n *\n * To run a query within a React component, call `useCadProvideModuleSpacingSettingsQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideModuleSpacingSettingsQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideModuleSpacingSettingsQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideModuleSpacingSettingsQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideModuleSpacingSettingsDocument, options);\n }\nexport function useCadProvideModuleSpacingSettingsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideModuleSpacingSettingsDocument, options);\n }\nexport type CadProvideModuleSpacingSettingsQueryHookResult = ReturnType;\nexport type CadProvideModuleSpacingSettingsLazyQueryHookResult = ReturnType;\nexport type CadProvideModuleSpacingSettingsQueryResult = Apollo.QueryResult;\nexport const CadProvideTenantIdDocument = gql`\n query CadProvideTenantId($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n userById(id: $id) {\n tenant {\n id\n }\n }\n}\n `;\n\n/**\n * __useCadProvideTenantIdQuery__\n *\n * To run a query within a React component, call `useCadProvideTenantIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideTenantIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideTenantIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideTenantIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideTenantIdDocument, options);\n }\nexport function useCadProvideTenantIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideTenantIdDocument, options);\n }\nexport type CadProvideTenantIdQueryHookResult = ReturnType;\nexport type CadProvideTenantIdLazyQueryHookResult = ReturnType;\nexport type CadProvideTenantIdQueryResult = Apollo.QueryResult;\nexport const CadProvideDesignDocument = gql`\n query CadProvideDesign($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n longitude\n latitude\n savedFromNewCad\n irradianceMapId\n irradianceMapStatus\n irradiancePanelsId\n irradiancePanelsStatus\n temperatureMax\n temperatureMin\n geodataBaseUrl\n geodataParentId\n }\n}\n `;\n\n/**\n * __useCadProvideDesignQuery__\n *\n * To run a query within a React component, call `useCadProvideDesignQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideDesignQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideDesignQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideDesignQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideDesignDocument, options);\n }\nexport function useCadProvideDesignLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideDesignDocument, options);\n }\nexport type CadProvideDesignQueryHookResult = ReturnType;\nexport type CadProvideDesignLazyQueryHookResult = ReturnType;\nexport type CadProvideDesignQueryResult = Apollo.QueryResult;\nexport const CadProvideLeadCaptureDataDocument = gql`\n query CadProvideLeadCaptureData($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n getLeadCaptureProjectData(id: $id) {\n id\n location {\n latitude\n longitude\n }\n pointCloud {\n id\n data\n }\n image {\n id\n dataUrl\n worldfile {\n a\n b\n c\n e\n d\n f\n }\n dimensions {\n height\n width\n }\n orthoImage {\n id\n source\n url\n name\n active\n opacity\n width\n height\n worldfileA\n worldfileB\n worldfileC\n worldfileD\n worldfileE\n worldfileF\n resource {\n id\n source\n url\n type\n worldfile {\n a\n b\n c\n e\n d\n f\n }\n dimensions {\n width\n height\n }\n metadata {\n opacity\n name\n }\n }\n }\n }\n site {\n id\n data {\n roofPlanes {\n shell {\n x\n y\n edgeType\n }\n holes {\n x\n y\n edgeType\n }\n height\n pitch\n azimuthEdgeIndex\n }\n obstructions {\n shape\n center\n azimuthVector\n radius\n width\n length\n flush\n heightAbove\n confidence\n }\n baseElevation\n centerLat\n centerLng\n }\n }\n irradianceMap {\n id\n annualUrl\n monthlyUrl\n metaUrl\n }\n scenarios {\n energyTarget\n design {\n id\n data\n }\n irradiancePanels {\n id\n annualUrl\n monthlyUrl\n metaUrl\n }\n }\n }\n}\n `;\n\n/**\n * __useCadProvideLeadCaptureDataQuery__\n *\n * To run a query within a React component, call `useCadProvideLeadCaptureDataQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideLeadCaptureDataQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideLeadCaptureDataQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideLeadCaptureDataQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideLeadCaptureDataDocument, options);\n }\nexport function useCadProvideLeadCaptureDataLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideLeadCaptureDataDocument, options);\n }\nexport type CadProvideLeadCaptureDataQueryHookResult = ReturnType;\nexport type CadProvideLeadCaptureDataLazyQueryHookResult = ReturnType;\nexport type CadProvideLeadCaptureDataQueryResult = Apollo.QueryResult;\nexport const CadProvidePricePerWattDocument = gql`\n query CadProvidePricePerWatt($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n pricePerWatt\n }\n}\n `;\n\n/**\n * __useCadProvidePricePerWattQuery__\n *\n * To run a query within a React component, call `useCadProvidePricePerWattQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvidePricePerWattQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvidePricePerWattQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvidePricePerWattQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvidePricePerWattDocument, options);\n }\nexport function useCadProvidePricePerWattLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvidePricePerWattDocument, options);\n }\nexport type CadProvidePricePerWattQueryHookResult = ReturnType;\nexport type CadProvidePricePerWattLazyQueryHookResult = ReturnType;\nexport type CadProvidePricePerWattQueryResult = Apollo.QueryResult;\nexport const CadProvideTimeZoneOffsetDocument = gql`\n query CadProvideTimeZoneOffset($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n project {\n timeZoneOffset\n }\n }\n}\n `;\n\n/**\n * __useCadProvideTimeZoneOffsetQuery__\n *\n * To run a query within a React component, call `useCadProvideTimeZoneOffsetQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideTimeZoneOffsetQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideTimeZoneOffsetQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideTimeZoneOffsetQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideTimeZoneOffsetDocument, options);\n }\nexport function useCadProvideTimeZoneOffsetLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideTimeZoneOffsetDocument, options);\n }\nexport type CadProvideTimeZoneOffsetQueryHookResult = ReturnType;\nexport type CadProvideTimeZoneOffsetLazyQueryHookResult = ReturnType;\nexport type CadProvideTimeZoneOffsetQueryResult = Apollo.QueryResult;\nexport const CadProvideTemplatesJsonDocument = gql`\n query CadProvideTemplatesJson($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n templatesJson\n }\n}\n `;\n\n/**\n * __useCadProvideTemplatesJsonQuery__\n *\n * To run a query within a React component, call `useCadProvideTemplatesJsonQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideTemplatesJsonQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideTemplatesJsonQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideTemplatesJsonQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideTemplatesJsonDocument, options);\n }\nexport function useCadProvideTemplatesJsonLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideTemplatesJsonDocument, options);\n }\nexport type CadProvideTemplatesJsonQueryHookResult = ReturnType;\nexport type CadProvideTemplatesJsonLazyQueryHookResult = ReturnType;\nexport type CadProvideTemplatesJsonQueryResult = Apollo.QueryResult;\nexport const CadProvideSolarPanelDocument = gql`\n query CadProvideSolarPanel($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: solarPanelById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideSolarPanelQuery__\n *\n * To run a query within a React component, call `useCadProvideSolarPanelQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideSolarPanelQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideSolarPanelQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideSolarPanelQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideSolarPanelDocument, options);\n }\nexport function useCadProvideSolarPanelLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideSolarPanelDocument, options);\n }\nexport type CadProvideSolarPanelQueryHookResult = ReturnType;\nexport type CadProvideSolarPanelLazyQueryHookResult = ReturnType;\nexport type CadProvideSolarPanelQueryResult = Apollo.QueryResult;\nexport const CadProvideSolarInverterDocument = gql`\n query CadProvideSolarInverter($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: solarInverterById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideSolarInverterQuery__\n *\n * To run a query within a React component, call `useCadProvideSolarInverterQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideSolarInverterQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideSolarInverterQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideSolarInverterQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideSolarInverterDocument, options);\n }\nexport function useCadProvideSolarInverterLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideSolarInverterDocument, options);\n }\nexport type CadProvideSolarInverterQueryHookResult = ReturnType;\nexport type CadProvideSolarInverterLazyQueryHookResult = ReturnType;\nexport type CadProvideSolarInverterQueryResult = Apollo.QueryResult;\nexport const CadProvideDcOptimizerDocument = gql`\n query CadProvideDcOptimizer($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: dcOptimizerById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideDcOptimizerQuery__\n *\n * To run a query within a React component, call `useCadProvideDcOptimizerQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideDcOptimizerQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideDcOptimizerQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideDcOptimizerQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideDcOptimizerDocument, options);\n }\nexport function useCadProvideDcOptimizerLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideDcOptimizerDocument, options);\n }\nexport type CadProvideDcOptimizerQueryHookResult = ReturnType;\nexport type CadProvideDcOptimizerLazyQueryHookResult = ReturnType;\nexport type CadProvideDcOptimizerQueryResult = Apollo.QueryResult;\nexport const CadProvideCombinerBoxDocument = gql`\n query CadProvideCombinerBox($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: combinerBoxById(id: $id) {\n id\n voltageRating\n fuseRating\n nemaRating\n }\n}\n `;\n\n/**\n * __useCadProvideCombinerBoxQuery__\n *\n * To run a query within a React component, call `useCadProvideCombinerBoxQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideCombinerBoxQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideCombinerBoxQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideCombinerBoxQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideCombinerBoxDocument, options);\n }\nexport function useCadProvideCombinerBoxLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideCombinerBoxDocument, options);\n }\nexport type CadProvideCombinerBoxQueryHookResult = ReturnType;\nexport type CadProvideCombinerBoxLazyQueryHookResult = ReturnType;\nexport type CadProvideCombinerBoxQueryResult = Apollo.QueryResult;\nexport const CadProvideDisconnectDocument = gql`\n query CadProvideDisconnect($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: disconnectById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideDisconnectQuery__\n *\n * To run a query within a React component, call `useCadProvideDisconnectQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideDisconnectQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideDisconnectQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideDisconnectQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideDisconnectDocument, options);\n }\nexport function useCadProvideDisconnectLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideDisconnectDocument, options);\n }\nexport type CadProvideDisconnectQueryHookResult = ReturnType;\nexport type CadProvideDisconnectLazyQueryHookResult = ReturnType;\nexport type CadProvideDisconnectQueryResult = Apollo.QueryResult;\nexport const CadProvideLoadCenterDocument = gql`\n query CadProvideLoadCenter($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: loadCenterById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideLoadCenterQuery__\n *\n * To run a query within a React component, call `useCadProvideLoadCenterQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideLoadCenterQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideLoadCenterQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideLoadCenterQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideLoadCenterDocument, options);\n }\nexport function useCadProvideLoadCenterLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideLoadCenterDocument, options);\n }\nexport type CadProvideLoadCenterQueryHookResult = ReturnType;\nexport type CadProvideLoadCenterLazyQueryHookResult = ReturnType;\nexport type CadProvideLoadCenterQueryResult = Apollo.QueryResult;\nexport const CadProvideMeterDocument = gql`\n query CadProvideMeter($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: meterById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideMeterQuery__\n *\n * To run a query within a React component, call `useCadProvideMeterQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideMeterQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideMeterQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideMeterQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideMeterDocument, options);\n }\nexport function useCadProvideMeterLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideMeterDocument, options);\n }\nexport type CadProvideMeterQueryHookResult = ReturnType;\nexport type CadProvideMeterLazyQueryHookResult = ReturnType;\nexport type CadProvideMeterQueryResult = Apollo.QueryResult;\nexport const CadProvideServicePanelDocument = gql`\n query CadProvideServicePanel($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n component: servicePanelById(id: $id) {\n ...CadRequiredComponentProperties\n }\n}\n ${CadRequiredComponentPropertiesFragmentDoc}`;\n\n/**\n * __useCadProvideServicePanelQuery__\n *\n * To run a query within a React component, call `useCadProvideServicePanelQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadProvideServicePanelQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadProvideServicePanelQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useCadProvideServicePanelQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadProvideServicePanelDocument, options);\n }\nexport function useCadProvideServicePanelLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadProvideServicePanelDocument, options);\n }\nexport type CadProvideServicePanelQueryHookResult = ReturnType;\nexport type CadProvideServicePanelLazyQueryHookResult = ReturnType;\nexport type CadProvideServicePanelQueryResult = Apollo.QueryResult;\nexport const PanelIrradianceProgressDocument = gql`\n query PanelIrradianceProgress @trace_info(traceInfo: {pod: cad}) {\n CAD @client {\n irradianceState {\n panels {\n progress\n }\n }\n }\n}\n `;\n\n/**\n * __usePanelIrradianceProgressQuery__\n *\n * To run a query within a React component, call `usePanelIrradianceProgressQuery` and pass it any options that fit your needs.\n * When your component renders, `usePanelIrradianceProgressQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = usePanelIrradianceProgressQuery({\n * variables: {\n * },\n * });\n */\nexport function usePanelIrradianceProgressQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(PanelIrradianceProgressDocument, options);\n }\nexport function usePanelIrradianceProgressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(PanelIrradianceProgressDocument, options);\n }\nexport type PanelIrradianceProgressQueryHookResult = ReturnType;\nexport type PanelIrradianceProgressLazyQueryHookResult = ReturnType;\nexport type PanelIrradianceProgressQueryResult = Apollo.QueryResult;\nexport const RoofIrradianceProgressDocument = gql`\n query RoofIrradianceProgress @trace_info(traceInfo: {pod: cad}) {\n CAD @client {\n irradianceState {\n roof {\n progress\n }\n }\n }\n}\n `;\n\n/**\n * __useRoofIrradianceProgressQuery__\n *\n * To run a query within a React component, call `useRoofIrradianceProgressQuery` and pass it any options that fit your needs.\n * When your component renders, `useRoofIrradianceProgressQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useRoofIrradianceProgressQuery({\n * variables: {\n * },\n * });\n */\nexport function useRoofIrradianceProgressQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(RoofIrradianceProgressDocument, options);\n }\nexport function useRoofIrradianceProgressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(RoofIrradianceProgressDocument, options);\n }\nexport type RoofIrradianceProgressQueryHookResult = ReturnType;\nexport type RoofIrradianceProgressLazyQueryHookResult = ReturnType;\nexport type RoofIrradianceProgressQueryResult = Apollo.QueryResult;","import {\n ApolloClient,\n DataProxy,\n DocumentNode,\n NormalizedCacheObject,\n OperationVariables,\n} from '@apollo/client';\nimport { estimateProgress } from '@aurorasolar/common-core/src/utils';\nimport {\n StartAsyncJobDocument,\n StartAsyncJobMutation,\n StartAsyncJobMutationVariables,\n} from '@aurorasolar/common-data-access-layer';\nimport {\n GetTenantUnitSettingDocument,\n GetTenantUnitSettingQuery,\n} from '@aurorasolar/common-numeric-conversion';\nimport {\n AsyncJobParameters,\n AsyncJobType,\n ComponentTypes,\n} from '@aurorasolar/graphql-client-schema';\n\nimport { CadPreferences } from '@aurorasolar/cad-preferences';\nimport {\n CadProvideCombinerBoxDocument,\n CadProvideCombinerBoxQuery,\n CadProvideDcOptimizerDocument,\n CadProvideDcOptimizerQuery,\n CadProvideDesignDocument,\n CadProvideDesignQuery,\n CadProvideDesignQueryVariables,\n CadProvideDisconnectDocument,\n CadProvideDisconnectQuery,\n CadProvideLeadCaptureDataDocument,\n CadProvideLeadCaptureDataQuery,\n CadProvideLeadCaptureDataQueryVariables,\n CadProvideLoadCenterDocument,\n CadProvideLoadCenterQuery,\n CadProvideMeterDocument,\n CadProvideMeterQuery,\n CadProvideModuleSpacingSettingsDocument,\n CadProvideModuleSpacingSettingsQuery,\n CadProvideModuleSpacingSettingsQueryVariables,\n CadProvidePricePerWattDocument,\n CadProvidePricePerWattQuery,\n CadProvidePricePerWattQueryVariables,\n CadProvideProjectIdDocument,\n CadProvideProjectIdQuery,\n CadProvideProjectIdQueryVariables,\n CadProvideProjectTypeDocument,\n CadProvideProjectTypeQuery,\n CadProvideProjectTypeQueryVariables,\n CadProvideServicePanelDocument,\n CadProvideServicePanelQuery,\n CadProvideSolarInverterDocument,\n CadProvideSolarInverterQuery,\n CadProvideSolarPanelDocument,\n CadProvideSolarPanelQuery,\n CadProvideTemplatesJsonDocument,\n CadProvideTemplatesJsonQuery,\n CadProvideTemplatesJsonQueryVariables,\n CadProvideTimeZoneOffsetDocument,\n CadProvideTimeZoneOffsetQuery,\n CadProvideTimeZoneOffsetQueryVariables,\n IsLidarAvailableDocument,\n IsLidarAvailableQuery,\n PanelIrradianceProgressDocument,\n PanelIrradianceProgressQuery,\n RoofIrradianceProgressDocument,\n RoofIrradianceProgressQuery,\n} from './data-service.generated';\n\ntype KebabToCamel = S extends `${infer H}-${infer T}`\n ? T extends Capitalize\n ? `${H}-${KebabToCamel}`\n : `${H}${KebabToCamel>}`\n : S;\n\nexport const convertKebabToCamelCase = (s: T) =>\n s.replace('.', '_').replace(/(\\w)-(\\w)/g, (_, a, b) => a + b.toUpperCase()) as KebabToCamel;\n\nexport const convertSnakeToCamelCase = (s: string) =>\n s.replace(/(\\w)_(\\w)/g, (_, a, b) => a + b.toUpperCase());\n\ntype ComponentQueryResult = T extends ComponentTypes.CombinerBox\n ? CadProvideCombinerBoxQuery\n : T extends ComponentTypes.DcOptimizer\n ? CadProvideDcOptimizerQuery\n : T extends ComponentTypes.Disconnect\n ? CadProvideDisconnectQuery\n : T extends ComponentTypes.LoadCenter\n ? CadProvideLoadCenterQuery\n : T extends ComponentTypes.Meter\n ? CadProvideMeterQuery\n : T extends ComponentTypes.ServicePanel\n ? CadProvideServicePanelQuery\n : T extends ComponentTypes.SolarInverter\n ? CadProvideSolarInverterQuery\n : T extends ComponentTypes.SolarPanel\n ? CadProvideSolarPanelQuery\n : never;\n\nconst getComponentReadQuery =\n (query: DocumentNode) =>\n (client: ApolloClient, id: string) =>\n client.cache.readQuery({\n query,\n variables: {\n id,\n } as unknown as V,\n } as DataProxy.ReadQueryOptions);\n\nconst ComponentQueries = {\n [ComponentTypes.CombinerBox]: getComponentReadQuery(\n CadProvideCombinerBoxDocument,\n ),\n [ComponentTypes.DcOptimizer]: getComponentReadQuery(\n CadProvideDcOptimizerDocument,\n ),\n [ComponentTypes.Disconnect]: getComponentReadQuery(\n CadProvideDisconnectDocument,\n ),\n [ComponentTypes.LoadCenter]: getComponentReadQuery(\n CadProvideLoadCenterDocument,\n ),\n [ComponentTypes.Meter]: getComponentReadQuery(CadProvideMeterDocument),\n [ComponentTypes.SolarInverter]: getComponentReadQuery(\n CadProvideSolarInverterDocument,\n ),\n [ComponentTypes.ServicePanel]: getComponentReadQuery(\n CadProvideServicePanelDocument,\n ),\n [ComponentTypes.SolarPanel]: getComponentReadQuery(\n CadProvideSolarPanelDocument,\n ),\n} as const;\n\n/** A subset of `ComponentTypes` that are used in the data service */\nexport type DataServiceComponentType = keyof typeof ComponentQueries;\n\nexport const getTenantInfo = (client: ApolloClient) => {\n return client.readQuery({\n query: GetTenantUnitSettingDocument,\n });\n};\n\nexport const isLidarAvailable = (client: ApolloClient) =>\n client.cache.readQuery({\n query: IsLidarAvailableDocument,\n returnPartialData: true,\n })?.lidarController?.lidarAvailable ?? false;\n\nexport const getDesign = (\n client: ApolloClient,\n id: string,\n): CadProvideDesignQuery['designById'] | undefined =>\n client.cache.readQuery({\n query: CadProvideDesignDocument,\n returnPartialData: true,\n variables: {\n id,\n },\n })?.designById;\n\nexport const getLeadCaptureDesign = (\n client: ApolloClient,\n id: string,\n): CadProvideLeadCaptureDataQuery['getLeadCaptureProjectData'] | undefined =>\n client.cache.readQuery({\n query: CadProvideLeadCaptureDataDocument,\n returnPartialData: true,\n variables: {\n id,\n },\n })?.getLeadCaptureProjectData;\n\nexport const getProjectId = (client: ApolloClient, id: string) => {\n const data = client.cache.readQuery({\n query: CadProvideProjectIdDocument,\n returnPartialData: true,\n variables: {\n id,\n },\n });\n\n return data?.designById?.project?.id ?? '';\n};\n\nexport const getProjectType = (client: ApolloClient, id: string) => {\n const data = client.cache.readQuery<\n CadProvideProjectTypeQuery,\n CadProvideProjectTypeQueryVariables\n >({\n query: CadProvideProjectTypeDocument,\n returnPartialData: true,\n variables: {\n id,\n },\n });\n\n return data?.designById?.project?.projectType || '';\n};\nexport type ModuleSpacingSettings = {\n /** @deprecated - Old setting: used in place of `y` when the panel has a tilt **/\n rowSpacing: number;\n /** @deprecated - Old setting */\n x: number;\n /** @deprecated - Old setting: used when the panel has no tilt */\n y: number;\n\n /** Used when the roof is flat */\n flatX: number;\n /** Used when the roof is flat */\n flatY: number;\n\n /** Used when the roof is pitched */\n pitchedX: number;\n /** Used when the roof is pitched */\n pitchedY: number;\n\n pitchedThreshold: number;\n};\n\n/**\n * Gets the module spacing settings for CAD\n *\n * The deprecated fields `rowSpacing`, `x`, and `y` are taken from the design itself.\n * The flat and pitched specific fields are taken from user preferences, if available.\n */\nexport const getModuleSpacingSettings = (\n client: ApolloClient,\n designId: string,\n preferences?: CadPreferences,\n) => {\n const { design, tenantSettings } =\n client.cache.readQuery<\n CadProvideModuleSpacingSettingsQuery,\n CadProvideModuleSpacingSettingsQueryVariables\n >({\n query: CadProvideModuleSpacingSettingsDocument,\n variables: {\n id: designId,\n },\n }) ?? {};\n\n const panelPreferences = preferences?.get('panelPlaceMode');\n\n const moduleSpacingSettings: ModuleSpacingSettings = {\n flatX: panelPreferences?.flatIntermoduleSpacingX ?? tenantSettings?.flatX?.value ?? 0,\n flatY: panelPreferences?.flatRowSpacing ?? tenantSettings?.flatY?.value ?? 0,\n pitchedThreshold:\n panelPreferences?.pitchedThreshold ?? tenantSettings?.pitchedThreshold?.value ?? 0,\n pitchedX: panelPreferences?.pitchedIntermoduleSpacingX ?? tenantSettings?.pitchedX?.value ?? 0,\n pitchedY: panelPreferences?.pitchedRowSpacing ?? tenantSettings?.pitchedY?.value ?? 0,\n rowSpacing: design?.rowSpacing ?? 0,\n x: design?.interModuleSpacingX ?? 0,\n y: design?.interModuleSpacingY ?? 0,\n };\n\n return moduleSpacingSettings;\n};\n\nexport const getPricePerWatt = (client: ApolloClient, id: string) => {\n const data = client.cache.readQuery<\n CadProvidePricePerWattQuery,\n CadProvidePricePerWattQueryVariables\n >({\n query: CadProvidePricePerWattDocument,\n variables: {\n id,\n },\n });\n\n return data?.designById?.pricePerWatt ?? 0;\n};\n\nexport const getTimeZoneOffset = (client: ApolloClient, id: string) => {\n const data = client.cache.readQuery<\n CadProvideTimeZoneOffsetQuery,\n CadProvideTimeZoneOffsetQueryVariables\n >({\n query: CadProvideTimeZoneOffsetDocument,\n variables: {\n id,\n },\n });\n\n return data?.designById.project.timeZoneOffset ?? 0;\n};\n\nexport const isLidarAccessible = (\n client: ApolloClient,\n lidarFeatureAvailable: boolean,\n) => {\n return !!lidarFeatureAvailable && isLidarAvailable(client);\n};\n\nexport const getTemplateJsonById = (client: ApolloClient, id: string) => {\n const data = client.cache.readQuery<\n CadProvideTemplatesJsonQuery,\n CadProvideTemplatesJsonQueryVariables\n >({\n query: CadProvideTemplatesJsonDocument,\n variables: {\n id,\n },\n });\n\n return data?.designById?.templatesJson?.[id] ?? null;\n};\n\nexport type MapType = 'roof' | 'panels';\ntype IrradianceStateQuery = PanelIrradianceProgressQuery | RoofIrradianceProgressQuery;\n\nconst setIrradianceProgress = (\n client: ApolloClient,\n mapType: T,\n progress: number,\n) => {\n client.writeQuery({\n data: {\n __typename: 'Query',\n CAD: {\n __typename: 'CAD',\n irradianceState: {\n __typename: 'IrradianceState',\n [mapType]: {\n __typename: 'IrradianceStateType',\n progress,\n },\n },\n },\n } as IrradianceStateQuery,\n query: mapType === 'panels' ? PanelIrradianceProgressDocument : RoofIrradianceProgressDocument,\n });\n};\n\nexport const getIrradiance = async (\n client: ApolloClient,\n mapType: MapType,\n designId: string,\n) => {\n const settings = { designId, mapType };\n const setProgress = (progress: number) => setIrradianceProgress(client, mapType, progress);\n setProgress(0);\n const stopEstimating = estimateProgress(30, setProgress);\n const { data } = await client\n .mutate({\n mutation: StartAsyncJobDocument,\n variables: {\n settings,\n type: AsyncJobType.Irradiance,\n },\n })\n .catch((error) => {\n stopEstimating();\n setProgress(0);\n throw error;\n });\n stopEstimating();\n setProgress(100);\n return data?.startAsyncJob ?? null;\n};\n\nexport const runAutoString = async (\n client: ApolloClient,\n params: AsyncJobParameters,\n) => {\n const { data } = await client.mutate({\n mutation: StartAsyncJobDocument,\n variables: {\n settings: params,\n type: AsyncJobType.AutoString,\n },\n });\n\n // We have to clone as CAD tries to modify and cache doesn't allow this\n return JSON.parse(JSON.stringify(data?.startAsyncJob ?? null));\n};\n\nexport const getIrradianceState = (client: ApolloClient, id: string) => {\n const design = getDesign(client, id);\n\n if (!design) {\n throw new Error('Could not get design for getIrradianceState');\n }\n\n return {\n id,\n panels: {\n id: design.irradiancePanelsId,\n status: design.irradiancePanelsStatus || 'invalid',\n },\n roof: {\n id: design.irradianceMapId,\n status: design.irradianceMapStatus || 'invalid',\n },\n };\n};\n\nexport const getIrradianceStateAutoRoof = (\n client: ApolloClient,\n id: string,\n) => {\n const design = getDesign(client, id);\n\n if (!design) {\n throw new Error('Could not get design for getIrradianceStateAutoRoof');\n }\n\n return {\n id,\n panels: {\n id: design.irradiancePanelsId || null,\n status: design.irradiancePanelsStatus || 'invalid',\n },\n roof: {\n id: design.irradianceMapId || null,\n status: design.irradianceMapStatus || 'invalid',\n },\n };\n};\n\nconst formatMlpe = (component: T): T => {\n if (component?.__typename === 'SolarPanel' && component.mlpe) {\n const { mlpe } = component;\n\n if (mlpe.isDcOptimizer) {\n return { ...component, mlpe: { ...mlpe, ...mlpe.dcOptimizer } };\n }\n if (mlpe.isSolarInverter) {\n return { ...component, mlpe: { ...mlpe, ...mlpe.solarInverter } };\n }\n if (mlpe.isCellStringOptimizer) {\n return { ...component, mlpe: { ...mlpe, ...mlpe.cellStringOptimizer } };\n }\n }\n return component;\n};\n\nconst readComponent = (\n client: ApolloClient,\n type: T,\n id: string,\n) => {\n const queryComponent = ComponentQueries[type];\n const result = queryComponent(client, id) as ComponentQueryResult | null;\n return result?.component ?? null;\n};\n\nexport const peekRecord = (\n client: ApolloClient,\n type: T,\n compId: string,\n) => {\n const typeCamelCase = convertKebabToCamelCase(type);\n try {\n if (!(typeCamelCase in ComponentQueries)) {\n throw new Error(`Invalid type: ${type}`);\n }\n const result = readComponent(client, typeCamelCase as DataServiceComponentType, compId);\n return result ? formatMlpe(result) : null;\n } catch (e) {\n console.error(e);\n console.error(\n `Failed to fetch a record from apollo cache: ${typeCamelCase} ${compId} does not exist. `,\n );\n throw e;\n }\n};\n","const Converter = function (numerator, definitions) {\n this.definitions = definitions;\n this.val = numerator;\n};\n\nConverter.prototype.from = function (from) {\n if (this.destination) { throw new Error('.from must be called before .to') }\n\n this.origin = this.getUnit(from);\n\n if (!this.origin) {\n this.throwUnsupportedUnitError(from);\n }\n\n return this\n};\n\nConverter.prototype.to = function (to) {\n if (!this.origin) { throw new Error('.to must be called after .from') }\n\n this.destination = this.getUnit(to);\n\n let result;\n\n if (!this.destination) {\n this.throwUnsupportedUnitError(to);\n }\n\n if (this.origin.abbr === this.destination.abbr) {\n return Object.assign({ value: this.val }, this.describe(this.destination.abbr))\n }\n\n result = this.val * this.origin.unit.to_anchor;\n\n if (this.origin.unit.anchor_shift) {\n result -= this.origin.unit.anchor_shift;\n }\n\n if (this.origin.system !== this.destination.system) {\n result = this.definitions[this.origin.system].transform(result);\n }\n\n if (this.destination.unit.anchor_shift !== undefined) {\n result += this.destination.unit.anchor_shift;\n }\n\n return Object.assign({ value: result / this.destination.unit.to_anchor }, this.describe(this.destination.abbr))\n};\n\nConverter.prototype.toBest = function (options) {\n if (!this.origin) { throw new Error('.toBest must be called after .from') }\n\n options = Object.assign({\n exclude: [],\n cutOffNumber: 1\n }, options);\n\n return this.list()\n .filter(item => !options.exclude.includes(item.unit) && this.describe(item.unit).system === this.origin.system)\n .reduce((acc, item) => {\n const result = this.to(item.unit);\n if (!acc || (result.value >= options.cutOffNumber && result.value < acc.value)) {\n return result\n } else {\n return acc\n }\n }, undefined)\n};\n\nConverter.prototype.getUnit = function (abbr) {\n const systemNames = Object.keys(this.definitions);\n const found = systemNames.map(systemName => {\n if (this.definitions[systemName][abbr]) {\n return {\n abbr: abbr,\n system: systemName,\n unit: this.definitions[systemName][abbr]\n }\n }\n }).filter(item => item !== undefined);\n\n return Array.isArray(found) ? found[0] : undefined\n};\n\nConverter.prototype.list = function () {\n return this.possibilities().map(abbr => this.describe(abbr))\n};\n\nConverter.prototype.throwUnsupportedUnitError = function (what) {\n throw new Error('Unsupported unit ' + what)\n};\n\nConverter.prototype.describe = function (abbr) {\n if (!abbr) { throw new Error('You must select a unit') }\n\n const unit = this.getUnit(abbr);\n\n return {\n unit: unit.abbr,\n system: unit.system,\n singular: unit.unit.name.singular,\n plural: unit.unit.name.plural\n }\n};\n\nConverter.prototype.possibilities = function () {\n return Array.prototype.concat(...Object.keys(this.definitions)\n .map(systemName => {\n return Object.keys(this.definitions[systemName]).splice(2)\n }))\n};\n\nfunction converter (definitions) {\n return (val) => {\n return new Converter(val, definitions)\n }\n}\n\nexport default converter;\n","import utils from '../utils.js';\n\nconst acceleration = {\n metric: {\n baseUnit: 'g-force',\n transform: (val) => { return val * 1 },\n 'g-force': {\n name: {\n singular: 'g-force',\n plural: 'g-forces'\n },\n to_anchor: 9.80665\n },\n 'm/s2': {\n name: {\n singular: 'Metre per second squared',\n plural: 'Metres per second squared'\n },\n to_anchor: 1\n }\n }\n};\n\nvar acceleration$1 = utils(acceleration);\n\nexport default acceleration$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\nconst PI = 3.141592653589793;\n\nconst angle = {\n metric: {\n baseUnit: 'g-force',\n transform: (val) => { return val * RATIO },\n rad: {\n name: {\n singular: 'radian',\n plural: 'radians'\n },\n to_anchor: 180 / PI\n },\n deg: {\n name: {\n singular: 'degree',\n plural: 'degrees'\n },\n to_anchor: 1\n },\n grad: {\n name: {\n singular: 'gradian',\n plural: 'gradians'\n },\n to_anchor: 9 / 10\n },\n arcmin: {\n name: {\n singular: 'arcminute',\n plural: 'arcminutes'\n },\n to_anchor: 1 / 60\n },\n arcsec: {\n name: {\n singular: 'arcsecond',\n plural: 'arcseconds'\n },\n to_anchor: 1 / 3600\n }\n }\n};\n\nvar angle$1 = utils(angle);\n\nexport default angle$1;\n","import utils from '../utils.js';\n\nconst apparentPower = {\n metric: {\n baseUnit: 'VA',\n transform: (val) => { return val * 1 },\n VA: {\n name: {\n singular: 'Volt-Ampere',\n plural: 'Volt-Amperes'\n },\n to_anchor: 1\n },\n mVA: {\n name: {\n singular: 'Millivolt-Ampere',\n plural: 'Millivolt-Amperes'\n },\n to_anchor: 0.001\n },\n kVA: {\n name: {\n singular: 'Kilovolt-Ampere',\n plural: 'Kilovolt-Amperes'\n },\n to_anchor: 1000\n },\n MVA: {\n name: {\n singular: 'Megavolt-Ampere',\n plural: 'Megavolt-Amperes'\n },\n to_anchor: 1000000\n },\n GVA: {\n name: {\n singular: 'Gigavolt-Ampere',\n plural: 'Gigavolt-Amperes'\n },\n to_anchor: 1000000000\n }\n }\n};\n\nvar apparentPower$1 = utils(apparentPower);\n\nexport default apparentPower$1;\n","import utils from '../utils.js';\n\nconst RATIO = 10.7639;\n\nconst area = {\n metric: {\n baseUnit: 'm2',\n transform: (val) => { return val * RATIO },\n mm2: {\n name: {\n singular: 'Square Millimeter',\n plural: 'Square Millimeters'\n },\n to_anchor: 1 / 1000000\n },\n cm2: {\n name: {\n singular: 'Square Centimeter',\n plural: 'Square Centimeters'\n },\n to_anchor: 1 / 10000\n },\n m2: {\n name: {\n singular: 'Square Meter',\n plural: 'Square Meters'\n },\n to_anchor: 1\n },\n ha: {\n name: {\n singular: 'Hectare',\n plural: 'Hectares'\n },\n to_anchor: 10000\n },\n km2: {\n name: {\n singular: 'Square Kilometer',\n plural: 'Square Kilometers'\n },\n to_anchor: 1000000\n }\n },\n imperial: {\n baseUnit: 'ft2',\n transform: (val) => { return val * 1 / RATIO },\n 'in2': {\n name: {\n singular: 'Square Inch',\n plural: 'Square Inches'\n },\n to_anchor: 1 / 144\n },\n yd2: {\n name: {\n singular: 'Square Yard',\n plural: 'Square Yards'\n },\n to_anchor: 9\n },\n ft2: {\n name: {\n singular: 'Square Foot',\n plural: 'Square Feet'\n },\n to_anchor: 1\n },\n ac: {\n name: {\n singular: 'Acre',\n plural: 'Acres'\n },\n to_anchor: 43560\n },\n mi2: {\n name: {\n singular: 'Square Mile',\n plural: 'Square Miles'\n },\n to_anchor: 27878400\n }\n }\n};\n\nvar area$1 = utils(area);\n\nexport default area$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst charge = {\n metric: {\n baseUnit: 'c',\n transform: (val) => { return RATIO * val },\n c: {\n name: {\n singular: 'Coulomb',\n plural: 'Coulombs'\n },\n to_anchor: 1\n },\n mC: {\n name: {\n singular: 'Millicoulomb',\n plural: 'Millicoulombs'\n },\n to_anchor: 1 / 1000\n },\n μC: {\n name: {\n singular: 'Microcoulomb',\n plural: 'Microcoulombs'\n },\n to_anchor: 1 / 1000000\n },\n nC: {\n name: {\n singular: 'Nanocoulomb',\n plural: 'Nanocoulombs'\n },\n to_anchor: 1e-9\n },\n pC: {\n name: {\n singular: 'Picocoulomb',\n plural: 'Picocoulombs'\n },\n to_anchor: 1e-12\n }\n }\n};\n\nvar charge$1 = utils(charge);\n\nexport default charge$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst current = {\n metric: {\n baseUnit: 'a',\n transform: (val) => { return RATIO * val },\n A: {\n name: {\n singular: 'Ampere',\n plural: 'Amperes'\n },\n to_anchor: 1\n },\n mA: {\n name: {\n singular: 'Milliampere',\n plural: 'Milliamperes'\n },\n to_anchor: 0.001\n },\n kA: {\n name: {\n singular: 'Kiloampere',\n plural: 'Kiloamperes'\n },\n to_anchor: 1000\n }\n }\n};\n\nvar current$1 = utils(current);\n\nexport default current$1;\n","import utils from '../utils.js';\n\nconst RATIO = 8;\n\nconst digitals = {\n bits: {\n baseUnit: 'b',\n transform: (val) => { return val * 1 / RATIO },\n b: {\n name: {\n singular: 'Bit',\n plural: 'Bits'\n },\n to_anchor: 1\n },\n Kb: {\n name: {\n singular: 'Kilobit',\n plural: 'Kilobits'\n },\n to_anchor: 1024\n },\n Mb: {\n name: {\n singular: 'Megabit',\n plural: 'Megabits'\n },\n to_anchor: 1048576\n },\n Gb: {\n name: {\n singular: 'Gigabit',\n plural: 'Gigabits'\n },\n to_anchor: 1073741824\n },\n Tb: {\n name: {\n singular: 'Terabit',\n plural: 'Terabits'\n },\n to_anchor: 1099511627776\n }\n },\n\n bytes: {\n baseUnit: 'B',\n transform: (val) => { return val * RATIO },\n B: {\n name: {\n singular: 'Byte',\n plural: 'Bytes'\n },\n to_anchor: 1\n },\n KB: {\n name: {\n singular: 'Kilobyte',\n plural: 'Kilobytes'\n },\n to_anchor: 1024\n },\n MB: {\n name: {\n singular: 'Megabyte',\n plural: 'Megabytes'\n },\n to_anchor: 1048576\n },\n GB: {\n name: {\n singular: 'Gigabyte',\n plural: 'Gigabytes'\n },\n to_anchor: 1073741824\n },\n TB: {\n name: {\n singular: 'Terabyte',\n plural: 'Terabytes'\n },\n to_anchor: 1099511627776\n }\n }\n};\n\nvar digital = utils(digitals);\n\nexport default digital;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\nconst each = {\n metric: {\n baseUnit: 'ea',\n transform: (val) => { return RATIO * val },\n ea: {\n name: {\n singular: 'Each',\n plural: 'Each'\n },\n to_anchor: 1\n },\n dz: {\n name: {\n singular: 'Dozen',\n plural: 'Dozens'\n },\n to_anchor: 12\n }\n }\n};\n\nvar each$1 = utils(each);\n\nexport default each$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst energy = {\n metric: {\n baseUnit: 'J',\n transform: (val) => { return RATIO * val },\n Wh: {\n name: {\n singular: 'Watt-hour',\n plural: 'Watt-hours'\n },\n to_anchor: 3600\n },\n mWh: {\n name: {\n singular: 'Milliwatt-hour',\n plural: 'Milliwatt-hours'\n },\n to_anchor: 3.6\n },\n kWh: {\n name: {\n singular: 'Kilowatt-hour',\n plural: 'Kilowatt-hours'\n },\n to_anchor: 3600000\n },\n MWh: {\n name: {\n singular: 'Megawatt-hour',\n plural: 'Megawatt-hours'\n },\n to_anchor: 3600000000\n },\n GWh: {\n name: {\n singular: 'Gigawatt-hour',\n plural: 'Gigawatt-hours'\n },\n to_anchor: 3600000000000\n },\n J: {\n name: {\n singular: 'Joule',\n plural: 'Joules'\n },\n to_anchor: 1\n },\n kJ: {\n name: {\n singular: 'Kilojoule',\n plural: 'Kilojoules'\n },\n to_anchor: 1000\n }\n }\n};\n\nvar energy$1 = utils(energy);\n\nexport default energy$1;\n","import utils from '../utils.js';\n\nconst RATIO = 4.44822;\n\nconst force = {\n metric: {\n baseUnit: 'N',\n transform: (val) => { return val * 1 / RATIO },\n N: {\n name: {\n singular: 'Newton',\n plural: 'Newtons'\n },\n to_anchor: 1\n },\n kN: {\n name: {\n singular: 'Kilonewton',\n plural: 'Kilonewtons'\n },\n to_anchor: 1000\n }\n },\n imperial: {\n baseUnit: 'lbf',\n transform: (val) => { return RATIO * val },\n lbf: {\n name: {\n singular: 'Pound-force',\n plural: 'Pound-forces'\n },\n to_anchor: 1\n }\n }\n};\n\nvar force$1 = utils(force);\n\nexport default force$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\nconst PI = 3.141592653589793;\n\nconst frequency = {\n metric: {\n baseUnit: 'Hz',\n transform: (val) => { return RATIO * val },\n mHz: {\n name: {\n singular: 'millihertz',\n plural: 'millihertz'\n },\n to_anchor: 1 / 1000\n },\n Hz: {\n name: {\n singular: 'hertz',\n plural: 'hertz'\n },\n to_anchor: 1\n },\n kHz: {\n name: {\n singular: 'kilohertz',\n plural: 'kilohertz'\n },\n to_anchor: 1000\n },\n MHz: {\n name: {\n singular: 'megahertz',\n plural: 'megahertz'\n },\n to_anchor: 1000 * 1000\n },\n GHz: {\n name: {\n singular: 'gigahertz',\n plural: 'gigahertz'\n },\n to_anchor: 1000 * 1000 * 1000\n },\n THz: {\n name: {\n singular: 'terahertz',\n plural: 'terahertz'\n },\n to_anchor: 1000 * 1000 * 1000 * 1000\n },\n rpm: {\n name: {\n singular: 'rotation per minute',\n plural: 'rotations per minute'\n },\n to_anchor: 1 / 60\n },\n 'deg/s': {\n name: {\n singular: 'degree per second',\n plural: 'degrees per second'\n },\n to_anchor: 1 / 360\n },\n 'rad/s': {\n name: {\n singular: 'radian per second',\n plural: 'radians per second'\n },\n to_anchor: 1 / (PI * 2)\n }\n }\n};\n\nvar frequency$1 = utils(frequency);\n\nexport default frequency$1;\n","import utils from '../utils.js';\n\nconst RATIO = 10.76391;\n\nconst illuminance = {\n metric: {\n baseUnit: 'lx',\n transform: (val) => { return val * 1 / RATIO },\n 'lx': {\n name: {\n singular: 'Lux',\n plural: 'Lux'\n },\n to_anchor: 1\n }\n },\n imperial: {\n baseUnit: 'ft-cd',\n transform: (val) => { return RATIO * val },\n 'ft-cd': {\n name: {\n singular: 'Foot-candle',\n plural: 'Foot-candles'\n },\n to_anchor: 1\n }\n }\n};\n\nvar illuminance$1 = utils(illuminance);\n\nexport default illuminance$1;\n","import utils from '../utils.js';\n\nconst RATIO = 3.28084;\n\nconst length = {\n metric: {\n baseUnit: 'm',\n transform: (val) => { return val * RATIO },\n mm: {\n name: {\n singular: 'Millimeter',\n plural: 'Millimeters'\n },\n to_anchor: 1 / 1000\n },\n cm: {\n name: {\n singular: 'Centimeter',\n plural: 'Centimeters'\n },\n to_anchor: 1 / 100\n },\n m: {\n name: {\n singular: 'Meter',\n plural: 'Meters'\n },\n to_anchor: 1\n },\n km: {\n name: {\n singular: 'Kilometer',\n plural: 'Kilometers'\n },\n to_anchor: 1000\n }\n },\n imperial: {\n baseUnit: 'ft',\n transform: (val) => { return val * 1 / RATIO },\n 'in': {\n name: {\n singular: 'Inch',\n plural: 'Inches'\n },\n to_anchor: 1 / 12\n },\n yd: {\n name: {\n singular: 'Yard',\n plural: 'Yards'\n },\n to_anchor: 3\n },\n 'ft-us': {\n name: {\n singular: 'US Survey Foot',\n plural: 'US Survey Feet'\n },\n to_anchor: 1.000002\n },\n ft: {\n name: {\n singular: 'Foot',\n plural: 'Feet'\n },\n to_anchor: 1\n },\n fathom: {\n name: {\n singular: 'Fathom',\n plural: 'Fathoms'\n },\n to_anchor: 6\n },\n mi: {\n name: {\n singular: 'Mile',\n plural: 'Miles'\n },\n to_anchor: 5280\n },\n nMi: {\n name: {\n singular: 'Nautical Mile',\n plural: 'Nautical Miles'\n },\n to_anchor: 6076.12\n }\n }\n};\n\nvar length$1 = utils(length);\n\nexport default length$1;\n","import utils from '../utils.js';\n\nconst RATIO = 453.592;\n\nconst mass = {\n metric: {\n baseUnit: 'g',\n transform: (val) => { return val * 1 / RATIO },\n mcg: {\n name: {\n singular: 'Microgram',\n plural: 'Micrograms'\n },\n to_anchor: 1 / 1000000\n },\n mg: {\n name: {\n singular: 'Milligram',\n plural: 'Milligrams'\n },\n to_anchor: 1 / 1000\n },\n g: {\n name: {\n singular: 'Gram',\n plural: 'Grams'\n },\n to_anchor: 1\n },\n kg: {\n name: {\n singular: 'Kilogram',\n plural: 'Kilograms'\n },\n to_anchor: 1000\n },\n mt: {\n name: {\n singular: 'Metric Tonne',\n plural: 'Metric Tonnes'\n },\n to_anchor: 1000000\n }\n },\n imperial: {\n baseUnit: 'lb',\n transform: (val) => { return val * RATIO },\n oz: {\n name: {\n singular: 'Ounce',\n plural: 'Ounces'\n },\n to_anchor: 1 / 16\n },\n lb: {\n name: {\n singular: 'Pound',\n plural: 'Pounds'\n },\n to_anchor: 1\n },\n t: {\n name: {\n singular: 'Ton',\n plural: 'Tons'\n },\n to_anchor: 2000\n }\n }\n};\n\nvar mass$1 = utils(mass);\n\nexport default mass$1;\n","import utils from '../utils.js';\n\nconst RATIO = 0.3048;\n\nconst pace = {\n metric: {\n baseUnit: 's/m',\n transform: (val) => { return val * RATIO },\n 'min/km': {\n name: {\n singular: 'Minute per kilometre',\n plural: 'Minutes per kilometre'\n },\n to_anchor: 0.06\n },\n 's/m': {\n name: {\n singular: 'Second per metre',\n plural: 'Seconds per metre'\n },\n to_anchor: 1\n }\n },\n imperial: {\n baseUnit: 's/ft',\n transform: (val) => { return val * 1 / RATIO },\n 'min/mi': {\n name: {\n singular: 'Minute per mile',\n plural: 'Minutes per mile'\n },\n to_anchor: 0.0113636\n },\n 's/ft': {\n name: {\n singular: 'Second per foot',\n plural: 'Seconds per foot'\n },\n to_anchor: 1\n }\n }\n};\n\nvar pace$1 = utils(pace);\n\nexport default pace$1;\n","import utils from '../utils.js';\n\nconst RATIO = 0.000001;\n\nconst partsPer = {\n metric: {\n baseUnit: 'ppm',\n transform: (val) => { return val * RATIO },\n ppm: {\n name: {\n singular: 'Part-per Million',\n plural: 'Parts-per Million'\n },\n to_anchor: 1\n },\n ppb: {\n name: {\n singular: 'Part-per Billion',\n plural: 'Parts-per Billion'\n },\n to_anchor: 0.001\n },\n ppt: {\n name: {\n singular: 'Part-per Trillion',\n plural: 'Parts-per Trillion'\n },\n to_anchor: 0.000001\n },\n ppq: {\n name: {\n singular: 'Part-per Quadrillion',\n plural: 'Parts-per Quadrillion'\n },\n to_anchor: 0.000000001\n }\n }\n};\n\nvar partsPer$1 = utils(partsPer);\n\nexport default partsPer$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst power = {\n metric: {\n baseUnit: 'W',\n transform: (val) => { return val * RATIO },\n W: {\n name: {\n singular: 'Watt',\n plural: 'Watts'\n },\n to_anchor: 1\n },\n mW: {\n name: {\n singular: 'Milliwatt',\n plural: 'Milliwatts'\n },\n to_anchor: 0.001\n },\n kW: {\n name: {\n singular: 'Kilowatt',\n plural: 'Kilowatts'\n },\n to_anchor: 1000\n },\n MW: {\n name: {\n singular: 'Megawatt',\n plural: 'Megawatts'\n },\n to_anchor: 1000000\n },\n GW: {\n name: {\n singular: 'Gigawatt',\n plural: 'Gigawatts'\n },\n to_anchor: 1000000000\n }\n }\n};\nvar power$1 = utils(power);\n\nexport default power$1;\n","import utils from '../utils.js';\n\nconst RATIO = 0.00014503768078;\n\nconst pressure = {\n metric: {\n baseUnit: 'kPa',\n transform: (val) => { return val * RATIO },\n Pa: {\n name: {\n singular: 'pascal',\n plural: 'pascals'\n },\n to_anchor: 1 / 1000\n },\n kPa: {\n name: {\n singular: 'kilopascal',\n plural: 'kilopascals'\n },\n to_anchor: 1\n },\n MPa: {\n name: {\n singular: 'megapascal',\n plural: 'megapascals'\n },\n to_anchor: 1000\n },\n hPa: {\n name: {\n singular: 'hectopascal',\n plural: 'hectopascals'\n },\n to_anchor: 1 / 10\n },\n bar: {\n name: {\n singular: 'bar',\n plural: 'bar'\n },\n to_anchor: 100\n },\n torr: {\n name: {\n singular: 'torr',\n plural: 'torr'\n },\n to_anchor: 101325 / 760000\n }\n },\n\n imperial: {\n baseUnit: 'psi',\n transform: (val) => { return val * 1 / RATIO },\n psi: {\n name: {\n singular: 'pound per square inch',\n plural: 'pounds per square inch'\n },\n to_anchor: 1 / 1000\n },\n ksi: {\n name: {\n singular: 'kilopound per square inch',\n plural: 'kilopound per square inch'\n },\n to_anchor: 1\n }\n }\n};\n\nvar pressure$1 = utils(pressure);\n\nexport default pressure$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst reactiveEnergy = {\n metric: {\n baseUnit: 'VARh',\n transform: (val) => { return val * RATIO },\n VARh: {\n name: {\n singular: 'Volt-Ampere Reactive Hour',\n plural: 'Volt-Amperes Reactive Hour'\n },\n to_anchor: 1\n },\n mVARh: {\n name: {\n singular: 'Millivolt-Ampere Reactive Hour',\n plural: 'Millivolt-Amperes Reactive Hour'\n },\n to_anchor: 0.001\n },\n kVARh: {\n name: {\n singular: 'Kilovolt-Ampere Reactive Hour',\n plural: 'Kilovolt-Amperes Reactive Hour'\n },\n to_anchor: 1000\n },\n MVARh: {\n name: {\n singular: 'Megavolt-Ampere Reactive Hour',\n plural: 'Megavolt-Amperes Reactive Hour'\n },\n to_anchor: 1000000\n },\n GVARh: {\n name: {\n singular: 'Gigavolt-Ampere Reactive Hour',\n plural: 'Gigavolt-Amperes Reactive Hour'\n },\n to_anchor: 1000000000\n }\n }\n};\n\nvar reactiveEnergy$1 = utils(reactiveEnergy);\n\nexport default reactiveEnergy$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst reactivePower = {\n metric: {\n baseUnit: 'VAR',\n transform: (val) => { return val * RATIO },\n VAR: {\n name: {\n singular: 'Volt-Ampere Reactive',\n plural: 'Volt-Amperes Reactive'\n },\n to_anchor: 1\n },\n mVAR: {\n name: {\n singular: 'Millivolt-Ampere Reactive',\n plural: 'Millivolt-Amperes Reactive'\n },\n to_anchor: 0.001\n },\n kVAR: {\n name: {\n singular: 'Kilovolt-Ampere Reactive',\n plural: 'Kilovolt-Amperes Reactive'\n },\n to_anchor: 1000\n },\n MVAR: {\n name: {\n singular: 'Megavolt-Ampere Reactive',\n plural: 'Megavolt-Amperes Reactive'\n },\n to_anchor: 1000000\n },\n GVAR: {\n name: {\n singular: 'Gigavolt-Ampere Reactive',\n plural: 'Gigavolt-Amperes Reactive'\n },\n to_anchor: 1000000000\n }\n }\n};\n\nvar reactivePower$1 = utils(reactivePower);\n\nexport default reactivePower$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1.609344;\n\nconst speed = {\n metric: {\n baseUnit: 'N',\n transform: (val) => { return val * 1 / RATIO },\n 'm/s': {\n name: {\n singular: 'Metre per second',\n plural: 'Metres per second'\n },\n to_anchor: 3.6\n },\n 'km/h': {\n name: {\n singular: 'Kilometre per hour',\n plural: 'Kilometres per hour'\n },\n to_anchor: 1\n }\n },\n imperial: {\n baseUnit: 'm/h',\n transform: (val) => { return val * RATIO },\n 'm/h': {\n name: {\n singular: 'Mile per hour',\n plural: 'Miles per hour'\n },\n to_anchor: 1\n },\n knot: {\n name: {\n singular: 'Knot',\n plural: 'Knots'\n },\n to_anchor: 1.150779\n },\n 'ft/s': {\n name: {\n singular: 'Foot per second',\n plural: 'Feet per second'\n },\n to_anchor: 0.681818\n }\n }\n};\n\nvar speed$1 = utils(speed);\n\nexport default speed$1;\n","import utils from '../utils.js';\n\nconst temperature = {\n metric: {\n baseUnit: 'C',\n transform: (val) => { return val / (5 / 9) + 32 },\n C: {\n name: {\n singular: 'degree Celsius',\n plural: 'degrees Celsius'\n },\n to_anchor: 1,\n anchor_shift: 0\n },\n K: {\n name: {\n singular: 'degree Kelvin',\n plural: 'degrees Kelvin'\n },\n to_anchor: 1,\n anchor_shift: 273.15\n }\n },\n imperial: {\n baseUnit: 'F',\n transform: (val) => { return (val - 32) * (5 / 9) },\n F: {\n name: {\n singular: 'degree Fahrenheit',\n plural: 'degrees Fahrenheit'\n },\n to_anchor: 1\n },\n R: {\n name: {\n singular: 'degree Rankine',\n plural: 'degrees Rankine'\n },\n to_anchor: 1,\n anchor_shift: 459.67\n }\n }\n};\n\nvar temperature$1 = utils(temperature);\n\nexport default temperature$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\nconst daysInYear = 365.25;\n\nconst time = {\n metric: {\n baseUnit: 's',\n transform: (val) => { return val * RATIO },\n ns: {\n name: {\n singular: 'Nanosecond',\n plural: 'Nanoseconds'\n },\n to_anchor: 1 / 1000000000\n },\n mu: {\n name: {\n singular: 'Microsecond',\n plural: 'Microseconds'\n },\n to_anchor: 1 / 1000000\n },\n ms: {\n name: {\n singular: 'Millisecond',\n plural: 'Milliseconds'\n },\n to_anchor: 1 / 1000\n },\n s: {\n name: {\n singular: 'Second',\n plural: 'Seconds'\n },\n to_anchor: 1\n },\n min: {\n name: {\n singular: 'Minute',\n plural: 'Minutes'\n },\n to_anchor: 60\n },\n h: {\n name: {\n singular: 'Hour',\n plural: 'Hours'\n },\n to_anchor: 60 * 60\n },\n d: {\n name: {\n singular: 'Day',\n plural: 'Days'\n },\n to_anchor: 60 * 60 * 24\n },\n week: {\n name: {\n singular: 'Week',\n plural: 'Weeks'\n },\n to_anchor: 60 * 60 * 24 * 7\n },\n month: {\n name: {\n singular: 'Month',\n plural: 'Months'\n },\n to_anchor: 60 * 60 * 24 * daysInYear / 12\n },\n year: {\n name: {\n singular: 'Year',\n plural: 'Years'\n },\n to_anchor: 60 * 60 * 24 * daysInYear\n }\n }\n};\n\nvar time$1 = utils(time);\n\nexport default time$1;\n","import utils from '../utils.js';\n\nconst RATIO = 1;\n\nconst voltage = {\n metric: {\n baseUnit: 'V',\n transform: (val) => { return val * RATIO },\n V: {\n name: {\n singular: 'Volt',\n plural: 'Volts'\n },\n to_anchor: 1\n },\n mV: {\n name: {\n singular: 'Millivolt',\n plural: 'Millivolts'\n },\n to_anchor: 0.001\n },\n kV: {\n name: {\n singular: 'Kilovolt',\n plural: 'Kilovolts'\n },\n to_anchor: 1000\n }\n }\n};\n\nvar voltage$1 = utils(voltage);\n\nexport default voltage$1;\n","import utils from '../utils.js';\n\nconst RATIO = 33.8140226;\n\nconst volume = {\n metric: {\n baseUnit: 'l',\n transform: (val) => { return RATIO * val },\n mm3: {\n name: {\n singular: 'Cubic Millimeter',\n plural: 'Cubic Millimeters'\n },\n to_anchor: 1 / 1000000\n },\n cm3: {\n name: {\n singular: 'Cubic Centimeter',\n plural: 'Cubic Centimeters'\n },\n to_anchor: 1 / 1000\n },\n ml: {\n name: {\n singular: 'Millilitre',\n plural: 'Millilitres'\n },\n to_anchor: 1 / 1000\n },\n cl: {\n name: {\n singular: 'Centilitre',\n plural: 'Centilitres'\n },\n to_anchor: 1 / 100\n },\n dl: {\n name: {\n singular: 'Decilitre',\n plural: 'Decilitres'\n },\n to_anchor: 1 / 10\n },\n l: {\n name: {\n singular: 'Litre',\n plural: 'Litres'\n },\n to_anchor: 1\n },\n kl: {\n name: {\n singular: 'Kilolitre',\n plural: 'Kilolitres'\n },\n to_anchor: 1000\n },\n m3: {\n name: {\n singular: 'Cubic meter',\n plural: 'Cubic meters'\n },\n to_anchor: 1000\n },\n km3: {\n name: {\n singular: 'Cubic kilometer',\n plural: 'Cubic kilometers'\n },\n to_anchor: 1000000000000\n },\n\n // Swedish units\n krm: {\n name: {\n singular: 'Matsked',\n plural: 'Matskedar'\n },\n to_anchor: 1 / 1000\n },\n tsk: {\n name: {\n singular: 'Tesked',\n plural: 'Teskedar'\n },\n to_anchor: 5 / 1000\n },\n msk: {\n name: {\n singular: 'Matsked',\n plural: 'Matskedar'\n },\n to_anchor: 15 / 1000\n },\n kkp: {\n name: {\n singular: 'Kaffekopp',\n plural: 'Kaffekoppar'\n },\n to_anchor: 150 / 1000\n },\n glas: {\n name: {\n singular: 'Glas',\n plural: 'Glas'\n },\n to_anchor: 200 / 1000\n },\n kanna: {\n name: {\n singular: 'Kanna',\n plural: 'Kannor'\n },\n to_anchor: 2.617\n }\n },\n\n imperial: {\n baseUnit: 'fl-oz',\n transform: (val) => { return val * 1 / RATIO },\n tsp: {\n name: {\n singular: 'Teaspoon',\n plural: 'Teaspoons'\n },\n to_anchor: 1 / 6\n },\n Tbs: {\n name: {\n singular: 'Tablespoon',\n plural: 'Tablespoons'\n },\n to_anchor: 1 / 2\n },\n in3: {\n name: {\n singular: 'Cubic inch',\n plural: 'Cubic inches'\n },\n to_anchor: 0.55411\n },\n 'fl-oz': {\n name: {\n singular: 'Fluid Ounce',\n plural: 'Fluid Ounces'\n },\n to_anchor: 1\n },\n cup: {\n name: {\n singular: 'Cup',\n plural: 'Cups'\n },\n to_anchor: 8\n },\n pnt: {\n name: {\n singular: 'Pint',\n plural: 'Pints'\n },\n to_anchor: 16\n },\n qt: {\n name: {\n singular: 'Quart',\n plural: 'Quarts'\n },\n to_anchor: 32\n },\n gal: {\n name: {\n singular: 'Gallon',\n plural: 'Gallons'\n },\n to_anchor: 128\n },\n ft3: {\n name: {\n singular: 'Cubic foot',\n plural: 'Cubic feet'\n },\n to_anchor: 957.506\n },\n yd3: {\n name: {\n singular: 'Cubic yard',\n plural: 'Cubic yards'\n },\n to_anchor: 25852.7\n }\n }\n};\n\nvar volume$1 = utils(volume);\n\nexport default volume$1;\n","import utils from '../utils.js';\n\nconst RATIO = 33.8140227;\n\nconst volumeFlowRate = {\n metric: {\n baseUnit: 'l/s',\n transform: (val) => { return val * RATIO },\n 'mm3/s': {\n name: {\n singular: 'Cubic Millimeter per second',\n plural: 'Cubic Millimeters per second'\n },\n to_anchor: 1 / 1000000\n },\n 'cm3/s': {\n name: {\n singular: 'Cubic Centimeter per second',\n plural: 'Cubic Centimeters per second'\n },\n to_anchor: 1 / 1000\n },\n 'ml/s': {\n name: {\n singular: 'Millilitre per second',\n plural: 'Millilitres per second'\n },\n to_anchor: 1 / 1000\n },\n 'cl/s': {\n name: {\n singular: 'Centilitre per second',\n plural: 'Centilitres per second'\n },\n to_anchor: 1 / 100\n },\n 'dl/s': {\n name: {\n singular: 'Decilitre per second',\n plural: 'Decilitres per second'\n },\n to_anchor: 1 / 10\n },\n 'l/s': {\n name: {\n singular: 'Litre per second',\n plural: 'Litres per second'\n },\n to_anchor: 1\n },\n 'l/min': {\n name: {\n singular: 'Litre per minute',\n plural: 'Litres per minute'\n },\n to_anchor: 1 / 60\n },\n 'l/h': {\n name: {\n singular: 'Litre per hour',\n plural: 'Litres per hour'\n },\n to_anchor: 1 / 3600\n },\n 'kl/s': {\n name: {\n singular: 'Kilolitre per second',\n plural: 'Kilolitres per second'\n },\n to_anchor: 1000\n },\n 'kl/min': {\n name: {\n singular: 'Kilolitre per minute',\n plural: 'Kilolitres per minute'\n },\n to_anchor: 50 / 3\n },\n 'kl/h': {\n name: {\n singular: 'Kilolitre per hour',\n plural: 'Kilolitres per hour'\n },\n to_anchor: 5 / 18\n },\n 'm3/s': {\n name: {\n singular: 'Cubic meter per second',\n plural: 'Cubic meters per second'\n },\n to_anchor: 1000\n },\n 'm3/min': {\n name: {\n singular: 'Cubic meter per minute',\n plural: 'Cubic meters per minute'\n },\n to_anchor: 50 / 3\n },\n 'm3/h': {\n name: {\n singular: 'Cubic meter per hour',\n plural: 'Cubic meters per hour'\n },\n to_anchor: 5 / 18\n },\n 'km3/s': {\n name: {\n singular: 'Cubic kilometer per second',\n plural: 'Cubic kilometers per second'\n },\n to_anchor: 1000000000000\n }\n },\n imperial: {\n baseUnit: 'fl-oz/s',\n transform: (val) => { return val * 1 / RATIO },\n 'tsp/s': {\n name: {\n singular: 'Teaspoon per second',\n plural: 'Teaspoons per second'\n },\n to_anchor: 1 / 6\n },\n 'Tbs/s': {\n name: {\n singular: 'Tablespoon per second',\n plural: 'Tablespoons per second'\n },\n to_anchor: 1 / 2\n },\n 'in3/s': {\n name: {\n singular: 'Cubic inch per second',\n plural: 'Cubic inches per second'\n },\n to_anchor: 0.55411\n },\n 'in3/min': {\n name: {\n singular: 'Cubic inch per minute',\n plural: 'Cubic inches per minute'\n },\n to_anchor: 0.55411 / 60\n },\n 'in3/h': {\n name: {\n singular: 'Cubic inch per hour',\n plural: 'Cubic inches per hour'\n },\n to_anchor: 0.55411 / 3600\n },\n 'fl-oz/s': {\n name: {\n singular: 'Fluid Ounce per second',\n plural: 'Fluid Ounces per second'\n },\n to_anchor: 1\n },\n 'fl-oz/min': {\n name: {\n singular: 'Fluid Ounce per minute',\n plural: 'Fluid Ounces per minute'\n },\n to_anchor: 1 / 60\n },\n 'fl-oz/h': {\n name: {\n singular: 'Fluid Ounce per hour',\n plural: 'Fluid Ounces per hour'\n },\n to_anchor: 1 / 3600\n },\n 'cup/s': {\n name: {\n singular: 'Cup per second',\n plural: 'Cups per second'\n },\n to_anchor: 8\n },\n 'pnt/s': {\n name: {\n singular: 'Pint per second',\n plural: 'Pints per second'\n },\n to_anchor: 16\n },\n 'pnt/min': {\n name: {\n singular: 'Pint per minute',\n plural: 'Pints per minute'\n },\n to_anchor: 4 / 15\n },\n 'pnt/h': {\n name: {\n singular: 'Pint per hour',\n plural: 'Pints per hour'\n },\n to_anchor: 1 / 225\n },\n 'qt/s': {\n name: {\n singular: 'Quart per second',\n plural: 'Quarts per second'\n },\n to_anchor: 32\n },\n 'gal/s': {\n name: {\n singular: 'Gallon per second',\n plural: 'Gallons per second'\n },\n to_anchor: 128\n },\n 'gal/min': {\n name: {\n singular: 'Gallon per minute',\n plural: 'Gallons per minute'\n },\n to_anchor: 32 / 15\n },\n 'gal/h': {\n name: {\n singular: 'Gallon per hour',\n plural: 'Gallons per hour'\n },\n to_anchor: 8 / 225\n },\n 'ft3/s': {\n name: {\n singular: 'Cubic foot per second',\n plural: 'Cubic feet per second'\n },\n to_anchor: 957.506\n },\n 'ft3/min': {\n name: {\n singular: 'Cubic foot per minute',\n plural: 'Cubic feet per minute'\n },\n to_anchor: 957.506 / 60\n },\n 'ft3/h': {\n name: {\n singular: 'Cubic foot per hour',\n plural: 'Cubic feet per hour'\n },\n to_anchor: 957.506 / 3600\n },\n 'yd3/s': {\n name: {\n singular: 'Cubic yard per second',\n plural: 'Cubic yards per second'\n },\n to_anchor: 25852.7\n },\n 'yd3/min': {\n name: {\n singular: 'Cubic yard per minute',\n plural: 'Cubic yards per minute'\n },\n to_anchor: 25852.7 / 60\n },\n 'yd3/h': {\n name: {\n singular: 'Cubic yard per hour',\n plural: 'Cubic yards per hour'\n },\n to_anchor: 25852.7 / 3600\n }\n }\n};\n\nvar volumeFlowRate$1 = utils(volumeFlowRate);\n\nexport default volumeFlowRate$1;\n","import { area, length, mass, speed, temperature } from 'units-converter';\n\nimport { TemperatureUnit, UnitSystem } from '@aurorasolar/graphql-client-schema';\n\nimport type { INumericInputProps } from '@blueprintjs/core';\n\nimport type { UnitSystemsFragment } from './get-unit.generated';\n\nconst MAX_DECIMAL_PLACES = 16;\nexport type NumericConversion = (number: number) => number;\n// (32°F − 32) × 5/9 = 0°C\nexport const getDecimalPlaces = (n: number): number => {\n const decimal = String(n).split('.')[1];\n return typeof decimal === 'string' ? decimal.length : 0;\n};\n\nconst roundTo =\n (decimalPlaces = MAX_DECIMAL_PLACES): NumericConversion =>\n (n: number) => {\n return Number(n.toFixed(Math.min(MAX_DECIMAL_PLACES, decimalPlaces)));\n };\nconst pipe = (...fns: NumericConversion[]): NumericConversion =>\n fns.reduce(\n (prev, next) =>\n (...args) =>\n next(prev(...args)),\n (arg: T): T => arg,\n );\n\nexport const celsiusToFahrenheit: NumericConversion = (celsius) =>\n temperature(celsius).from('C').to('F').value;\n\nexport const fahrenheitToCelsius: NumericConversion = (fahrenheit) =>\n temperature(fahrenheit).from('F').to('C').value;\n\nexport const decimalToPercentage: NumericConversion = (decimal) => decimal * 100;\n\nexport const percentageToDecimal: NumericConversion = (percentage) => percentage / 100;\n\nexport enum ConversionType {\n None,\n Area, // Square Feet or Square Meters\n Distance, // Meters or Feet\n DistanceSmall, // Centimeters or Inches\n Load,\n Mass,\n Percentage, // Decimal to 0-100%\n PricePerArea, // Price Per Square Foot or Price Per Square Meter\n Speed,\n Temperature,\n}\n\nexport enum UnitType {\n Foot = 'ft',\n Inch = 'in',\n Fahrenheit = '°F',\n Meter = 'm',\n Centimeter = 'cm',\n Celsius = '°C',\n Pound = 'lb',\n Kilogram = 'kg',\n SquareFoot = 'ft2',\n SquareMeter = 'm2',\n MilesPerHour = 'm/h',\n KilometersPerHour = 'km/h',\n PricePerSquareFoot = '$/ft2',\n PricePerSquareMeter = '$/m2',\n PoundsPerSquareFoot = 'lb/ft2',\n KilogramsPerSquareMeter = 'kg/m2',\n Percent = '%',\n}\n\nconst unitsNeedingSuffixFormat = [\n UnitType.SquareFoot,\n UnitType.SquareMeter,\n UnitType.PricePerSquareFoot,\n UnitType.PricePerSquareMeter,\n UnitType.PoundsPerSquareFoot,\n UnitType.KilogramsPerSquareMeter,\n UnitType.MilesPerHour,\n];\nexport const getUnitSuffix = (unitType: UnitType) =>\n unitsNeedingSuffixFormat.includes(unitType)\n ? unitType.replace('$', '').replace('2', '²').replace('m/h', 'mph')\n : unitType;\n\nexport const areaConversion =\n (from: UnitType, to: UnitType): NumericConversion =>\n (n) =>\n area(n).from(from).to(to).value;\n\nexport const squareFeetToSquareMeters = areaConversion(UnitType.SquareFoot, UnitType.SquareMeter);\nexport const squareMetersToSquareFeet = areaConversion(UnitType.SquareMeter, UnitType.SquareFoot);\nexport const pricePerSquareFootToPricePerSquareMeter = areaConversion(\n UnitType.SquareMeter,\n UnitType.SquareFoot,\n);\nexport const pricePerSquareMeterToPricePerSquareFoot = areaConversion(\n UnitType.SquareFoot,\n UnitType.SquareMeter,\n);\n\nexport const massConversion =\n (from: UnitType, to: UnitType): NumericConversion =>\n (n) =>\n mass(n).from(from).to(to).value;\n\nexport const poundToKilogram = massConversion(UnitType.Pound, UnitType.Kilogram);\nexport const kilogramToPound = massConversion(UnitType.Kilogram, UnitType.Pound);\n\nexport const poundPerSquareFootToKilogramPerSquareMeter = pipe(\n poundToKilogram,\n squareMetersToSquareFeet,\n);\nexport const kilogramPerSquareMeterToPoundPerSquareFoot = pipe(\n kilogramToPound,\n squareFeetToSquareMeters,\n);\n\nexport const speedConversion =\n (from: UnitType, to: UnitType): NumericConversion =>\n (n) =>\n speed(n).from(from).to(to).value;\n\nexport const milesPerHourToKilometersPerHour = speedConversion(\n UnitType.MilesPerHour,\n UnitType.KilometersPerHour,\n);\nexport const kilometersPerHourToMilesPerHour = speedConversion(\n UnitType.KilometersPerHour,\n UnitType.MilesPerHour,\n);\n\n// precise conversions for ensuring units converted back and forth between sq-ft and sq-m match up as much as possible\n// 1m = 3.280839895 ft\nconst multiplierForPreciseAreaConversion = 10.7639104166236;\n\nexport const preciseSquareFeetToSquareMeters = (squareMeters: number): number => {\n return squareMeters / multiplierForPreciseAreaConversion;\n};\n\nexport const preciseSquareMetersToSquareFeet = (squareFeet: number): number => {\n return squareFeet * multiplierForPreciseAreaConversion;\n};\n\nexport const precisePricePerSquareFootToPricePerSquareMeter = (\n pricePerSquareFoot: number,\n): number => {\n return pricePerSquareFoot * multiplierForPreciseAreaConversion;\n};\n\nexport const precisePricePerSquareMeterToPricePerSquareFoot = (\n pricePerSquareMeter: number,\n): number => {\n return pricePerSquareMeter / multiplierForPreciseAreaConversion;\n};\n\nconst multiplierForBuildingHeightConversion = 3;\n\nexport const metersToBuildingStories = (meters: number): number => {\n return meters / multiplierForBuildingHeightConversion;\n};\n\nexport const buildingStoriesToMeters = (stories: number): number => {\n return stories * multiplierForBuildingHeightConversion;\n};\n\nexport const lengthConversion =\n (from: UnitType, to: UnitType): NumericConversion =>\n (n) =>\n length(n).from(from).to(to).value;\n\nexport const metersToInches = lengthConversion(UnitType.Meter, UnitType.Inch);\nexport const inchesToMeters = lengthConversion(UnitType.Inch, UnitType.Meter);\nexport const metersToCm = lengthConversion(UnitType.Meter, UnitType.Centimeter);\nexport const cmToMeters = lengthConversion(UnitType.Centimeter, UnitType.Meter);\nexport const metersToFeet = lengthConversion(UnitType.Meter, UnitType.Foot);\nexport const feetToMeters = lengthConversion(UnitType.Foot, UnitType.Meter);\n\nexport const noChange: NumericConversion = (n) => n;\n\nconst defaultUnitSystems: Omit & Partial = {\n __typename: 'Tenant',\n distanceUnit: UnitSystem.Metric,\n temperatureUnit: TemperatureUnit.C,\n};\n\nexport const getUnitType = (\n conversionType: ConversionType,\n { distanceUnit, temperatureUnit } = defaultUnitSystems,\n) => {\n const isMetric = distanceUnit === UnitSystem.Metric;\n const isCelsius = temperatureUnit === TemperatureUnit.C;\n switch (conversionType) {\n case ConversionType.Percentage:\n return UnitType.Percent;\n case ConversionType.Temperature:\n return isCelsius ? UnitType.Celsius : UnitType.Fahrenheit;\n case ConversionType.Distance:\n return isMetric ? UnitType.Meter : UnitType.Foot;\n case ConversionType.DistanceSmall:\n return isMetric ? UnitType.Centimeter : UnitType.Inch;\n case ConversionType.PricePerArea:\n return isMetric ? UnitType.PricePerSquareMeter : UnitType.PricePerSquareFoot;\n case ConversionType.Mass:\n return isMetric ? UnitType.Kilogram : UnitType.Pound;\n case ConversionType.Load:\n return isMetric ? UnitType.KilogramsPerSquareMeter : UnitType.PoundsPerSquareFoot;\n case ConversionType.Speed:\n return isMetric ? UnitType.KilometersPerHour : UnitType.MilesPerHour;\n default:\n return UnitType.Meter;\n }\n};\nexport type ConversionTuple = [toInput: NumericConversion, fromInput: NumericConversion];\n\nexport const getConversionTuple = (unitType: UnitType, decimalPlaces?: number) => {\n const round = (fn: NumericConversion) => pipe(fn, roundTo(decimalPlaces));\n const map = new Map([\n [UnitType.Inch, [round(metersToInches), inchesToMeters]],\n [UnitType.Centimeter, [round(metersToCm), cmToMeters]],\n [UnitType.Foot, [round(metersToFeet), feetToMeters]],\n [UnitType.Fahrenheit, [round(celsiusToFahrenheit), round(fahrenheitToCelsius)]],\n [UnitType.Kilogram, [round(kilogramToPound), round(poundToKilogram)]],\n [\n UnitType.KilogramsPerSquareMeter,\n [\n round(kilogramPerSquareMeterToPoundPerSquareFoot),\n round(poundPerSquareFootToKilogramPerSquareMeter),\n ],\n ],\n [\n UnitType.KilometersPerHour,\n [round(kilometersPerHourToMilesPerHour), round(milesPerHourToKilometersPerHour)],\n ],\n [\n UnitType.PricePerSquareMeter,\n [round(pricePerSquareFootToPricePerSquareMeter), pricePerSquareMeterToPricePerSquareFoot],\n ],\n [UnitType.Percent, [round(decimalToPercentage), percentageToDecimal]],\n ]);\n return map.get(unitType) ?? [round(noChange), noChange];\n};\n\nexport interface ConvertibleInputProps {\n value?: number | string;\n onValueChange: INumericInputProps['onValueChange'];\n min?: number;\n max?: number;\n stepSize?: number;\n sliderMin?: number;\n sliderMax?: number;\n}\n\nexport const convertProps = (\n originalProps: Props,\n [inConversion, outConversion]: ConversionTuple,\n): Props => {\n const inPropKeys = ['value', 'min', 'max', 'sliderMin', 'sliderMax'];\n const inProps = Object.keys(originalProps)\n .filter((key) => inPropKeys.includes(key))\n // If the value is undefined, skip conversion\n .filter((key) => originalProps[key] !== undefined)\n .reduce((all, key) => ({ ...all, [key]: inConversion(originalProps[key]) }), {});\n\n const onValueChange: ConvertibleInputProps['onValueChange'] = (numericValue) => {\n const converted = outConversion(numericValue);\n const noop = () => {};\n return originalProps.onValueChange?.(converted, String(converted)) ?? noop;\n };\n return {\n ...originalProps,\n ...inProps,\n onValueChange,\n };\n};\n","import {\n ConversionType,\n UnitType,\n getConversionTuple,\n getUnitType,\n} from '@aurorasolar/common-numeric-conversion';\nimport { TemperatureUnit, UnitSystem } from '@aurorasolar/graphql-client-schema';\nimport { IIntlContext } from '@aurorasolar/intl';\n\nexport const buildUnitsAdapter = (\n distanceUnit: UnitSystem,\n temperatureUnit: TemperatureUnit,\n intl: IIntlContext,\n) => {\n const unitType = getUnitType(ConversionType.Distance, {\n distanceUnit,\n temperatureUnit,\n });\n const [convertIn, convertOut] = getConversionTuple(unitType);\n return {\n convert: convertIn,\n distanceUnit: () => (distanceUnit === UnitSystem.Imperial ? 'ft' : 'm'),\n // CAD calls format with a third parameter which is unused here.\n format: (value: number, numFixed: number, _measurementType: string, footInchFormat = false) => {\n const convertedValue = convertIn(value);\n const formattedValue = intl.formatNumber(convertedValue, {\n maximumFractionDigits: numFixed,\n minimumFractionDigits: numFixed,\n });\n if (footInchFormat && unitType === UnitType.Foot) {\n const feet = Math.floor(convertedValue);\n const decimal = convertedValue % 1;\n const inches = Math.floor(12 * decimal);\n return `${feet}'-${inches}\"`;\n }\n return `${formattedValue} ${unitType}`;\n },\n smallDistanceUnit: () => (distanceUnit === UnitSystem.Imperial ? 'in' : 'cm'),\n system: {\n distance: distanceUnit,\n },\n unconvert: convertOut,\n };\n};\n","import { ApolloClient, NormalizedCacheObject } from '@apollo/client';\n\nimport { SUPPORTED_LOCALES } from '@aurorasolar/intl';\nimport { AuroraApiEnvironment } from '../../api-environment';\nimport { CadBridge } from './CAD-geodata-service';\n\nexport interface CadEngine {\n state: unknown;\n bridge: {\n designId?: string;\n save: (options?: { saveScreenshot?: boolean }) => Promise;\n triggerAction: (\n action: string,\n payload: unknown,\n _?: unknown,\n debounce?: boolean,\n defer?: number,\n ) => void;\n } & CadBridge;\n}\n\nexport interface CadSaveData {\n designId: string;\n jsonToSave: {\n site: JSON;\n system: JSON;\n designJsonSchemaVersion: number;\n };\n saveVersion: string;\n saveScreenshot: boolean;\n}\n\ninterface CadAutoRoofDataProviderFactory {\n new (\n graphqlClient: ApolloClient,\n designId: string | null,\n userId: string | null,\n distanceUnits: 'metric' | 'imperial',\n temperatureUnits: 'C' | 'F',\n autoRoofData: unknown,\n ): unknown;\n}\n\nexport enum CompassPosition {\n LowerRight = 'LowerRight',\n LowerRightCorner = 'LowerRightCorner',\n UpperLeft = 'UpperLeft',\n Invisible = 'Invisible',\n}\n\nexport interface CadEngineOptions {\n dataProvider: unknown;\n designJsonSchemaVersion: number;\n designJson: { system: JSON; site: AutoRoofCadSite | JSON | {} };\n dynamicMultiView?: boolean;\n environment: AuroraApiEnvironment | undefined;\n eventEmitter: unknown;\n saveFormat: '1.0';\n stateFramework: {\n makeReactive(a: T): T;\n effect(\n getReactive: () => ReactiveValue,\n runEffect: (reactiveValue: ReactiveValue) => void,\n ): () => void;\n cloneInert(object: T): T;\n };\n lat: number;\n lng: number;\n renderMode: string;\n stateMode: string;\n useCompassPosition?: CompassPosition;\n useMapView: boolean;\n useStreetView: boolean;\n useToastMessage: boolean;\n useSimplePointerControls?: boolean;\n useSimpleTouchControls?: boolean;\n viewData: Array<{\n camera?: {\n verticalAngle?: number;\n horizontalAngle?: number;\n radius?: number;\n lookatX?: number;\n lookatY?: number;\n lookatZ?: number;\n };\n domElement: HTMLElement;\n name: string;\n theme?: string;\n }>;\n viewSettings: {\n 'design-3d': ViewPortViewSettings;\n };\n}\n\ninterface CadFactory {\n getEngineInstance: (\n designId: string,\n options: CadEngineOptions,\n forceRefresh: boolean,\n ) => CadEngine;\n initEngineInstance: (\n engine: CadEngine,\n dependencies: {\n dataProvider: unknown;\n eventEmitter: unknown;\n geodataService?: unknown;\n store: unknown;\n saveHandler?: {\n save: (saveData: CadSaveData) => Promise;\n };\n irradianceMapService?: IrradianceMapService;\n locale: SUPPORTED_LOCALES;\n },\n ) => Promise;\n getActiveEngineInstance(deisgnId: string): CadEngine | null;\n cleanupEngineInstance(): void;\n}\n\ninterface AssetLoader {\n instance: AssetLoader;\n initialize(): AssetLoader;\n startLoad(): Promise;\n}\n\ninterface IrradianceMapService {\n // eslint-disable-next-line\n new (): IrradianceMapService;\n}\n\nexport interface ICADJSModule {\n Factory: CadFactory;\n AssetLoader: AssetLoader;\n Services: {\n IrradianceMapService: IrradianceMapService;\n DataProviderAutoRoof: CadAutoRoofDataProviderFactory;\n };\n}\n\nexport interface ICADProvider {\n engineSaveFn: () => Promise;\n engine: CadEngine;\n}\n\nexport interface ICadFeatureGate {\n aiSmartRoof?: boolean;\n ambientOcclusion: boolean;\n autoDesigner: boolean;\n autoRoof: boolean;\n balanceOfSystem: boolean;\n /**\n * @deprecated: we should use `compassPosition` in bridge,\n * but keeping it for now, otherwise there's currently bugs\n */\n compassToLowerRight: boolean;\n csvMonthly: boolean;\n datamodelLibrary: boolean;\n editSiteModel: boolean;\n fillZone: boolean;\n fitTreesToLidar: boolean;\n lidar: boolean;\n multiObjectSelectionTabs?: boolean;\n panelPlaceMode?: boolean;\n salesModeAutoString?: boolean;\n saveDesignJsonSchemaVersion2: boolean;\n walkway: boolean;\n focusOnSelection: boolean;\n useSimpleShaders?: boolean;\n}\n\n/*\n * TODO - These duplicate definitions in generated schema files but since we can't pull them in we'll\n * replace them later\n * */\n\ninterface AutoRoofCadObstruction {\n shape: string;\n center: number[];\n azimuthVector: number[];\n radius: number;\n width: number;\n length: number;\n flush: boolean;\n heightAbove: number;\n confidence: number;\n}\n\ninterface AutoRoofCadRoofPlane {\n shell: AutoRoofCadRoofPlaneNode[];\n holes: AutoRoofCadRoofPlaneNode[][];\n height: number;\n pitch: number;\n azimuthEdgeIndex: number;\n}\n\ninterface AutoRoofCadRoofPlaneNode {\n x: number;\n y: number;\n edgeType: string;\n}\n\ninterface AutoRoofCadSite {\n roofPlanes: AutoRoofCadRoofPlane[];\n obstructions: AutoRoofCadObstruction[];\n baseElevation: number;\n centerLat: number;\n centerLng: number;\n}\n\nexport type ViewPortViewSettings = {\n azimuthArrows?: boolean;\n buildings?: boolean;\n connections?: boolean;\n designComponents?: boolean;\n disabledPanels?: boolean;\n edges?: boolean;\n electricalComponents?: boolean;\n fillZones?: boolean;\n ground?: boolean;\n irradianceMap?: boolean;\n irradianceMapPanels?: boolean;\n lidar?: boolean;\n map?: boolean;\n mapImagery?: boolean;\n mapView?: boolean;\n measurements?: boolean;\n projectCenter?: boolean;\n rulers?: boolean;\n setbacks?: boolean;\n shadeReportLabels?: boolean;\n shadows?: boolean;\n sky?: boolean;\n solarPanels?: boolean;\n streetView?: boolean;\n strings?: boolean;\n sunpath?: boolean;\n templates?: boolean;\n toolbarExpanded?: boolean;\n trees?: boolean;\n visualModuleValidation?: boolean;\n walkways?: boolean;\n};\n","export enum CadMode {\n Site = 'default-site',\n System = 'default-design',\n Basic = 'default-basic',\n /**\n * A simplified CAD mode that allows panel toggling. Used by Sales Mode and the Client SDK.\n */\n Limited = 'default-limited',\n ReadOnly = 'read-only',\n Advanced = 'advanced',\n MoveRoof = 'move.roof',\n Paste = 'place.paste',\n DrawObstructionPolygon = 'draw.obstruction-polygon',\n DrawObstructionCircle = 'draw.obstruction-circle',\n DrawObstructionRectangle = 'draw.obstruction-rectangle',\n PasteObstructionPolygon = 'place.paste.obstruction-polygon',\n PasteObstructionCircle = 'place.paste.obstruction-circle',\n PasteObstructionRectangle = 'place.paste.obstruction-rectangle',\n DrawTree = 'draw.tree',\n PasteTree = 'place.paste.tree',\n EditOrthoImage = 'ortho-image-editing',\n PlaceOrthoImage = 'place.ortho-image-editor',\n DrawRuler = 'draw.ruler',\n Roof = 'roof',\n DrawRoof = 'draw.roof',\n DrawRoofPlane = 'draw.roof-plane',\n PasteRoof = 'place.paste.roof',\n PlaceDormer = 'place.dormer',\n PlaceKink = 'place.kink',\n DragInternalEdge = 'internal-edge-drag',\n DrawWalkway = 'draw.walkway',\n PasteWalkway = 'place.paste.draw.walkway',\n Stringing = 'stringing',\n DrawFillZone = 'draw.fill-zone',\n DrawSolarPanel = 'draw-solar-panel',\n PasteDrawSolarPanel = 'place.paste.draw-solar-panel',\n PasteDrawSolarArray = 'place.paste.draw-solar-array',\n PlaceSolarArray = 'place.solar-array',\n PlaceSolarInverter = 'place.solar-inverter',\n PlaceCombinerBox = 'place.combiner-box',\n PlaceLoadCenter = 'place.load-center',\n PlaceServicePanel = 'place.service-panel',\n PlaceMeter = 'place.meter',\n PlaceDisconnect = 'place.disconnect',\n FillRoofFace = 'fill-roof-face',\n TogglePanels = 'toggle-panels',\n DrawSolarArray = 'draw-solar-array',\n EditPanelPlane = 'edit.panel-plane',\n}\n","import { CADTriggerActionTypes } from '@aurorasolar/common-data-store';\nimport { CadBridge, ICADGeodataService } from '@aurorasolar/common-module-loader';\n\nimport { LeadCaptureCadQuery } from './use-lead-capture-cad.generated';\n\nexport const getLeadCaptureGeodataService = (data: LeadCaptureCadQuery): ICADGeodataService => {\n const processGroundTextures = async (cadBridge: CadBridge) => {\n cadBridge.triggerAction(CADTriggerActionTypes.ProcessGroundTextures, {\n orthoImages: [data.leadCadData.image!.orthoImage],\n });\n };\n\n return {\n deleteOrthoImage: async () => {},\n detectAllObstructions: async () => {},\n detectObstructions: async () => {},\n initialize: async (cadBridge) => processGroundTextures(cadBridge),\n initialized: true,\n onOrthoImageBoundsIncrease: async () => {},\n onProjectLocationChange: async () => {},\n onSiteBoundsChange: async () => {},\n onSpecifiedBoundsChange: async () => {},\n updateOrthoImage: async () => {},\n willDestroy: async () => {},\n };\n};\n","export enum PreferenceScope {\n /**\n * Preference saved per design\n */\n Design,\n\n /**\n * Preference saved per project\n */\n Project,\n\n /**\n * Preference saved for the entire app\n */\n App,\n}\n\nexport enum ExpirationType {\n /**\n * Never expires. Try to avoid using\n */\n Never,\n\n /**\n * Expires when exiting preference instance, e.g.\n * a single CAD instance\n */\n Instance,\n\n /**\n * Allows certain max number of preferences of the same type.\n * Once that number is reached, the oldest preferences of the same\n * type are removed when new ones are added\n */\n MaxCount,\n\n /**\n * Expires after a certain time period\n */\n MaxDuration,\n}\n\nexport enum UserScope {\n /**\n * Shared preference between all users. Default\n * option\n */\n Shared,\n\n /**\n * Separate preference for every user\n */\n PerUser,\n}\n\n/**\n * Type for preference descriptors\n */\nexport type PreferenceDescriptor = {\n preferenceScope: PreferenceScope;\n /**\n * If not provided, defaults to UserScope.Shared\n */\n userScope?: UserScope;\n isValid: (value: unknown) => value is T;\n} & (\n | {\n expirationType: ExpirationType.Never | ExpirationType.Instance;\n }\n | {\n expirationType: ExpirationType.MaxCount;\n maxCount: number;\n }\n | {\n expirationType: ExpirationType.MaxDuration;\n maxDurationMs: number;\n }\n);\n","/**\n * This shape will be stored per value and should not change in breaking ways.\n * We may only be able to add optional properties\n */\nexport type StoredValue = {\n value: T;\n timestamp: number;\n};\n\nexport type PreferenceProvider = {\n getKeys(): string[];\n has(key: string): boolean;\n get(key: string): undefined | StoredValue;\n set(key: string, value: StoredValue): void;\n remove(key: string): void;\n};\n\n/**\n * Since stored value may be manually changed or become out of date with the latest code,\n * we're ensuring that the stored value corresponds to the correct JSON object\n */\nconst getLocalStorageStoredValue = (value: string): undefined | StoredValue => {\n try {\n const json: number | string | Partial<{ [K in keyof StoredValue]: unknown }> =\n JSON.parse(value);\n if (\n json &&\n typeof json === 'object' &&\n 'value' in json &&\n 'timestamp' in json &&\n typeof json.timestamp === 'number'\n ) {\n return {\n timestamp: json.timestamp,\n value: json.value,\n };\n }\n return undefined;\n } catch (_) {\n return undefined;\n }\n};\n\n/**\n * Creates a local storage-based preference provider that keeps value in the browser\n * until it is cleaned up\n */\nexport const createLocalStoragePreferenceProvider = (storagePrefix: string) => {\n const isCadKey = (key: string) => key.startsWith(storagePrefix);\n\n const removeCadKeyPrefix = (key: string) => key.substring(storagePrefix.length);\n\n const provider: PreferenceProvider = {\n get(key) {\n if (provider.has(key)) {\n const item = localStorage.getItem(`${storagePrefix}${key}`);\n if (typeof item === 'string') {\n return getLocalStorageStoredValue(item);\n }\n }\n return undefined;\n },\n getKeys() {\n return Object.getOwnPropertyNames(localStorage).filter(isCadKey).map(removeCadKeyPrefix);\n },\n has(key) {\n return localStorage.hasOwnProperty(`${storagePrefix}${key}`);\n },\n remove(key) {\n localStorage.removeItem(`${storagePrefix}${key}`);\n },\n set(key, value) {\n localStorage.setItem(`${storagePrefix}${key}`, JSON.stringify(value));\n },\n };\n\n return provider;\n};\n\n/**\n * Creates a preference provider for a single instance of the preferences.\n * Since preferences are instantiated along with CAD, these preferences\n * are per CAD instance\n */\nexport const createInstancePreferenceProvider = () => {\n const storage: { [k: string]: StoredValue } = {};\n const provider: PreferenceProvider = {\n get(key) {\n if (provider.has(key)) {\n return storage[key];\n }\n return undefined;\n },\n getKeys() {\n return Object.getOwnPropertyNames(storage);\n },\n has(key) {\n return storage.hasOwnProperty(key);\n },\n remove(key) {\n delete storage[key];\n },\n set(key, value) {\n storage[key] = value;\n },\n };\n return provider;\n};\n","import {\n ExpirationType,\n PreferenceDescriptor,\n PreferenceScope,\n UserScope,\n} from './preference-descriptor-types';\nimport {\n createInstancePreferenceProvider,\n createLocalStoragePreferenceProvider,\n PreferenceProvider,\n} from './preference-providers';\nimport {\n GeneralPreferenceDescriptors,\n GetPreference,\n getPreferenceIds,\n KeysWithValuesOfType,\n TypedPreferenceDescriptors,\n} from './preference-utils';\n\nexport type CurrentScope = {\n getUserId: () => string | null;\n getProjectId: () => string | null;\n getDesignId: () => string | null;\n};\n\nexport const isDateMoreThanOneDayIntoTheFuture = (timestamp: number) =>\n timestamp > Date.now() + 24 * 60 * 60 * 1000;\n\nexport const isPastExpiryDate = (timestamp: number, maxDurationMs: number) =>\n Date.now() > timestamp + maxDurationMs;\n\n/**\n * Preferences are our way of storing user-, design-, project- and app-based user-entered\n * preferences. Preferences may be acquired and cleared via interactions with forms or, if\n * needed, via a dedicated page. Preferences are meant to be type-validated, type-safe and\n * geared towards long-term storage. Backwards compatibility and cleanup implications:\n * 1. Preferences must be backwards compatible. If we want to preserve the preference, then\n * `storagePrefix` and preference IDs should not change, and `isValid` of the preference\n * should remain `true` continuously (i.e. schema needs to be backwards compatible)\n * 2. The current maximum total storage should not exceed 5 megabytes, which should be\n * sufficient for a lot of preferences. But, in order to keep that well below the limit,\n * preferences should utilize `MaxCount` or `MaxDuration` expiry type as much as possible\n * 3. Cleanup (removal of stored preference) is performed when the number of preferences with\n * the same ID exceeds max count or max duration (depending on its expiry type), when the\n * setting's `isValid` returns false (e.g. when the schema changes in incompatible ways),\n * or if the setting ID was removed\n * 4. We can evolve preference's expiry type over time and the preference should automatically\n * be able to adapt to it. It is noteworthy that, as it stands, patching preference's scope\n * and user scope will not make the preference automatically get inherited. For the preference\n * to be retrieved correctly, it must have the exact same scope as at the time of storage.\n * This behavior can be changed eventually, which is why there is no preference cleanup\n * for preferences whose scope has changed since the preference introduction\n *\n * General note: preferences are designed to remove the need to write migrations, have a\n * clear cleanup strategy and provide type safety and type convenience throughout the\n * entirety of the codebase\n *\n * This function creates a preference manager for namespaced handling of preferences.\n * Provided `preferenceNames` and `preferenceDescriptors`\n * must satisfy the following constraints:\n * 1. `preferenceNames` is a map between meaningless preference IDs and\n * meaningful preference names\n * 2. Every key of `preferenceDescriptors` should be a preference name\n * defined in `preferenceNames` and vice versa\n * 3. `preferenceDescriptors` should be an object where every key matches\n * `PreferenceDescriptor` type\n */\nexport const createPreferencesManager = <\n PreferenceNames extends object,\n PreferenceDescriptors extends object,\n>(\n preferenceNames: PreferenceNames,\n preferenceDescriptors: PreferenceDescriptors,\n storagePrefix: string,\n) => {\n type Preference = GetPreference;\n\n /**\n * Various type checks for PreferenceNames and PreferenceDescriptors. This error\n * will be displayed as a result type if the type error occurs\n */\n type PreferenceTypeError = Preference['Name'] extends keyof PreferenceDescriptors\n ? keyof PreferenceDescriptors extends Preference['Name']\n ? PreferenceDescriptors extends GeneralPreferenceDescriptors\n ? PreferenceDescriptors extends TypedPreferenceDescriptors<\n Preference['Names'],\n PreferenceDescriptors\n >\n ? null\n : 'Every descriptor should match PreferenceDescriptor'\n : 'Preference descriptors should be an object where values match PreferenceDescriptor'\n : 'Every key of preferenceDescriptors should appear in preferenceNames and vice versa'\n : 'Every key of preferenceDescriptors should appear in preferenceNames and vice versa';\n\n type PreferenceName = Preference['Name'] & keyof PreferenceDescriptors;\n\n type GetPreferenceValue =\n PreferenceDescriptors[Name] extends { isValid: (value: unknown) => value is infer U }\n ? U\n : never;\n\n type GetPreferenceDescriptor = PreferenceDescriptor<\n GetPreferenceValue\n >;\n\n /**\n * This is a helper type that allows us to type-check and provide intellisense\n * autocomplete for a map between an action and its corresponding preference\n * property. The first argument the action is called with must be equal to the type\n * of the preference property\n */\n type ActionPreferenceNames = {\n [ActionName in keyof Actions]?: Actions[ActionName] extends (value: infer U) => void\n ? KeysWithValuesOfType>, Exclude>\n : never;\n };\n\n /**\n * The map from preference name back to preference ID\n */\n const preferenceIds = getPreferenceIds(preferenceNames);\n\n const createPreferences = (currentScope: CurrentScope) => {\n const localStorageProvider = createLocalStoragePreferenceProvider(storagePrefix);\n const instanceProvider = createInstancePreferenceProvider();\n const providers = [localStorageProvider, instanceProvider];\n\n const getProvider = (descriptor: PreferenceDescriptor): PreferenceProvider => {\n if (descriptor.expirationType === ExpirationType.Instance) {\n return instanceProvider;\n }\n return localStorageProvider;\n };\n\n const getDescriptor = (name: Name) => {\n return preferenceDescriptors[name] as unknown as GetPreferenceDescriptor;\n };\n\n const getCurrentProviderKey = (name: Name): string => {\n const preferenceId = String(preferenceIds[name]);\n const descriptor = getDescriptor(name);\n const userId = currentScope.getUserId();\n const projectId = currentScope.getProjectId();\n const designId = currentScope.getDesignId();\n let prefix = `pref_id:${preferenceId}`;\n if (userId && descriptor.userScope === UserScope.PerUser) {\n prefix = `${prefix}/user_id:${userId}`;\n }\n if (\n projectId &&\n (descriptor.preferenceScope === PreferenceScope.Project ||\n descriptor.preferenceScope === PreferenceScope.Design)\n ) {\n if (designId && descriptor.preferenceScope === PreferenceScope.Design) {\n return `${prefix}/project_id:${projectId}/design_id:${designId}`;\n }\n return `${prefix}/project_id:${projectId}`;\n }\n return prefix;\n };\n\n const has = (name: Name): boolean => {\n const providerKey = getCurrentProviderKey(name);\n const descriptor = getDescriptor(name);\n const provider = getProvider(descriptor);\n return provider.has(providerKey);\n };\n\n const get = (name: Name): GetPreferenceValue | undefined => {\n const providerKey = getCurrentProviderKey(name);\n const descriptor = getDescriptor(name);\n const provider = getProvider(descriptor);\n const storedValue = provider.get(providerKey);\n\n // In case \"get\" is performed before the cleanup is triggered,\n // it is valuable to check for validity in case schema changed\n // since last stored value\n if (storedValue && descriptor.isValid(storedValue.value)) {\n if (\n descriptor.expirationType === ExpirationType.MaxDuration &&\n (isDateMoreThanOneDayIntoTheFuture(storedValue.timestamp) ||\n isPastExpiryDate(storedValue.timestamp, descriptor.maxDurationMs))\n ) {\n return undefined;\n }\n return storedValue.value;\n }\n return undefined;\n };\n\n const set = (\n name: Name,\n value: GetPreferenceValue,\n ): void => {\n const providerKey = getCurrentProviderKey(name);\n const descriptor = getDescriptor(name);\n const provider = getProvider(descriptor);\n provider.set(providerKey, {\n timestamp: Date.now(),\n value,\n });\n };\n\n const remove = (name: Name): void => {\n const providerKey = getCurrentProviderKey(name);\n const descriptor = getDescriptor(name);\n const provider = getProvider(descriptor);\n provider.remove(providerKey);\n };\n\n /**\n * Wrapper function for automatically adjusting preferences whenever\n * actions are called. This is geared towards preferences that are strictly\n * typed objects. To wrap actions, provide an object that contains\n * original actions and an object representing a map between an action\n * and its corresponding preference property. Returns a new object\n * with wrapped actions\n */\n const wrapActions = (\n name: Name,\n actions: Actions,\n actionPreferenceNames: ActionPreferenceNames,\n ): Actions => {\n const newActions = { ...actions };\n Object.keys(actionPreferenceNames).forEach((actionName: string) => {\n const property = actionPreferenceNames[actionName];\n newActions[actionName] = (newValue: unknown): unknown => {\n const returnedValue = actions[actionName](newValue);\n const preferences: unknown = get(name) ?? {};\n if (preferences && typeof preferences === 'object') {\n let result: object;\n if (newValue === undefined) {\n result = { ...preferences };\n delete result[property];\n } else {\n result = {\n ...preferences,\n [property]: newValue,\n };\n }\n set(name, result as GetPreferenceValue);\n }\n return returnedValue;\n };\n });\n return newActions;\n };\n\n const getIdAndDescriptor = (providerKey: string) => {\n const prefIdPrefix = 'pref_id:';\n const preferenceId =\n providerKey\n .split('/')\n .find((value) => value.startsWith(prefIdPrefix))\n ?.substring(prefIdPrefix.length) ?? '';\n const name: PreferenceName | undefined = preferenceNames[preferenceId];\n const descriptor = name && getDescriptor(name);\n return { descriptor, preferenceId };\n };\n\n /**\n * A function for performing preference cleanup. The cleanup is for\n * making sure preferences that were removed from codebase, got expired\n * or exceed max count are cleaned up from the browser. It also ensures\n * that the value is stored in the correct provider in case the property\n * changes a provider\n */\n const cleanup = () => {\n providers.forEach((provider) => {\n const maxCountKeys: { [k: string]: Array<[timestamp: number, providerKey: string]> } = {};\n\n /**\n * If the preference changed providers, remove the value from\n * the old provider and store it in the new one\n */\n provider.getKeys().forEach((providerKey) => {\n const { descriptor } = getIdAndDescriptor(providerKey);\n if (!descriptor) {\n return;\n }\n const expectedProvider = getProvider(descriptor);\n if (provider !== expectedProvider) {\n const storedValue = provider.get(providerKey);\n if (storedValue) {\n provider.remove(providerKey);\n expectedProvider.set(providerKey, storedValue);\n }\n }\n });\n\n provider.getKeys().forEach((providerKey) => {\n const { preferenceId, descriptor } = getIdAndDescriptor(providerKey);\n const storedValue = provider.get(providerKey);\n if (\n // If the stored value is invalid (e.g. user-modified):\n !storedValue ||\n // If preference ID was deleted from our codebase:\n !(preferenceId in preferenceNames) ||\n !descriptor ||\n // If the value no longer matches schema:\n !descriptor.isValid(storedValue.value) ||\n // If the value expired:\n (descriptor.expirationType === ExpirationType.MaxDuration &&\n (isDateMoreThanOneDayIntoTheFuture(storedValue.timestamp) ||\n isPastExpiryDate(storedValue.timestamp, descriptor.maxDurationMs)))\n ) {\n provider.remove(providerKey);\n } else if (descriptor && descriptor.expirationType === ExpirationType.MaxCount) {\n // Gathering information about values possibly exceeding max count\n if (!maxCountKeys[preferenceId]) {\n maxCountKeys[preferenceId] = [];\n }\n maxCountKeys[preferenceId].push([storedValue.timestamp, providerKey]);\n }\n });\n\n // Clean up settings that exceeded max count\n Object.keys(maxCountKeys).forEach((preferenceId) => {\n const maxCountKey = maxCountKeys[preferenceId];\n const name: PreferenceName = preferenceNames[preferenceId];\n const descriptor = getDescriptor(name);\n if (descriptor.expirationType === ExpirationType.MaxCount) {\n const countDiff = maxCountKey.length - descriptor.maxCount;\n if (countDiff > 0) {\n maxCountKey\n .sort(([t1], [t2]) => t1 - t2)\n .forEach(([, providerKey], i) => {\n if (i < countDiff) {\n provider.remove(providerKey);\n }\n });\n }\n }\n });\n });\n };\n\n return {\n cleanup,\n get,\n has,\n remove,\n set,\n wrapActions,\n };\n };\n\n const manager = { createPreferences };\n return manager as PreferenceTypeError extends null ? typeof manager : PreferenceTypeError;\n};\n","import { BaseSchema, InferType } from 'yup';\n\nimport { PreferenceDescriptor } from './preference-descriptor-types';\n\nexport type GetPreference = {\n Names: PreferenceNames;\n Id: keyof PreferenceNames;\n Name: PreferenceNames[keyof PreferenceNames] extends string | number | symbol\n ? PreferenceNames[keyof PreferenceNames]\n : never;\n};\n\nexport type GeneralPreferenceDescriptors = {\n [K in GetPreference['Name']]: PreferenceDescriptor;\n};\n\nexport type TypedPreferenceDescriptors<\n PreferenceNames,\n Descriptors extends GeneralPreferenceDescriptors,\n> = {\n [K in keyof Descriptors]: Descriptors[K] extends PreferenceDescriptor\n ? PreferenceDescriptor\n : never;\n};\n\n/**\n * Inverts a map from ID to name to be from name to ID\n */\nexport const getPreferenceIds = (\n preferenceNames: PreferenceNames,\n) => {\n type Preference = GetPreference;\n\n type GetPrefIdFromPrefName = {\n [K in Preference['Id']]: PrefName extends Preference['Names'][K] ? K : never;\n }[Preference['Id']];\n\n type PreferenceIds = {\n [K in Preference['Name']]: GetPrefIdFromPrefName;\n };\n\n const result = {} as object;\n Object.entries(preferenceNames).forEach(([key, value]) => {\n result[value] = key as Preference['Id'];\n });\n return result as PreferenceIds;\n};\n\n/**\n * Returns an \"isValid\" check based on Yup schema. Additionally\n * fixes Yup's optional field behavior\n */\nexport const schemaCheck = (schema: T) => {\n type InferredType = T extends {\n __inputType: unknown;\n __outputType: unknown;\n }\n ? InferType\n : never;\n\n type PickUndefined = {\n [Key in keyof InferredType as undefined extends InferredType[Key]\n ? Key\n : never]: InferredType[Key];\n };\n\n type PickRequired = {\n [Key in keyof InferredType as undefined extends InferredType[Key]\n ? never\n : Key]: InferredType[Key];\n };\n\n /**\n * Note: this fixes an issue with Yup typescript where optional fields are\n * still required in the schema. Here, if a field can be undefined, it is\n * also considered optional\n */\n type SchemaType = {\n [Key in keyof PickUndefined]?: InferredType[Key];\n } & {\n [Key in keyof PickRequired]: InferredType[Key];\n };\n\n return (value: unknown): value is SchemaType => {\n return (schema as unknown as BaseSchema).isValidSync(value);\n };\n};\n\n/**\n * Gets keys of a type T where values are of type V\n */\nexport type KeysWithValuesOfType = keyof {\n /**\n * Note: \"T[P] extends V && V extends T[P]\" is equivalent to saying that\n * T[P] and V are completely equal types\n */\n [P in keyof T as T[P] extends V ? (V extends T[P] ? P : never) : never]: P;\n};\n","/* eslint-disable sort-keys */\nimport * as yup from 'yup';\nimport { ExpirationType, PreferenceScope } from './preference-descriptor-types';\nimport { createPreferencesManager, CurrentScope } from './preference-manager';\nimport { schemaCheck } from './preference-utils';\n\n/**\n * Prefix for local storage of CAD preferences. This should not change once\n * it goes in production, otherwise this would wipe out all preferences\n */\nconst CAD_PREFERENCE_STORAGE_PREFIX = 'CAD_PREF::';\n\n/**\n * An object that maps a preference ID to a meaningful name. The preference ID\n * should be meaningless so that it may be repurposed. We may add new IDs, remove\n * old IDs (in which case the preference will be cleaned up and removed from storage),\n * but we may never repeat previously used IDs. For that reason, we use an ID schema\n * \"p###\"\" where \"###\" are ever-increasing numbers. If we have to remove an ID with\n * the highest number, we should leave a comment here\n */\nconst preferenceNames = {\n p000: 'panelPlaceMode',\n} as const;\n\n/**\n * Descriptors for every preference. Every preference in `preferenceNames` must be\n * defined and correspond to PreferenceDescriptor. Schema should only change in\n * backwards compatible ways, otherwise the preference will be invalidated and cleaned\n * up. It is also important that these types are fully defined here rather than\n * being imported from other places to avoid accidental changes to the schema. When\n * adding or modifying preferences, it's vital to make sure that\n * `cad-preference-compatibility.test.ts` passes and that we add new test cases for\n * any new preferences / preference changes to keep them backwards compatible as the\n * schema evolves\n *\n * Reminder, preferences are our way of storing user-, design-, project- and app-based\n * user-entered preferences. Preferences may be acquired and cleared via interactions with\n * forms or, if needed, via a dedicated page. Preferences are meant to be type-validated,\n * type-safe and geared towards long-term storage with all the backwards compatibility\n * implications that are described in `createPreferencesManager`\n */\nconst preferenceDescriptors = {\n panelPlaceMode: {\n preferenceScope: PreferenceScope.Design,\n expirationType: ExpirationType.MaxCount,\n maxCount: 50,\n isValid: schemaCheck(\n yup\n .object({\n dcOptimizerId: yup.string().nullable(),\n microinverterId: yup.string().nullable(),\n solarPanelId: yup.string().nullable(),\n minSap: yup.number(),\n\n pitchedThreshold: yup.number(),\n\n flatTilt: yup.number(),\n flatRotation: yup.number(),\n flatIntermoduleSpacingX: yup.number(),\n flatRowSpacing: yup.number(),\n flatOrientation: yup.mixed<'L' | 'P'>().oneOf(['L', 'P']),\n\n pitchedTilt: yup.number(),\n pitchedRotation: yup.number(),\n pitchedIntermoduleSpacingX: yup.number(),\n pitchedRowSpacing: yup.number(),\n pitchedOrientation: yup.mixed<'L' | 'P'>().oneOf(['L', 'P']),\n })\n .required(),\n ),\n },\n} as const;\n\nconst cadPreferencesManager = createPreferencesManager(\n preferenceNames,\n preferenceDescriptors,\n CAD_PREFERENCE_STORAGE_PREFIX,\n);\n\nexport type CadPreferences = ReturnType;\n\nexport const createCadPreferences = (currentScope: CurrentScope) => {\n const preferences = cadPreferencesManager.createPreferences(currentScope);\n /**\n * Cleanup is performed right after preference initialization during\n * browser's idle period in order to slightly speed up CAD initialization.\n * Done immediately for browsers that don't support `requestIdleCallback`\n * like Safari\n */\n if ('requestIdleCallback' in window) {\n requestIdleCallback(preferences.cleanup);\n } else {\n preferences.cleanup();\n }\n return preferences;\n};\n","import {\n CadSelectionMetadata,\n CadSelectionMetadataActions,\n CadSelectionType,\n CadModeType,\n PrimarySelectionKey,\n} from '../cad-engine-state';\n\nexport type ActiveInspectorTabType = null | 'sky' | 'lidar' | 'selectionList' | CadModeType;\nexport type ActiveTabType = CadSelectionType | ActiveInspectorTabType | null;\n\nexport const modeInspectorTabTypes: CadModeType[] = ['fill-roof-face', 'draw-solar-panel'];\n\ntype ActiveTabData = {\n /**\n * Inspector-specific tabs that don't have a corresponding CAD selection object\n */\n activeInspectorOnlyTab: ActiveInspectorTabType;\n\n activeTab: ActiveTabType;\n};\n\nexport const createActiveTabData = (selectionMetadata: CadSelectionMetadata): ActiveTabData => {\n return {\n activeInspectorOnlyTab: null,\n\n get activeTab() {\n return selectionMetadata.primarySelectionKey ?? this.activeInspectorOnlyTab;\n },\n };\n};\n\nexport const createActiveTabActions = (\n activeTabData: ActiveTabData,\n selectionMetadataActions: CadSelectionMetadataActions,\n) => {\n return {\n setActiveTab: (newActiveTab: ActiveTabType) => {\n if (\n newActiveTab === 'sky' ||\n newActiveTab === 'lidar' ||\n newActiveTab === 'selectionList' ||\n modeInspectorTabTypes.includes(newActiveTab as CadModeType)\n ) {\n selectionMetadataActions.setPrimarySelectionKey(null);\n activeTabData.activeInspectorOnlyTab = newActiveTab as CadModeType;\n } else {\n selectionMetadataActions.setPrimarySelectionKey(newActiveTab as PrimarySelectionKey);\n activeTabData.activeInspectorOnlyTab = null;\n }\n },\n };\n};\n","import { performance } from '@aurorasolar/common-performance';\n\nconst { AutoDesignerStart, AutoDesignerFinished } = performance.MarkName;\nconst { AutoDesignerDuration } = performance.MeasureName;\n\nexport type AutoDesignerData = {\n isAutoDesignerRunning: boolean;\n};\n\nexport const createAutoDesignerData = (): AutoDesignerData => {\n return {\n isAutoDesignerRunning: false,\n };\n};\n\nexport const createAutoDesignerActions = (autoDesignerData: AutoDesignerData) => {\n return {\n autoDesignerFinish: () => {\n autoDesignerData.isAutoDesignerRunning = false;\n performance.mark(AutoDesignerFinished);\n performance.measure(AutoDesignerDuration, AutoDesignerStart, AutoDesignerFinished);\n },\n autoDesignerStart: () => {\n autoDesignerData.isAutoDesignerRunning = true;\n performance.mark(AutoDesignerStart);\n },\n };\n};\n","export enum ModalType {\n None,\n Nearmap,\n Vexcel,\n}\n\nexport enum OverlayType {\n DesignSettings,\n}\n\nexport enum DesignSettingsTab {\n System = 'design-settings-system-tab',\n Simulation = 'design-settings-simulation-tab',\n}\n\nexport type OverlayData = {\n type: OverlayType.DesignSettings;\n data: {\n tab: DesignSettingsTab;\n };\n};\n\nexport type ModalData = {\n activeModal: ModalType;\n activeOverlays: OverlayData[];\n};\n\nexport const createModalData = (): ModalData => {\n return {\n activeModal: ModalType.None,\n activeOverlays: [],\n };\n};\n\nexport const createModalActions = (modalData: ModalData) => {\n return {\n closeModal: () => {\n modalData.activeModal = ModalType.None;\n },\n closeOverlay: (overlayType: OverlayType) => {\n const index = modalData.activeOverlays.findIndex((overlayDatum) => {\n return overlayDatum.type === overlayType;\n });\n if (index !== -1) {\n modalData.activeOverlays.splice(index, 1);\n }\n },\n openModal: (modalType: ModalType) => {\n modalData.activeModal = modalType;\n },\n openOverlay: (overlayData: OverlayData) => {\n const index = modalData.activeOverlays.findIndex((overlayDatum) => {\n return overlayDatum.type === overlayData.type;\n });\n if (index === -1) {\n modalData.activeOverlays.push(overlayData);\n }\n },\n setDesignSettingsTab: (designSettingsTab: DesignSettingsTab) => {\n modalData.activeOverlays.forEach((overlayDatum) => {\n if (overlayDatum.type === OverlayType.DesignSettings) {\n overlayDatum.data.tab = designSettingsTab;\n }\n });\n },\n };\n};\n","import { HistoryData } from '../cad-engine-state';\n\nexport type SaveData = {\n isSaving: boolean;\n hasUnsavedChanges: boolean;\n recentSavedVersion: string | null;\n};\n\nexport const createSaveData = (historyData: HistoryData): SaveData => {\n return {\n get hasUnsavedChanges() {\n return this.recentSavedVersion !== historyData.recentVersion;\n },\n isSaving: false,\n recentSavedVersion: historyData.recentVersion,\n };\n};\n\nexport const createSaveActions = (saveData: SaveData) => {\n return {\n finishSaving: (saveVersion: string) => {\n saveData.isSaving = false;\n saveData.recentSavedVersion = saveVersion;\n },\n startSaving: () => {\n saveData.isSaving = true;\n },\n };\n};\n","/* eslint-disable sort-keys */\nimport { createActiveTabActions, createActiveTabData } from './active-tab-data/active-tab-state';\nimport {\n createAutoDesignerActions,\n createAutoDesignerData,\n} from './auto-designer-state/auto-designer-state';\nimport { CadEngineState } from './cad-engine-state';\nimport { markDeepReadonly } from './deep-readonly-util';\nimport { makeReactive, provideCadStateTrace } from './framework';\nimport { createModalActions, createModalData } from './modal-state/modal-state';\nimport { createPrismActions, createPrismData } from './prism-state/prism-state';\nimport { createSaveActions, createSaveData } from './save-state/save-state';\nimport { createSelectedTypesData } from './selected-types/selected-types-state';\n\nexport type CadState = ReturnType;\n\n/**\n * Creates CAD state that React components will be able to subscribe to\n *\n * CAD state is meant for combining and managing CAD-related V2 state tied to a single CAD instance. It\n * is meant for managing CAD-wide data related to forms, modals, interactions, operations in progress, etc.\n * The returned state combines V2-specific CAD state with CAD engine state (state maintained by CAD engine\n * itself). CAD state should not contain class instances or React nodes. The entirety of CAD state data should\n * be comprised of simple JS objects containing primitive values or other simple JS objects, and CAD state\n * actions should only contain functions that can take primitive values or simple JS objects\n */\nexport const createCadState = (cadEngineState: CadEngineState) => {\n if (process.env.NODE_ENV === 'development') {\n provideCadStateTrace();\n }\n\n const selectedTypeData = makeReactive(createSelectedTypesData(cadEngineState));\n const modalData = makeReactive(createModalData());\n const modalActions = makeReactive(createModalActions(modalData));\n const autoDesignerData = makeReactive(createAutoDesignerData());\n const autoDesignerActions = makeReactive(createAutoDesignerActions(autoDesignerData));\n const saveData = makeReactive(createSaveData(cadEngineState.data.historyData));\n const saveActions = makeReactive(createSaveActions(saveData));\n const prismData = makeReactive(createPrismData());\n const prismActions = makeReactive(createPrismActions(prismData));\n const activeTabData = makeReactive(createActiveTabData(cadEngineState.data.selectionMetadata));\n const activeTabActions = makeReactive(\n createActiveTabActions(activeTabData, cadEngineState.actions.selectionMetadataActions),\n );\n\n return {\n data: markDeepReadonly({\n activeTabData,\n autoDesignerData,\n ...cadEngineState.data,\n modalData,\n prismData,\n saveData,\n selectedTypeData,\n }),\n actions: {\n activeTabActions,\n autoDesignerActions,\n ...cadEngineState.actions,\n modalActions,\n prismActions,\n saveActions,\n },\n stopEffects: {\n ...cadEngineState.stopEffects,\n },\n };\n};\n\n/**\n * Cleans up CAD state by stopping all of its effects\n */\nexport const stopCadStateEffects = (cadState: CadState) => {\n const items: Record void>> = cadState.stopEffects;\n Object.keys(items).forEach((stopEffectMapKey) => {\n const stopEffectMap = items[stopEffectMapKey];\n Object.keys(stopEffectMap).forEach((stopEffectKey) => {\n const stopEffect = stopEffectMap[stopEffectKey];\n stopEffect();\n });\n });\n};\n","import { CadEngineState, CadSelectionType } from '../cad-engine-state';\n\nexport const createSelectedTypesData = (cadEngineState: CadEngineState) => {\n return {\n get selectedTypes() {\n return Object.entries(cadEngineState.data.selectionData).reduce(\n (types, [type, { count }]) => (count > 0 ? [...types, type] : types) as CadSelectionType[],\n [] as CadSelectionType[],\n );\n },\n };\n};\n","export type PrismData = {\n isPrismCadOpen: boolean;\n};\n\nexport const createPrismData = (): PrismData => {\n return {\n isPrismCadOpen: false,\n };\n};\n\nexport const createPrismActions = (prismData: PrismData) => {\n return {\n toggleIsPrismCadOpen: (newState: boolean) => {\n prismData.isPrismCadOpen = newState;\n },\n };\n};\n","import { CadSelectionType } from '@aurorasolar/cad-state';\nimport { Notification } from '@aurorasolar/common-module-loader';\n\nimport { AiRoofType, ModalTrigger, ModalTriggerData } from './actions';\n\nexport enum CadEventTypes {\n AutoRoofCancelled = 'autoRoofCancelled',\n AutoRoofErrored = 'autoRoofErrored',\n AutoRoofFinished = 'autoRoofFinished',\n AutoRoofStarted = 'autoRoofStarted',\n AutoStringCancelled = 'autoStringCancelled',\n AutoStringErrored = 'autoStringErrored',\n AutoStringFinished = 'autoStringFinished',\n AutoStringStarted = 'autoStringStarted',\n BeforeDrawWalkway = 'beforeDrawWalkway',\n BeforeRunAutoRoof = 'beforeRunAutoRoof',\n CadErrorOccurred = 'cadErrorOccurred',\n CadGeometryErrorOccurred = 'cadGeometryErrorOccurred',\n CadLoggedMessage = 'cadLoggedMessage',\n DownloadDxf = 'downloadDxf',\n DxfParams = 'generateDxfParams',\n LoadSystemDesignFinished = 'loadSystemDesignFinished',\n Notify = 'notify',\n PlacePathwaysFinished = 'placePathwaysFinished',\n RelayInternalCadState = 'relayInternalCadState',\n SaveScreenshotAsset = 'saveScreenshotAsset',\n CadScreenshot = 'cadScreenshot',\n SetExternalStateData = 'setExternalStateData',\n TrackAnalyticsAction = 'trackAnalyticsAction',\n UndoFinished = 'undoFinished',\n BoxSelectionChanged = 'boxSelectionChanged',\n ClickSelected = 'clickSelected',\n ClickDeselected = 'clickDeselected',\n}\n\nexport interface AutoRoofCompletion {\n autoroofRequestId: string;\n state?: string;\n roofIds: string[];\n obstructionIds: string[];\n roofType: AiRoofType;\n autoAccept: boolean;\n}\n\nexport interface AutoRoofError {\n autoroofRequestId: string;\n error?: Error;\n roofIds?: string[];\n obstructionIds?: string[];\n roofType: AiRoofType;\n}\ninterface CadScreenshot {\n id?: string | symbol;\n imageType: 'png' | 'jpeg' | 'webp';\n data: Blob;\n}\n\ntype AutoStringEventData = {\n allPanelsStrung: boolean;\n errorType: AutoStringErrorType;\n error: Error;\n inverterCount: number;\n};\n\nenum AutoStringErrorType {\n RemoteError = 'remote-error',\n PartialStringing = 'partial-stringing',\n}\n\nexport type CadEventProps = {\n [CadEventTypes.Notify]: CadNotification;\n [CadEventTypes.AutoRoofFinished]: AutoRoofCompletion;\n [CadEventTypes.AutoRoofErrored]: AutoRoofError;\n [CadEventTypes.CadScreenshot]: CadScreenshot;\n [CadEventTypes.AutoRoofStarted]: { roofType: AiRoofType };\n [CadEventTypes.AutoRoofCancelled]: { roofType: AiRoofType };\n [CadEventTypes.CadErrorOccurred]: CadError;\n [CadEventTypes.CadGeometryErrorOccurred]: CadError;\n [CadEventTypes.CadLoggedMessage]: CadLogMessage;\n [CadEventTypes.AutoStringErrored]: AutoStringEventData;\n [CadEventTypes.AutoStringFinished]: AutoStringEventData;\n [CadEventTypes.AutoStringCancelled]: AutoStringEventData;\n [CadEventTypes.PlacePathwaysFinished]: { isChanged: boolean };\n [CadEventTypes.ClickSelected]: {\n selectionKey: CadSelectionType;\n };\n [CadEventTypes.ClickDeselected]: {\n selectionKey: CadSelectionType;\n };\n} & {\n [K in ModalTrigger]: ModalTriggerData;\n};\n\ntype CadNotification = {\n message: string;\n messageType: Notification.MessageType;\n dismissType: Notification.DismissType;\n title?: string;\n variables: string[];\n};\n\nexport type CadEventPropType = A extends keyof CadEventProps\n ? CadEventProps[A]\n : undefined;\n\nexport type CadEvent = A extends keyof CadEventProps\n ? { eventType: A; payload: CadEventPropType }\n : { eventType: A; payload: {} };\n\nexport type CadEventPayload = CadEvent['payload'];\n\nexport interface ErrorWData extends Error {\n cause?: unknown;\n}\n\nexport interface CadError {\n err: ErrorWData;\n message: string;\n}\n\nexport interface CadLogMessage {\n message: string;\n extraData?: Record;\n}\n","export const NOVO_TOAST_CHANNEL = Symbol('novo toast channel');\nexport const TOAST_CHANNEL = Symbol('toast channel');\nexport const E_PROPOSAL_VALIDATION_ERROR_CHANNEL = Symbol('E-proposal validation error channel');\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type GetUserInfoQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type GetUserInfoQuery = { __typename: 'Query', currentUser?: { __typename: 'User', id: string } | null | undefined };\n\nexport type CreateBssUploadUrlsMutationVariables = Types.Exact<{\n createBSSUploadUrlsInput: Types.CreateBssUploadUrlsInput;\n}>;\n\n\nexport type CreateBssUploadUrlsMutation = { __typename: 'Mutation', createBSSUploadUrls?: Array<{ __typename: 'CreateFileBSSUploadUrl', blobId?: string | null | undefined, contentSha256?: string | null | undefined, uploadNeeded?: boolean | null | undefined, uploadUrl?: string | null | undefined, mandatoryUploadHeaders?: Array<{ __typename: 'MandatoryHeader', name?: string | null | undefined, value?: string | null | undefined } | null | undefined> | null | undefined } | null | undefined> | null | undefined };\n\n\nexport const GetUserInfoDocument = gql`\n query GetUserInfo @trace_info(traceInfo: {pod: proposals}) {\n currentUser {\n id\n }\n}\n `;\n\n/**\n * __useGetUserInfoQuery__\n *\n * To run a query within a React component, call `useGetUserInfoQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetUserInfoQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetUserInfoQuery({\n * variables: {\n * },\n * });\n */\nexport function useGetUserInfoQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(GetUserInfoDocument, options);\n }\nexport function useGetUserInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(GetUserInfoDocument, options);\n }\nexport type GetUserInfoQueryHookResult = ReturnType;\nexport type GetUserInfoLazyQueryHookResult = ReturnType;\nexport type GetUserInfoQueryResult = Apollo.QueryResult;\nexport const CreateBssUploadUrlsDocument = gql`\n mutation CreateBSSUploadUrls($createBSSUploadUrlsInput: CreateBSSUploadUrlsInput!) @trace_info(traceInfo: {pod: proposals}) {\n createBSSUploadUrls(createBSSUploadUrlsInput: $createBSSUploadUrlsInput) {\n blobId\n contentSha256\n uploadNeeded\n uploadUrl\n mandatoryUploadHeaders {\n name\n value\n }\n }\n}\n `;\nexport type CreateBssUploadUrlsMutationFn = Apollo.MutationFunction;\n\n/**\n * __useCreateBssUploadUrlsMutation__\n *\n * To run a mutation, you first call `useCreateBssUploadUrlsMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useCreateBssUploadUrlsMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [createBssUploadUrlsMutation, { data, loading, error }] = useCreateBssUploadUrlsMutation({\n * variables: {\n * createBSSUploadUrlsInput: // value for 'createBSSUploadUrlsInput'\n * },\n * });\n */\nexport function useCreateBssUploadUrlsMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(CreateBssUploadUrlsDocument, options);\n }\nexport type CreateBssUploadUrlsMutationHookResult = ReturnType;\nexport type CreateBssUploadUrlsMutationResult = Apollo.MutationResult;\nexport type CreateBssUploadUrlsMutationOptions = Apollo.BaseMutationOptions;","import { useCallback, useRef } from 'react';\n\nimport { ApolloClient, FileUploadHandler, useAppModule } from '@aurorasolar/common-module-loader';\n\nimport {\n GetUserInfoDocument,\n GetUserInfoQuery,\n GetUserInfoQueryVariables,\n useCreateBssUploadUrlsMutation,\n} from '../file-uploader.generated';\n\nexport const useCreateBssUploadUrls = () => {\n const userId = useRef();\n const fileUploader = useAppModule(FileUploadHandler);\n const client = useAppModule(ApolloClient);\n\n const fetchUserId = useCallback(async () => {\n if (!client) {\n throw new Error('Apollo Client is not initialized');\n }\n\n if (userId.current) {\n return userId.current;\n }\n\n const userData = await client.query({\n fetchPolicy: 'cache-first',\n query: GetUserInfoDocument,\n });\n\n const newUserId = userData.data.currentUser?.id;\n userId.current = newUserId;\n return newUserId;\n }, [client]);\n\n const [createBssUploadUrls] = useCreateBssUploadUrlsMutation();\n\n const fetchBssUploadUrls = useCallback(\n async (files: File[]) => {\n let currentUserId = userId.current;\n if (!currentUserId) {\n try {\n currentUserId = await fetchUserId();\n } catch {\n throw new Error('Failed to fetch userId');\n }\n }\n\n // Fetch worked but still came back undefined\n if (!currentUserId) {\n throw new Error('Cannot request BSS Urls without a userId');\n }\n\n if (!fileUploader?.hashFile) {\n throw new Error('fileUploader must be ready to use');\n }\n\n const bssUploadInputsPromises = files.map(async (file) => {\n const hash = (await fileUploader?.hashFile?.(file)) ?? '';\n return {\n blobName: file.name,\n contentLength: file.size,\n contentSha256: hash,\n mimeType: file.type,\n };\n });\n\n const bssUploadInputs = await Promise.all(bssUploadInputsPromises);\n\n try {\n const result = await createBssUploadUrls({\n variables: {\n createBSSUploadUrlsInput: {\n files: bssUploadInputs,\n id: currentUserId,\n },\n },\n });\n\n return result.data?.createBSSUploadUrls;\n } catch (e) {\n throw new Error(`Failed to fetch BSS Upload tokens ${e}`);\n }\n },\n [fileUploader, createBssUploadUrls, fetchUserId],\n );\n\n return fileUploader ? fetchBssUploadUrls : undefined;\n};\n","import { useCallback } from 'react';\n\nimport { useStartAsyncJobMutation } from '@aurorasolar/common-data-access-layer';\nimport { ApolloClient, AsyncJob, useAppModule } from '@aurorasolar/common-module-loader';\nimport {\n AsyncJobType,\n FileUploaderResult,\n UserFileLabel,\n} from '@aurorasolar/graphql-client-schema';\n\nexport const useUploadFileAsyncJob = () => {\n const [startAsyncJob] = useStartAsyncJobMutation();\n const invalidateJobs = useAppModule(AsyncJob)?.invalidateJobs;\n const client = useAppModule(ApolloClient);\n\n const runUploadFileAsyncJob = useCallback(\n async (\n temporaryBlobId: string,\n fileName: string,\n label: UserFileLabel,\n mimeType: string,\n parentId?: string,\n parentType?: string,\n parentRoleType?: string,\n ) => {\n try {\n const result = await startAsyncJob({\n variables: {\n settings: {\n fileName,\n label,\n mimeType,\n parentId,\n parentRoleType,\n parentType,\n temporaryBlobId,\n },\n type: AsyncJobType.FileUploader,\n },\n });\n\n return result?.data?.startAsyncJob as FileUploaderResult;\n } catch (e) {\n throw new Error(`Upload File async job failed ${e}`);\n }\n },\n [startAsyncJob],\n );\n\n const invalidateUploadFileAsyncJob = useCallback(\n (id) => {\n invalidateJobs?.([`file_uploader_${id}`]);\n },\n [invalidateJobs],\n );\n\n return {\n invalidateUploadFileAsyncJob: invalidateJobs ? invalidateUploadFileAsyncJob : undefined,\n runUploadFileAsyncJob: client ? runUploadFileAsyncJob : undefined,\n };\n};\n","import { useCallback, useEffect, useRef, useState } from 'react';\n\nimport { generateUuid } from '@aurorasolar/common-core/src/utils';\nimport { FileUploadHandler, useAppModule } from '@aurorasolar/common-module-loader';\nimport { UserFileLabel } from '@aurorasolar/graphql-client-schema';\n\nimport { FileResult, FileResultUploadStatus, getFileResultType } from '../common';\nimport { useCreateBssUploadUrls } from './use-create-bss-upload-urls';\nimport { useUploadFileAsyncJob } from './use-upload-file-async-job';\n\nexport const SERVER_ERROR_MESSAGE = 'Failed to upload to server';\n\nconst fileResultNotInProgress = (fileResult: FileResult): boolean => {\n return fileResult.status !== FileResultUploadStatus.IN_PROGRESS;\n};\n\nexport interface UserFileOptions {\n label: UserFileLabel;\n parentId?: string;\n parentType?: string;\n parentRoleType?: string;\n}\n\nexport const useUploadFiles = (userFileOptions: UserFileOptions) => {\n // Store fileResults in a ref so that they can be accessed inside a useCallback function without stale values\n // Store in object so that getting fileResult by ID is quicker\n const fileMap = useRef<{ [key: string]: FileResult }>({});\n // fileResults is an array of references to items in the fileMap\n // keeps ordering of files, when updated allows for rerender to give updated results\n const [fileResults, setFileResults] = useState([]);\n\n // Needed to get the signed urls for uploading file directly\n const fetchBssUploadUrls = useCreateBssUploadUrls();\n // fileUploader.uploadToSignedUrl makes POST request to upload file to signed url\n const fileUploader = useAppModule(FileUploadHandler);\n // runUploadFileAsyncJob used to tell BE file is ready to run validations on\n // returns results of successful validated UserFiles or validation errors\n // invalidateUploadFileAsyncJob is used to cancel the asyncJob if the file upload is canceled\n const { runUploadFileAsyncJob, invalidateUploadFileAsyncJob } = useUploadFileAsyncJob();\n\n const updateFileResult = useCallback((id: string, updatedOptions: Partial) => {\n setFileResults((prev) => {\n const newFileResults = [...prev];\n const updateIndex = newFileResults.findIndex((fileResult) => fileResult.id === id);\n if (updateIndex >= 0) {\n fileMap.current[id] = {\n ...newFileResults[updateIndex],\n ...updatedOptions,\n };\n newFileResults[updateIndex] = fileMap.current[id];\n\n return newFileResults;\n }\n return prev;\n });\n }, []);\n\n // Set the status of a fileResult to cancel to queue the canceling of asyncJob (if it exists)\n const cancelFileUpload = useCallback(\n (id: string) => {\n const fileResult = fileMap.current[id];\n if (\n fileResult?.status === FileResultUploadStatus.IN_PROGRESS ||\n fileResult?.status === FileResultUploadStatus.PENDING\n ) {\n updateFileResult(id, { status: FileResultUploadStatus.CANCELED });\n } else {\n console.warn(\n `Cannot cancel file upload when file result status is \"${fileResult?.status}\". Status must be \"in-progress\" or \"pending\"`,\n );\n }\n },\n [updateFileResult],\n );\n\n // Set the status of the fileResult to pending to re-queue the file for upload\n const retryFileUpload = useCallback(\n (id: string) => {\n const fileResult = fileMap.current[id];\n if (\n fileResult?.status === FileResultUploadStatus.NON_VALIDATION_ERROR ||\n fileResult?.status === FileResultUploadStatus.VALIDATION_ERROR\n ) {\n updateFileResult(id, {\n errorText: undefined,\n result: undefined,\n status: FileResultUploadStatus.PENDING,\n });\n } else {\n console.warn(\n `Cannot retry file upload when file result status is \"${fileResult?.status}\". Status must be \"validation-error\" or \"non-validation-error\"`,\n );\n }\n },\n [updateFileResult],\n );\n\n // Remove a fileResult from the array (used after canceling completed)\n const removeFileUpload = useCallback((id: string) => {\n setFileResults((prev) => {\n const newFileResults = [...prev].filter((fileResult) => fileResult.id !== id);\n delete fileMap.current[id];\n return newFileResults;\n });\n }, []);\n\n const clearResults = useCallback(() => {\n setFileResults([]);\n fileMap.current = {};\n }, []);\n\n // Used to add files that failed external validation to the results list\n const addErroredFiles = useCallback((erroredFiles: { errorText: string; file: File }[]) => {\n const newErroredFileResults = erroredFiles.map(({ errorText, file }) => {\n const id = generateUuid();\n const newErroredFileResult = {\n errorText,\n file,\n fileType: getFileResultType(file.type),\n id,\n status: FileResultUploadStatus.VALIDATION_ERROR,\n };\n\n fileMap.current[id] = newErroredFileResult;\n return fileMap.current[id];\n });\n\n setFileResults((prev) => [...prev, ...newErroredFileResults]);\n }, []);\n\n const uploadFiles = useCallback(async (newFiles: File[]) => {\n const newFileResults = newFiles.map((newFile) => {\n const id = generateUuid();\n const newFileResult = {\n file: newFile,\n fileType: getFileResultType(newFile.type),\n id,\n status: FileResultUploadStatus.PENDING,\n };\n\n fileMap.current[id] = newFileResult;\n return fileMap.current[id];\n });\n\n setFileResults((prev) => [...prev, ...newFileResults]);\n }, []);\n\n // LOGIC TO UPLOAD QUEUED PENDING FILES\n useEffect(() => {\n const asyncUploadFiles = async () => {\n const pendingFileResults = fileResults.filter(\n (fileResult) => fileResult.status === FileResultUploadStatus.PENDING,\n );\n\n if (pendingFileResults.length > 0) {\n const pendingFiles = pendingFileResults.map((fileResult) => {\n updateFileResult(fileResult.id, { status: FileResultUploadStatus.IN_PROGRESS });\n return fileResult.file;\n });\n\n try {\n // Get the all the signed urls needed to upload files\n const bssUploadUrls = await fetchBssUploadUrls?.(pendingFiles);\n bssUploadUrls?.forEach(async (uploadUrl, i) => {\n const inProgressFileResult = fileMap.current[pendingFileResults[i]?.id];\n if (uploadUrl) {\n try {\n // Stop upload process early if status has changed\n if (fileResultNotInProgress(inProgressFileResult)) {\n return;\n }\n\n // Upload file directly to BSS from FE\n const blobId = await fileUploader?.uploadToSignedUrl?.(pendingFiles[i], uploadUrl);\n\n // Stop upload process early if status has changed\n if (fileResultNotInProgress(inProgressFileResult)) {\n return;\n }\n if (blobId) {\n // Start the async job to run validations for label\n const result = await runUploadFileAsyncJob?.(\n blobId,\n pendingFiles[i].name,\n userFileOptions.label,\n pendingFiles[i].type,\n userFileOptions.parentId,\n userFileOptions.parentType,\n userFileOptions.parentRoleType,\n );\n\n updateFileResult(inProgressFileResult.id, { result });\n\n // Stop upload process early if status has changed\n if (fileResultNotInProgress(inProgressFileResult)) {\n return;\n }\n\n // Full upload has finished, save the result (either success or validation error)\n if (result?.errors?.length) {\n const [firstError] = result.errors;\n updateFileResult(inProgressFileResult.id, {\n errorText: firstError,\n status: FileResultUploadStatus.VALIDATION_ERROR,\n });\n } else {\n updateFileResult(inProgressFileResult?.id, {\n status: FileResultUploadStatus.COMPLETE,\n });\n }\n }\n } catch (e) {\n // If something has errored during the individual file upload process set a non validation error\n updateFileResult(inProgressFileResult?.id, {\n errorText: SERVER_ERROR_MESSAGE,\n status: FileResultUploadStatus.NON_VALIDATION_ERROR,\n });\n }\n }\n });\n } catch (e) {\n pendingFileResults.forEach((fileResult) => {\n updateFileResult(fileResult.id, {\n errorText: SERVER_ERROR_MESSAGE,\n status: FileResultUploadStatus.NON_VALIDATION_ERROR,\n });\n });\n }\n }\n };\n\n if (fileResults && fetchBssUploadUrls && fileUploader && runUploadFileAsyncJob) {\n asyncUploadFiles();\n }\n }, [\n fileResults,\n fetchBssUploadUrls,\n updateFileResult,\n fileUploader,\n runUploadFileAsyncJob,\n userFileOptions,\n ]);\n\n // LOGIC TO CANCEL UPLOAD FOR QUEUED CANCELED FILES\n useEffect(() => {\n const cancelFileResults = fileResults.filter(\n (fileResult) => fileResult.status === FileResultUploadStatus.CANCELED,\n );\n\n if (cancelFileResults.length > 0 && invalidateUploadFileAsyncJob) {\n cancelFileResults.forEach(async (fileResult) => {\n await invalidateUploadFileAsyncJob(fileResult?.id);\n removeFileUpload(fileResult.id);\n });\n }\n }, [fileResults, removeFileUpload, invalidateUploadFileAsyncJob]);\n\n return {\n addErroredFiles,\n cancelFileUpload,\n clearResults,\n results: fileResults,\n retryFileUpload,\n uploadFiles,\n };\n};\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type SaveDesignMutationVariables = Types.Exact<{\n designId: Types.Scalars['ID'];\n cadUpdatedDesign: Types.CadUpdatedDesign;\n}>;\n\n\nexport type SaveDesignMutation = { __typename: 'Mutation', saveDesign: { __typename: 'Design', id: string, savesDisabled?: boolean | null | undefined, designString?: string | null | undefined, designJson?: any | null | undefined, siteString?: string | null | undefined, siteJson?: any | null | undefined, latitude: number, longitude: number, savedFromNewCad: boolean, irradianceMapId?: string | null | undefined, irradianceMapStatus?: string | null | undefined, irradiancePanelsId?: string | null | undefined, irradiancePanelsStatus?: string | null | undefined, temperatureMax?: number | null | undefined, temperatureMin?: number | null | undefined, geodataBaseUrl?: string | null | undefined, geodataParentId?: number | null | undefined, updatedAt?: string | null | undefined, energyOffsetPercent?: number | null | undefined, systemSize?: number | null | undefined, pricePerWatt?: number | null | undefined, addersAndDiscounts?: Array<{ __typename: 'Adder', id: string, adderName?: string | null | undefined, adderType?: Types.AdderType | null | undefined, adderValue?: number | null | undefined }> | null | undefined, avoidedCost: { __typename: 'AvoidedCost', id: string, valid?: boolean | null | undefined, billOffsetPercentage?: number | null | undefined }, masterPerformanceSimulation: { __typename: 'PerformanceSimulation', id: string, valid?: boolean | null | undefined }, financings?: Array<{ __typename: 'Financing', id: string, valid?: boolean | null | undefined }> | null | undefined, pricing: { __typename: 'Pricing', id: string, systemCost: number } } };\n\nexport type CadUberModeQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type CadUberModeQuery = { __typename: 'Query', CAD: { __typename: 'CAD', uberMode: string } };\n\nexport type GetDesignByIdQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type GetDesignByIdQuery = { __typename: 'Query', designById: { __typename: 'Design', id: string, savesDisabled?: boolean | null | undefined, designString?: string | null | undefined, designJson?: any | null | undefined, siteString?: string | null | undefined, siteJson?: any | null | undefined, latitude: number, longitude: number, savedFromNewCad: boolean, irradianceMapId?: string | null | undefined, irradianceMapStatus?: string | null | undefined, irradiancePanelsId?: string | null | undefined, irradiancePanelsStatus?: string | null | undefined, temperatureMax?: number | null | undefined, temperatureMin?: number | null | undefined, geodataBaseUrl?: string | null | undefined, geodataParentId?: number | null | undefined } };\n\nexport type CadModeQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type CadModeQuery = { __typename: 'Query', CAD: { __typename: 'CAD', mode: string } };\n\n\nexport const SaveDesignDocument = gql`\n mutation SaveDesign($designId: ID!, $cadUpdatedDesign: CadUpdatedDesign!) @trace_info(traceInfo: {pod: cad}) {\n saveDesign(id: $designId, cadUpdatedDesign: $cadUpdatedDesign) {\n id\n savesDisabled\n designString\n designJson @client\n siteString\n siteJson @client\n latitude\n longitude\n savedFromNewCad\n irradianceMapId\n irradianceMapStatus\n irradiancePanelsId\n irradiancePanelsStatus\n temperatureMax\n temperatureMin\n geodataBaseUrl\n geodataParentId\n updatedAt\n energyOffsetPercent\n systemSize\n pricePerWatt\n addersAndDiscounts {\n id\n adderName\n adderType\n adderValue\n }\n avoidedCost {\n id\n valid\n billOffsetPercentage\n }\n masterPerformanceSimulation {\n id\n valid\n }\n financings {\n id\n valid\n }\n pricing {\n id\n systemCost\n }\n }\n}\n `;\nexport type SaveDesignMutationFn = Apollo.MutationFunction;\n\n/**\n * __useSaveDesignMutation__\n *\n * To run a mutation, you first call `useSaveDesignMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useSaveDesignMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [saveDesignMutation, { data, loading, error }] = useSaveDesignMutation({\n * variables: {\n * designId: // value for 'designId'\n * cadUpdatedDesign: // value for 'cadUpdatedDesign'\n * },\n * });\n */\nexport function useSaveDesignMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(SaveDesignDocument, options);\n }\nexport type SaveDesignMutationHookResult = ReturnType;\nexport type SaveDesignMutationResult = Apollo.MutationResult;\nexport type SaveDesignMutationOptions = Apollo.BaseMutationOptions;\nexport const CadUberModeDocument = gql`\n query CadUberMode @trace_info(traceInfo: {pod: cad}) {\n CAD @client {\n uberMode\n }\n}\n `;\n\n/**\n * __useCadUberModeQuery__\n *\n * To run a query within a React component, call `useCadUberModeQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadUberModeQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadUberModeQuery({\n * variables: {\n * },\n * });\n */\nexport function useCadUberModeQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadUberModeDocument, options);\n }\nexport function useCadUberModeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadUberModeDocument, options);\n }\nexport type CadUberModeQueryHookResult = ReturnType;\nexport type CadUberModeLazyQueryHookResult = ReturnType;\nexport type CadUberModeQueryResult = Apollo.QueryResult;\nexport const GetDesignByIdDocument = gql`\n query GetDesignById($id: ID!) @trace_info(traceInfo: {pod: cad}) {\n designById(id: $id) {\n id\n savesDisabled\n designString\n designJson @client\n siteString\n siteJson @client\n latitude\n longitude\n savedFromNewCad\n irradianceMapId\n irradianceMapStatus\n irradiancePanelsId\n irradiancePanelsStatus\n temperatureMax\n temperatureMin\n geodataBaseUrl\n geodataParentId\n }\n}\n `;\n\n/**\n * __useGetDesignByIdQuery__\n *\n * To run a query within a React component, call `useGetDesignByIdQuery` and pass it any options that fit your needs.\n * When your component renders, `useGetDesignByIdQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useGetDesignByIdQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useGetDesignByIdQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(GetDesignByIdDocument, options);\n }\nexport function useGetDesignByIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(GetDesignByIdDocument, options);\n }\nexport type GetDesignByIdQueryHookResult = ReturnType;\nexport type GetDesignByIdLazyQueryHookResult = ReturnType;\nexport type GetDesignByIdQueryResult = Apollo.QueryResult;\nexport const CadModeDocument = gql`\n query CadMode @trace_info(traceInfo: {pod: cad}) {\n CAD @client {\n mode\n }\n}\n `;\n\n/**\n * __useCadModeQuery__\n *\n * To run a query within a React component, call `useCadModeQuery` and pass it any options that fit your needs.\n * When your component renders, `useCadModeQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useCadModeQuery({\n * variables: {\n * },\n * });\n */\nexport function useCadModeQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(CadModeDocument, options);\n }\nexport function useCadModeLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(CadModeDocument, options);\n }\nexport type CadModeQueryHookResult = ReturnType;\nexport type CadModeLazyQueryHookResult = ReturnType;\nexport type CadModeQueryResult = Apollo.QueryResult;","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type PreSaveQueryVariables = Types.Exact<{\n designId: Types.Scalars['ID'];\n}>;\n\n\nexport type PreSaveQuery = { __typename: 'Query', design: { __typename: 'Design', id: string, savesDisabled?: boolean | null | undefined }, CAD: { __typename: 'CAD', irradiance: { __typename: 'IrradianceState', roof: { __typename: 'IrradianceStateType', mapId?: string | null | undefined, jobCanBeRun: boolean, status?: Types.IrradianceStates | null | undefined }, panels: { __typename: 'IrradianceStateType', mapId?: string | null | undefined, jobCanBeRun: boolean, status?: Types.IrradianceStates | null | undefined } } } };\n\n\nexport const PreSaveDocument = gql`\n query PreSave($designId: ID!) @trace_info(traceInfo: {pod: cad}) {\n design: designById(id: $designId) {\n id\n savesDisabled\n }\n CAD @client {\n irradiance: irradianceState {\n roof {\n mapId\n jobCanBeRun\n status\n }\n panels {\n mapId\n jobCanBeRun\n status\n }\n }\n }\n}\n `;\n\n/**\n * __usePreSaveQuery__\n *\n * To run a query within a React component, call `usePreSaveQuery` and pass it any options that fit your needs.\n * When your component renders, `usePreSaveQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = usePreSaveQuery({\n * variables: {\n * designId: // value for 'designId'\n * },\n * });\n */\nexport function usePreSaveQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(PreSaveDocument, options);\n }\nexport function usePreSaveLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(PreSaveDocument, options);\n }\nexport type PreSaveQueryHookResult = ReturnType;\nexport type PreSaveLazyQueryHookResult = ReturnType;\nexport type PreSaveQueryResult = Apollo.QueryResult;","import { Store } from 'redux';\nimport { filter, firstValueFrom, map, Subject } from 'rxjs';\n\nimport {\n CadEvent,\n CadEventTypes,\n CADTriggerActionTypes,\n triggerCADAction,\n} from '@aurorasolar/common-data-store';\nimport { CadEngine } from '@aurorasolar/common-module-loader';\nimport { useUploadFiles } from '@aurorasolar/file-uploader';\n\nexport interface ScreenshotDeps {\n cadEvents$: Subject>;\n designId: string;\n engine: CadEngine;\n fileUploader: ReturnType;\n reduxStore: Store;\n saveVersion: string;\n}\n\n/**\n * Adds a timeout to a Promise.\n * Throws the an error with the timeout message if the timeout is reached before the promise resolves.\n * */\nconst withTimeout = (promise: Promise, time: number, timeoutMessage: string) => {\n const timeoutPromise = new Promise((resolve) => {\n setTimeout(resolve, time);\n }).then(() => {\n throw new Error(timeoutMessage);\n });\n return Promise.race([promise, timeoutPromise]);\n};\n\n/**\n * Resolves a promise with the first screenshot event it sees with a matching id\n */\nconst listenForScreenshotResponse = (cadEvents$: Subject>, id: string) =>\n firstValueFrom(\n cadEvents$.pipe(\n filter(\n (event): event is CadEvent =>\n event.eventType === CadEventTypes.CadScreenshot && event.payload.id === id,\n ),\n map((event) => event.payload),\n ),\n );\n\n/**\n * Requests a screenshot from CAD and then uploads that screenshot\n * with the fileUploader\n */\nexport const takeSaveScreenshot = async ({\n cadEvents$,\n designId,\n engine,\n fileUploader,\n reduxStore,\n saveVersion,\n}: ScreenshotDeps) => {\n const screenshotPromise = listenForScreenshotResponse(cadEvents$, saveVersion);\n reduxStore.dispatch(\n triggerCADAction({\n actionType: CADTriggerActionTypes.TakeScreenshot,\n cadInstance: { engine },\n props: { id: saveVersion, imageType: 'png' },\n }),\n );\n const screenshotResponse = await withTimeout(\n screenshotPromise,\n 30000,\n 'Timed out taking a screenshot',\n );\n\n const screenshotFile = new File(\n [screenshotResponse.data],\n `${designId}.${screenshotResponse.imageType}`,\n { type: screenshotResponse.data.type },\n );\n\n await withTimeout(\n fileUploader.uploadFiles([screenshotFile]),\n 60000,\n 'Screenshot upload timed out',\n );\n};\n","import { Store } from 'redux';\nimport { Subject } from 'rxjs';\n\nimport { ApolloClient, NormalizedCacheObject } from '@apollo/client';\nimport { CadEvent, CadEventTypes } from '@aurorasolar/common-data-store';\nimport { CadEngine, CadSaveData } from '@aurorasolar/common-module-loader';\nimport { useUploadFiles } from '@aurorasolar/file-uploader';\nimport { Query, CadUpdatedDesign, IrradianceStates } from '@aurorasolar/graphql-client-schema';\nimport type { Reference, StoreObject } from '@apollo/client';\n\nimport {\n SaveDesignDocument,\n SaveDesignMutation,\n SaveDesignMutationVariables,\n} from '../cad.generated';\nimport { CadContextType } from '../use-cad';\nimport { PreSaveDocument, PreSaveQuery } from './cad-save-callback.generated';\nimport { checkCadCanSave } from './check-cad-can-save';\nimport { takeSaveScreenshot } from './take-save-screenshot';\n\nexport interface CadSaveCallbackDeps {\n apolloClient: ApolloClient;\n cadContext: CadContextType;\n cadEvents$: Subject>;\n engine: CadEngine;\n fileUploader: ReturnType;\n reduxStore: Store;\n evictCache: (fieldName: K) => void;\n evictCacheById: (storeObject: StoreObject | Reference) => void;\n}\n\n/**\n * Not to be used directly outside of `getCadSaveCallback()`.\n * This is the save callback that will be passed to the CAD engine during setup,\n * it only intended to be called by the CAD engine.\n * */\nexport const cadSaveCallbackCore = async (\n {\n apolloClient,\n reduxStore,\n engine,\n evictCache,\n evictCacheById,\n cadEvents$,\n fileUploader,\n cadContext,\n }: CadSaveCallbackDeps,\n {\n designId,\n saveVersion,\n jsonToSave: { site, system, designJsonSchemaVersion },\n saveScreenshot = true,\n }: CadSaveData,\n) => {\n if (!(await checkCadCanSave(apolloClient, designId, cadContext))) {\n return;\n }\n\n const { CAD } = await apolloClient\n .query({\n fetchPolicy: 'cache-first',\n query: PreSaveDocument,\n variables: { designId },\n })\n .then(({ data }) => data);\n\n // indicate within CAD state that a save is in process\n cadContext?.state?.actions?.saveActions.startSaving();\n\n const systemStats = cadContext?.state?.data.systemStatsData;\n\n const cadUpdatedDesign: CadUpdatedDesign = {\n carportSystemSizeStc: systemStats?.offRoofSystemSizeStc,\n design: JSON.stringify(system),\n designJsonSchemaVersion: designJsonSchemaVersion ?? 0,\n id: designId,\n irradianceMapId: CAD.irradiance.roof.mapId,\n irradianceMapStatus: CAD.irradiance.roof.status || IrradianceStates.Invalid,\n irradiancePanelsId: CAD.irradiance.panels.mapId,\n irradiancePanelsStatus: CAD.irradiance.panels.status || IrradianceStates.Invalid,\n roofSystemSizeStc: systemStats?.roofSystemSizeStc,\n site: JSON.stringify(site),\n systemSizeAc: systemStats?.systemSizeAc,\n systemSizePtc: systemStats?.systemSizePtc,\n systemSizeStc: systemStats?.systemSizeStc,\n };\n\n const savePromise = apolloClient\n .mutate({\n awaitRefetchQueries: true,\n mutation: SaveDesignDocument,\n variables: {\n cadUpdatedDesign,\n designId,\n },\n })\n .finally(() => {\n evictCache('componentSummaryByDesignId');\n evictCacheById({\n __typename: 'Design',\n id: designId,\n });\n });\n\n const screenshotPromise = saveScreenshot\n ? takeSaveScreenshot({\n cadEvents$,\n designId,\n engine,\n fileUploader,\n reduxStore,\n saveVersion,\n }).catch((error) => {\n console.warn('Save screenshot failed');\n console.warn(error);\n })\n : null;\n\n await Promise.all([savePromise, screenshotPromise]);\n\n cadContext?.state?.actions?.saveActions.finishSaving(saveVersion);\n};\n","import { ApolloClient, NormalizedCacheObject } from '@apollo/client';\nimport { CadContextType } from '../use-cad';\n\nimport { PreSaveDocument, PreSaveQuery } from './cad-save-callback.generated';\n\nexport const checkCadCanSave = async (\n client: ApolloClient,\n designId: string,\n cadContext: CadContextType,\n) => {\n const isSaving = cadContext?.state?.data.saveData.isSaving;\n const { design } = await client\n .query({\n fetchPolicy: 'cache-first',\n query: PreSaveDocument,\n variables: { designId },\n })\n\n .then(({ data }) => data);\n\n const canSave =\n !design.savesDisabled && cadContext?.state?.data.saveData.hasUnsavedChanges && !isSaving;\n\n return canSave;\n};\n","import { CadSaveData } from '@aurorasolar/common-module-loader';\n\nimport { cadSaveCallbackCore, CadSaveCallbackDeps } from './cad-save-callback-core';\n\nexport type SaveFn = typeof cadSaveCallbackCore;\n\n/**\n * This creates a callback to be passed in to the CAD engine during setup.\n * It ensures that only one save function will run at a time.\n * Subsequent save calls will be chained on to the end of the current call.\n */\nexport const getCadSaveCallback = (saveDependencies: CadSaveCallbackDeps) => {\n let currentSave: Promise = Promise.resolve();\n\n return async (data: CadSaveData) => {\n const result = currentSave.then(() => cadSaveCallbackCore(saveDependencies, data));\n\n currentSave = result.catch(() => {});\n\n await result;\n\n if (result === currentSave) {\n currentSave = Promise.resolve();\n }\n };\n};\n","export async function convertCanvasToBlob(\n canvas: HTMLCanvasElement,\n fileType: string,\n): Promise {\n const imageCanvas = document.createElement('canvas');\n imageCanvas.width = canvas.width;\n imageCanvas.height = canvas.height;\n const imageContext = imageCanvas.getContext('2d')!;\n\n imageContext.drawImage(canvas, 0, 0, imageCanvas.width, imageCanvas.height);\n\n return new Promise((resolve) => {\n const resolver: BlobCallback = (blob) => {\n resolve(blob || undefined);\n };\n imageCanvas.toBlob(resolver, fileType);\n });\n}\n\nexport async function downloadCanvasAsPng(canvas: HTMLCanvasElement, filename?: string) {\n const blob = await convertCanvasToBlob(canvas, 'image/png');\n\n if (!blob) {\n throw new Error('Could not create Canvas blob');\n }\n\n const url = URL.createObjectURL(blob);\n downloadDataURL(url, filename);\n\n // cleanup\n URL.revokeObjectURL(url);\n}\n\nconst shouldEscapeCSV = ['\"', \"'\", ','];\nconst shouldSkipInCSV = ['\\n'];\nconst escapeCSVString = (str: string) => {\n let escaped = '';\n for (let i = 0; i < str.length; i += 1) {\n const currentChar = str[i];\n if (!shouldSkipInCSV.includes(currentChar)) {\n if (shouldEscapeCSV.includes(currentChar)) {\n escaped += `\"${currentChar}\"`;\n } else {\n escaped += currentChar;\n }\n }\n }\n return escaped;\n};\n\nconst CSV_DATA_URL_PREFIX = `data:text/csv;charset=utf-8,`;\nexport function createCSVDataURL(csv: string[][]) {\n return `${CSV_DATA_URL_PREFIX}${csv.map((row) => row.map(escapeCSVString).join(',')).join('\\n')}`;\n}\n\nexport function downloadDataURL(\n url: string,\n filename: string = 'file.csv',\n createLink: boolean = false,\n) {\n const encodedURI = encodeURI(url);\n const link = document.createElement('a');\n link.setAttribute('href', encodedURI);\n link.setAttribute('download', filename);\n if (createLink) {\n link.style.display = 'none';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n } else {\n link.click();\n }\n}\n","import { ApolloClient, NormalizedCacheObject } from '@apollo/client';\nimport { downloadDataURL } from '@aurorasolar/common-core/src/utils/download-utils';\nimport {\n StartAsyncJobDocument,\n StartAsyncJobMutation,\n StartAsyncJobMutationVariables,\n} from '@aurorasolar/common-data-access-layer';\nimport { CADTriggerActionProps, CADTriggerActionTypes } from '@aurorasolar/common-data-store';\nimport { AsyncDxf, AsyncJobParameters, AsyncJobType } from '@aurorasolar/graphql-client-schema';\n\nexport const downloadDxf = async (\n client: ApolloClient,\n payload: AsyncJobParameters,\n) => {\n const { data } = await client.mutate({\n mutation: StartAsyncJobDocument,\n variables: {\n settings: payload,\n type: AsyncJobType.Dxf,\n },\n });\n const dxf = data?.startAsyncJob as AsyncDxf;\n if (dxf.uri) {\n downloadDataURL(dxf.uri, 'aurora_dxf.dxf');\n }\n};\n\nexport type PublicDxfParams = {\n Buildings: boolean;\n Obstructions: boolean;\n Setbacks: boolean;\n Trees: boolean;\n Modules: boolean;\n Inverters: boolean;\n 'Balance Of System': boolean;\n Connections: boolean;\n Strings: boolean;\n};\n\nexport type PublicDxfParam = keyof PublicDxfParams;\nexport const PublicDxfParamsList: PublicDxfParam[] = [\n 'Buildings',\n 'Obstructions',\n 'Setbacks',\n 'Trees',\n 'Modules',\n 'Inverters',\n 'Balance Of System',\n 'Connections',\n 'Strings',\n];\n\nexport const translateDxfParams = (input: PublicDxfParams) => {\n const output: CADTriggerActionProps[CADTriggerActionTypes.DXF] = {};\n Object.entries(input).forEach(([k, v]) => {\n if (k === 'Buildings') {\n output.buildings = v;\n } else if (k === 'Obstructions') {\n output.obstructions = v;\n output.walkways = v;\n } else if (k === 'Setbacks') {\n output.setbacks = v;\n } else if (k === 'Trees') {\n output.trees = v;\n } else if (k === 'Modules') {\n output.modules = v;\n output.arrays = v;\n } else if (k === 'Inverters') {\n output.microinverters = v;\n output.inverters = v;\n } else if (k === 'Balance Of System') {\n output.disconnects = v;\n output.loadCenters = v;\n output.meters = v;\n output.servicePanels = v;\n output.combinerBoxes = v;\n } else if (k === 'Connections') {\n output.connections = v;\n } else if (k === 'Strings') {\n output.strings = v;\n }\n });\n return output;\n};\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type AddAssetMutationVariables = Types.Exact<{\n newAsset: Types.NewAsset;\n}>;\n\n\nexport type AddAssetMutation = { __typename: 'Mutation', addAsset: { __typename: 'Asset', id: string, assetType: Types.AssetType, url?: string | null | undefined, designId?: string | null | undefined, projectId?: string | null | undefined, takenAt?: string | null | undefined, tenantId?: string | null | undefined, userId?: string | null | undefined } };\n\nexport type UpdateAssetMutationVariables = Types.Exact<{\n updatedAsset: Types.UpdatedAsset;\n}>;\n\n\nexport type UpdateAssetMutation = { __typename: 'Mutation', updateAsset: { __typename: 'Asset', id: string, assetType: Types.AssetType, url?: string | null | undefined, designId?: string | null | undefined, projectId?: string | null | undefined, takenAt?: string | null | undefined, tenantId?: string | null | undefined, userId?: string | null | undefined } };\n\nexport type UploadInProgressQueryVariables = Types.Exact<{ [key: string]: never; }>;\n\n\nexport type UploadInProgressQuery = { __typename: 'Query', cadUploadState?: { __typename: 'CadUploadState', screenshotInProgress?: boolean | null | undefined } | null | undefined };\n\n\nexport const AddAssetDocument = gql`\n mutation AddAsset($newAsset: NewAsset!) @trace_info(traceInfo: {pod: cad}) {\n addAsset(newAsset: $newAsset) {\n id\n assetType\n url\n designId\n projectId\n takenAt\n tenantId\n userId\n }\n}\n `;\nexport type AddAssetMutationFn = Apollo.MutationFunction;\n\n/**\n * __useAddAssetMutation__\n *\n * To run a mutation, you first call `useAddAssetMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useAddAssetMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [addAssetMutation, { data, loading, error }] = useAddAssetMutation({\n * variables: {\n * newAsset: // value for 'newAsset'\n * },\n * });\n */\nexport function useAddAssetMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(AddAssetDocument, options);\n }\nexport type AddAssetMutationHookResult = ReturnType;\nexport type AddAssetMutationResult = Apollo.MutationResult;\nexport type AddAssetMutationOptions = Apollo.BaseMutationOptions;\nexport const UpdateAssetDocument = gql`\n mutation UpdateAsset($updatedAsset: UpdatedAsset!) @trace_info(traceInfo: {pod: cad}) {\n updateAsset(updatedAsset: $updatedAsset) {\n id\n assetType\n url\n designId\n projectId\n takenAt\n tenantId\n userId\n }\n}\n `;\nexport type UpdateAssetMutationFn = Apollo.MutationFunction;\n\n/**\n * __useUpdateAssetMutation__\n *\n * To run a mutation, you first call `useUpdateAssetMutation` within a React component and pass it any options that fit your needs.\n * When your component renders, `useUpdateAssetMutation` returns a tuple that includes:\n * - A mutate function that you can call at any time to execute the mutation\n * - An object with fields that represent the current status of the mutation's execution\n *\n * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2;\n *\n * @example\n * const [updateAssetMutation, { data, loading, error }] = useUpdateAssetMutation({\n * variables: {\n * updatedAsset: // value for 'updatedAsset'\n * },\n * });\n */\nexport function useUpdateAssetMutation(baseOptions?: Apollo.MutationHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useMutation(UpdateAssetDocument, options);\n }\nexport type UpdateAssetMutationHookResult = ReturnType;\nexport type UpdateAssetMutationResult = Apollo.MutationResult;\nexport type UpdateAssetMutationOptions = Apollo.BaseMutationOptions;\nexport const UploadInProgressDocument = gql`\n query UploadInProgress @trace_info(traceInfo: {pod: cad}) {\n cadUploadState @client {\n screenshotInProgress\n }\n}\n `;\n\n/**\n * __useUploadInProgressQuery__\n *\n * To run a query within a React component, call `useUploadInProgressQuery` and pass it any options that fit your needs.\n * When your component renders, `useUploadInProgressQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useUploadInProgressQuery({\n * variables: {\n * },\n * });\n */\nexport function useUploadInProgressQuery(baseOptions?: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(UploadInProgressDocument, options);\n }\nexport function useUploadInProgressLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(UploadInProgressDocument, options);\n }\nexport type UploadInProgressQueryHookResult = ReturnType;\nexport type UploadInProgressLazyQueryHookResult = ReturnType;\nexport type UploadInProgressQueryResult = Apollo.QueryResult;","import { ApolloClient, NormalizedCacheObject } from '@apollo/client';\nimport { downloadDataURL } from '@aurorasolar/common-core/src/utils/download-utils';\nimport { NewAsset } from '@aurorasolar/graphql-client-schema';\n\nimport {\n AddAssetDocument,\n AddAssetMutation,\n AddAssetMutationVariables,\n UpdateAssetDocument,\n UpdateAssetMutation,\n UpdateAssetMutationVariables,\n UploadInProgressDocument,\n UploadInProgressQuery,\n} from './asset.generated';\n\nexport const saveScreenshotAsset = async (\n client: ApolloClient,\n newAsset: NewAsset,\n blob: Blob,\n) => {\n const { data } = await client.mutate({\n mutation: AddAssetDocument,\n variables: {\n newAsset,\n },\n });\n const asset = data?.addAsset;\n\n if (!asset?.url) {\n return undefined;\n }\n\n await fetch(asset.url, {\n body: blob,\n headers: {\n 'Content-Type': 'image/png',\n },\n method: 'PUT',\n mode: 'cors',\n });\n\n await client.mutate({\n mutation: UpdateAssetDocument,\n variables: {\n updatedAsset: { id: asset.id, options: { uploadInProgress: false } },\n },\n });\n\n return asset.url.split('?')[0];\n};\n\nexport const saveAndDownloadScreenshotAsset = async (\n client: ApolloClient,\n newAsset: NewAsset,\n blob: Blob,\n) => {\n client.writeQuery({\n data: {\n __typename: 'Query',\n cadUploadState: {\n __typename: 'CadUploadState',\n screenshotInProgress: true,\n },\n },\n query: UploadInProgressDocument,\n });\n\n try {\n await saveScreenshotAsset(client, newAsset, blob);\n } finally {\n client.writeQuery({\n data: {\n __typename: 'Query',\n cadUploadState: {\n __typename: 'CadUploadState',\n screenshotInProgress: false,\n },\n },\n query: UploadInProgressDocument,\n });\n }\n\n const url = window.URL.createObjectURL(blob);\n if (shouldDownload(url, newAsset)) {\n downloadDataURL(url, 'aurora_snapshot.png');\n }\n};\n\n/**\n * Default behavior is to download, so unless the option is explicitly false, we download here.\n */\nfunction shouldDownload(url: string, newAsset: NewAsset) {\n return url && newAsset.options.isDownload !== false;\n}\n","export type WebGLVersion = 'webgpu' | 'webgl2' | 'webgl1' | 'none';\n\ninterface IWebGLRenderingContext {\n getExtension(str: 'WEBGL_lose_context'): WEBGL_lose_context | null;\n}\ninterface BrowserWebGlInfo {\n /** The unmasked name of the GPU, or an explanation of why we can't get it. */\n gpu: string;\n /**\n * The max webgl/webgpu version that is supported by the current browser\n * or 'none' if webgql is not supported.\n */\n webgl: WebGLVersion;\n}\n\nfunction checkContext(\n canvas: HTMLCanvasElement,\n contextName: 'webgpu' | 'webgl2' | 'webgl',\n): boolean {\n const context = canvas.getContext(contextName);\n if (context) {\n if (contextName === 'webgl2' || contextName === 'webgl') {\n (context as IWebGLRenderingContext).getExtension('WEBGL_lose_context')?.loseContext();\n }\n return true;\n }\n return false;\n}\n\nfunction getMaxWebGLSupported(): WebGLVersion {\n const testCanvas = document.createElement('canvas');\n try {\n // Source of production bug due to iOS upgrade:\n // https://aurorasolar.atlassian.net/browse/APP-20756\n // if (checkContext(testCanvas, 'webgpu')) {\n // return 'webgpu';\n // }\n if (checkContext(testCanvas, 'webgl2')) {\n return 'webgl2';\n }\n if (checkContext(testCanvas, 'webgl')) {\n return 'webgl1';\n }\n return 'none';\n } catch (_) {\n return 'none';\n }\n}\n\nfunction getUnmaskedGPUName() {\n const testCanvas = document.createElement('canvas');\n try {\n const context = testCanvas.getContext('webgl');\n if (context) {\n const debugInfo = context.getExtension('WEBGL_debug_renderer_info');\n const renderer = debugInfo\n ? (context.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) as string)\n : 'no WEBGL_debug_renderer_info';\n\n // lose context now so we don't have to wait for GC\n context.getExtension('WEBGL_lose_context')?.loseContext();\n return renderer;\n }\n return 'failed to get webgl context';\n } catch (_) {\n return 'error retrieving gpu name';\n }\n}\n\nlet browserWebglInfo: BrowserWebGlInfo | null = null;\n\n/**\n * Checks the current browser's webgl/webgpu compatibility and which GPU it's using.\n *\n * The results are memoized because the checks are expensive.\n */\nexport const getBrowserWebglInfo = () => {\n if (browserWebglInfo === null) {\n browserWebglInfo = {\n gpu: getUnmaskedGPUName(),\n webgl: getMaxWebGLSupported(),\n };\n }\n return browserWebglInfo!;\n};\n","import { Patch } from 'immer';\nimport { Store } from 'redux';\nimport { Subject } from 'rxjs';\n\nimport { ApolloClient, NormalizedCacheObject } from '@apollo/client';\nimport { convertSnakeToCamelCase } from '@aurorasolar/common-cad-data-service';\nimport {\n CadActionTypes,\n CadError,\n CadEvent,\n CadEventPayload,\n CadEventPropType,\n CadEventTypes,\n CadLogMessage,\n CADTriggerActionTypes,\n eventIsModalTrigger,\n eventIsRightPanelTrigger,\n ModalTrigger,\n ModalTriggerData,\n RightPanelTrigger,\n RightPanelTriggerData,\n setCadModalAction,\n setCadRightPanelAction,\n setLocalStateAction,\n} from '@aurorasolar/common-data-store';\nimport {\n AnalyticsEventTypes,\n IAnalyticsProvider,\n IAppConfig,\n ITracking,\n} from '@aurorasolar/common-module-loader';\nimport {\n AssetOptionsInput,\n AssetType,\n AsyncJobParameters,\n} from '@aurorasolar/graphql-client-schema';\n\nimport { downloadDxf } from '../downloads/download-dxf';\nimport { saveAndDownloadScreenshotAsset } from '../downloads/download-png';\nimport { getBrowserWebglInfo } from '../webgl-check';\n\nconst isEventOfType = (\n event: CadEvent,\n eventType: T,\n): event is CadEvent => {\n return event.eventType === eventType;\n};\n\nexport const subscribeToCadEvent = (\n eventStream: Subject>,\n eventType: T,\n subscriber: (payload: CadEventPayload) => void,\n) => {\n return eventStream.subscribe((event) => {\n if (isEventOfType(event, eventType)) {\n subscriber(event.payload);\n }\n });\n};\n\nexport const stopEvents = (eventStream?: Subject>) => {\n eventStream?.complete();\n};\n\ninterface CadImageData {\n blob: Blob;\n metadata: { [key: string]: string | number };\n options: AssetOptionsInput;\n}\n\ninterface CadAnalyticsEvent {\n actionName: AnalyticsEventTypes;\n properties: {\n usedShortcut?: boolean;\n [key: string]: unknown;\n };\n}\n\nexport const getCadEventHandler = ({\n appConfig,\n client,\n designId,\n eventStream,\n projectId,\n store,\n track,\n trackingModule,\n}: {\n appConfig: IAppConfig;\n client: ApolloClient;\n designId: string;\n eventStream: Subject>;\n projectId: string;\n store: Store;\n track: IAnalyticsProvider['track'];\n trackingModule: ITracking;\n}) => {\n return (eventType: T, eventPayload: CadEventPropType) => {\n const payload = (eventPayload ?? {}) as CadEvent['payload'];\n const event = { eventType, payload } as CadEvent;\n eventStream.next(event);\n\n // TODO move these to subscriptions\n if (eventType === CadEventTypes.SetExternalStateData) {\n store.dispatch(\n setLocalStateAction({\n patches: payload as unknown as Patch[],\n }),\n );\n return;\n }\n if (eventType === CadEventTypes.TrackAnalyticsAction) {\n const { actionName, properties } = payload as unknown as CadAnalyticsEvent;\n const { usedShortcut, ...trackableProperties } = properties;\n if (usedShortcut !== undefined) {\n trackableProperties.used_shortcut = usedShortcut;\n }\n track(actionName, trackableProperties as PLEASE_DO_NOT_USE_THIS_ANY_FOR_MIGRATION_ONLY);\n return;\n }\n if (\n eventType === CadEventTypes.CadErrorOccurred ||\n eventType === CadEventTypes.CadGeometryErrorOccurred\n ) {\n const { err, message } = payload as unknown as CadError;\n console.error(message, err);\n\n const data = getLogData(\n appConfig,\n designId,\n projectId,\n trackingModule.DataDog?.rum.getUser(),\n );\n data.message = message;\n data.stack = err.stack;\n data.logRocketURL = trackingModule.LogRocket.sessionURL;\n\n if (err.cause != null) {\n data.geometryData = JSON.stringify(err.cause);\n trackingModule.DataDog?.logs.logger.info('cad-error', data);\n } else {\n trackingModule.DataDog?.logs.logger.error('cad-error', data);\n }\n\n return;\n }\n if (eventType === CadEventTypes.CadLoggedMessage) {\n const { message, extraData } = payload as unknown as CadLogMessage;\n const data = getLogData(\n appConfig,\n designId,\n projectId,\n trackingModule.DataDog?.rum.getUser(),\n );\n data.message = message;\n if (extraData) {\n data.extraData = JSON.stringify(extraData);\n }\n trackingModule.DataDog?.logs.logger.info('cad-log', data);\n }\n if (eventIsModalTrigger(eventType)) {\n // TypeScript isn't smart enough to figure out\n // how \"eventType\" overlaps with modal triggers\n store.dispatch(\n setCadModalAction(\n eventType as unknown as ModalTrigger,\n payload as unknown as ModalTriggerData,\n ),\n );\n return;\n }\n if (eventIsRightPanelTrigger(eventType)) {\n // TypeScript isn't smart enough to figure out\n // how \"eventType\" overlaps with right panel triggers\n const rightPanelPayload = payload as {\n rightPanelData?: RightPanelTriggerData;\n };\n store.dispatch(\n setCadRightPanelAction(eventType as RightPanelTrigger, rightPanelPayload.rightPanelData),\n );\n return;\n }\n if (eventType === CadEventTypes.RelayInternalCadState) {\n store.dispatch({\n payload,\n type: 'RELAY_INTERNAL_CAD_STATE',\n });\n }\n if (eventType === CadEventTypes.SaveScreenshotAsset) {\n const { options } = payload as unknown as CadImageData;\n const newOptions = getCamelCaseImageOptions(options);\n saveAndDownloadScreenshotAsset(\n client,\n { assetType: AssetType.CadScreenshot, designId, options: newOptions, projectId },\n (payload as unknown as CadImageData).blob,\n );\n }\n if (eventType === CadEventTypes.DownloadDxf) {\n downloadDxf(client, { ...payload, designId } as AsyncJobParameters);\n }\n if (eventType === CadEventTypes.BeforeDrawWalkway) {\n store.dispatch({\n payload: { actionType: CADTriggerActionTypes.DrawWalkway },\n type: CadActionTypes.TRIGGER_CAD_ACTION,\n });\n }\n };\n};\n\nconst getCamelCaseImageOptions = (options: AssetOptionsInput) => {\n const newOptions: AssetOptionsInput = {};\n Object.entries(options).forEach(([k, v]) => {\n const newKey = convertSnakeToCamelCase(k);\n newOptions[newKey] = v;\n });\n return newOptions;\n};\n\nfunction getLogData(appConfig: IAppConfig, designId: string, projectId: string, user: unknown) {\n const data: Record = {\n ...getBrowserWebglInfo(),\n cad_config: {\n cadVersion: appConfig.cadVersion,\n designId,\n projectId,\n },\n host: window.location.host,\n source: 'cad',\n user,\n v2_config: {\n api_host: appConfig.apiHost,\n app_name: appConfig.buildEnvironment.APP_NAME,\n environment: appConfig.buildEnvironment.ENVIRONMENT,\n git_branch: appConfig.buildEnvironment.GIT_BRANCH.trim(),\n git_hash: appConfig.buildEnvironment.GIT_COMMIT_HASH.trim(),\n release: appConfig.buildEnvironment.RELEASE_VERSION,\n },\n };\n return data;\n}\n","import { useEffect, useRef } from 'react';\nimport { Subject } from 'rxjs';\n\nimport { ApolloClient, NormalizedCacheObject } from '@apollo/client';\nimport { createCadPreferences } from '@aurorasolar/cad-preferences';\nimport {\n CadEngineState,\n cloneInert,\n createCadState,\n effect,\n makeReactive,\n stopCadStateEffects,\n} from '@aurorasolar/cad-state';\nimport { CadEvent, CadEventTypes } from '@aurorasolar/common-data-store';\nimport {\n Analytics,\n AnalyticsEventTypes,\n ApolloClient as ApolloClientModule,\n AppConfig,\n AuroraApiEnvironment,\n AuthToken,\n CadEngine,\n CadEngineOptions,\n CADLib,\n FeatureFlags,\n ICadDataServiceSettings,\n ICadFeatureGate,\n ICADGeodataService,\n IOrgPermissions,\n Notifications,\n OrgPermissions,\n ReduxStore,\n Tracking,\n useAppModule,\n} from '@aurorasolar/common-module-loader';\nimport { TOAST_CHANNEL } from '@aurorasolar/common-notifications';\nimport { useUploadFiles } from '@aurorasolar/file-uploader';\nimport { UserFileLabel } from '@aurorasolar/graphql-client-schema';\nimport { IIntlContext, SUPPORTED_LOCALES, useIntl } from '@aurorasolar/intl';\nimport { ParcelBounds } from '@aurorasolar/common-cad-data-service';\n\nimport { useEvictCache } from '@aurorasolar/common-core/src/hooks';\n\nimport { getCadSaveCallback } from '../cad-save-callback';\nimport { cleanupCad } from '../provide-cad/cleanup-cad';\nimport { getCadEventHandler, stopEvents, subscribeToCadEvent } from '../provide-cad/event-handler';\nimport { CadMode } from '../types';\nimport { getBrowserWebglInfo } from '../webgl-check';\nimport { useCadContext, useCadInitializerContext } from './cad-context';\n\nlet unknownProjectIdCount = 0;\nlet unknownDesignIdCount = 0;\n\nexport const WEBGL_ERROR = 'WebGL not supported by device';\n\nconst performUnknownProjectDesignEffect = (\n providedProjectId: string | undefined,\n providedDesignId: string | undefined,\n) => {\n if (!providedProjectId) {\n unknownProjectIdCount += 1;\n }\n if (!providedDesignId) {\n unknownDesignIdCount += 1;\n }\n return () => {\n if (!providedProjectId) {\n unknownProjectIdCount -= 1;\n }\n if (!providedDesignId) {\n unknownDesignIdCount -= 1;\n }\n };\n};\n\nconst performDOMEventsEffect = (cadContainer: HTMLElement) => {\n const preventDefault = (e: Event) => {\n e.preventDefault();\n };\n cadContainer.addEventListener('touchmove', preventDefault, {\n passive: false,\n });\n cadContainer.addEventListener('contextmenu', preventDefault);\n return () => {\n cadContainer.removeEventListener('touchmove', preventDefault);\n cadContainer.removeEventListener('contextmenu', preventDefault);\n };\n};\n\ninterface CadDataServiceProps {\n client?: ApolloClient;\n environment: AuroraApiEnvironment;\n orgPermissions?: IOrgPermissions;\n parcelBounds?: ParcelBounds;\n designId?: string;\n featureGate: ICadFeatureGate;\n intl: IIntlContext;\n preferences: ReturnType;\n}\n\ninterface CadAsyncEngineInitProps {\n engine: CadEngine;\n}\n\nexport interface UseCadProps {\n isShown?: boolean;\n\n // TODO: As of now, Homeowner Leave Behind does not\n // have its own app container, so we cannot provide\n // a different feature gate / org permissions. Hence,\n // we have to rely on passing different featureGate\n // for HLB. Ideally, we would handle this with a\n // different org permissions module provider.\n featureGate: ICadFeatureGate | undefined;\n\n geodataService: ICADGeodataService | undefined;\n parcelBounds?: ParcelBounds;\n projectId?: string;\n designId?: string;\n userId?: string;\n designRequestId?: string;\n createDataProvider?: (props: CadDataServiceProps) => ICadDataServiceSettings;\n engineOptions: Omit<\n CadEngineOptions,\n 'dataProvider' | 'environment' | 'stateFramework' | 'eventEmitter' | 'stateMode'\n > & { stateMode: CadMode };\n asyncEngineInit?: (props: CadAsyncEngineInitProps) => void;\n enableSave?: boolean;\n}\n\nexport const useCad = ({\n isShown = true,\n geodataService,\n parcelBounds,\n projectId: providedProjectId,\n designId: providedDesignId,\n userId,\n designRequestId,\n createDataProvider,\n engineOptions,\n featureGate,\n asyncEngineInit,\n enableSave = false,\n}: UseCadProps) => {\n const config = useAppModule(AppConfig);\n const authToken = useAppModule(AuthToken);\n const cadLib = useAppModule(CADLib);\n const reduxStore = useAppModule(ReduxStore);\n const notifications = useAppModule(Notifications);\n const trackingModule = useAppModule(Tracking);\n const analytics = useAppModule(Analytics);\n const orgPermissions = useAppModule(OrgPermissions);\n\n const fileUploader = useUploadFiles({\n label: UserFileLabel.Screenshot,\n parentId: providedDesignId,\n parentRoleType: 'save_auto_screenshot',\n parentType: 'Design',\n });\n const featureFlags = useAppModule(FeatureFlags);\n const cadContextValue = useCadContext();\n const cadInitializerContextValue = useCadInitializerContext();\n const { evictCache, evictCacheById } = useEvictCache();\n\n // This ref is to ensure CAD is only initialized once per mount\n const effectInfo = useRef({\n effectCleanup: () => {},\n isInitialized: false,\n });\n\n // Note: we'd like `useCad` to be mostly independent of apolloClient, so do not\n // add extra dependencies on apolloClient within `useCad` other than for screenshots\n // and DXF download handling.\n const apolloClient = useAppModule(ApolloClientModule);\n\n const intl = useIntl();\n\n useEffect(() => {\n const cadContainer = engineOptions.viewData[0].domElement;\n if (\n effectInfo.current.isInitialized ||\n !isShown ||\n !cadLib ||\n !reduxStore ||\n !notifications ||\n !apolloClient ||\n !config ||\n !authToken ||\n !trackingModule ||\n !analytics ||\n !geodataService ||\n !featureGate ||\n !createDataProvider ||\n !featureFlags ||\n !cadContainer\n ) {\n return;\n }\n effectInfo.current.isInitialized = true;\n\n const preferences = createCadPreferences({\n getDesignId: () => providedDesignId ?? null,\n getProjectId: () => providedProjectId ?? null,\n getUserId: () => userId ?? null,\n });\n\n if (getBrowserWebglInfo().webgl === 'none') {\n cadInitializerContextValue.setCadError(new Error(WEBGL_ERROR));\n return;\n }\n\n const events$ = new Subject>();\n const subscription = subscribeToCadEvent(\n events$,\n CadEventTypes.Notify,\n ({ dismissType, message, messageType, title, variables }) => {\n const channel = notifications.getChannel(TOAST_CHANNEL);\n channel.push({ dismissType, message, messageType, title, variables }, Symbol(message));\n },\n );\n\n const projectId = providedProjectId ?? `unknown-project-id-${unknownProjectIdCount}`;\n const designId = providedDesignId ?? `unknown-design-id-${unknownDesignIdCount}`;\n const cleanupDOMEventsEffect = performDOMEventsEffect(cadContainer);\n\n const cleanupUnknownProjectDesignEffect = performUnknownProjectDesignEffect(\n providedProjectId,\n providedDesignId,\n );\n\n // todo add featuregate\n const dataProvider = createDataProvider({\n client: apolloClient,\n designId,\n environment: config.apiEnvironment,\n featureGate,\n intl,\n orgPermissions,\n parcelBounds,\n preferences,\n });\n\n const eventEmitter = {\n trigger: getCadEventHandler({\n appConfig: config,\n client: apolloClient,\n designId,\n eventStream: events$,\n projectId,\n store: reduxStore,\n track: analytics.track,\n trackingModule,\n }),\n };\n\n const engine = cadLib.Factory.getEngineInstance(\n designId,\n {\n ...engineOptions,\n dataProvider,\n environment: config.apiEnvironment,\n eventEmitter,\n stateFramework: {\n cloneInert,\n effect,\n makeReactive,\n },\n useToastMessage: false,\n },\n true,\n );\n\n if (engine instanceof Error) {\n cadInitializerContextValue.setCadError(engine);\n return;\n }\n\n const locale: SUPPORTED_LOCALES = document.documentElement.lang as SUPPORTED_LOCALES;\n const asyncInitEngineInstance = cadLib.Factory.initEngineInstance(engine, {\n dataProvider,\n eventEmitter,\n geodataService,\n irradianceMapService: new cadLib.Services.IrradianceMapService(),\n locale,\n saveHandler: {\n save: enableSave\n ? getCadSaveCallback({\n apolloClient,\n cadContext: cadContextValue,\n cadEvents$: events$,\n engine,\n evictCache,\n evictCacheById,\n fileUploader,\n reduxStore,\n })\n : () => Promise.reject(new Error('Saving is not enabled')),\n },\n store: dataProvider,\n });\n\n let isCadLoadCancelled = false;\n asyncInitEngineInstance\n .then(() => {\n if (isCadLoadCancelled) {\n return false;\n }\n\n const cadState = createCadState(engine.state as CadEngineState);\n\n cadInitializerContextValue.setCadContext({\n designId,\n domNode: cadContainer,\n engine,\n engineSaveFn: enableSave\n ? (options) => {\n const engineScoped = cadLib?.Factory.getActiveEngineInstance(designId);\n if (!engineScoped) {\n return Promise.reject();\n }\n analytics.track(AnalyticsEventTypes.DesignClickedSave);\n return engineScoped.bridge.save(options);\n }\n : null,\n eventStream: events$,\n preferences,\n state: cadState,\n });\n\n // TODO fix cad so this doesnt need to wait\n geodataService.initialize(engine.bridge, {\n designRequestId,\n projectId,\n });\n\n window.cadReady = true;\n if (CYPRESS_BUILD) {\n window.cadReduxStore = reduxStore;\n window.cadScreenshot$ = new Subject();\n window.cadActivity = { track() {} };\n window.cadInstance = { cadState, engine };\n // eslint-disable-next-line\n import('sinon').then((sinon) => sinon.spy(reduxStore, 'dispatch')).catch(() => {});\n }\n\n asyncEngineInit?.({ engine });\n return true;\n })\n .catch((e) => {\n cadInitializerContextValue.setCadError(e);\n return false;\n });\n\n effectInfo.current.effectCleanup = () => {\n subscription.unsubscribe();\n cleanupDOMEventsEffect();\n cleanupUnknownProjectDesignEffect();\n cleanupCad({ CadLib: cadLib, store: reduxStore });\n stopEvents(events$);\n\n if (cadContextValue.state) {\n stopCadStateEffects(cadContextValue.state);\n }\n isCadLoadCancelled = true;\n cadInitializerContextValue.clearCadContext();\n };\n }, [\n effectInfo,\n cadLib,\n reduxStore,\n notifications,\n apolloClient,\n config,\n authToken,\n fileUploader,\n trackingModule,\n analytics,\n providedProjectId,\n providedDesignId,\n designRequestId,\n createDataProvider,\n engineOptions,\n geodataService,\n featureGate,\n isShown,\n cadContextValue,\n cadInitializerContextValue,\n orgPermissions,\n asyncEngineInit,\n featureFlags,\n intl,\n userId,\n evictCache,\n evictCacheById,\n parcelBounds,\n enableSave,\n ]);\n\n useEffect(() => {\n return () => {\n // Both the initialization and cleanup should only run once\n // eslint-disable-next-line react-hooks/exhaustive-deps\n effectInfo.current.effectCleanup();\n };\n }, []);\n};\n","import { useCallback } from 'react';\n\nimport { ApolloClient, useAppModule } from '@aurorasolar/common-module-loader';\nimport { Query } from '@aurorasolar/graphql-client-schema';\n\nimport type { Reference, StoreObject } from '@apollo/client';\n\nexport const useEvictCache = () => {\n const client = useAppModule(ApolloClient);\n\n const evictCache = useCallback(\n (fieldName: K) => {\n client?.cache.evict({ fieldName });\n client?.cache.gc();\n },\n [client],\n );\n\n const evictCacheById = useCallback(\n (storeObject: StoreObject | Reference) => {\n client?.cache.evict({ id: client.cache.identify(storeObject) });\n client?.cache.gc();\n },\n [client],\n );\n\n return { evictCache, evictCacheById };\n};\n","import { Store } from 'redux';\n\nimport { clearLocalStateAction } from '@aurorasolar/common-data-store';\nimport { ICADJSModule, ICADProvider } from '@aurorasolar/common-module-loader';\n\ninterface CadCleanupDependencies {\n CadLib: ICADJSModule | undefined;\n store: Store;\n}\nexport const cleanupCad = async ({\n CadLib,\n store,\n}: CadCleanupDependencies): Promise => {\n CadLib!.Factory.cleanupEngineInstance();\n\n store.dispatch(clearLocalStateAction());\n window.cadReady = false;\n window.cadInstance = { cadState: null, engine: null };\n\n return {} as ICADProvider;\n};\n","// @ts-ignore: Ignore unused { * as Types } import\nimport * as Types from '@aurorasolar/graphql-client-schema';\n\nimport { gql } from '@apollo/client';\nimport * as Apollo from '@apollo/client';\nconst defaultOptions = {} as const;\nexport type LeadCaptureCadQueryVariables = Types.Exact<{\n id: Types.Scalars['ID'];\n}>;\n\n\nexport type LeadCaptureCadQuery = { __typename: 'Query', leadCadData: { __typename: 'LeadCaptureProject', id: string, location?: { __typename: 'LeadCaptureLocation', latitude: number, longitude: number } | null | undefined, image?: { __typename: 'LeadCaptureImage', id: string, orthoImage: { __typename: 'OrthoImage', id: string, source: Types.OrthoImageSource, url?: string | null | undefined, name: string, active: boolean, opacity?: number | null | undefined, width?: number | null | undefined, height?: number | null | undefined, worldfileA?: number | null | undefined, worldfileB?: number | null | undefined, worldfileC?: number | null | undefined, worldfileD?: number | null | undefined, worldfileE?: number | null | undefined, worldfileF?: number | null | undefined, resource?: { __typename: 'GeodataResource', id?: string | null | undefined, source: string, url?: string | null | undefined, type: Types.GeodataResourceType, worldfile?: { __typename: 'Worldfile', a?: number | null | undefined, b?: number | null | undefined, c?: number | null | undefined, e?: number | null | undefined, d?: number | null | undefined, f?: number | null | undefined } | null | undefined, dimensions?: { __typename: 'GeodataDimensions', width?: number | null | undefined, height?: number | null | undefined } | null | undefined, metadata?: { __typename: 'GeodataMeta', opacity?: number | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined } } | null | undefined, site?: { __typename: 'LeadCaptureSite', id: string, data?: { __typename: 'LeadCaptureCadSite', baseElevation: number, centerLat: number, centerLng: number, roofPlanes: Array<{ __typename: 'LeadCaptureCadRoofPlane', height: number, pitch: number, azimuthEdgeIndex: number, shell: Array<{ __typename: 'LeadCaptureCadRoofPlaneNode', x: number, y: number, edgeType: string }>, holes: Array | null | undefined> }>, obstructions: Array<{ __typename: 'LeadCaptureCadObstruction', shape: string, center: Array, azimuthVector: Array, radius?: number | null | undefined, width?: number | null | undefined, length?: number | null | undefined, flush: boolean, heightAbove?: number | null | undefined, confidence: number }> } | null | undefined } | null | undefined, scenarios: Array<{ __typename: 'LeadCaptureScenario', design?: { __typename: 'LeadCaptureDesign', id: string, data?: any | null | undefined } | null | undefined }>, components?: { __typename: 'LeadCaptureComponents', panels: Array<{ __typename: 'SolarPanel', id: string, efficiency?: number | null | undefined, height?: number | null | undefined, imp?: number | null | undefined, isc?: number | null | undefined, length?: number | null | undefined, name?: string | null | undefined, noct?: number | null | undefined, panelType?: string | null | undefined, price?: number | null | undefined, ratingPtc?: number | null | undefined, ratingStc?: number | null | undefined, tempCoeffIsc?: number | null | undefined, tempCoeffPmax?: number | null | undefined, tempCoeffVoc?: number | null | undefined, vmp?: number | null | undefined, voc?: number | null | undefined, width?: number | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined, mlpe?: { __typename: 'MLPE', id: string, type?: string | null | undefined, isSolarInverter?: boolean | null | undefined, isDcOptimizer?: boolean | null | undefined, isCellStringOptimizer?: boolean | null | undefined, solarInverter?: { __typename: 'SolarInverter', id: string, efficiencyCec?: number | null | undefined, efficiencyEuropean?: number | null | undefined, efficiencyMax?: number | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputVoltageMax?: number | null | undefined, inputVoltageMin?: number | null | undefined, inputVoltageSE?: number | null | undefined, isSolarEdge?: boolean | null | undefined, mpptRatedPowerVoltageMax?: number | null | undefined, mpptRatedPowerVoltageMin?: number | null | undefined, mppts?: number | null | undefined, name?: string | null | undefined, numPhases?: number | null | undefined, numPhysicalDcInputs?: number | null | undefined, outputCurrent?: number | null | undefined, outputVoltageNominal?: number | null | undefined, price?: number | null | undefined, ratedPower?: number | null | undefined, usableInputCurrentMax?: number | null | undefined, usableInputPowerMax?: number | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined, dcOptimizer?: { __typename: 'DcOptimizer', id: string, efficiency?: number | null | undefined, efficiencyMax?: number | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputShortCircuitCurrentMax?: number | null | undefined, inputVoltageMax?: number | null | undefined, isLongString?: boolean | null | undefined, isSolarEdge?: boolean | null | undefined, mpptOperatingVoltageMax?: number | null | undefined, mpptOperatingVoltageMin?: number | null | undefined, name?: string | null | undefined, numInputs?: number | null | undefined, operatingModel?: string | null | undefined, optimizationBehavior?: string | null | undefined, outputCurrentMax?: number | null | undefined, outputVoltageMax?: number | null | undefined, price?: number | null | undefined, stcInputPowerMax?: number | null | undefined, systemVoltageMax?: number | null | undefined, usesSelectiveOptimization?: boolean | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined, cellStringOptimizer?: { __typename: 'CellStringOptimizer', id: string, name?: string | null | undefined, voltageLimit?: boolean | null | undefined, maxOutputVoltage?: number | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined } | null | undefined } | null | undefined }>, inverters: Array<{ __typename: 'SolarInverter', id: string, efficiencyCec?: number | null | undefined, efficiencyEuropean?: number | null | undefined, efficiencyMax?: number | null | undefined, hasGlobalMppt?: boolean | null | undefined, inputVoltageMax?: number | null | undefined, inputVoltageMin?: number | null | undefined, inputVoltageSE?: number | null | undefined, isSolarEdge?: boolean | null | undefined, mpptRatedPowerVoltageMin?: number | null | undefined, mppts?: number | null | undefined, name?: string | null | undefined, numPhases?: number | null | undefined, numPhysicalDcInputs?: number | null | undefined, outputCurrent?: number | null | undefined, outputVoltageNominal?: number | null | undefined, price?: number | null | undefined, ratedPower?: number | null | undefined, usableInputCurrentMax?: number | null | undefined, usableInputPowerMax?: number | null | undefined, manufacturer?: { __typename: 'Manufacturer', id: string, displayName?: string | null | undefined, name?: string | null | undefined } | null | undefined }> } | null | undefined } };\n\n\nexport const LeadCaptureCadDocument = gql`\n query LeadCaptureCad($id: ID!) @trace_info(traceInfo: {pod: leads}) {\n leadCadData: getLeadCaptureProjectData(id: $id) {\n id\n location {\n latitude\n longitude\n }\n image {\n id\n orthoImage {\n id\n source\n url\n name\n active\n opacity\n width\n height\n worldfileA\n worldfileB\n worldfileC\n worldfileD\n worldfileE\n worldfileF\n resource {\n id\n source\n url\n type\n worldfile {\n a\n b\n c\n e\n d\n f\n }\n dimensions {\n width\n height\n }\n metadata {\n opacity\n name\n }\n }\n }\n }\n site {\n id\n data {\n roofPlanes {\n shell {\n x\n y\n edgeType\n }\n holes {\n x\n y\n edgeType\n }\n height\n pitch\n azimuthEdgeIndex\n }\n obstructions {\n shape\n center\n azimuthVector\n radius\n width\n length\n flush\n heightAbove\n confidence\n }\n baseElevation\n centerLat\n centerLng\n }\n }\n scenarios {\n design {\n id\n data\n }\n }\n components {\n panels {\n id\n efficiency\n height\n imp\n isc\n length\n name\n noct\n panelType\n price\n ratingPtc\n ratingStc\n tempCoeffIsc\n tempCoeffPmax\n tempCoeffVoc\n vmp\n voc\n width\n manufacturer {\n id\n displayName\n name\n }\n mlpe {\n id\n type\n isSolarInverter\n isDcOptimizer\n isCellStringOptimizer\n solarInverter {\n id\n efficiencyCec\n efficiencyEuropean\n efficiencyMax\n hasGlobalMppt\n inputVoltageMax\n inputVoltageMin\n inputVoltageSE\n isSolarEdge\n mpptRatedPowerVoltageMax\n mpptRatedPowerVoltageMin\n mppts\n name\n numPhases\n numPhysicalDcInputs\n outputCurrent\n outputVoltageNominal\n price\n ratedPower\n usableInputCurrentMax\n usableInputPowerMax\n manufacturer {\n id\n displayName\n name\n }\n }\n dcOptimizer {\n id\n efficiency\n efficiencyMax\n hasGlobalMppt\n inputShortCircuitCurrentMax\n inputVoltageMax\n isLongString\n isSolarEdge\n mpptOperatingVoltageMax\n mpptOperatingVoltageMin\n name\n numInputs\n operatingModel\n optimizationBehavior\n outputCurrentMax\n outputVoltageMax\n price\n stcInputPowerMax\n systemVoltageMax\n usesSelectiveOptimization\n manufacturer {\n id\n displayName\n name\n }\n }\n cellStringOptimizer {\n id\n name\n voltageLimit\n maxOutputVoltage\n manufacturer {\n id\n displayName\n name\n }\n }\n }\n }\n inverters {\n id\n efficiencyCec\n efficiencyEuropean\n efficiencyMax\n hasGlobalMppt\n inputVoltageMax\n inputVoltageMin\n inputVoltageSE\n isSolarEdge\n mpptRatedPowerVoltageMin\n mppts\n name\n numPhases\n numPhysicalDcInputs\n outputCurrent\n outputVoltageNominal\n price\n ratedPower\n usableInputCurrentMax\n usableInputPowerMax\n manufacturer {\n id\n displayName\n name\n }\n }\n }\n }\n}\n `;\n\n/**\n * __useLeadCaptureCadQuery__\n *\n * To run a query within a React component, call `useLeadCaptureCadQuery` and pass it any options that fit your needs.\n * When your component renders, `useLeadCaptureCadQuery` returns an object from Apollo Client that contains loading, error, and data properties\n * you can use to render your UI.\n *\n * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;\n *\n * @example\n * const { data, loading, error } = useLeadCaptureCadQuery({\n * variables: {\n * id: // value for 'id'\n * },\n * });\n */\nexport function useLeadCaptureCadQuery(baseOptions: Apollo.QueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useQuery(LeadCaptureCadDocument, options);\n }\nexport function useLeadCaptureCadLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) {\n const options = {...defaultOptions, ...baseOptions}\n return Apollo.useLazyQuery(LeadCaptureCadDocument, options);\n }\nexport type LeadCaptureCadQueryHookResult = ReturnType;\nexport type LeadCaptureCadLazyQueryHookResult = ReturnType;\nexport type LeadCaptureCadQueryResult = Apollo.QueryResult;","import isChromatic from 'chromatic';\nimport { useMemo } from 'react';\n\nimport { ApolloClient as ApolloClientType, NormalizedCacheObject } from '@apollo/client';\nimport { buildUnitsAdapter, peekRecord } from '@aurorasolar/common-cad-data-service';\nimport { CADTriggerActionTypes } from '@aurorasolar/common-data-store';\nimport {\n ApolloClient,\n AuroraApiEnvironment,\n CadEngine,\n CompassPosition,\n ICadDataServiceSettings,\n ICadFeatureGate,\n useAppModule,\n} from '@aurorasolar/common-module-loader';\nimport { IrradianceStates, TemperatureUnit, UnitSystem } from '@aurorasolar/graphql-client-schema';\nimport { IIntlContext, useIntl } from '@aurorasolar/intl';\n\nimport { CadMode } from '../types';\nimport { getLeadCaptureGeodataService } from './lead-capture-geodata-service';\nimport { useCad, UseCadProps } from './use-cad';\nimport { LeadCaptureCadQuery, useLeadCaptureCadQuery } from './use-lead-capture-cad.generated';\n\ninterface CreateLeadCaptureCadDataProviderProps {\n client: ApolloClientType;\n id: string;\n intl: IIntlContext;\n lat: number;\n lng: number;\n}\n\nconst createLeadCaptureCadDataProvider = ({\n client,\n id,\n intl,\n lat,\n lng,\n}: CreateLeadCaptureCadDataProviderProps) => {\n return ({\n environment,\n featureGate,\n }: {\n featureGate: ICadFeatureGate;\n environment: AuroraApiEnvironment;\n }): ICadDataServiceSettings => ({\n design: {\n latitude: lat,\n longitude: lng,\n },\n designId: id,\n distanceUnit: UnitSystem.Metric,\n environment,\n featureGate,\n getIrradiance: async () => null,\n getTemplateJsonById: async () => null,\n get irradianceState() {\n return {\n id,\n panels: {\n id: null,\n status: IrradianceStates.Invalid,\n },\n roof: {\n id: null,\n status: IrradianceStates.Invalid,\n },\n };\n },\n lidarAccessible: false,\n moduleSpacingSettings: {\n rowSpacing: 0,\n x: 0,\n y: 0,\n },\n peekRecord(type: string, compId: string) {\n return peekRecord(client, type, compId);\n },\n pricePerWatt: 0,\n projectId: '',\n projectType: '',\n recentSavedVersion: '',\n selectedImageryTypes: {\n basic: true,\n },\n timeZoneOffset: Math.round(lng / 15),\n units: buildUnitsAdapter(UnitSystem.Metric, TemperatureUnit.C, intl),\n });\n};\n\nconst getLeadCaptureFeatureGate = () => ({\n ambientOcclusion: false,\n autoDesigner: false,\n autoRoof: false,\n balanceOfSystem: false,\n compassToLowerRight: true,\n csvMonthly: false,\n datamodelLibrary: false,\n editSiteModel: false,\n fillZone: false,\n fitTreesToLidar: false,\n focusOnSelection: false,\n lidar: false,\n saveDesignJsonSchemaVersion2: false,\n walkway: false,\n});\n\nconst getLeadCaptureViewSettings = () => ({\n 'design-3d': {\n azimuthArrows: false,\n edges: false,\n ground: true,\n irradianceMap: false,\n irradianceMapPanels: false,\n lidar: false,\n mapImagery: true,\n mapView: false,\n measurements: false,\n projectCenter: false,\n setbacks: false,\n shadows: true,\n sky: true,\n streetView: false,\n sunpath: false,\n },\n});\n\ninterface GetLeadCaptureAsyncEngineInitProps {\n data: LeadCaptureCadQuery;\n hasOrbitMode: boolean;\n}\n\nconst getLeadCaptureAsyncEngineInit = ({\n data,\n hasOrbitMode,\n}: GetLeadCaptureAsyncEngineInitProps) => {\n return ({ engine }: { engine: CadEngine }): void => {\n engine.bridge.triggerAction(CADTriggerActionTypes.DrawReconstructedRoofPlanes, {\n ...data.leadCadData.site!.data,\n });\n\n engine.bridge.triggerAction(CADTriggerActionTypes.LoadSystemDesign, {\n design: data.leadCadData.scenarios[0].design!.data,\n });\n\n if (!CYPRESS_BUILD && !isChromatic() && hasOrbitMode) {\n engine.bridge.triggerAction(CADTriggerActionTypes.ZoomAndOrbit, {});\n }\n };\n};\n\ninterface UseLeadCaptureCadProps {\n cadContainer: HTMLElement | null;\n id: string;\n hasOrbitMode?: boolean;\n showCompass?: boolean;\n}\n\nexport const useLeadCaptureCad = ({\n cadContainer,\n id,\n hasOrbitMode = false,\n showCompass = false,\n}: UseLeadCaptureCadProps) => {\n const client = useAppModule(ApolloClient);\n\n const { data, loading } = useLeadCaptureCadQuery({\n variables: { id },\n });\n\n const geodataService = useMemo(\n () => (!data || loading ? undefined : getLeadCaptureGeodataService(data)),\n [loading, data],\n );\n\n const intl = useIntl();\n\n const lat = data?.leadCadData.location?.latitude || 0;\n const lng = data?.leadCadData.location?.longitude || 0;\n\n const createDataProvider = useMemo(() => {\n if (loading || !client) {\n return undefined;\n }\n\n return createLeadCaptureCadDataProvider({\n client,\n id,\n intl,\n lat,\n lng,\n });\n }, [client, id, intl, lat, lng, loading]);\n\n const asyncEngineInit = useMemo(() => {\n if (loading || !data) {\n return undefined;\n }\n\n return getLeadCaptureAsyncEngineInit({\n data,\n hasOrbitMode,\n });\n }, [data, loading, hasOrbitMode]);\n\n const propsForUseCad = useMemo(\n () => ({\n asyncEngineInit,\n createDataProvider,\n designId: id,\n engineOptions: {\n designJson: {\n site: {},\n system: {} as JSON,\n },\n designJsonSchemaVersion: 1,\n lat,\n lng,\n renderMode: 'main',\n saveFormat: '1.0',\n stateMode: CadMode.ReadOnly,\n useCompassPosition: showCompass\n ? CompassPosition.LowerRightCorner\n : CompassPosition.Invisible,\n useMapView: false,\n useSimplePointerControls: true,\n useSimpleTouchControls: false,\n useStreetView: false,\n useToastMessage: false,\n viewData: [\n {\n domElement: cadContainer as HTMLElement,\n name: 'design-3d',\n },\n ],\n viewSettings: getLeadCaptureViewSettings(),\n },\n featureGate: getLeadCaptureFeatureGate(),\n geodataService,\n isShown: !!(id && createDataProvider),\n }),\n [asyncEngineInit, createDataProvider, id, lat, lng, cadContainer, geodataService, showCompass],\n );\n\n return useCad(propsForUseCad);\n};\n","/* eslint-disable sort-keys */\nimport {\n isComputedProp,\n isObservableArray,\n isObservableMap,\n isObservableObject,\n isObservableSet,\n observable,\n toJS,\n} from 'mobx';\n\nlet reactiveRootId = 0;\n\nconst createDefaultReactiveName = () => {\n const currentRootId = reactiveRootId;\n reactiveRootId += 1;\n return `reactive_root_${currentRootId}`;\n};\n\n/**\n * Types to improve readability of other types\n */\ntype Reactive = object;\ntype MobXObject = object;\ntype Inert = object;\n\nconst reactiveNameLookup = new WeakMap();\nconst isReactive = new WeakSet();\nconst reactiveLookup = new WeakMap();\nconst inertSetLookup = new WeakMap>();\nconst reactiveArrayOverridesLookup = new WeakMap<\n Reactive,\n ReturnType\n>();\nconst reactiveSetOverridesLookup = new WeakMap<\n Reactive,\n ReturnType\n>();\nconst reactiveMapOverridesLookup = new WeakMap<\n Reactive,\n ReturnType\n>();\n\n/**\n * Convenience function to check if value is an object\n */\nexport const isObject = (value: T): value is T & object => {\n return value && typeof value === 'object';\n};\n\n/**\n * When changing a reactive object in any way, its values no longer\n * matches its original inert object. Hence, if that original\n * object is reassigned back to the same parent's property, we should\n * no longer prevent such reassignment\n */\nconst decoupleReactiveFromOriginal = (object: Reactive | MobXObject | undefined) => {\n if (object) {\n const reactive = reactiveLookup.get(object) ?? object;\n inertSetLookup.delete(reactive);\n }\n};\n\n/**\n * Wraps a method that causes a change in array, set or map to ensure\n * it is decoupled from its original inert object\n */\nconst wrapDecoupled = , Result>(\n object: MobXObject,\n method: (...args: Args) => Result,\n): ((...args: Args) => Result) => {\n return (...args) => {\n decoupleReactiveFromOriginal(object);\n return method.apply(object, args);\n };\n};\n\n/**\n * Returns whether reactive object corresponds to its\n * coupled original inert object\n */\nconst isReactiveObjectEqual = (reactiveOrMobX: Reactive | MobXObject, object: Inert): boolean => {\n if (reactiveOrMobX === object) {\n return true;\n }\n const reactive = reactiveLookup.get(reactiveOrMobX) ?? reactiveOrMobX;\n const inertSet = inertSetLookup.get(reactive);\n return !!inertSet && inertSet.has(object);\n};\n\n/**\n * Creates overrides for array methods so that newly added items are deeply reactive\n */\nconst createReactiveArrayOverrides = (\n mobxArray: T[],\n initialIndex: number,\n): Pick<\n Array,\n | 'push'\n | 'splice'\n | 'unshift'\n | 'fill'\n | 'indexOf'\n | 'lastIndexOf'\n | 'pop'\n | 'reverse'\n | 'shift'\n | 'sort'\n> => {\n let index = initialIndex;\n return {\n pop: wrapDecoupled(mobxArray, mobxArray.pop),\n reverse: wrapDecoupled(mobxArray, mobxArray.reverse),\n shift: wrapDecoupled(mobxArray, mobxArray.shift),\n sort: wrapDecoupled(mobxArray, mobxArray.sort),\n indexOf(searchElement: T, fromIndex?: number): number {\n const foundIndex = mobxArray.indexOf(searchElement, fromIndex);\n if (foundIndex >= 0 || !isObject(searchElement)) {\n return foundIndex;\n }\n const foundItem = mobxArray.find((item) => {\n return isObject(item) && isReactiveObjectEqual(item, searchElement);\n });\n return foundItem == null ? -1 : mobxArray.indexOf(foundItem);\n },\n lastIndexOf(searchElement: T, fromIndex?: number): number {\n const foundIndex = mobxArray.lastIndexOf(searchElement, fromIndex);\n if (foundIndex >= 0 || !isObject(searchElement)) {\n return foundIndex;\n }\n const foundItem = mobxArray.find((item) => {\n return isObject(item) && isReactiveObjectEqual(item, searchElement);\n });\n return foundItem == null ? -1 : mobxArray.lastIndexOf(foundItem);\n },\n push(...items: T[]): number {\n const reactive = reactiveLookup.get(mobxArray) as T[];\n const reactiveName = reactiveNameLookup.get(reactive)!;\n const newItems = items.map((item) => {\n const reactiveItem = makeDeepReactive(item, new Map(), `${reactiveName}[${index}]`);\n index += 1;\n return reactiveItem;\n });\n decoupleReactiveFromOriginal(reactive);\n return mobxArray.push(...newItems);\n },\n splice(start: number, deleteCount: number, ...rest: T[]): T[] {\n const reactive = reactiveLookup.get(mobxArray) as T[];\n const reactiveName = reactiveNameLookup.get(reactive)!;\n const newRestItems = rest.map((item) => {\n const reactiveItem = makeDeepReactive(item, new Map(), `${reactiveName}[${index}]`);\n index += 1;\n return reactiveItem;\n });\n decoupleReactiveFromOriginal(reactive);\n return mobxArray.splice(start, deleteCount, ...newRestItems);\n },\n unshift(...items: T[]): number {\n const reactive = reactiveLookup.get(mobxArray) as T[];\n const reactiveName = reactiveNameLookup.get(reactive)!;\n const newItems = items.map((item) => {\n const reactiveItem = makeDeepReactive(item, new Map(), `${reactiveName}[${index}]`);\n index += 1;\n return reactiveItem;\n });\n decoupleReactiveFromOriginal(reactive);\n return mobxArray.unshift(...newItems);\n },\n fill(value: T, start?: number | undefined, end?: number | undefined) {\n const reactive = reactiveLookup.get(mobxArray) as T[];\n const reactiveName = reactiveNameLookup.get(reactive)!;\n const newValue = makeDeepReactive(value, new Map(), `${reactiveName}[${index}]`);\n index += 1;\n mobxArray.fill(newValue, start, end);\n decoupleReactiveFromOriginal(reactive);\n return reactive;\n },\n };\n};\n\n/**\n * Creates overrides for set methods so that newly added items are deeply reactive\n */\nconst createReactiveSetOverrides = (\n mobxSet: Set,\n initialIndex: number,\n): Pick, 'add' | 'delete' | 'has' | 'clear'> => {\n let index = initialIndex;\n\n /**\n * If provided value is an original object, returns\n * its corresponding value in the reactive set\n */\n const getItem = (value: V): V | undefined => {\n return Array.from(mobxSet).find((item) => {\n if (isObject(item) && isObject(value)) {\n return isReactiveObjectEqual(item, value);\n }\n return false;\n });\n };\n\n return {\n clear: wrapDecoupled(mobxSet, mobxSet.clear),\n has(value) {\n return getItem(value) != null || mobxSet.has(value);\n },\n delete(value) {\n const searchedValue = getItem(value) ?? value;\n return mobxSet.delete(searchedValue);\n },\n add(value) {\n const reactive = reactiveLookup.get(mobxSet) as Set;\n if (getItem(value) == null) {\n const reactiveName = reactiveNameLookup.get(reactive)!;\n const newValue = makeDeepReactive(value, new Map(), `${reactiveName}.Item[${index}]`);\n index += 1;\n mobxSet.add(newValue);\n }\n return reactive;\n },\n };\n};\n\n/**\n * Creates overrides for map methods so that newly added items are deeply reactive\n */\nconst createReactiveMapOverrides = (\n mobxMap: Map,\n initialIndex: number,\n): Pick, 'set' | 'has' | 'get' | 'delete' | 'clear'> => {\n let index = initialIndex;\n\n /**\n * If provided key is an original object, returns\n * the actual map key\n */\n const getItemKey = (key: K): K | undefined => {\n return Array.from(mobxMap.keys()).find((item) => {\n if (isObject(item) && isObject(key)) {\n return isReactiveObjectEqual(item, key);\n }\n return false;\n });\n };\n\n /**\n * Determines if the provided value, which may be an original\n * object, is equal to the current Map's value stored at provided key\n */\n const isValueStoredAtKeyEqual = (existingKey: K | undefined, value: V) => {\n if (existingKey == null) {\n return false;\n }\n const existingValue = mobxMap.get(existingKey);\n if (isObject(value) && isObject(existingValue)) {\n return isReactiveObjectEqual(existingValue, value);\n }\n return mobxMap.has(existingKey) && value === existingValue;\n };\n\n return {\n clear: wrapDecoupled(mobxMap, mobxMap.clear),\n has(key) {\n return getItemKey(key) != null || mobxMap.has(key);\n },\n get(key) {\n return mobxMap.get(getItemKey(key) ?? key);\n },\n delete(key) {\n const searchedValue = getItemKey(key) ?? key;\n decoupleReactiveFromOriginal(mobxMap);\n return mobxMap.delete(searchedValue);\n },\n set(key, value) {\n const reactive = reactiveLookup.get(mobxMap) as Map;\n const reactiveName = reactiveNameLookup.get(reactive)!;\n let stringKey = typeof key === 'string' || typeof key === 'number' ? `${key}` : null;\n if (stringKey == null) {\n stringKey = `${index}`;\n index += 1;\n }\n const existingKey = getItemKey(key);\n // If the value is already equal to what is stored in the map,\n // no need to propagate the update to MobX\n if (!isValueStoredAtKeyEqual(existingKey, value)) {\n const newKey =\n existingKey ?? makeDeepReactive(key, new Map(), `${reactiveName}.Key[${stringKey}]`);\n const newValue = makeDeepReactive(value, new Map(), `${reactiveName}.Value[${stringKey}]`);\n decoupleReactiveFromOriginal(reactive);\n mobxMap.set(newKey, newValue);\n }\n return reactive;\n },\n };\n};\n\n/**\n * Wraps MobX object with our own reactive proxy, as well as provides\n * necessary values and connections to customize reactive behavior\n */\nconst createReactive = (name: string, inert: T, mobxObject: T): T => {\n const reactive = new Proxy(mobxObject, reactiveProxyHandler) as T;\n isReactive.add(reactive);\n reactiveNameLookup.set(reactive, name);\n reactiveLookup.set(mobxObject, reactive);\n const inertSet = new WeakSet([inert]);\n inertSetLookup.set(reactive, inertSet);\n return reactive;\n};\n\n/**\n * Returns an object equivalent to the provided one, but deeply wrapped\n * to provide MobX reactivity, as well as customize MobX via our own\n * reactive proxy\n */\nexport const makeDeepReactive = (\n object: T,\n seenObjects: Map,\n currentPath: string = createDefaultReactiveName(),\n): T => {\n if (!isObject(object) || isReactive.has(object)) {\n return object;\n }\n\n const proxy = seenObjects.get(object);\n if (proxy) {\n return proxy as unknown as T;\n }\n\n if (Array.isArray(object)) {\n const mobxObject = observable.array(undefined, {\n name: currentPath,\n });\n const reactive = createReactive(currentPath, object, mobxObject);\n seenObjects.set(object, reactive);\n object.forEach((item, i) => {\n mobxObject.push(makeDeepReactive(item, seenObjects, `${currentPath}[${i}]`));\n });\n reactiveArrayOverridesLookup.set(\n reactive,\n createReactiveArrayOverrides(mobxObject, reactive.length),\n );\n return reactive as unknown as T;\n }\n\n if (object instanceof Set) {\n const mobxObject = observable.set(undefined, {\n name: currentPath,\n });\n const reactive = createReactive>(currentPath, object, mobxObject);\n seenObjects.set(object, reactive);\n let index = 0;\n object.forEach((item) => {\n mobxObject.add(makeDeepReactive(item, seenObjects, `${currentPath}.Item[${index}]`));\n index += 1;\n });\n reactiveSetOverridesLookup.set(reactive, createReactiveSetOverrides(mobxObject, index));\n return reactive as unknown as T;\n }\n\n if (object instanceof Map) {\n const mobxObject = observable.map(undefined, {\n name: currentPath,\n });\n const reactive = createReactive>(currentPath, object, mobxObject);\n seenObjects.set(object, reactive);\n let index = 0;\n object.forEach((value, key) => {\n let stringKey = typeof key === 'string' || typeof key === 'number' ? `${key}` : null;\n if (stringKey == null) {\n stringKey = `${index}`;\n index += 1;\n }\n const reactiveKey = makeDeepReactive(key, seenObjects, `${currentPath}.Key[${stringKey}]`);\n const reactiveValue = makeDeepReactive(\n value,\n seenObjects,\n `${currentPath}.Value[${stringKey}]`,\n );\n mobxObject.set(reactiveKey, reactiveValue);\n });\n reactiveMapOverridesLookup.set(reactive, createReactiveMapOverrides(mobxObject, index));\n return reactive as unknown as T;\n }\n\n const mobxObject = observable.object(object, undefined, {\n name: currentPath,\n });\n const reactive = createReactive(currentPath, object, mobxObject);\n seenObjects.set(object, reactive);\n Object.keys(object).forEach((name) => {\n if (!isComputedProp(reactive, name)) {\n mobxObject[name] = makeDeepReactive(object[name], seenObjects, `${currentPath}.${name}`);\n }\n });\n return reactive as unknown as T;\n};\n\n/**\n * This reactive proxy is assigned on top of MobX proxy in order to\n * customize its functionality\n */\nconst reactiveProxyHandler: ProxyHandler = {\n /**\n * MobX makes actions and computed properties non-enumerable, which\n * leads to certain issues, such as \"Object.keys\" not returning computed\n * properties or not being able to iterate over them in \"for-in\" loops.\n * This is an unfortunate design decision, which could be rectified\n * by creating the proxy trap and overriding enumerable behavior.\n * Note: since MobX observable objects are themselves proxies, we cannot\n * simply recreate the object via defining property descriptors upon\n * reactive object creation, and, instead, we have to have an additional\n * proxy\n */\n getOwnPropertyDescriptor(target, property) {\n const mobxDescriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (isObservableObject(target) && mobxDescriptor && typeof property === 'string') {\n return {\n ...mobxDescriptor,\n enumerable: true,\n };\n }\n return mobxDescriptor;\n },\n\n /**\n * This trap overrides various methods for arrays, sets and maps,\n * in order to ensure newly added items are made deeply reactive,\n * as well as accessing elements via original objects is possible\n */\n get(target, property, receiver) {\n const reactive = reactiveLookup.get(target);\n const reactiveArrayOverrides = reactive && reactiveArrayOverridesLookup.get(reactive);\n if (reactiveArrayOverrides && reactiveArrayOverrides[property]) {\n return reactiveArrayOverrides[property];\n }\n const reactiveSetOverrides = reactive && reactiveSetOverridesLookup.get(reactive);\n if (reactiveSetOverrides && reactiveSetOverrides[property]) {\n return reactiveSetOverrides[property];\n }\n const reactiveMapOverrides = reactive && reactiveMapOverridesLookup.get(reactive);\n if (reactiveMapOverrides && reactiveMapOverrides[property]) {\n return reactiveMapOverrides[property];\n }\n return Reflect.get(target, property, receiver);\n },\n\n /**\n * This proxy trap has 2 goals:\n *\n * 1. Reduce effect retriggers by not propagating the change to MobX\n * when value is the same as before. This applies to assigning\n * the same objects, which is complicated by the fact that MobX\n * proxy is not strictly equal to its target, in addition to the\n * fact that MobX proxy doesn't directly manage provided object, but\n * creates a new object to use as MobX proxy target. In order to weakly\n * couple the original object to our reactive proxy, we use `inertSetLookup`,\n * which maps the resulting reactive proxy to a WeakSet of original\n * targets (there is always only one target, but WeakSet has a better\n * browser support than WeakRef)\n *\n * 2. Deeply make objects, arrays, sets and maps appearing inside the\n * object reative\n */\n set(target, property, newValue, receiver) {\n if (property in target && target[property] === newValue) {\n /**\n * This avoids updates when the value is assigned to what it was\n * before\n */\n return true;\n }\n\n const reactive = reactiveLookup.get(target);\n if (reactive && isObject(newValue)) {\n const currentReactiveValue = reactive[property];\n if (currentReactiveValue && isReactive.has(currentReactiveValue)) {\n if (isReactiveObjectEqual(currentReactiveValue, newValue)) {\n /**\n * The case of reassigning to the same object. We should do\n * nothing here, hereby overriding default behavior of MobX\n * that causes effects to get retriggered when assigning the\n * same object. We wish to avoid effects retriggers when\n * assigning the same object to the property\n */\n return true;\n }\n }\n\n const currentPath = reactiveNameLookup.get(reactive) ?? undefined;\n decoupleReactiveFromOriginal(reactive);\n return Reflect.set(\n target,\n property,\n makeDeepReactive(newValue, new Map(), `${currentPath}.${String(property)}`),\n receiver,\n );\n }\n\n decoupleReactiveFromOriginal(reactive);\n return Reflect.set(target, property, newValue, receiver);\n },\n};\n\n/**\n * Walks through the object deeply, accessing all of direct and downstream\n * properties, for example to allow effects to subscribe to any change in a\n * reactive object\n */\nexport const deepAccessReactive = (object: T, seenObjects: Set): void => {\n if (isObject(object) && seenObjects.has(object as unknown as object)) {\n return;\n }\n if (isObject(object) && (Array.isArray(object) || isObservableArray(object))) {\n seenObjects.add(object);\n object.forEach((item) => {\n deepAccessReactive(item, seenObjects);\n });\n } else if (object instanceof Set || isObservableSet(object)) {\n seenObjects.add(object);\n object.forEach((item) => {\n deepAccessReactive(item, seenObjects);\n });\n } else if (object instanceof Map || isObservableMap(object)) {\n seenObjects.add(object);\n object.forEach((value, key) => {\n deepAccessReactive(key, seenObjects);\n deepAccessReactive(value, seenObjects);\n });\n } else if (isObject(object)) {\n seenObjects.add(object as unknown as object);\n Object.keys(object).forEach((name) => {\n deepAccessReactive(object[name], seenObjects);\n });\n }\n};\n\n/**\n * Deeply clones a reactive object. Simply re-creates all arrays, objects,\n * maps and sets; for all other types (which should mostly just be primitives),\n * defaults to `toJS` provided by MobX. Supports cycles via \"seenObjects\" map\n */\nexport const deepCloneReactiveToInert = (object: T, seenObjects: Map): T => {\n if (object && typeof object === 'object') {\n const seenObject = seenObjects.get(object as unknown as object);\n if (seenObject) {\n return seenObject as unknown as T;\n }\n }\n if (\n object &&\n typeof object === 'object' &&\n (Array.isArray(object) || isObservableArray(object))\n ) {\n const array: unknown[] = [];\n seenObjects.set(object, array);\n object.forEach((item) => {\n array.push(deepCloneReactiveToInert(item, seenObjects));\n });\n return array as unknown as T;\n }\n if (object instanceof Set || isObservableSet(object)) {\n const set = new Set();\n seenObjects.set(object, set);\n object.forEach((item) => {\n set.add(deepCloneReactiveToInert(item, seenObjects));\n });\n return set as unknown as T;\n }\n if (object instanceof Map || isObservableMap(object)) {\n const map = new Map();\n seenObjects.set(object, map);\n object.forEach((value, key) => {\n map.set(\n deepCloneReactiveToInert(key, seenObjects),\n deepCloneReactiveToInert(value, seenObjects),\n );\n });\n return map as unknown as T;\n }\n if (object && typeof object === 'object') {\n const newObject = {} as T;\n seenObjects.set(object as unknown as object, newObject as unknown as object);\n Object.keys(object).forEach((name) => {\n newObject[name] = deepCloneReactiveToInert(object[name], seenObjects);\n });\n return newObject;\n }\n return toJS(object);\n};\n","/**\n * This file is to wrap / re-export MobX's functions so that we can:\n * 1. Depend on the limited set of MobX's functionality\n * 2. Depend on our own internal functions for majority of codebase rather\n * than requiring MobX everywhere\n * 3. Wrap important MobX defaults\n */\nimport { configure, reaction, trace } from 'mobx';\nimport { observer, useLocalObservable } from 'mobx-react-lite';\n\nimport {\n deepAccessReactive,\n deepCloneReactiveToInert,\n isObject,\n makeDeepReactive,\n} from './framework-deep';\n\nexport type MakeReactive = (object: T) => T;\n\nexport type Effect = (\n getReactive: () => ReactiveValue,\n runEffect: (reactiveValue: ReactiveValue) => void,\n) => () => void;\n\nconfigure({\n /**\n * Note: for the purposes of mocking, it is useful to be able to\n * override certain state and actions outside of a MobX action\n */\n enforceActions: process.env.NODE_ENV === 'test' ? 'never' : 'observed',\n\n /**\n * We want to isolate the MobX global state\n * to prevent issues with multiple instances of MobX\n * in the same app (specifically with CSDK applications)\n * https://mobx.js.org/configuration.html#isolateglobalstate-boolean\n */\n isolateGlobalState: true,\n});\n\n/**\n * For debugging, allows us to use \"window.cadState.trace()\" function inside\n * a computed property / observer to determine the reason for computed value\n * updates by showing the current update tree\n */\nexport const provideCadStateTrace = () => {\n if ('cadState' in window) {\n return;\n }\n const value = { trace };\n Object.freeze(value);\n Object.defineProperty(window, 'cadState', {\n configurable: false,\n enumerable: false,\n value,\n writable: false,\n });\n};\n\n/**\n * Wrapper around objects to return reactive copy of the object. Reactive objects can\n * consist of independent properties, getters (aka computed properties) and functions\n * (aka actions). What makes reactive objects special is that the computed properties\n * are cached and only recalculated when its dependencies change, actions batch changes\n * to reactive properties, and any changes to reactive properties (either independent or\n * computed) trigger rerunning of the effects that depend on them. Under the hood, it\n * wraps a MobX function and provides defaults\n */\nexport const makeReactive: MakeReactive = (object: T): T => {\n return makeDeepReactive(object, new Map()) as T;\n};\n\n/**\n * Effects is a way to react to state changes and perform updates. For example,\n * every React component that depends on a subset of the state will have an effect\n * to rerender whenever this subset changes. The effect takes two functions:\n * 1. Reactive part. All reactive properties accessed inside the reactive part will\n * subscribe the effect to the changes. In addition, the effect will be deeply\n * subscribed to anything reactive returned from the reactive part\n * 2. Inert part. This function is called immediately after the reactive part. It will\n * receive the result returned from the reactive part and can safely perform any\n * work or any side effect without subscribing the effect to anything further\n *\n * The effect is called immediately when `effect(reactive, inert)` is called and any\n * time the subset of the state accessed in (or returned from) reactive part changes.\n * We MUST clean up the effects whenever they are no longer needed (e.g. when the React\n * component unmounts). The cleanup function is returned from the `effect` call\n *\n * Internally, this wraps MobX's \"reaction\" and provides useful defaults.\n * Renamed from \"reaction\" to \"effect\" in order to indicate the intent is\n * for external effects\n */\nexport const effect: Effect = (getReactive, runEffect) => {\n const getAccessedReactive = () => {\n const result = getReactive();\n /**\n * For every effect, we should deeply access its reactive object so that a change\n * in any downstream property leads to retriggering of the effect. This makes effects\n * reliable and easy to work with, but still avoids deep clones\n */\n deepAccessReactive(result, new Set());\n return result;\n };\n\n return reaction(getAccessedReactive, runEffect, {\n /**\n * Note: default MobX behavior is to avoid running effects when\n * the result of reactive part is strictly the same (===) as before.\n * This can also be altered by choosing a deep equality (comparer.structural)\n * comparer instead.\n *\n * If we choose default strict equality comparer, we cannot return\n * the same object as before from the effect, because in such a case,\n * the effect will not be rerun, even if the returned object has\n * been modified, which lead to the effect in the first place.\n * Hence we are only limited to returning primitives from the\n * reactive part of the effect.\n *\n * If we choose deep equality comparer, when returning a reactive\n * object directly from the reactive part, this will result in no\n * effect triggered, even if the object was modified. The only way\n * to correctly trigger the update would be to return deeply cloned\n * object from the reactive part, because references will be\n * different and deep comparison will auto-determine that change happened.\n * However, this is very expensive, because the object needs to be deeply\n * cloned and then deeply compared to the old one.\n *\n * The solution is to\n *\n * 1. Avoid triggering updates for reactive objects when the property\n * value is the same as before via our own `reactiveProxy`\n *\n * 2. Allow updates to cause effects regardless of the value returned\n * from the effect, so that we can return reactive objects\n * directly, without having to deep clone them\n */\n equals: (a: unknown, b: unknown) => {\n if (isObject(a) && isObject(b)) {\n return false;\n }\n return a === b;\n },\n\n /**\n * There are very few circumstances where we don't want to run\n * the effects immediately, in which cases we can easily handle that\n * inside effect creation functions\n */\n fireImmediately: true,\n });\n};\n\n/**\n * Get a non-reactive deep clone of a reactive object\n */\nexport const cloneInert = (object: T): T => {\n return deepCloneReactiveToInert(object, new Map());\n};\n\n/**\n * Renamed MobX's \"observer\" to \"stateObserver\" to make it more clear and searchable\n */\nexport { observer as stateObserver, useLocalObservable };\n","import { v4 as uuidv4 } from 'uuid';\n\nexport const generateUuid = (): string => uuidv4();\n","import { useEffect, useState } from 'react';\n\ninterface UseInterceptMouseProps {\n cadDomNode?: HTMLCanvasElement | null;\n}\n\nexport const useInterceptMouse = ({ cadDomNode }: UseInterceptMouseProps) => {\n const [clicked, setClicked] = useState(false);\n\n useEffect(() => {\n if (!cadDomNode) return undefined;\n const onMouse = () => {\n setClicked(true);\n };\n const options = { capture: true, once: true, passive: true };\n // NOTE: This may fire more than once, but the total number of events should be small\n cadDomNode.addEventListener('pointerdown', onMouse, options);\n\n return () => {\n cadDomNode.removeEventListener('pointerdown', onMouse, options);\n };\n }, [cadDomNode]);\n\n return clicked;\n};\n","import { FileUploaderResult } from '@aurorasolar/graphql-client-schema';\n\nexport enum FileResultType {\n IMAGE = 'image',\n DOCUMENT = 'document',\n VIDEO = 'video',\n UNKNOWN = 'unknown',\n}\n\nexport enum FileResultUploadStatus {\n // Upload manually canceled\n CANCELED = 'canceled',\n COMPLETE = 'complete',\n IN_PROGRESS = 'in-progress',\n // Unknown error - can retry upload\n NON_VALIDATION_ERROR = 'non-validation-error',\n // Awaiting upload kickoff\n PENDING = 'pending',\n // File will not pass validation, do not allow retry upload\n VALIDATION_ERROR = 'validation-error',\n}\n\nexport interface FileResult {\n errorText?: string;\n file: File;\n fileType: FileResultType;\n status: FileResultUploadStatus;\n id: string;\n result?: FileUploaderResult | null;\n}\n\nexport interface BSSClientResponse {\n blob_id: string;\n upload_needed: boolean;\n upload_url: string;\n mandatory_upload_headers?:\n | ({ name?: string | null; value?: string | null } | null | undefined)[]\n | null;\n}\n\nexport enum SupportedMimeTypes {\n GIF = 'image/gif',\n HEIC = 'image/heic',\n JPEG = 'image/jpeg',\n PDF = 'application/pdf',\n PNG = 'image/png',\n WEBP = 'image/webp',\n ZIP = 'application/zip',\n DXF = 'image/vnd.dxf',\n DWG = 'image/vnd.dwg',\n}\n","import { FileResultType, SupportedMimeTypes } from './types';\n\nexport const getFileResultType = (mimeType: string) => {\n switch (mimeType) {\n case SupportedMimeTypes.GIF:\n case SupportedMimeTypes.JPEG:\n case SupportedMimeTypes.PNG:\n case SupportedMimeTypes.WEBP:\n case SupportedMimeTypes.HEIC:\n case SupportedMimeTypes.DXF:\n case SupportedMimeTypes.DWG:\n return FileResultType.IMAGE;\n case SupportedMimeTypes.PDF:\n return FileResultType.DOCUMENT;\n default:\n return FileResultType.UNKNOWN;\n }\n};\n\nexport const getFileSizeFormatted = (fileSize: number): string => {\n if (fileSize <= 0) {\n return '0 KB';\n }\n const kbSize = Math.round((fileSize / 1024) * 100) / 100;\n if (kbSize < 1024) {\n return `${kbSize} KB`;\n }\n const mbSize = Math.round((kbSize / 1024) * 100) / 100;\n if (mbSize < 1024) {\n return `${mbSize} MB`;\n }\n const gbSize = Math.round((mbSize / 1024) * 100) / 100;\n return `${gbSize} GB`;\n};\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;"],"names":["useState","Error","defaultNoopBatch","callback","FinalizationRegistryLocal","FinalizationRegistry","undefined","createTrackingData","reaction","mounted","changedBeforeMount","cleanAt","Date","now","CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS","__values","o","s","Symbol","iterator","m","i","call","length","next","value","done","TypeError","_a","cleanupTokenToReactionTrackingMap","Map","globalCleanupTokensCounter","registry","token","trackedReaction","get","dispose","delete","addReactionToTrack","reactionTrackingRef","objectRetainedByReact","register","current","finalizationRegistryCleanupToken","set","recordReactionAsCommitted","reactionRef","unregister","forceCleanupTimerToRunNowForTests","resetCleanupScheduleForTests","createReactionCleanupTrackingUsingFinalizationRegister","reactionCleanupHandle","uncommittedReactionRefs","Set","ensureCleanupTimerRunning","setTimeout","cleanUncommittedReactions","forEach","ref","tracking","size","add","clearTimeout","e_1","uncommittedReactionRefs_1","uncommittedReactionRefs_1_1","e_1_1","error","return","clear","createTimerBasedReactionCleanupTracking","hasSymbol","for","forwardRef","props","memo","useLocalObservable","initializer","annotations","autoBind","reactionScheduler","die","_len","arguments","args","Array","_key","map","String","join","mockGlobal","getGlobal","globalThis","window","g","self","assign","Object","getDescriptor","getOwnPropertyDescriptor","defineProperty","objectPrototype","prototype","EMPTY_ARRAY","freeze","EMPTY_OBJECT","hasProxy","Proxy","plainObjectString","toString","assertProxies","once","func","invoked","apply","this","noop","isFunction","fn","isStringish","isObject","isPlainObject","proto","getPrototypeOf","protoConstructor","hasOwnProperty","constructor","isGenerator","obj","name","displayName","addHiddenProp","object","propName","enumerable","writable","configurable","addHiddenFinalProp","createInstanceofPredicate","theClass","x","isES6Map","thing","isES6Set","hasGetOwnPropertySymbols","getOwnPropertySymbols","ownKeys","Reflect","getOwnPropertyNames","concat","toPrimitive","hasProp","target","prop","getOwnPropertyDescriptors","res","key","_defineProperties","descriptor","_createClass","Constructor","protoProps","staticProps","_extends","source","_inheritsLoose","subClass","superClass","create","_setPrototypeOf","p","setPrototypeOf","__proto__","_assertThisInitialized","ReferenceError","_arrayLikeToArray","arr","len","arr2","_createForOfIteratorHelperLoose","allowArrayLike","it","bind","isArray","minLen","n","slice","from","test","_unsupportedIterableToArray","storedAnnotationsSymbol","createDecoratorAnnotation","annotation","property","storeAnnotation","annotationType_","OVERRIDE","isOverride","$mobx","Atom","name_","isPendingUnobservation_","isBeingObserved_","observers_","diffValue_","lastAccessedBy_","lowestObserverState_","IDerivationState_","NOT_TRACKING_","onBOL","onBUOL","_proto","onBO","listener","onBUO","reportObserved","reportChanged","startBatch","propagateChanged","endBatch","isAtom","createAtom","onBecomeObservedHandler","onBecomeUnobservedHandler","arg3","atom","interceptHook","ON_BECOME_OBSERVED","onBecomeUnobserved","comparer","identity","a","b","structural","deepEqual","is","shallow","deepEnhancer","v","_","isObservable","observable","array","isAction","isFlow","flow","autoAction","referenceEnhancer","newValue","createActionAnnotation","options","options_","make_","make_$1","extend_","extend_$1","adm","_this$options_","bound","target_","actionDescriptor","createActionDescriptor","proxyTrap","defineProperty_","safeDescriptors","_annotation$options_","_annotation$options_$","_annotation$options_2","_annotation$options_$2","_annotation$options_3","_annotation$options_4","_adm$proxy_2","_ref2","globalState","_adm$proxy_","proxy_","createAction","isPlainObject_","createFlowAnnotation","make_$2","extend_$2","flowDescriptor","createFlowDescriptor","_this$options_2","isMobXFlow","createComputedAnnotation","make_$3","extend_$3","_ref","assertComputedDescriptor","defineComputedProperty_","createObservableAnnotation","make_$4","extend_$4","_this$options_$enhanc","assertObservableDescriptor","defineObservableProperty_","enhancer","AUTO","autoAnnotation","createAutoAnnotation","make_$5","extend_$5","_this$options_3","_this$options_4","computed","observableAnnotation","deep","_this$options_5","_this$options_6","defaultCreateObservableOptions","defaultDecorator","proxy","asCreateObservableOptions","observableRefAnnotation","observableShallowAnnotation","isObservableObject","isObservableArray","isObservableMap","isObservableSet","observableStructAnnotation","oldValue","observableDecoratorAnnotation","getEnhancerFromOptions","createObservable","arg2","box","_getDescriptor$config","_getDescriptor","ObservableValue","equals","initialValues","useProxies","createLegacyArray","createObservableArray","ObservableMap","ObservableSet","decorators","extendObservable","asObservableObject","_target$$mobx","_target$$mobx$proxy_","objectProxyTraps","asDynamicObservableObject","struct","COMPUTED","computedAnnotation","computedStructAnnotation","arg1","opts","ComputedValue","_Symbol$toPrimitive","currentActionId","nextActionId","isFunctionNameConfigurable","tmpNameDescriptor","actionName","executeAction","isMobxAction","canRunAsDerivation","scope","runInfo","notifySpy_","startTime_","prevDerivation_","trackingDerivation","runAsAction","prevAllowStateChanges_","allowStateChanges","untrackedStart","allowStateChangesStart","prevAllowStateReads_","allowStateReadsStart","runAsAction_","actionId_","parentActionId_","_startAction","err","error_","suppressReactionErrors","allowStateChangesEnd","allowStateReadsEnd","untrackedEnd","_endAction","prev","_Symbol$toPrimitive$1","_Atom","notifySpy","_this","hasUnreportedChange_","interceptors_","changeListeners_","value_","dehancer","dehanceValue","prepareNewValue_","UNCHANGED","setNewValue_","checkIfStateModificationsAreAllowed","hasInterceptors","change","interceptChange","type","UPDATE","hasListeners","notifyListeners","intercept_","handler","registerInterceptor","observe_","fireImmediately","observableKind","debugObjectName","registerListener","raw","toJSON","valueOf","isObservableValue","TraceMode","dependenciesState_","observing_","newObserving_","runId_","UP_TO_DATE_","unboundDepsCount_","CaughtException","triggeredBy_","isComputing_","isRunningSetter_","derivation","setter_","isTracing_","NONE","scope_","equals_","requiresReaction_","keepAlive_","compareStructural","context","requiresReaction","keepAlive","onBecomeStale_","POSSIBLY_STALE_","d","propagateMaybeChanged","inBatch","shouldCompute","prevTrackingContext","trackingContext","trackAndCompute","STALE_","propagateChangeConfirmed","warnAboutUntrackedRead_","computeValue_","result","isCaughtException","cause","wasSuspended","changed","track","trackDerivedFunction","disableErrorBoundaries","e","suspend_","clearObserving","firstTime","prevValue","autorun","prevU","isComputedValue","prevAllowStateReads","prevUntracked","obs","l","changeDependenciesStateTo0","f","runId","prevTracking","prevObserving","observing","lowestNewObservingDerivationState","i0","dep","_dep","removeObserver","_dep2","addObserver","bindDependencies","untracked","action","allowStateReads","MobXGlobals","version","mobxGuid","pendingUnobservations","pendingReactions","isRunningReactions","enforceActions","spyListeners","globalReactionErrorHandlers","computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","verifyProxies","canMergeGlobalState","isolateCalled","global","__mobxInstanceCount","__mobxGlobals","node","queueForUnobservation","push","runReactions","list","Reaction","onInvalidate_","errorHandler_","requiresObservable_","isDisposed_","isScheduled_","isTrackPending_","isRunning_","schedule_","isScheduled","runReaction_","reportExceptionInDerivation_","prevReaction","message","console","getDisposer_","r","trace","enterBreakPoint","pop","getAtom","getAtomFromArgs","log","BREAK","LOG","MAX_REACTION_ITERATIONS","runReactionsHelper","allReactions","iterations","splice","remainingReactions","isReaction","ACTION","AUTOACTION","DEFAULT_ACTION_NAME","actionAnnotation","actionBoundAnnotation","autoActionAnnotation","autoActionBoundAnnotation","createActionFactory","view","_opts$name","_opts","scheduler","delay","reactionRunner","onError","requiresObservable","createSchedulerFromOptions","run","expression","effect","_opts$name2","errorHandler","baseFn","effectAction","runSync","nextValue","ON_BECOME_UNOBSERVED","hook","cb","listenersKey","hookListeners","NEVER","ALWAYS","OBSERVED","configure","isolateGlobalState","baseScheduler","ea","properties","descriptors","getDependencyTree","nodeToDependencyTree","dependencies","generatorId","FlowCancellationError","flowAnnotation","flowBoundAnnotation","generator","rejector","gen","pendingPromise","promise","Promise","resolve","reject","stepId","onFulfilled","ret","onRejected","then","cancel","cancelPromise","_res","yieldedPromise","_isComputed","values_","has","isComputedProp","_isObservable","cache","toJSHelper","__alreadySeen","idx","_res2","_res3","ownKeys_","apiOwnKeys","propertyIsEnumerable","toJS","transaction","thisArg","getAdm","has_","get_","_getAdm$set_","set_","deleteProperty","_getAdm$delete_","delete_","_getAdm$definePropert","preventExtensions","interceptable","interceptors","indexOf","listenable","listeners","makeObservable","collectStoredAnnotations","SPLICE","arrayTraps","getArrayLength_","isNaN","arrayExtensions","parseInt","setArrayLength_","ObservableArrayAdministration","owned_","legacyMode_","atom_","enhancer_","lastKnownLength_","newV","oldV","dehanceValue_","dehanceValues_","values","index","added","addedCount","removed","removedCount","newLength","currentLength","newItems","spliceWithArray_","updateArrayLength_","oldLength","delta","reserveArrayBuffer","deleteCount","Math","max","min","lengthDelta","spliceItemsIntoValues_","notifyArraySplice_","_this$values_","oldItems","_i","notifyArrayChildUpdate_","notify","warn","owned","replace","spliceWithArray","_len2","items","_key2","shift","unshift","_len3","_key3","reverse","sort","copy","remove","addArrayExtension","funcName","funcFactory","simpleFunc","dehancedValues","mapLikeFunc","_this2","element","reduceLikeFunc","_this3","accumulator","currentValue","_Symbol$iterator","_Symbol$toStringTag","isObservableArrayAdministration","ObservableMapMarker","ADD","DELETE","toStringTag","_Symbol$iterator$1","_Symbol$toStringTag$1","initialData","data_","hasMap_","keysAtom_","merge","entry","newEntry","hasKey","updateValue_","addValue_","_change","_this3$hasMap_$get","_this4","_this4$hasMap_$get","keys","makeIterable","_keys$next","entries","_keys$next2","_step","_iterator","_step$value","other","_this5","symbols","filter","getPlainObjectKeys","_this6","_step2","_iterator2","_this7","_step3","replacementMap","dataStructure","convertToMap","orderedData","keysReportChangedCalled","_iterator3","_step4","_iterator4","_step4$value","_value","keyExisted","_value2","iter1","iter2","next1","next2","ObservableSetMarker","callbackFn","_change2","nextIndex","observableValues","descriptorCache","REMOVE","ObservableObjectAdministration","defaultAnnotation_","appliedAnnotations_","pendingKeys_","getObservablePropValue_","setObservablePropValue_","assertAnnotable","_this$target_$storedA","outcome","recordAnnotationApplied","deleteOutcome","notifyPropertyAddition_","cachedDescriptor","getCachedObservablePropDescriptor","_this$pendingKeys_","_this$pendingKeys_$ge","_this$pendingKeys_2","_this$pendingKeys_2$g","keys_","_options$name","_options$defaultDecor","getAnnotationFromOptions","isObservableObjectAdministration","_adm$target_$storedAn","ctor","ENTRY_0","createArrayEntryDescriptor","OBSERVABLE_ARRAY_BUFFER_SIZE","StubArray","LegacyObservableArray","_StubArray","arrays","createArrayBufferItem","getDebugName","_observable","getAdministration","named","depth","eq","aStack","bStack","className","unwrap","areArrays","aCtor","bCtor","getSelf","__MOBX_DEVTOOLS_GLOBAL_HOOK__","injectMobx","spy","extras","LoadingAnimation","Lottie","lazy","path","setPath","useEffect","async","pathData","default","lazyLoadLottie","loadpath","Suspense","fallback","loop","play","rendererSettings","preserveAspectRatio","style","backgroundColor","height","width","LoadingText","h1Box","CadLoadingPage","alignItems","flexDirection","h","justifyContent","mb","h3","color","textAlign","useOnceRef","isInitialized","useRef","useReactive","getReactive","dependencyArray","isWithinRender","rerender","reactiveCallback","useCallback","lastReactiveCallbackRef","reactiveObservable","setReactiveCallback","newReactiveCallback","stopEffect","createCadContainer","document","createElement","ReactiveContextProvider","CadPageViewportsStateProvider","useReactiveState","useCadPageViewportsState","createState","ReactiveContext","createContext","children","reactiveContextRef","Provider","reactiveContext","useContext","useReactiveContext","createReactiveSetup","makeReactive","data","defaultCamera","defaultLayers","exclusiveViewportName","viewports","cadContainersData","cadContainers","defaultCadContainer","scheduledActions","processActions","currentActionIndex","findIndex","scheduledAction","currentActionType","requestAnimationFrame","scheduleAddViewport","some","scheduleRemoveViewport","createCadViewportActionsScheduler","actions","addViewport","removeViewport","viewportIndex","setDefaultViewSettings","camera","layers","setExclusiveViewportName","newExclusiveViewportName","createCadPageViewportsActions","CadStatus","CadContext","CadInitializerContext","useCadContext","status","useOptionalCadContext","useCadInitializerContext","initialCadContext","designId","domNode","engine","engineSaveFn","eventStream","preferences","state","CadContextProvider","cadContext","isLoaded","Loading","cadContextInitializer","clearCadContext","fullContext","setCadContext","newCadContext","Loaded","setCadError","CadProvideSolarPanelDocument","CadProvideSolarInverterDocument","CadProvideDcOptimizerDocument","CadProvideCombinerBoxDocument","CadProvideDisconnectDocument","CadProvideLoadCenterDocument","CadProvideMeterDocument","CadProvideServicePanelDocument","getComponentReadQuery","query","client","id","readQuery","variables","ComponentQueries","CombinerBox","DcOptimizer","Disconnect","LoadCenter","Meter","SolarInverter","ServicePanel","SolarPanel","peekRecord","compId","typeCamelCase","toUpperCase","queryComponent","component","readComponent","__typename","mlpe","isDcOptimizer","dcOptimizer","isSolarInverter","solarInverter","isCellStringOptimizer","cellStringOptimizer","formatMlpe","Converter","numerator","definitions","val","destination","origin","getUnit","throwUnsupportedUnitError","to","abbr","describe","unit","to_anchor","anchor_shift","system","transform","toBest","exclude","cutOffNumber","item","includes","reduce","acc","found","systemName","possibilities","what","singular","plural","utils","metric","baseUnit","rad","deg","grad","arcmin","arcsec","VA","mVA","kVA","MVA","GVA","mm2","cm2","m2","ha","km2","imperial","yd2","ft2","ac","mi2","c","mC","nC","pC","A","mA","kA","bits","Kb","Mb","Gb","Tb","bytes","B","KB","MB","GB","TB","dz","Wh","mWh","kWh","MWh","GWh","J","kJ","N","kN","lbf","mHz","Hz","kHz","MHz","GHz","THz","rpm","mm","cm","km","yd","ft","fathom","mi","nMi","mcg","mg","kg","mt","oz","lb","t","ppm","ppb","ppt","ppq","W","mW","kW","MW","GW","Pa","kPa","MPa","hPa","bar","torr","psi","ksi","VARh","mVARh","kVARh","MVARh","GVARh","VAR","mVAR","kVAR","MVAR","GVAR","knot","C","K","F","R","ns","mu","ms","week","month","year","V","mV","kV","mm3","cm3","ml","cl","dl","kl","m3","km3","krm","tsk","msk","kkp","glas","kanna","tsp","Tbs","in3","cup","pnt","qt","gal","ft3","yd3","pipe","fns","arg","celsiusToFahrenheit","celsius","fahrenheitToCelsius","fahrenheit","decimalToPercentage","decimal","percentageToDecimal","percentage","ConversionType","UnitType","SquareFoot","SquareMeter","PricePerSquareFoot","PricePerSquareMeter","PoundsPerSquareFoot","KilogramsPerSquareMeter","MilesPerHour","areaConversion","squareFeetToSquareMeters","squareMetersToSquareFeet","pricePerSquareFootToPricePerSquareMeter","pricePerSquareMeterToPricePerSquareFoot","massConversion","poundToKilogram","Pound","Kilogram","kilogramToPound","poundPerSquareFootToKilogramPerSquareMeter","kilogramPerSquareMeterToPoundPerSquareFoot","speedConversion","milesPerHourToKilometersPerHour","KilometersPerHour","kilometersPerHourToMilesPerHour","lengthConversion","metersToInches","Inch","inchesToMeters","metersToCm","Centimeter","cmToMeters","metersToFeet","Foot","feetToMeters","noChange","defaultUnitSystems","distanceUnit","Metric","temperatureUnit","getConversionTuple","unitType","decimalPlaces","round","Number","toFixed","roundTo","Fahrenheit","Percent","buildUnitsAdapter","intl","conversionType","isMetric","isCelsius","Percentage","Temperature","Celsius","Distance","DistanceSmall","PricePerArea","Mass","Load","Speed","getUnitType","convertIn","convertOut","convert","Imperial","format","numFixed","_measurementType","footInchFormat","convertedValue","formattedValue","formatNumber","maximumFractionDigits","minimumFractionDigits","floor","smallDistanceUnit","distance","unconvert","CompassPosition","CadMode","getLeadCaptureGeodataService","deleteOrthoImage","detectAllObstructions","detectObstructions","initialize","cadBridge","triggerAction","ProcessGroundTextures","orthoImages","leadCadData","image","orthoImage","processGroundTextures","initialized","onOrthoImageBoundsIncrease","onProjectLocationChange","onSiteBoundsChange","onSpecifiedBoundsChange","updateOrthoImage","willDestroy","PreferenceScope","ExpirationType","UserScope","createLocalStoragePreferenceProvider","storagePrefix","isCadKey","startsWith","removeCadKeyPrefix","substring","provider","localStorage","getItem","json","JSON","parse","timestamp","getLocalStorageStoredValue","getKeys","removeItem","setItem","stringify","isDateMoreThanOneDayIntoTheFuture","isPastExpiryDate","maxDurationMs","schema","cadPreferencesManager","preferenceNames","preferenceDescriptors","preferenceIds","getPreferenceIds","manager","createPreferences","currentScope","localStorageProvider","instanceProvider","storage","createInstancePreferenceProvider","providers","getProvider","expirationType","Instance","getCurrentProviderKey","preferenceId","userId","getUserId","projectId","getProjectId","getDesignId","prefix","userScope","PerUser","preferenceScope","Project","Design","providerKey","storedValue","isValid","MaxDuration","getIdAndDescriptor","prefIdPrefix","split","find","cleanup","maxCountKeys","expectedProvider","MaxCount","maxCountKey","countDiff","maxCount","t1","t2","wrapActions","actionPreferenceNames","newActions","returnedValue","createPreferencesManager","p000","panelPlaceMode","dcOptimizerId","nullable","microinverterId","solarPanelId","minSap","pitchedThreshold","flatTilt","flatRotation","flatIntermoduleSpacingX","flatRowSpacing","flatOrientation","oneOf","pitchedTilt","pitchedRotation","pitchedIntermoduleSpacingX","pitchedRowSpacing","pitchedOrientation","required","isValidSync","modeInspectorTabTypes","createActiveTabData","selectionMetadata","activeInspectorOnlyTab","activeTab","primarySelectionKey","AutoDesignerStart","AutoDesignerFinished","performance","MarkName","AutoDesignerDuration","MeasureName","ModalType","OverlayType","DesignSettingsTab","createSaveData","historyData","hasUnsavedChanges","recentSavedVersion","recentVersion","isSaving","createCadState","cadEngineState","selectedTypeData","selectedTypes","selectionData","types","count","createSelectedTypesData","modalData","activeModal","None","activeOverlays","modalActions","closeModal","closeOverlay","overlayType","overlayDatum","openModal","modalType","openOverlay","overlayData","setDesignSettingsTab","designSettingsTab","DesignSettings","tab","createModalActions","autoDesignerData","isAutoDesignerRunning","autoDesignerActions","autoDesignerFinish","mark","measure","autoDesignerStart","createAutoDesignerActions","saveData","saveActions","finishSaving","saveVersion","startSaving","createSaveActions","prismData","isPrismCadOpen","prismActions","toggleIsPrismCadOpen","newState","createPrismActions","activeTabData","activeTabActions","selectionMetadataActions","setActiveTab","newActiveTab","setPrimarySelectionKey","createActiveTabActions","stopEffects","CadEventTypes","AutoStringErrorType","TOAST_CHANNEL","GetUserInfoDocument","CreateBssUploadUrlsDocument","useCreateBssUploadUrls","fileUploader","fetchUserId","userData","fetchPolicy","newUserId","currentUser","createBssUploadUrls","baseOptions","useCreateBssUploadUrlsMutation","fetchBssUploadUrls","files","currentUserId","hashFile","bssUploadInputsPromises","file","hash","blobName","contentLength","contentSha256","mimeType","bssUploadInputs","all","createBSSUploadUrlsInput","createBSSUploadUrls","SERVER_ERROR_MESSAGE","fileResultNotInProgress","fileResult","IN_PROGRESS","useUploadFiles","userFileOptions","fileMap","fileResults","setFileResults","runUploadFileAsyncJob","invalidateUploadFileAsyncJob","startAsyncJob","invalidateJobs","temporaryBlobId","fileName","label","parentId","parentType","parentRoleType","settings","FileUploader","useUploadFileAsyncJob","updateFileResult","updatedOptions","newFileResults","updateIndex","cancelFileUpload","PENDING","CANCELED","retryFileUpload","NON_VALIDATION_ERROR","VALIDATION_ERROR","errorText","removeFileUpload","clearResults","addErroredFiles","erroredFiles","newErroredFileResults","newErroredFileResult","fileType","uploadFiles","newFiles","newFile","newFileResult","pendingFileResults","pendingFiles","bssUploadUrls","uploadUrl","inProgressFileResult","blobId","uploadToSignedUrl","errors","firstError","COMPLETE","asyncUploadFiles","cancelFileResults","results","SaveDesignDocument","PreSaveDocument","withTimeout","time","timeoutMessage","timeoutPromise","race","takeSaveScreenshot","cadEvents$","reduxStore","screenshotPromise","firstValueFrom","event","eventType","CadScreenshot","payload","listenForScreenshotResponse","dispatch","actionType","TakeScreenshot","cadInstance","imageType","screenshotResponse","screenshotFile","File","cadSaveCallbackCore","apolloClient","evictCache","evictCacheById","jsonToSave","site","designJsonSchemaVersion","saveScreenshot","design","savesDisabled","checkCadCanSave","CAD","systemStats","systemStatsData","cadUpdatedDesign","carportSystemSizeStc","offRoofSystemSizeStc","irradianceMapId","irradiance","roof","mapId","irradianceMapStatus","Invalid","irradiancePanelsId","panels","irradiancePanelsStatus","roofSystemSizeStc","systemSizeAc","systemSizePtc","systemSizeStc","savePromise","mutate","awaitRefetchQueries","mutation","finally","catch","getCadSaveCallback","saveDependencies","currentSave","downloadDataURL","url","filename","createLink","encodedURI","encodeURI","link","setAttribute","display","body","appendChild","click","removeChild","AddAssetDocument","UpdateAssetDocument","UploadInProgressDocument","saveAndDownloadScreenshotAsset","newAsset","blob","writeQuery","cadUploadState","screenshotInProgress","asset","addAsset","fetch","headers","method","mode","updatedAsset","uploadInProgress","saveScreenshotAsset","URL","createObjectURL","isDownload","shouldDownload","checkContext","canvas","contextName","getContext","getExtension","loseContext","getMaxWebGLSupported","testCanvas","getUnmaskedGPUName","debugInfo","renderer","getParameter","UNMASKED_RENDERER_WEBGL","browserWebglInfo","getBrowserWebglInfo","gpu","webgl","getCadEventHandler","appConfig","store","trackingModule","eventPayload","SetExternalStateData","TrackAnalyticsAction","usedShortcut","trackableProperties","used_shortcut","CadErrorOccurred","CadGeometryErrorOccurred","getLogData","DataDog","rum","getUser","stack","logRocketURL","LogRocket","sessionURL","geometryData","logs","logger","info","CadLoggedMessage","extraData","rightPanelPayload","rightPanelData","RelayInternalCadState","SaveScreenshotAsset","newOptions","getCamelCaseImageOptions","assetType","DownloadDxf","Dxf","dxf","uri","downloadDxf","BeforeDrawWalkway","DrawWalkway","TRIGGER_CAD_ACTION","patches","k","newKey","user","cad_config","cadVersion","host","location","v2_config","api_host","apiHost","app_name","buildEnvironment","APP_NAME","environment","ENVIRONMENT","git_branch","GIT_BRANCH","trim","git_hash","GIT_COMMIT_HASH","release","RELEASE_VERSION","unknownProjectIdCount","unknownDesignIdCount","useCad","isShown","geodataService","parcelBounds","providedProjectId","providedDesignId","designRequestId","createDataProvider","engineOptions","featureGate","asyncEngineInit","enableSave","config","authToken","cadLib","notifications","analytics","orgPermissions","Screenshot","featureFlags","cadContextValue","cadInitializerContextValue","fieldName","evict","gc","storeObject","identify","useEvictCache","effectInfo","effectCleanup","cadContainer","viewData","domElement","requestIdleCallback","createCadPreferences","events$","Subject","subscription","Notify","subscriber","dismissType","messageType","title","getChannel","subscribe","isEventOfType","cleanupDOMEventsEffect","preventDefault","addEventListener","passive","removeEventListener","performDOMEventsEffect","cleanupUnknownProjectDesignEffect","performUnknownProjectDesignEffect","dataProvider","apiEnvironment","eventEmitter","trigger","Factory","getEngineInstance","stateFramework","cloneInert","useToastMessage","locale","documentElement","lang","asyncInitEngineInstance","initEngineInstance","irradianceMapService","Services","IrradianceMapService","saveHandler","save","isCadLoadCancelled","cadState","engineScoped","getActiveEngineInstance","DesignClickedSave","bridge","cadReady","unsubscribe","CadLib","cleanupEngineInstance","cleanupCad","complete","stopEvents","stopEffectMapKey","stopEffectMap","stopEffectKey","stopCadStateEffects","LeadCaptureCadDocument","useLeadCaptureCad","hasOrbitMode","showCompass","loading","useLeadCaptureCadQuery","useMemo","lat","latitude","lng","longitude","getIrradiance","getTemplateJsonById","irradianceState","lidarAccessible","moduleSpacingSettings","rowSpacing","y","pricePerWatt","projectType","selectedImageryTypes","basic","timeZoneOffset","units","createLeadCaptureCadDataProvider","DrawReconstructedRoofPlanes","LoadSystemDesign","scenarios","isChromatic","ZoomAndOrbit","getLeadCaptureAsyncEngineInit","propsForUseCad","designJson","renderMode","saveFormat","stateMode","ReadOnly","useCompassPosition","LowerRightCorner","Invisible","useMapView","useSimplePointerControls","useSimpleTouchControls","useStreetView","viewSettings","azimuthArrows","edges","ground","irradianceMap","irradianceMapPanels","lidar","mapImagery","mapView","measurements","projectCenter","setbacks","shadows","sky","streetView","sunpath","ambientOcclusion","autoDesigner","autoRoof","balanceOfSystem","compassToLowerRight","csvMonthly","datamodelLibrary","editSiteModel","fillZone","fitTreesToLidar","focusOnSelection","saveDesignJsonSchemaVersion2","walkway","reactiveRootId","reactiveNameLookup","WeakMap","isReactive","WeakSet","reactiveLookup","inertSetLookup","reactiveArrayOverridesLookup","reactiveSetOverridesLookup","reactiveMapOverridesLookup","decoupleReactiveFromOriginal","reactive","wrapDecoupled","isReactiveObjectEqual","reactiveOrMobX","inertSet","createReactiveMapOverrides","mobxMap","initialIndex","getItemKey","searchedValue","reactiveName","stringKey","existingKey","existingValue","isValueStoredAtKeyEqual","makeDeepReactive","createReactive","inert","mobxObject","reactiveProxyHandler","seenObjects","currentPath","currentRootId","createDefaultReactiveName","mobxArray","searchElement","fromIndex","foundIndex","foundItem","lastIndexOf","reactiveItem","start","rest","newRestItems","fill","end","createReactiveArrayOverrides","mobxSet","createReactiveSetOverrides","reactiveKey","reactiveValue","mobxDescriptor","receiver","reactiveArrayOverrides","reactiveSetOverrides","reactiveMapOverrides","currentReactiveValue","deepAccessReactive","deepCloneReactiveToInert","seenObject","newObject","runEffect","generateUuid","useInterceptMouse","cadDomNode","clicked","setClicked","onMouse","capture","FileResultType","FileResultUploadStatus","SupportedMimeTypes","getFileResultType","GIF","JPEG","PNG","WEBP","HEIC","DXF","DWG","IMAGE","PDF","DOCUMENT","UNKNOWN","getFileSizeFormatted","fileSize","kbSize","mbSize","getRandomValues","rnds8","Uint8Array","rng","crypto","msCrypto","uuid","byteToHex","substr","offset","toLowerCase","buf","rnds","random"],"sourceRoot":""}