import{s as H,b7 as K,b8 as L,E as z,G as M,aG as T,aH as x,y as c,aK as _,ap as V,f as v,ad as O,O as I,t as q,ae as Q,z as j,P as J,Q as B,T as X,D as Y,ba as Z,an as ee,dF as re,K as te,av as oe,a5 as ne,a3 as $}from"./index-DT8qTvyx.js";var se=function(b){H(a,b);function a(r){var e=b.call(this,r)||this;e.$$id=K(),r.store.setEntered(!!r.show),e.handleSelfClose=e.handleSelfClose.bind(e),e.handleAction=e.handleAction.bind(e),e.handleActionSensor=e.handleActionSensor.bind(e),e.handleDrawerConfirm=e.handleDrawerConfirm.bind(e),e.handleDrawerClose=e.handleDrawerClose.bind(e),e.handleDialogConfirm=e.handleDialogConfirm.bind(e),e.handleDialogClose=e.handleDialogClose.bind(e),e.handleChildFinished=e.handleChildFinished.bind(e),e.handleEntered=e.handleEntered.bind(e),e.handleExited=e.handleExited.bind(e),e.handleFormInit=e.handleFormInit.bind(e),e.handleFormChange=e.handleFormChange.bind(e),e.handleFormSaved=e.handleFormSaved.bind(e);var t=r.store;return e.reaction=L(function(){return"".concat(t.loading).concat(t.error)},function(){return e.forceUpdate()}),e}return a.prototype.componentWillUnmount=function(){this.reaction&&this.reaction(),clearTimeout(this.clearErrorTimer)},a.prototype.buildActions=function(){var r=this.props,e=r.actions,t=r.confirm,o=r.translate,n=r.testIdBuilder;if(typeof e<"u")return e;var s=[];return s.push({type:"button",testIdBuilder:n==null?void 0:n.getChild("cancel"),actionType:"close",label:o("cancel")}),t&&s.push({type:"button",actionType:"confirm",testIdBuilder:n==null?void 0:n.getChild("confirm"),label:o("confirm"),primary:!0}),s},a.prototype.handleSelfClose=function(){return z(this,void 0,void 0,function(){var r,e,t,o,n;return M(this,function(s){switch(s.label){case 0:return r=this.props,e=r.onClose,t=r.store,o=r.dispatchEvent,t.dialogOpen!==!1||t.drawerOpen!==!1?[2]:[4,o("cancel",this.props.data)];case 1:return n=s.sent(),n!=null&&n.prevented?[2]:n!=null&&n.pendingPromise.length?[4,n.allDone()]:[3,3];case 2:s.sent(),s.label=3;case 3:return t.updateMessage(),e(),[2]}})})},a.prototype.handleActionSensor=function(r){var e=this.props.store,t=e.busying;e.markBusying(!0),e.updateMessage(),r.then(function(){e.markBusying(t)}).catch(function(o){e.updateMessage(o.message,!0),e.markBusying(t)})},a.prototype.handleAction=function(r,e,t){var o=this.props,n=o.onClose,s=o.onAction;e.actionType==="close"||e.actionType==="cancel"?n():s&&s(r,e,t)},a.prototype.handleDrawerConfirm=function(r,e){for(var t=[],o=2;o