{"version":3,"file":"vcard_controller-6R0UCVgD.js","sources":["../../../app/javascript/controllers/message/vcard_controller.js"],"sourcesContent":["import ApplicationController from \"../application_controller\"\n\nexport default class extends ApplicationController {\n static targets = [\"showMoreButton\", \"contact\", \"toggleButton\", \"actionsContainer\"]\n\n showMore() {\n this.contactTargets\n .forEach((element, index) => {\n if(index === 0) {\n element.classList.replace(\"rounded-2xl\", \"rounded-t-2xl\")\n return\n } else if(index === this.contactTargets.length - 1) {\n element.classList.replace(\"rounded-2xl\", \"rounded-b-2xl\")\n } else {\n element.classList.replace(\"rounded-2xl\", \"rounded-none\")\n }\n\n element.classList.remove(\n \"absolute\", \"-z-10\",\n ...element.dataset.positionClass,\n ...element.dataset.rotationClass.split(\" \")\n )\n\n element.classList.add(\"w-full\", \"relative\")\n })\n\n\n this.removeClass(this.actionsContainerTarget, \"mb-8\", \"mb-2\")\n this.showMoreButtonTarget.classList.add(\"hidden\")\n }\n\n displayTimestamps({ target }) {\n if(target.tagName === \"LI\") {\n this.toggleButtonTarget.click()\n }\n }\n\n flash({ detail }) {\n if(detail.detail.id !== this.element.id) return\n\n const containerClass = this.element.dataset.messageState === \"received\" ? \"bg-lavender-light\" : \"bg-night-10\"\n\n this.contactTargets.forEach((element) => {\n element.classList.replace(containerClass, \"bg-lavender\")\n this.showMoreButtonTarget.classList.add(\"bg-lavender\")\n })\n\n setTimeout(() => {\n this.contactTargets.forEach((element) => {\n element.classList.replace(\"bg-lavender\", containerClass)\n this.showMoreButtonTarget.classList.remove(\"bg-lavender\")\n })\n }, 500)\n }\n}\n"],"names":["vcard_controller","ApplicationController","element","index","target","detail","containerClass","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAGjD,UAAW,CACT,KAAK,eACF,QAAQ,CAACC,EAASC,IAAU,CAC3B,GAAGA,IAAU,EAAG,CACdD,EAAQ,UAAU,QAAQ,cAAe,eAAe,EACxD,MACD,MAASC,IAAU,KAAK,eAAe,OAAS,EAC/CD,EAAQ,UAAU,QAAQ,cAAe,eAAe,EAExDA,EAAQ,UAAU,QAAQ,cAAe,cAAc,EAGzDA,EAAQ,UAAU,OAChB,WAAY,QACZ,GAAGA,EAAQ,QAAQ,cACnB,GAAGA,EAAQ,QAAQ,cAAc,MAAM,GAAG,CACpD,EAEQA,EAAQ,UAAU,IAAI,SAAU,UAAU,CAC3C,CAAA,EAGH,KAAK,YAAY,KAAK,uBAAwB,OAAQ,MAAM,EAC5D,KAAK,qBAAqB,UAAU,IAAI,QAAQ,CACpD,CAEE,kBAAkB,CAAE,OAAAE,GAAU,CACzBA,EAAO,UAAY,MACpB,KAAK,mBAAmB,MAAK,CAEnC,CAEE,MAAM,CAAE,OAAAC,GAAU,CAChB,GAAGA,EAAO,OAAO,KAAO,KAAK,QAAQ,GAAI,OAEzC,MAAMC,EAAiB,KAAK,QAAQ,QAAQ,eAAiB,WAAa,oBAAsB,cAEhG,KAAK,eAAe,QAASJ,GAAY,CACvCA,EAAQ,UAAU,QAAQI,EAAgB,aAAa,EACvD,KAAK,qBAAqB,UAAU,IAAI,aAAa,CACtD,CAAA,EAED,WAAW,IAAM,CACf,KAAK,eAAe,QAASJ,GAAY,CACvCA,EAAQ,UAAU,QAAQ,cAAeI,CAAc,EACvD,KAAK,qBAAqB,UAAU,OAAO,aAAa,CACzD,CAAA,CACP,EAAO,GAAG,CACV,CACA,CAnDEC,EADkBP,EACX,UAAU,CAAC,iBAAkB,UAAW,eAAgB,kBAAkB"}