{"version":3,"sources":["common/dialogs/ok-cancel-dialog-base.ts"],"names":["html","nothing","DialogBase","CmsOkCancelDialogBase","onCancelCallback","onSuccessCallback","verify","constructor","super","this","verifying","buttonsTemplate","dialogLabels","Cancel","handleCancel","bind","Ok","handleSuccess","addTranslation","name","value","await","setTimeout","close"],"mappings":"OAASA,KAAMC,OAAyB,KAAV,kBACrBC,UAAmC,KAAlB,yBAEJC,8BAA8BD,WAGzCE,0BACAC,2BACAC,eAAmC,MAAO,CAAA,CAAM,CAEvDC,cACIC,MAAK,EANFC,KAAAC,UAAqB,CAAA,EAYrBD,KAAAE,gBAAkB,IAAMX;gEAC6BS,KAAKG,aAAaC;qBAC7DJ,KAAKK,aAAaC,KAAKN,IAAI;cAClCA,KAAKG,aAAaC;;mEAEmCJ,KAAKC,oBAAoBD,KAAKG,aAAaI;qBACzFP,KAAKQ,cAAcF,KAAKN,IAAI;cACnCA,KAAKG,aAAaI,KAAKP,KAAKC,UAAYV,6EAA+EC;;MAZ7HQ,KAAKS,eAAe,KAAM,CAAC,CAACC,KAAK,KAAMC,MAAM,IAAI,EAAG,CAACD,KAAK,SAAUC,MAAM,QAAQ,EAAE,EACpFX,KAAKS,eAAe,KAAM,CAAC,CAACC,KAAK,KAAMC,MAAM,IAAI,EAAG,CAACD,KAAK,SAAUC,MAAM,QAAQ,EAAE,CACxF,CAgBQN,qBACJO,MAAMZ,KAAKL,iBAAgB,EAC3BkB,WAAW,IAAMb,KAAKc,MAAK,EAAI,GAAG,CACtC,CAEQN,sBACAI,MAAMZ,KAAKH,OAAM,IACjBe,MAAMZ,KAAKJ,kBAAiB,EAC5BiB,WAAW,IAAMb,KAAKc,MAAK,EAAI,GAAG,EAE1C,C,QArCkBpB,qB","file":"ok-cancel-dialog-base.js","sourcesContent":["import { html, nothing } from \"lit-html\";\r\nimport { DialogBase} from \"./dialog-base.js\";\r\n\r\nexport abstract class CmsOkCancelDialogBase extends DialogBase {\r\n\r\n public verifying: boolean = false;\r\n public async onCancelCallback(): Promise {};\r\n public async onSuccessCallback(): Promise {};\r\n public async verify(): Promise { return true; }\r\n\r\n constructor() {\r\n super();\r\n this.addTranslation('en', [{name:'Ok', value:'Ok'}, {name:'Cancel', value:'Cancel'}]);\r\n this.addTranslation('no', [{name:'Ok', value:'Ok'}, {name:'Cancel', value:'Avbryt'}]);\r\n }\r\n\r\n // #region Abstract\r\n public buttonsTemplate = () => html`\r\n \r\n \r\n `;\r\n // #endregion\r\n\r\n // #region Event handlers\r\n private async handleCancel() {\r\n await this.onCancelCallback();\r\n setTimeout(() => this.close(), 100);\r\n }\r\n\r\n private async handleSuccess() {\r\n if (await this.verify()) {\r\n await this.onSuccessCallback();\r\n setTimeout(() => this.close(), 100);\r\n }\r\n }\r\n // #endregion\r\n\r\n}\r\n"]}