var __awaiter=this&&this.__awaiter||function(t,a,e,n){function i(t){return t instanceof e?t:new e((function(a){a(t)}))}return new(e||(e=Promise))((function(e,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function l(t){try{c(n["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):i(t.value).then(o,l)}c((n=n.apply(t,a||[])).next())}))};var __generator=this&&this.__generator||function(t,a){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(t){return function(a){return c([t,a])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(e)try{if(n=1,i&&(r=o[0]&2?i["return"]:o[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;if(i=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;i=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]1;var n=t&&a>1;if(!n&&!e){return null}return a1;t.hidden=t!==r}))}if(o){o.menuOpen=false}a.panels=e;if(n!==i){var l=a.getFlowDirection(n,i);a.panelCount=i;a.flowDirection=l}};this.panelItemMutationObserver=createObserver("mutation",this.updateFlowProps)}t.prototype.back=function(){return __awaiter(this,void 0,void 0,(function(){var t,a;return __generator(this,(function(e){t=this.el.querySelector("calcite-panel:last-child");if(!t){return[2]}a=t.beforeBack?t.beforeBack:function(){return Promise.resolve()};return[2,a.call(t).then((function(){t.remove();return t}))]}))}))};t.prototype.connectedCallback=function(){var t;(t=this.panelItemMutationObserver)===null||t===void 0?void 0:t.observe(this.el,{childList:true,subtree:true});this.updateFlowProps()};t.prototype.disconnectedCallback=function(){var t;(t=this.panelItemMutationObserver)===null||t===void 0?void 0:t.disconnect()};t.prototype.handleCalcitePanelBackClick=function(){this.back()};t.prototype.render=function(){var t;var a=this,e=a.flowDirection,n=a.panelCount;var i=(t={},t[CSS.frame]=true,t[CSS.frameAdvancing]=e==="advancing",t[CSS.frameRetreating]=e==="retreating",t);return h("div",{class:i,key:n},h("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();Flow.style=flowCss;export{Flow as calcite_flow};