{"version":3,"file":"pane_controller-ppaLCmUy.js","sources":["../../../app/javascript/controllers/pane_controller.js"],"sourcesContent":["import ApplicationController from './application_controller'\n\nexport default class extends ApplicationController {\n static values = {\n show: Boolean,\n remove: Boolean,\n backTo: String,\n }\n\n connect() {\n if (this.showValue) {\n setTimeout(() => {\n this._show()\n }, 0)\n } else {\n this.hide()\n }\n\n super.connect()\n }\n\n disconnect() {\n this.hide()\n super.disconnect()\n }\n\n show() {\n this.element.classList.replace(\"-right-full\", \"right-0\")\n }\n\n _show() {\n this.element.classList.replace(\"-right-full\", \"right-0\")\n }\n\n hide({ currentTarget } = {}) {\n this.element.classList.replace(\"right-0\", \"-right-full\")\n\n this.element.querySelectorAll('[data-error-container]')\n .forEach((el) => el.innerHTML = '')\n\n if(currentTarget && currentTarget.dataset.backTo) {\n Turbo.visit(currentTarget.dataset.backTo, { action: 'replace', frame: 'pane-frame' })\n }\n\n if(currentTarget && currentTarget.hasAttribute('data-remove')) {\n console.log('removing element')\n setTimeout(() => {\n this.element.remove()\n }, 300)\n }\n\n if(this.removeValue) {\n setTimeout(() => {\n this.element.remove()\n }, 300)\n }\n }\n\n hideIfSuccess(e) {\n if (e.detail.success) {\n this.hide()\n }\n }\n\n get hidden() {\n return this.element.classList.contains(\"-right-full\")\n }\n\n get visible() {\n return this.element.classList.contains(\"right-0\")\n }\n\n get invisible() {\n return !this.visible\n }\n}\n"],"names":["PaneController","ApplicationController","currentTarget","el","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAOjD,SAAU,CACJ,KAAK,UACP,WAAW,IAAM,CACf,KAAK,MAAK,CAClB,EAAS,CAAC,EAEJ,KAAK,KAAI,EAGX,MAAM,QAAO,CACjB,CAEE,YAAa,CACX,KAAK,KAAI,EACT,MAAM,WAAU,CACpB,CAEE,MAAO,CACL,KAAK,QAAQ,UAAU,QAAQ,cAAe,SAAS,CAC3D,CAEE,OAAQ,CACN,KAAK,QAAQ,UAAU,QAAQ,cAAe,SAAS,CAC3D,CAEE,KAAK,CAAE,cAAAC,CAAe,EAAG,GAAI,CAC3B,KAAK,QAAQ,UAAU,QAAQ,UAAW,aAAa,EAEvD,KAAK,QAAQ,iBAAiB,wBAAwB,EACnD,QAASC,GAAOA,EAAG,UAAY,EAAE,EAEjCD,GAAiBA,EAAc,QAAQ,QACxC,MAAM,MAAMA,EAAc,QAAQ,OAAQ,CAAE,OAAQ,UAAW,MAAO,YAAc,CAAA,EAGnFA,GAAiBA,EAAc,aAAa,aAAa,IAC1D,QAAQ,IAAI,kBAAkB,EAC9B,WAAW,IAAM,CACf,KAAK,QAAQ,OAAM,CAC3B,EAAS,GAAG,GAGL,KAAK,aACN,WAAW,IAAM,CACf,KAAK,QAAQ,OAAM,CAC3B,EAAS,GAAG,CAEZ,CAEE,cAAc,EAAG,CACX,EAAE,OAAO,SACX,KAAK,KAAI,CAEf,CAEE,IAAI,QAAS,CACX,OAAO,KAAK,QAAQ,UAAU,SAAS,aAAa,CACxD,CAEE,IAAI,SAAU,CACZ,OAAO,KAAK,QAAQ,UAAU,SAAS,SAAS,CACpD,CAEE,IAAI,WAAY,CACd,MAAO,CAAC,KAAK,OACjB,CACA,CAxEEE,EADkBJ,EACX,SAAS,CACd,KAAM,QACN,OAAQ,QACR,OAAQ,MACZ"}