{"version":3,"file":"history_controller-Mu3IEhUJ.js","sources":["../../../app/javascript/controllers/browser/history_controller.js"],"sourcesContent":["import ApplicationController from \"../application_controller\"\n\nexport default class extends ApplicationController {\n static values = {\n url: String,\n title: String,\n }\n\n connect() {\n super.connect();\n console.log(\"History controller connected\")\n }\n\n pushState({ currentTarget }) {\n console.log(\"pushing state\")\n\n const url = currentTarget.dataset.url || this.urlValue\n const state = this.element.dataset.state\n const title = currentTarget.dataset.title || this.titleValue || document.title\n\n window.history.pushState(state, title, url)\n }\n\n replaceState({ currentTarget }) {\n console.log(\"replacing state\")\n\n const url = currentTarget.dataset.url || this.urlValue\n const state = this.element.dataset.state\n const title = currentTarget.dataset.title || this.titleValue || document.title\n\n console.log(url)\n window.history.replaceState(state, title, url)\n }\n\n goBack() {\n window.history.back()\n }\n}\n"],"names":["history_controller","ApplicationController","currentTarget","url","state","title","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAMjD,SAAU,CACR,MAAM,QAAS,EACf,QAAQ,IAAI,8BAA8B,CAC9C,CAEE,UAAU,CAAE,cAAAC,GAAiB,CAC3B,QAAQ,IAAI,eAAe,EAE3B,MAAMC,EAAMD,EAAc,QAAQ,KAAO,KAAK,SACxCE,EAAQ,KAAK,QAAQ,QAAQ,MAC7BC,EAAQH,EAAc,QAAQ,OAAS,KAAK,YAAc,SAAS,MAEzE,OAAO,QAAQ,UAAUE,EAAOC,EAAOF,CAAG,CAC9C,CAEE,aAAa,CAAE,cAAAD,GAAiB,CAC9B,QAAQ,IAAI,iBAAiB,EAE7B,MAAMC,EAAMD,EAAc,QAAQ,KAAO,KAAK,SACxCE,EAAQ,KAAK,QAAQ,QAAQ,MAC7BC,EAAQH,EAAc,QAAQ,OAAS,KAAK,YAAc,SAAS,MAEzE,QAAQ,IAAIC,CAAG,EACf,OAAO,QAAQ,aAAaC,EAAOC,EAAOF,CAAG,CACjD,CAEE,QAAS,CACP,OAAO,QAAQ,KAAI,CACvB,CACA,CAlCEG,EADkBN,EACX,SAAS,CACd,IAAK,OACL,MAAO,MACX"}