{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-nav_5.entry.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/cubic-bezier-2812fda3.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/framework-delegate-c2e2e1f4.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/index-4d91f03a.js"],"names":["ViewController","prototype","init","container","this","component","_a","_b","label","state","element","delegate","params","sent","_destroy","removeViewFromDom","parentElement","remove","nav","undefined","matches","view","id","currentParams","keysA","Object","keys","keysB","length","_i","keysA_1","key","convertToView","page","class_1","swipeGestureChanged","gesture","setDisabled","swipeGesture","rootChanged","root","useRouter","setRoot","rootParams","componentWillLoad","mode","document","querySelector","el","closest","getBoolean","ionNavWillLoad","emit","componentDidLoad","createSwipeBackGesture","canStart","bind","onStart","onMove","onEnd","componentDidUnload","views","destroy","transInstr","destroyed","push","componentProps","opts","done","queueTrns","insertStart","insertViews","insert","insertIndex","insertPages","insertComponents","pop","removeStart","removeCount","popTo","indexOrViewCtrl","tiConfig","removeView","popToRoot","removeIndex","startIndex","setPages","animated","setRouteId","direction","resolve","finish","commonOpts","viewController","_this","active","getActiveSync","Promise","changed","promise","r","updateURL","viewIsReady","enteringEl","mark","p","markVisible","find","v","assign","getRouteId","tagName","getActive","getByIndex","index","canGoBack","canGoBackSync","getPrevious","getPreviousSync","getLength","indexOf","ti","isTransitioning","skipIfBusy","reject","nextTrns","success","result","fireError","hasCompleted","requiresTransition","enteringView","leavingView","router","navChanged","failed","rejectReason","shift","runTransition","rejectReason_1","trys","ionNavWillChange","prepareTI","getEnteringView","Error","postViewInit","enteringRequiresTransition","leavingRequiresTransition","transition","ionNavDidChange","viewsLength","viewControllers","map","filter","viewControllers_1","removeEnd","i","destroyQueue","finalBalance","console","warn","insertViews_1","insertViewAt","destroyQueue_1","destroyQueue_2","destroyView","leavingEl","animationOpts","progressCallback","progressAnimation","ani","sbAni","showGoBack","baseEl","animationBuilder","animation","get","transitionFinish","cleanupView","cleanup","existingIndex","splice","activeView","activeViewIndex","animationEnabled","stepValue","progressStep","shouldComplete","dur","newStepValue","onFinish","oneTimeCallback","easing","progressEnd","render","defineProperty","enumerable","configurable","Nav","hostRef","navLink","routerDirection","NavLink","onClick","NavPop","NavPush","NavSetRoot","Point","x","y","getTimeGivenProgression","p0","p1","p2","p3","progression","tValues","solveCubicBezier","solveCubicParametricEquation","t","Math","pow","refPoint","solveCubicEquation","a","b","c","d","q","discriminant","sqrt","phi","acos","s","cos","PI","attachComponent","cssClasses","attachViewToDom","HTMLElement","ownerDocument","createElement","forEach","classList","add","appendChild","componentOnReady","detachComponent","beforeTransition","then","afterTransition","error","setZIndex","setPageHidden","getAnimationBuilder","noAnimation","duration","iosTransitionAnimation","mdTransitionAnimation","trans","didComplete","waitForReady","create","fireWillEvents","playTransition","fireDidEvents","defaultDeep","promises","deep","deepWait","deepReady","shallowReady","all","notifyViewReady","currentStep","progressStart","play","lifecycle","eventName","ev","CustomEvent","bubbles","cancelable","dispatchEvent","Array","from","children","hidden","setAttribute","removeAttribute","style","zIndex","getIonPageElement","contains"],"mappings":"+FAAA,gUAWIA,GAMAA,EAAeC,UAAUC,KAAO,SAAUC,GACtC,OAAO,YAAUC,KAAM,OAAQ,OAAQ,WACnC,IAAIC,EAAWC,EACf,OAAO,YAAYF,KAAM,SAAUG,GAC/B,OAAQA,EAAGC,OACP,KAAK,EAED,OADAJ,KAAKK,MAdH,EAeIL,KAAKM,SAAgB,CAAC,EAAa,IACzCL,EAAYD,KAAKC,UACjBC,EAAKF,KACE,CAAC,EAAa,YAAgBA,KAAKO,SAAUR,EAAWE,EAAW,CAAC,WAAY,sBAAuBD,KAAKQ,MAAM,IAC7H,KAAK,EACDN,EAAGI,QAAUH,EAAGM,KAAK,EACrBN,EAAGC,MAAQ,EACf,KAAK,EAAG,MAAO,CAAC,EACpB,CACJ,CAAC,CACL,CAAC,CACL,EAIAR,EAAeC,UAAUa,SAAW,WAChC,YA9BmB,IA8BZV,KAAKK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ACf,KAAK,EAAG,MAAO,CAAC,EACpB,CACJ,CAAC,CACL,CAAC,CAAG,EACAqP,EAAgB,SAAU7M,EAAI+O,GAC1BA,GACA/O,EAAGgP,aAAa,cAAe,MAAM,EACrChP,EAAGmM,UAAUC,IAAI,iBAAiB,IAGlCpM,EAAG+O,OAAS,GACZ/O,EAAGiP,gBAAgB,aAAa,EAChCjP,EAAGmM,UAAUlO,OAAO,iBAAiB,EAE7C,EACI2O,EAAY,SAAUrJ,EAAY+D,EAAW7E,GAC1BtE,SAAfoF,IACAA,EAAW2L,MAAMC,OAAwB,SAAd1M,EACrB,KACA,OAEQtE,SAAdmJ,IACAA,EAAU4H,MAAMC,OAAS,MAEjC,EACIC,EAAoB,SAAU1R,GAC9B,MAAIA,GAAQyO,UAAUkD,SAAS,UAAU,GAG3B3R,EAAQqC,cAAc,yDAAyD,GAKtFrC,CACX,C","file":"js/chunk-69b4d404.6e01d03c.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, c as getIonMode, h, e as getElement, H as Host } from './core-feeeff0d.js';\nimport { b as config } from './config-3c7f3790.js';\nimport { b as assert } from './helpers-46f4a262.js';\nimport { d as LIFECYCLE_WILL_UNLOAD, b as LIFECYCLE_WILL_LEAVE, c as LIFECYCLE_DID_LEAVE } from './constants-3c3e1099.js';\nimport { a as attachComponent } from './framework-delegate-c2e2e1f4.js';\nimport { l as lifecycle, t as transition, s as setPageHidden } from './index-4d91f03a.js';\nimport { g as getTimeGivenProgression, P as Point } from './cubic-bezier-2812fda3.js';\nvar VIEW_STATE_NEW = 1;\nvar VIEW_STATE_ATTACHED = 2;\nvar VIEW_STATE_DESTROYED = 3;\nvar ViewController = /** @class */ (function () {\n    function ViewController(component, params) {\n        this.component = component;\n        this.params = params;\n        this.state = VIEW_STATE_NEW;\n    }\n    ViewController.prototype.init = function (container) {\n        return __awaiter(this, void 0, void 0, function () {\n            var component, _a;\n            return __generator(this, function (_b) {\n                switch (_b.label) {\n                    case 0:\n                        this.state = VIEW_STATE_ATTACHED;\n                        if (!!this.element) return [3 /*break*/, 2];\n                        component = this.component;\n                        _a = this;\n                        return [4 /*yield*/, attachComponent(this.delegate, container, component, ['ion-page', 'ion-page-invisible'], this.params)];\n                    case 1:\n                        _a.element = _b.sent();\n                        _b.label = 2;\n                    case 2: return [2 /*return*/];\n                }\n            });\n        });\n    };\n    /**\n     * DOM WRITE\n     */\n    ViewController.prototype._destroy = function () {\n        assert(this.state !== VIEW_STATE_DESTROYED, 'view state must be ATTACHED');\n        var element = this.element;\n        if (element) {\n            if (this.delegate) {\n                this.delegate.removeViewFromDom(element.parentElement, element);\n            }\n            else {\n                element.remove();\n            }\n        }\n        this.nav = undefined;\n        this.state = VIEW_STATE_DESTROYED;\n    };\n    return ViewController;\n}());\nvar matches = function (view, id, params) {\n    if (!view) {\n        return false;\n    }\n    if (view.component !== id) {\n        return false;\n    }\n    var currentParams = view.params;\n    if (currentParams === params) {\n        return true;\n    }\n    if (!currentParams && !params) {\n        return true;\n    }\n    if (!currentParams || !params) {\n        return false;\n    }\n    var keysA = Object.keys(currentParams);\n    var keysB = Object.keys(params);\n    if (keysA.length !== keysB.length) {\n        return false;\n    }\n    // Test for A's keys different from B.\n    for (var _i = 0, keysA_1 = keysA; _i < keysA_1.length; _i++) {\n        var key = keysA_1[_i];\n        if (currentParams[key] !== params[key]) {\n            return false;\n        }\n    }\n    return true;\n};\nvar convertToView = function (page, params) {\n    if (!page) {\n        return null;\n    }\n    if (page instanceof ViewController) {\n        return page;\n    }\n    return new ViewController(page, params);\n};\nvar convertToViews = function (pages) {\n    return pages.map(function (page) {\n        if (page instanceof ViewController) {\n            return page;\n        }\n        if ('page' in page) {\n            return convertToView(page.page, page.params);\n        }\n        return convertToView(page, undefined);\n    }).filter(function (v) { return v !== null; });\n};\nvar Nav = /** @class */ (function () {\n    function class_1(hostRef) {\n        registerInstance(this, hostRef);\n        this.transInstr = [];\n        this.animationEnabled = true;\n        this.useRouter = false;\n        this.isTransitioning = false;\n        this.destroyed = false;\n        this.views = [];\n        /**\n         * If `true`, the nav should animate the transition of components.\n         */\n        this.animated = true;\n        this.ionNavWillLoad = createEvent(this, \"ionNavWillLoad\", 7);\n        this.ionNavWillChange = createEvent(this, \"ionNavWillChange\", 3);\n        this.ionNavDidChange = createEvent(this, \"ionNavDidChange\", 3);\n    }\n    class_1.prototype.swipeGestureChanged = function () {\n        if (this.gesture) {\n            this.gesture.setDisabled(this.swipeGesture !== true);\n        }\n    };\n    class_1.prototype.rootChanged = function () {\n        if (this.root !== undefined) {\n            if (!this.useRouter) {\n                this.setRoot(this.root, this.rootParams);\n            }\n        }\n    };\n    class_1.prototype.componentWillLoad = function () {\n        this.useRouter =\n            !!document.querySelector('ion-router') &&\n                !this.el.closest('[no-router]');\n        if (this.swipeGesture === undefined) {\n            var mode = getIonMode(this);\n            this.swipeGesture = config.getBoolean('swipeBackEnabled', mode === 'ios');\n        }\n        this.ionNavWillLoad.emit();\n    };\n    class_1.prototype.componentDidLoad = function () {\n        return __awaiter(this, void 0, void 0, function () {\n            var _a;\n            return __generator(this, function (_b) {\n                switch (_b.label) {\n                    case 0:\n                        this.rootChanged();\n                        _a = this;\n                        return [4 /*yield*/, import('./swipe-back-35ad8e37.js')];\n                    case 1:\n                        _a.gesture = (_b.sent()).createSwipeBackGesture(this.el, this.canStart.bind(this), this.onStart.bind(this), this.onMove.bind(this), this.onEnd.bind(this));\n                        this.swipeGestureChanged();\n                        return [2 /*return*/];\n                }\n            });\n        });\n    };\n    class_1.prototype.componentDidUnload = function () {\n        for (var _i = 0, _a = this.views; _i < _a.length; _i++) {\n            var view = _a[_i];\n            lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);\n            view._destroy();\n        }\n        if (this.gesture) {\n            this.gesture.destroy();\n            this.gesture = undefined;\n        }\n        // release swipe back gesture and transition\n        this.transInstr.length = this.views.length = 0;\n        this.destroyed = true;\n    };\n    /**\n     * Push a new component onto the current navigation stack. Pass any additional\n     * information along as an object. This additional information is accessible\n     * through NavParams.\n     *\n     * @param component The component to push onto the navigation stack.\n     * @param componentProps Any properties of the component.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.push = function (component, componentProps, opts, done) {\n        return this.queueTrns({\n            insertStart: -1,\n            insertViews: [{ page: component, params: componentProps }],\n            opts: opts\n        }, done);\n    };\n    /**\n     * Inserts a component into the navigation stack at the specified index.\n     * This is useful to add a component at any point in the navigation stack.\n     *\n     * @param insertIndex The index to insert the component at in the stack.\n     * @param component The component to insert into the navigation stack.\n     * @param componentProps Any properties of the component.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.insert = function (insertIndex, component, componentProps, opts, done) {\n        return this.queueTrns({\n            insertStart: insertIndex,\n            insertViews: [{ page: component, params: componentProps }],\n            opts: opts\n        }, done);\n    };\n    /**\n     * Inserts an array of components into the navigation stack at the specified index.\n     * The last component in the array will become instantiated as a view, and animate\n     * in to become the active view.\n     *\n     * @param insertIndex The index to insert the components at in the stack.\n     * @param insertComponents The components to insert into the navigation stack.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.insertPages = function (insertIndex, insertComponents, opts, done) {\n        return this.queueTrns({\n            insertStart: insertIndex,\n            insertViews: insertComponents,\n            opts: opts\n        }, done);\n    };\n    /**\n     * Pop a component off of the navigation stack. Navigates back from the current\n     * component.\n     *\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.pop = function (opts, done) {\n        return this.queueTrns({\n            removeStart: -1,\n            removeCount: 1,\n            opts: opts\n        }, done);\n    };\n    /**\n     * Pop to a specific index in the navigation stack.\n     *\n     * @param indexOrViewCtrl The index or view controller to pop to.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.popTo = function (indexOrViewCtrl, opts, done) {\n        var tiConfig = {\n            removeStart: -1,\n            removeCount: -1,\n            opts: opts\n        };\n        if (typeof indexOrViewCtrl === 'object' && indexOrViewCtrl.component) {\n            tiConfig.removeView = indexOrViewCtrl;\n            tiConfig.removeStart = 1;\n        }\n        else if (typeof indexOrViewCtrl === 'number') {\n            tiConfig.removeStart = indexOrViewCtrl + 1;\n        }\n        return this.queueTrns(tiConfig, done);\n    };\n    /**\n     * Navigate back to the root of the stack, no matter how far back that is.\n     *\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.popToRoot = function (opts, done) {\n        return this.queueTrns({\n            removeStart: 1,\n            removeCount: -1,\n            opts: opts\n        }, done);\n    };\n    /**\n     * Removes a component from the navigation stack at the specified index.\n     *\n     * @param startIndex The number to begin removal at.\n     * @param removeCount The number of components to remove.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.removeIndex = function (startIndex, removeCount, opts, done) {\n        if (removeCount === void 0) { removeCount = 1; }\n        return this.queueTrns({\n            removeStart: startIndex,\n            removeCount: removeCount,\n            opts: opts\n        }, done);\n    };\n    /**\n     * Set the root for the current navigation stack to a component.\n     *\n     * @param component The component to set as the root of the navigation stack.\n     * @param componentProps Any properties of the component.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.setRoot = function (component, componentProps, opts, done) {\n        return this.setPages([{ page: component, params: componentProps }], opts, done);\n    };\n    /**\n     * Set the views of the current navigation stack and navigate to the last view.\n     * By default animations are disabled, but they can be enabled by passing options\n     * to the navigation controller. Navigation parameters can also be passed to the\n     * individual pages in the array.\n     *\n     * @param views The list of views to set as the navigation stack.\n     * @param opts The navigation options.\n     * @param done The transition complete function.\n     */\n    class_1.prototype.setPages = function (views, opts, done) {\n        if (opts == null) {\n            opts = {};\n        }\n        // if animation wasn't set to true then default it to NOT animate\n        if (opts.animated !== true) {\n            opts.animated = false;\n        }\n        return this.queueTrns({\n            insertStart: 0,\n            insertViews: views,\n            removeStart: 0,\n            removeCount: -1,\n            opts: opts\n        }, done);\n    };\n    /** @internal */\n    class_1.prototype.setRouteId = function (id, params, direction) {\n        var _this = this;\n        var active = this.getActiveSync();\n        if (matches(active, id, params)) {\n            return Promise.resolve({\n                changed: false,\n                element: active.element\n            });\n        }\n        var resolve;\n        var promise = new Promise(function (r) { return (resolve = r); });\n        var finish;\n        var commonOpts = {\n            updateURL: false,\n            viewIsReady: function (enteringEl) {\n                var mark;\n                var p = new Promise(function (r) { return (mark = r); });\n                resolve({\n                    changed: true,\n                    element: enteringEl,\n                    markVisible: function () { return __awaiter(_this, void 0, void 0, function () {\n                        return __generator(this, function (_a) {\n                            switch (_a.label) {\n                                case 0:\n                                    mark();\n                                    return [4 /*yield*/, finish];\n                                case 1:\n                                    _a.sent();\n                                    return [2 /*return*/];\n                            }\n                        });\n                    }); }\n                });\n                return p;\n            }\n        };\n        if (direction === 'root') {\n            finish = this.setRoot(id, params, commonOpts);\n        }\n        else {\n            var viewController = this.views.find(function (v) { return matches(v, id, params); });\n            if (viewController) {\n                finish = this.popTo(viewController, Object.assign(Object.assign({}, commonOpts), { direction: 'back' }));\n            }\n            else if (direction === 'forward') {\n                finish = this.push(id, params, commonOpts);\n            }\n            else if (direction === 'back') {\n                finish = this.setRoot(id, params, Object.assign(Object.assign({}, commonOpts), { direction: 'back', animated: true }));\n            }\n        }\n        return promise;\n    };\n    /** @internal */\n    class_1.prototype.getRouteId = function () {\n        return __awaiter(this, void 0, void 0, function () {\n            var active;\n            return __generator(this, function (_a) {\n                active = this.getActiveSync();\n                return [2 /*return*/, active\n                        ? {\n                            id: active.element.tagName,\n                            params: active.params,\n                            element: active.element\n                        }\n                        : undefined];\n            });\n        });\n    };\n    /**\n     * Get the active view.\n     */\n    class_1.prototype.getActive = function () {\n        return Promise.resolve(this.getActiveSync());\n    };\n    /**\n     * Get the view at the specified index.\n     *\n     * @param index The index of the view.\n     */\n    class_1.prototype.getByIndex = function (index) {\n        return Promise.resolve(this.views[index]);\n    };\n    /**\n     * Returns `true` if the current view can go back.\n     *\n     * @param view The view to check.\n     */\n    class_1.prototype.canGoBack = function (view) {\n        return Promise.resolve(this.canGoBackSync(view));\n    };\n    /**\n     * Get the previous view.\n     *\n     * @param view The view to get.\n     */\n    class_1.prototype.getPrevious = function (view) {\n        return Promise.resolve(this.getPreviousSync(view));\n    };\n    class_1.prototype.getLength = function () {\n        return this.views.length;\n    };\n    class_1.prototype.getActiveSync = function () {\n        return this.views[this.views.length - 1];\n    };\n    class_1.prototype.canGoBackSync = function (view) {\n        if (view === void 0) { view = this.getActiveSync(); }\n        return !!(view && this.getPreviousSync(view));\n    };\n    class_1.prototype.getPreviousSync = function (view) {\n        if (view === void 0) { view = this.getActiveSync(); }\n        if (!view) {\n            return undefined;\n        }\n        var views = this.views;\n        var index = views.indexOf(view);\n        return index > 0 ? views[index - 1] : undefined;\n    };\n    // _queueTrns() adds a navigation stack change to the queue and schedules it to run:\n    // 1. _nextTrns(): consumes the next transition in the queue\n    // 2. _viewInit(): initializes enteringView if required\n    // 3. _viewTest(): ensures canLeave/canEnter Returns `true`, so the operation can continue\n    // 4. _postViewInit(): add/remove the views from the navigation stack\n    // 5. _transitionInit(): initializes the visual transition if required and schedules it to run\n    // 6. _viewAttachToDOM(): attaches the enteringView to the DOM\n    // 7. _transitionStart(): called once the transition actually starts, it initializes the Animation underneath.\n    // 8. _transitionFinish(): called once the transition finishes\n    // 9. _cleanup(): syncs the navigation internal state with the DOM. For example it removes the pages from the DOM or hides/show them.\n    class_1.prototype.queueTrns = function (ti, done) {\n        if (this.isTransitioning && ti.opts != null && ti.opts.skipIfBusy) {\n            return Promise.resolve(false);\n        }\n        var promise = new Promise(function (resolve, reject) {\n            ti.resolve = resolve;\n            ti.reject = reject;\n        });\n        ti.done = done;\n        // Normalize empty\n        if (ti.insertViews && ti.insertViews.length === 0) {\n            ti.insertViews = undefined;\n        }\n        // Enqueue transition instruction\n        this.transInstr.push(ti);\n        // if there isn't a transition already happening\n        // then this will kick off this transition\n        this.nextTrns();\n        return promise;\n    };\n    class_1.prototype.success = function (result, ti) {\n        if (this.destroyed) {\n            this.fireError('nav controller was destroyed', ti);\n            return;\n        }\n        if (ti.done) {\n            ti.done(result.hasCompleted, result.requiresTransition, result.enteringView, result.leavingView, result.direction);\n        }\n        ti.resolve(result.hasCompleted);\n        if (ti.opts.updateURL !== false && this.useRouter) {\n            var router = document.querySelector('ion-router');\n            if (router) {\n                var direction = result.direction === 'back' ? 'back' : 'forward';\n                router.navChanged(direction);\n            }\n        }\n    };\n    class_1.prototype.failed = function (rejectReason, ti) {\n        if (this.destroyed) {\n            this.fireError('nav controller was destroyed', ti);\n            return;\n        }\n        this.transInstr.length = 0;\n        this.fireError(rejectReason, ti);\n    };\n    class_1.prototype.fireError = function (rejectReason, ti) {\n        if (ti.done) {\n            ti.done(false, false, rejectReason);\n        }\n        if (ti.reject && !this.destroyed) {\n            ti.reject(rejectReason);\n        }\n        else {\n            ti.resolve(false);\n        }\n    };\n    class_1.prototype.nextTrns = function () {\n        // this is the framework's bread 'n butta function\n        // only one transition is allowed at any given time\n        if (this.isTransitioning) {\n            return false;\n        }\n        // there is no transition happening right now\n        // get the next instruction\n        var ti = this.transInstr.shift();\n        if (!ti) {\n            return false;\n        }\n        this.runTransition(ti);\n        return true;\n    };\n    class_1.prototype.runTransition = function (ti) {\n        return __awaiter(this, void 0, void 0, function () {\n            var leavingView, enteringView, requiresTransition, result, _a, rejectReason_1;\n            return __generator(this, function (_b) {\n                switch (_b.label) {\n                    case 0:\n                        _b.trys.push([0, 6, , 7]);\n                        // set that this nav is actively transitioning\n                        this.ionNavWillChange.emit();\n                        this.isTransitioning = true;\n                        this.prepareTI(ti);\n                        leavingView = this.getActiveSync();\n                        enteringView = this.getEnteringView(ti, leavingView);\n                        if (!leavingView && !enteringView) {\n                            throw new Error('no views in the stack to be removed');\n                        }\n                        if (!(enteringView && enteringView.state === VIEW_STATE_NEW)) return [3 /*break*/, 2];\n                        return [4 /*yield*/, enteringView.init(this.el)];\n                    case 1:\n                        _b.sent();\n                        _b.label = 2;\n                    case 2:\n                        this.postViewInit(enteringView, leavingView, ti);\n                        requiresTransition = (ti.enteringRequiresTransition || ti.leavingRequiresTransition) &&\n                            enteringView !== leavingView;\n                        if (!requiresTransition) return [3 /*break*/, 4];\n                        return [4 /*yield*/, this.transition(enteringView, leavingView, ti)];\n                    case 3:\n                        _a = _b.sent();\n                        return [3 /*break*/, 5];\n                    case 4:\n                        _a = {\n                            // transition is not required, so we are already done!\n                            // they're inserting/removing the views somewhere in the middle or\n                            // beginning, so visually nothing needs to animate/transition\n                            // resolve immediately because there's no animation that's happening\n                            hasCompleted: true,\n                            requiresTransition: false\n                        };\n                        _b.label = 5;\n                    case 5:\n                        result = _a;\n                        this.success(result, ti);\n                        this.ionNavDidChange.emit();\n                        return [3 /*break*/, 7];\n                    case 6:\n                        rejectReason_1 = _b.sent();\n                        this.failed(rejectReason_1, ti);\n                        return [3 /*break*/, 7];\n                    case 7:\n                        this.isTransitioning = false;\n                        this.nextTrns();\n                        return [2 /*return*/];\n                }\n            });\n        });\n    };\n    class_1.prototype.prepareTI = function (ti) {\n        var viewsLength = this.views.length;\n        ti.opts = ti.opts || {};\n        if (ti.opts.delegate === undefined) {\n            ti.opts.delegate = this.delegate;\n        }\n        if (ti.removeView !== undefined) {\n            assert(ti.removeStart !== undefined, 'removeView needs removeStart');\n            assert(ti.removeCount !== undefined, 'removeView needs removeCount');\n            var index = this.views.indexOf(ti.removeView);\n            if (index < 0) {\n                throw new Error('removeView was not found');\n            }\n            ti.removeStart += index;\n        }\n        if (ti.removeStart !== undefined) {\n            if (ti.removeStart < 0) {\n                ti.removeStart = viewsLength - 1;\n            }\n            if (ti.removeCount < 0) {\n                ti.removeCount = viewsLength - ti.removeStart;\n            }\n            ti.leavingRequiresTransition =\n                ti.removeCount > 0 && ti.removeStart + ti.removeCount === viewsLength;\n        }\n        if (ti.insertViews) {\n            // allow -1 to be passed in to auto push it on the end\n            // and clean up the index if it's larger then the size of the stack\n            if (ti.insertStart < 0 || ti.insertStart > viewsLength) {\n                ti.insertStart = viewsLength;\n            }\n            ti.enteringRequiresTransition = ti.insertStart === viewsLength;\n        }\n        var insertViews = ti.insertViews;\n        if (!insertViews) {\n            return;\n        }\n        assert(insertViews.length > 0, 'length can not be zero');\n        var viewControllers = convertToViews(insertViews);\n        if (viewControllers.length === 0) {\n            throw new Error('invalid views to insert');\n        }\n        // Check all the inserted view are correct\n        for (var _i = 0, viewControllers_1 = viewControllers; _i < viewControllers_1.length; _i++) {\n            var view = viewControllers_1[_i];\n            view.delegate = ti.opts.delegate;\n            var nav = view.nav;\n            if (nav && nav !== this) {\n                throw new Error('inserted view was already inserted');\n            }\n            if (view.state === VIEW_STATE_DESTROYED) {\n                throw new Error('inserted view was already destroyed');\n            }\n        }\n        ti.insertViews = viewControllers;\n    };\n    class_1.prototype.getEnteringView = function (ti, leavingView) {\n        var insertViews = ti.insertViews;\n        if (insertViews !== undefined) {\n            // grab the very last view of the views to be inserted\n            // and initialize it as the new entering view\n            return insertViews[insertViews.length - 1];\n        }\n        var removeStart = ti.removeStart;\n        if (removeStart !== undefined) {\n            var views = this.views;\n            var removeEnd = removeStart + ti.removeCount;\n            for (var i = views.length - 1; i >= 0; i--) {\n                var view = views[i];\n                if ((i < removeStart || i >= removeEnd) && view !== leavingView) {\n                    return view;\n                }\n            }\n        }\n        return undefined;\n    };\n    class_1.prototype.postViewInit = function (enteringView, leavingView, ti) {\n        assert(leavingView || enteringView, 'Both leavingView and enteringView are null');\n        assert(ti.resolve, 'resolve must be valid');\n        assert(ti.reject, 'reject must be valid');\n        var opts = ti.opts;\n        var insertViews = ti.insertViews;\n        var removeStart = ti.removeStart;\n        var removeCount = ti.removeCount;\n        var destroyQueue;\n        // there are views to remove\n        if (removeStart !== undefined && removeCount !== undefined) {\n            assert(removeStart >= 0, 'removeStart can not be negative');\n            assert(removeCount >= 0, 'removeCount can not be negative');\n            destroyQueue = [];\n            for (var i = 0; i < removeCount; i++) {\n                var view = this.views[i + removeStart];\n                if (view && view !== enteringView && view !== leavingView) {\n                    destroyQueue.push(view);\n                }\n            }\n            // default the direction to \"back\"\n            opts.direction = opts.direction || 'back';\n        }\n        var finalBalance = this.views.length +\n            (insertViews !== undefined ? insertViews.length : 0) -\n            (removeCount !== undefined ? removeCount : 0);\n        assert(finalBalance >= 0, 'final balance can not be negative');\n        if (finalBalance === 0) {\n            console.warn(\"You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.\", this, this.el);\n            throw new Error('navigation stack needs at least one root page');\n        }\n        // At this point the transition can not be rejected, any throw should be an error\n        // there are views to insert\n        if (insertViews) {\n            // add the views to the\n            var insertIndex = ti.insertStart;\n            for (var _i = 0, insertViews_1 = insertViews; _i < insertViews_1.length; _i++) {\n                var view = insertViews_1[_i];\n                this.insertViewAt(view, insertIndex);\n                insertIndex++;\n            }\n            if (ti.enteringRequiresTransition) {\n                // default to forward if not already set\n                opts.direction = opts.direction || 'forward';\n            }\n        }\n        // if the views to be removed are in the beginning or middle\n        // and there is not a view that needs to visually transition out\n        // then just destroy them and don't transition anything\n        // batch all of lifecycles together\n        // let's make sure, callbacks are zoned\n        if (destroyQueue && destroyQueue.length > 0) {\n            for (var _a = 0, destroyQueue_1 = destroyQueue; _a < destroyQueue_1.length; _a++) {\n                var view = destroyQueue_1[_a];\n                lifecycle(view.element, LIFECYCLE_WILL_LEAVE);\n                lifecycle(view.element, LIFECYCLE_DID_LEAVE);\n                lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);\n            }\n            // once all lifecycle events has been delivered, we can safely detroy the views\n            for (var _b = 0, destroyQueue_2 = destroyQueue; _b < destroyQueue_2.length; _b++) {\n                var view = destroyQueue_2[_b];\n                this.destroyView(view);\n            }\n        }\n    };\n    class_1.prototype.transition = function (enteringView, leavingView, ti) {\n        return __awaiter(this, void 0, void 0, function () {\n            var opts, progressCallback, mode, enteringEl, leavingEl, animationOpts, hasCompleted;\n            var _this = this;\n            return __generator(this, function (_a) {\n                switch (_a.label) {\n                    case 0:\n                        opts = ti.opts;\n                        progressCallback = opts.progressAnimation\n                            ? function (ani) { return _this.sbAni = ani; }\n                            : undefined;\n                        mode = getIonMode(this);\n                        enteringEl = enteringView.element;\n                        leavingEl = leavingView && leavingView.element;\n                        animationOpts = Object.assign({ mode: mode, showGoBack: this.canGoBackSync(enteringView), baseEl: this.el, animationBuilder: this.animation || opts.animationBuilder || config.get('navAnimation'), progressCallback: progressCallback, animated: this.animated && config.getBoolean('animated', true), enteringEl: enteringEl,\n                            leavingEl: leavingEl }, opts);\n                        return [4 /*yield*/, transition(animationOpts)];\n                    case 1:\n                        hasCompleted = (_a.sent()).hasCompleted;\n                        return [2 /*return*/, this.transitionFinish(hasCompleted, enteringView, leavingView, opts)];\n                }\n            });\n        });\n    };\n    class_1.prototype.transitionFinish = function (hasCompleted, enteringView, leavingView, opts) {\n        var cleanupView = hasCompleted ? enteringView : leavingView;\n        if (cleanupView) {\n            this.cleanup(cleanupView);\n        }\n        return {\n            hasCompleted: hasCompleted,\n            requiresTransition: true,\n            enteringView: enteringView,\n            leavingView: leavingView,\n            direction: opts.direction\n        };\n    };\n    class_1.prototype.insertViewAt = function (view, index) {\n        var views = this.views;\n        var existingIndex = views.indexOf(view);\n        if (existingIndex > -1) {\n            // this view is already in the stack!!\n            // move it to its new location\n            assert(view.nav === this, 'view is not part of the nav');\n            views.splice(index, 0, views.splice(existingIndex, 1)[0]);\n        }\n        else {\n            assert(!view.nav, 'nav is used');\n            // this is a new view to add to the stack\n            // create the new entering view\n            view.nav = this;\n            // insert the entering view into the correct index in the stack\n            views.splice(index, 0, view);\n        }\n    };\n    class_1.prototype.removeView = function (view) {\n        assert(view.state === VIEW_STATE_ATTACHED || view.state === VIEW_STATE_DESTROYED, 'view state should be loaded or destroyed');\n        var views = this.views;\n        var index = views.indexOf(view);\n        assert(index > -1, 'view must be part of the stack');\n        if (index >= 0) {\n            views.splice(index, 1);\n        }\n    };\n    class_1.prototype.destroyView = function (view) {\n        view._destroy();\n        this.removeView(view);\n    };\n    /**\n     * DOM WRITE\n     */\n    class_1.prototype.cleanup = function (activeView) {\n        // ok, cleanup time!! Destroy all of the views that are\n        // INACTIVE and come after the active view\n        // only do this if the views exist, though\n        if (this.destroyed) {\n            return;\n        }\n        var views = this.views;\n        var activeViewIndex = views.indexOf(activeView);\n        for (var i = views.length - 1; i >= 0; i--) {\n            var view = views[i];\n            var element = view.element;\n            if (i > activeViewIndex) {\n                // this view comes after the active view\n                // let's unload it\n                lifecycle(element, LIFECYCLE_WILL_UNLOAD);\n                this.destroyView(view);\n            }\n            else if (i < activeViewIndex) {\n                // this view comes before the active view\n                // and it is not a portal then ensure it is hidden\n                setPageHidden(element, true);\n            }\n        }\n    };\n    class_1.prototype.canStart = function () {\n        return (!!this.swipeGesture &&\n            !this.isTransitioning &&\n            this.transInstr.length === 0 &&\n            this.animationEnabled &&\n            this.canGoBackSync());\n    };\n    class_1.prototype.onStart = function () {\n        this.queueTrns({\n            removeStart: -1,\n            removeCount: 1,\n            opts: {\n                direction: 'back',\n                progressAnimation: true\n            }\n        }, undefined);\n    };\n    class_1.prototype.onMove = function (stepValue) {\n        if (this.sbAni) {\n            this.sbAni.progressStep(stepValue);\n        }\n    };\n    class_1.prototype.onEnd = function (shouldComplete, stepValue, dur) {\n        var _this = this;\n        if (this.sbAni) {\n            this.animationEnabled = false;\n            this.sbAni.onFinish(function () {\n                _this.animationEnabled = true;\n            }, { oneTimeCallback: true });\n            // Account for rounding errors in JS\n            var newStepValue = (shouldComplete) ? -0.001 : 0.001;\n            /**\n             * Animation will be reversed here, so need to\n             * reverse the easing curve as well\n             *\n             * Additionally, we need to account for the time relative\n             * to the new easing curve, as `stepValue` is going to be given\n             * in terms of a linear curve.\n             */\n            if (!shouldComplete) {\n                this.sbAni.easing('cubic-bezier(1, 0, 0.68, 0.28)');\n                newStepValue += getTimeGivenProgression(new Point(0, 0), new Point(1, 0), new Point(0.68, 0.28), new Point(1, 1), stepValue);\n            }\n            else {\n                newStepValue += getTimeGivenProgression(new Point(0, 0), new Point(0.32, 0.72), new Point(0, 1), new Point(1, 1), stepValue);\n            }\n            this.sbAni.progressEnd(shouldComplete ? 1 : 0, newStepValue, dur);\n        }\n    };\n    class_1.prototype.render = function () {\n        return (h(\"slot\", null));\n    };\n    Object.defineProperty(class_1.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(class_1, \"watchers\", {\n        get: function () {\n            return {\n                \"swipeGesture\": [\"swipeGestureChanged\"],\n                \"root\": [\"rootChanged\"]\n            };\n        },\n        enumerable: true,\n        configurable: true\n    });\n    Object.defineProperty(class_1, \"style\", {\n        get: function () { return \":host{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}\"; },\n        enumerable: true,\n        configurable: true\n    });\n    return class_1;\n}());\nvar navLink = function (el, routerDirection, component, componentProps) {\n    var nav = el.closest('ion-nav');\n    if (nav) {\n        if (routerDirection === 'forward') {\n            if (component !== undefined) {\n                return nav.push(component, componentProps, { skipIfBusy: true });\n            }\n        }\n        else if (routerDirection === 'root') {\n            if (component !== undefined) {\n                return nav.setRoot(component, componentProps, { skipIfBusy: true });\n            }\n        }\n        else if (routerDirection === 'back') {\n            return nav.pop({ skipIfBusy: true });\n        }\n    }\n    return Promise.resolve(false);\n};\nvar NavLink = /** @class */ (function () {\n    function NavLink(hostRef) {\n        var _this = this;\n        registerInstance(this, hostRef);\n        /**\n         * The transition direction when navigating to another page.\n         */\n        this.routerDirection = 'forward';\n        this.onClick = function () {\n            return navLink(_this.el, _this.routerDirection, _this.component, _this.componentProps);\n        };\n    }\n    NavLink.prototype.render = function () {\n        return (h(Host, { onClick: this.onClick }));\n    };\n    Object.defineProperty(NavLink.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: true,\n        configurable: true\n    });\n    return NavLink;\n}());\nvar NavPop = /** @class */ (function () {\n    function NavPop(hostRef) {\n        var _this = this;\n        registerInstance(this, hostRef);\n        this.pop = function () {\n            return navLink(_this.el, 'back');\n        };\n    }\n    NavPop.prototype.componentDidLoad = function () {\n        console.warn('[DEPRECATED][ion-nav-pop] <ion-nav-pop> is deprecated. Use `<ion-nav-link routerDirection=\"back\">` instead.');\n    };\n    NavPop.prototype.render = function () {\n        return (h(Host, { onClick: this.pop }));\n    };\n    Object.defineProperty(NavPop.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: true,\n        configurable: true\n    });\n    return NavPop;\n}());\nvar NavPush = /** @class */ (function () {\n    function NavPush(hostRef) {\n        var _this = this;\n        registerInstance(this, hostRef);\n        this.push = function () {\n            return navLink(_this.el, 'forward', _this.component, _this.componentProps);\n        };\n    }\n    NavPush.prototype.componentDidLoad = function () {\n        console.warn('[DEPRECATED][ion-nav-push] `<ion-nav-push component=\"MyComponent\">` is deprecated. Use `<ion-nav-link component=\"MyComponent\">` instead.');\n    };\n    NavPush.prototype.render = function () {\n        return (h(Host, { onClick: this.push }));\n    };\n    Object.defineProperty(NavPush.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: true,\n        configurable: true\n    });\n    return NavPush;\n}());\nvar NavSetRoot = /** @class */ (function () {\n    function NavSetRoot(hostRef) {\n        var _this = this;\n        registerInstance(this, hostRef);\n        this.setRoot = function () {\n            return navLink(_this.el, 'root', _this.component, _this.componentProps);\n        };\n    }\n    NavSetRoot.prototype.componentDidLoad = function () {\n        console.warn('[DEPRECATED][ion-nav-set-root] `<ion-nav-set-root component=\"MyComponent\">` is deprecated. Use `<ion-nav-link component=\"MyComponent\" routerDirection=\"root\">` instead.');\n    };\n    NavSetRoot.prototype.render = function () {\n        return (h(Host, { onClick: this.setRoot }));\n    };\n    Object.defineProperty(NavSetRoot.prototype, \"el\", {\n        get: function () { return getElement(this); },\n        enumerable: true,\n        configurable: true\n    });\n    return NavSetRoot;\n}());\nexport { Nav as ion_nav, NavLink as ion_nav_link, NavPop as ion_nav_pop, NavPush as ion_nav_push, NavSetRoot as ion_nav_set_root };\n","/**\n * Based on:\n * https://stackoverflow.com/questions/7348009/y-coordinate-for-a-given-x-cubic-bezier\n * https://math.stackexchange.com/questions/26846/is-there-an-explicit-form-for-cubic-b%C3%A9zier-curves\n * TODO: Reduce rounding error\n */\nvar Point = /** @class */ (function () {\n    function Point(x, y) {\n        this.x = x;\n        this.y = y;\n    }\n    return Point;\n}());\n/**\n * Given a cubic-bezier curve, get the x value (time) given\n * the y value (progression).\n * Ex: cubic-bezier(0.32, 0.72, 0, 1);\n * P0: (0, 0)\n * P1: (0.32, 0.72)\n * P2: (0, 1)\n * P3: (1, 1)\n *\n * If you give a cubic bezier curve that never reaches the\n * provided progression, this function will return NaN.\n */\nvar getTimeGivenProgression = function (p0, p1, p2, p3, progression) {\n    var tValues = solveCubicBezier(p0.y, p1.y, p2.y, p3.y, progression);\n    return solveCubicParametricEquation(p0.x, p1.x, p2.x, p3.x, tValues[0]); // TODO: Add better strategy for dealing with multiple solutions\n};\n/**\n * Solve a cubic equation in one dimension (time)\n */\nvar solveCubicParametricEquation = function (p0, p1, p2, p3, t) {\n    var partA = (3 * p1) * Math.pow(t - 1, 2);\n    var partB = (-3 * p2 * t) + (3 * p2) + (p3 * t);\n    var partC = p0 * Math.pow(t - 1, 3);\n    return t * (partA + (t * partB)) - partC;\n};\n/**\n * Find the `t` value for a cubic bezier using Cardano's formula\n */\nvar solveCubicBezier = function (p0, p1, p2, p3, refPoint) {\n    p0 -= refPoint;\n    p1 -= refPoint;\n    p2 -= refPoint;\n    p3 -= refPoint;\n    var roots = solveCubicEquation(p3 - 3 * p2 + 3 * p1 - p0, 3 * p2 - 6 * p1 + 3 * p0, 3 * p1 - 3 * p0, p0);\n    return roots.filter(function (root) { return root >= 0 && root <= 1; });\n};\nvar solveQuadraticEquation = function (a, b, c) {\n    var discriminant = b * b - 4 * a * c;\n    if (discriminant < 0) {\n        return [];\n    }\n    else {\n        return [\n            (-b + Math.sqrt(discriminant)) / (2 * a),\n            (-b - Math.sqrt(discriminant)) / (2 * a)\n        ];\n    }\n};\nvar solveCubicEquation = function (a, b, c, d) {\n    if (a === 0) {\n        return solveQuadraticEquation(b, c, d);\n    }\n    b /= a;\n    c /= a;\n    d /= a;\n    var p = (3 * c - b * b) / 3;\n    var q = (2 * b * b * b - 9 * b * c + 27 * d) / 27;\n    if (p === 0) {\n        return [Math.pow(-q, 1 / 3)];\n    }\n    else if (q === 0) {\n        return [Math.sqrt(-p), -Math.sqrt(-p)];\n    }\n    var discriminant = Math.pow(q / 2, 2) + Math.pow(p / 3, 3);\n    if (discriminant === 0) {\n        return [Math.pow(q / 2, 1 / 2) - b / 3];\n    }\n    else if (discriminant > 0) {\n        return [Math.pow(-(q / 2) + Math.sqrt(discriminant), 1 / 3) - Math.pow((q / 2) + Math.sqrt(discriminant), 1 / 3) - b / 3];\n    }\n    var r = Math.sqrt(Math.pow(-(p / 3), 3));\n    var phi = Math.acos(-(q / (2 * Math.sqrt(Math.pow(-(p / 3), 3)))));\n    var s = 2 * Math.pow(r, 1 / 3);\n    return [\n        s * Math.cos(phi / 3) - b / 3,\n        s * Math.cos((phi + 2 * Math.PI) / 3) - b / 3,\n        s * Math.cos((phi + 4 * Math.PI) / 3) - b / 3\n    ];\n};\nexport { Point as P, getTimeGivenProgression as g };\n","import { __awaiter, __generator } from \"tslib\";\nvar attachComponent = function (delegate, container, component, cssClasses, componentProps) { return __awaiter(void 0, void 0, void 0, function () {\n    var el;\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0:\n                if (delegate) {\n                    return [2 /*return*/, delegate.attachViewToDom(container, component, componentProps, cssClasses)];\n                }\n                if (typeof component !== 'string' && !(component instanceof HTMLElement)) {\n                    throw new Error('framework delegate is missing');\n                }\n                el = (typeof component === 'string')\n                    ? container.ownerDocument && container.ownerDocument.createElement(component)\n                    : component;\n                if (cssClasses) {\n                    cssClasses.forEach(function (c) { return el.classList.add(c); });\n                }\n                if (componentProps) {\n                    Object.assign(el, componentProps);\n                }\n                container.appendChild(el);\n                if (!el.componentOnReady) return [3 /*break*/, 2];\n                return [4 /*yield*/, el.componentOnReady()];\n            case 1:\n                _a.sent();\n                _a.label = 2;\n            case 2: return [2 /*return*/, el];\n        }\n    });\n}); };\nvar detachComponent = function (delegate, element) {\n    if (element) {\n        if (delegate) {\n            var container = element.parentElement;\n            return delegate.removeViewFromDom(container, element);\n        }\n        element.remove();\n    }\n    return Promise.resolve();\n};\nexport { attachComponent as a, detachComponent as d };\n","import { __awaiter, __generator } from \"tslib\";\nimport { w as writeTask } from './core-feeeff0d.js';\nimport { b as LIFECYCLE_WILL_LEAVE, L as LIFECYCLE_WILL_ENTER, a as LIFECYCLE_DID_ENTER, c as LIFECYCLE_DID_LEAVE } from './constants-3c3e1099.js';\nvar iosTransitionAnimation = function () { return import('./ios.transition-504cdd09.js'); };\nvar mdTransitionAnimation = function () { return import('./md.transition-fea2bbfb.js'); };\nvar transition = function (opts) {\n    return new Promise(function (resolve, reject) {\n        writeTask(function () {\n            beforeTransition(opts);\n            runTransition(opts).then(function (result) {\n                if (result.animation) {\n                    result.animation.destroy();\n                }\n                afterTransition(opts);\n                resolve(result);\n            }, function (error) {\n                afterTransition(opts);\n                reject(error);\n            });\n        });\n    });\n};\nvar beforeTransition = function (opts) {\n    var enteringEl = opts.enteringEl;\n    var leavingEl = opts.leavingEl;\n    setZIndex(enteringEl, leavingEl, opts.direction);\n    if (opts.showGoBack) {\n        enteringEl.classList.add('can-go-back');\n    }\n    else {\n        enteringEl.classList.remove('can-go-back');\n    }\n    setPageHidden(enteringEl, false);\n    if (leavingEl) {\n        setPageHidden(leavingEl, false);\n    }\n};\nvar runTransition = function (opts) { return __awaiter(void 0, void 0, void 0, function () {\n    var animationBuilder, ani;\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0: return [4 /*yield*/, getAnimationBuilder(opts)];\n            case 1:\n                animationBuilder = _a.sent();\n                ani = (animationBuilder)\n                    ? animation(animationBuilder, opts)\n                    : noAnimation(opts);\n                return [2 /*return*/, ani];\n        }\n    });\n}); };\nvar afterTransition = function (opts) {\n    var enteringEl = opts.enteringEl;\n    var leavingEl = opts.leavingEl;\n    enteringEl.classList.remove('ion-page-invisible');\n    if (leavingEl !== undefined) {\n        leavingEl.classList.remove('ion-page-invisible');\n    }\n};\nvar getAnimationBuilder = function (opts) { return __awaiter(void 0, void 0, void 0, function () {\n    var getAnimation, _a;\n    return __generator(this, function (_b) {\n        switch (_b.label) {\n            case 0:\n                if (!opts.leavingEl || !opts.animated || opts.duration === 0) {\n                    return [2 /*return*/, undefined];\n                }\n                if (opts.animationBuilder) {\n                    return [2 /*return*/, opts.animationBuilder];\n                }\n                if (!(opts.mode === 'ios')) return [3 /*break*/, 2];\n                return [4 /*yield*/, iosTransitionAnimation()];\n            case 1:\n                _a = (_b.sent()).iosTransitionAnimation;\n                return [3 /*break*/, 4];\n            case 2: return [4 /*yield*/, mdTransitionAnimation()];\n            case 3:\n                _a = (_b.sent()).mdTransitionAnimation;\n                _b.label = 4;\n            case 4:\n                getAnimation = _a;\n                return [2 /*return*/, getAnimation];\n        }\n    });\n}); };\nvar animation = function (animationBuilder, opts) { return __awaiter(void 0, void 0, void 0, function () {\n    var trans, mod, err_1, didComplete;\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0: return [4 /*yield*/, waitForReady(opts, true)];\n            case 1:\n                _a.sent();\n                _a.label = 2;\n            case 2:\n                _a.trys.push([2, 5, , 6]);\n                return [4 /*yield*/, import('./index-69c37885.js')];\n            case 3:\n                mod = _a.sent();\n                return [4 /*yield*/, mod.create(animationBuilder, opts.baseEl, opts)];\n            case 4:\n                trans = _a.sent();\n                return [3 /*break*/, 6];\n            case 5:\n                err_1 = _a.sent();\n                trans = animationBuilder(opts.baseEl, opts);\n                return [3 /*break*/, 6];\n            case 6:\n                fireWillEvents(opts.enteringEl, opts.leavingEl);\n                return [4 /*yield*/, playTransition(trans, opts)];\n            case 7:\n                didComplete = _a.sent();\n                if (opts.progressCallback) {\n                    opts.progressCallback(undefined);\n                }\n                if (didComplete) {\n                    fireDidEvents(opts.enteringEl, opts.leavingEl);\n                }\n                return [2 /*return*/, {\n                        hasCompleted: didComplete,\n                        animation: trans\n                    }];\n        }\n    });\n}); };\nvar noAnimation = function (opts) { return __awaiter(void 0, void 0, void 0, function () {\n    var enteringEl, leavingEl;\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0:\n                enteringEl = opts.enteringEl;\n                leavingEl = opts.leavingEl;\n                return [4 /*yield*/, waitForReady(opts, false)];\n            case 1:\n                _a.sent();\n                fireWillEvents(enteringEl, leavingEl);\n                fireDidEvents(enteringEl, leavingEl);\n                return [2 /*return*/, {\n                        hasCompleted: true\n                    }];\n        }\n    });\n}); };\nvar waitForReady = function (opts, defaultDeep) { return __awaiter(void 0, void 0, void 0, function () {\n    var deep, promises;\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0:\n                deep = opts.deepWait !== undefined ? opts.deepWait : defaultDeep;\n                promises = deep ? [\n                    deepReady(opts.enteringEl),\n                    deepReady(opts.leavingEl),\n                ] : [\n                    shallowReady(opts.enteringEl),\n                    shallowReady(opts.leavingEl),\n                ];\n                return [4 /*yield*/, Promise.all(promises)];\n            case 1:\n                _a.sent();\n                return [4 /*yield*/, notifyViewReady(opts.viewIsReady, opts.enteringEl)];\n            case 2:\n                _a.sent();\n                return [2 /*return*/];\n        }\n    });\n}); };\nvar notifyViewReady = function (viewIsReady, enteringEl) { return __awaiter(void 0, void 0, void 0, function () {\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0:\n                if (!viewIsReady) return [3 /*break*/, 2];\n                return [4 /*yield*/, viewIsReady(enteringEl)];\n            case 1:\n                _a.sent();\n                _a.label = 2;\n            case 2: return [2 /*return*/];\n        }\n    });\n}); };\nvar playTransition = function (trans, opts) {\n    var progressCallback = opts.progressCallback;\n    // TODO: Remove AnimationBuilder\n    var promise = new Promise(function (resolve) {\n        trans.onFinish(function (currentStep) {\n            if (typeof currentStep === 'number') {\n                resolve(currentStep === 1);\n            }\n            else if (trans.hasCompleted !== undefined) {\n                resolve(trans.hasCompleted);\n            }\n        });\n    });\n    // cool, let's do this, start the transition\n    if (progressCallback) {\n        // this is a swipe to go back, just get the transition progress ready\n        // kick off the swipe animation start\n        trans.progressStart(true);\n        progressCallback(trans);\n    }\n    else {\n        // only the top level transition should actually start \"play\"\n        // kick it off and let it play through\n        // ******** DOM WRITE ****************\n        trans.play();\n    }\n    // create a callback for when the animation is done\n    return promise;\n};\nvar fireWillEvents = function (enteringEl, leavingEl) {\n    lifecycle(leavingEl, LIFECYCLE_WILL_LEAVE);\n    lifecycle(enteringEl, LIFECYCLE_WILL_ENTER);\n};\nvar fireDidEvents = function (enteringEl, leavingEl) {\n    lifecycle(enteringEl, LIFECYCLE_DID_ENTER);\n    lifecycle(leavingEl, LIFECYCLE_DID_LEAVE);\n};\nvar lifecycle = function (el, eventName) {\n    if (el) {\n        var ev = new CustomEvent(eventName, {\n            bubbles: false,\n            cancelable: false,\n        });\n        el.dispatchEvent(ev);\n    }\n};\nvar shallowReady = function (el) {\n    if (el && el.componentOnReady) {\n        return el.componentOnReady();\n    }\n    return Promise.resolve();\n};\nvar deepReady = function (el) { return __awaiter(void 0, void 0, void 0, function () {\n    var element, stencilEl;\n    return __generator(this, function (_a) {\n        switch (_a.label) {\n            case 0:\n                element = el;\n                if (!element) return [3 /*break*/, 4];\n                if (!(element.componentOnReady != null)) return [3 /*break*/, 2];\n                return [4 /*yield*/, element.componentOnReady()];\n            case 1:\n                stencilEl = _a.sent();\n                if (stencilEl != null) {\n                    return [2 /*return*/];\n                }\n                _a.label = 2;\n            case 2: return [4 /*yield*/, Promise.all(Array.from(element.children).map(deepReady))];\n            case 3:\n                _a.sent();\n                _a.label = 4;\n            case 4: return [2 /*return*/];\n        }\n    });\n}); };\nvar setPageHidden = function (el, hidden) {\n    if (hidden) {\n        el.setAttribute('aria-hidden', 'true');\n        el.classList.add('ion-page-hidden');\n    }\n    else {\n        el.hidden = false;\n        el.removeAttribute('aria-hidden');\n        el.classList.remove('ion-page-hidden');\n    }\n};\nvar setZIndex = function (enteringEl, leavingEl, direction) {\n    if (enteringEl !== undefined) {\n        enteringEl.style.zIndex = (direction === 'back')\n            ? '99'\n            : '101';\n    }\n    if (leavingEl !== undefined) {\n        leavingEl.style.zIndex = '100';\n    }\n};\nvar getIonPageElement = function (element) {\n    if (element.classList.contains('ion-page')) {\n        return element;\n    }\n    var ionPage = element.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs');\n    if (ionPage) {\n        return ionPage;\n    }\n    // idk, return the original element so at least something animates and we don't have a null pointer\n    return element;\n};\nexport { deepReady as d, getIonPageElement as g, lifecycle as l, setPageHidden as s, transition as t };\n"],"sourceRoot":""}