{"version":3,"file":"attribute_copy_controller-vBnltcD0.js","sources":["../../../app/javascript/controllers/audience/attribute_copy_controller.js"],"sourcesContent":["import CopyController from '../copy_to_clipboard_controller'\n\nexport default class extends CopyController {\n static targets = ['container', 'duplicate', 'duplicateTrigger', 'duplicatePopover']\n\n onDuplicatePopoverToggle({ detail: isOpen }) {\n if(isOpen) {\n this.containerTarget.classList.remove('group-hover/copy:flex')\n } else {\n this.containerTarget.classList.add('group-hover/copy:flex')\n }\n }\n\n removeDuplicate({ currentTarget }) {\n this.nextTick(() => {\n currentTarget.closest('[data-audience--attribute-copy-target=\"duplicate\"]')?.remove()\n })\n }\n\n duplicateTargetDisconnected() {\n this.duplicateTriggerTarget.querySelector('[data-text]').textContent = this.duplicateTargets.length\n\n if(this.duplicateTargets.length === 0) {\n this.duplicateTriggerTarget.click()\n this.duplicateTriggerTarget.classList.add('hidden')\n this.duplicatePopoverTarget.remove()\n }\n }\n}\n"],"names":["attribute_copy_controller","CopyController","isOpen","currentTarget","_a","__publicField"],"mappings":"mOAEe,MAAKA,UAASC,CAAe,CAG1C,yBAAyB,CAAE,OAAQC,GAAU,CACxCA,EACD,KAAK,gBAAgB,UAAU,OAAO,uBAAuB,EAE7D,KAAK,gBAAgB,UAAU,IAAI,uBAAuB,CAEhE,CAEE,gBAAgB,CAAE,cAAAC,GAAiB,CACjC,KAAK,SAAS,IAAM,QAClBC,EAAAD,EAAc,QAAQ,oDAAoD,IAA1E,MAAAC,EAA6E,QAC9E,CAAA,CACL,CAEE,6BAA8B,CAC5B,KAAK,uBAAuB,cAAc,aAAa,EAAE,YAAc,KAAK,iBAAiB,OAE1F,KAAK,iBAAiB,SAAW,IAClC,KAAK,uBAAuB,MAAK,EACjC,KAAK,uBAAuB,UAAU,IAAI,QAAQ,EAClD,KAAK,uBAAuB,OAAM,EAExC,CACA,CAzBEC,EADkBL,EACX,UAAU,CAAC,YAAa,YAAa,mBAAoB,kBAAkB"}