{"version":3,"sources":["webpack:///./LeLab.Web/src/js/barba-form.entry.js"],"names":["PageComponent","constructor","node","this","form","submited","submitHandler","submit","bind","addEventListener","e","preventDefault","url","URL","action","URLSearchParams","FormData","forEach","v","k","searchParams","delete","append","barba","go","toString","destroy","removeEventListener"],"mappings":"2FAAA,kBAsCA,IAAIA,IAAc,sCApClB,MACIC,aAAY,KAAEC,IACVC,KAAKC,KAAOF,EACZC,KAAKE,UAAW,EAChBF,KAAKG,cAAgBH,KAAKI,OAAOC,KAAKL,MACtCA,KAAKC,KAAKK,iBAAiB,SAAUN,KAAKG,eAG9CC,OAAOG,GACH,GAAIP,KAAKE,SAEL,OADAK,EAAEC,kBACK,EAGX,IAAIC,EAAM,IAAIC,IAAIV,KAAKC,KAAKU,QAW5B,OATA,IAAIC,gBAAgB,IAAIC,SAASb,KAAKC,OAAOa,QAAQ,CAACC,EAAGC,KACrDP,EAAIQ,aAAaC,OAAOF,GACxBP,EAAIQ,aAAaE,OAAOH,EAAGD,KAG/BK,IAAMC,GAAGZ,EAAIa,YAEbtB,KAAKE,UAAW,EAChBK,EAAEC,kBACK,EAGXe,UACIvB,KAAKC,KAAKuB,oBAAoB,SAAUxB,KAAKG,sBACtCH,KAAKC,YACLD,KAAKE,gBACLF,KAAKG,mB","file":"barba-form.js","sourcesContent":["import { barba, PageComponent } from \"barba\"\r\n\r\nclass BarbaFormGet {\r\n constructor({ node }) {\r\n this.form = node\r\n this.submited = false\r\n this.submitHandler = this.submit.bind(this)\r\n this.form.addEventListener(\"submit\", this.submitHandler)\r\n }\r\n\r\n submit(e) {\r\n if (this.submited) {\r\n e.preventDefault()\r\n return false\r\n }\r\n\r\n let url = new URL(this.form.action)\r\n\r\n new URLSearchParams(new FormData(this.form)).forEach((v, k) => {\r\n url.searchParams.delete(k)\r\n url.searchParams.append(k, v)\r\n })\r\n\r\n barba.go(url.toString())\r\n\r\n this.submited = true\r\n e.preventDefault()\r\n return false\r\n }\r\n\r\n destroy() {\r\n this.form.removeEventListener(\"resize\", this.submitHandler)\r\n delete this.form\r\n delete this.submited\r\n delete this.submitHandler\r\n }\r\n}\r\n\r\nnew PageComponent('form[data-barba-form][method=\"get\"]', BarbaFormGet)\r\n"],"sourceRoot":""}