{"version":3,"file":"unfold_component_controller-4a583214.js","sources":["../../../app/components/unfold_component/unfold_component_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [\"content\", \"button\"]\n\n connect() {\n this.maxHeightPx = Number(this.contentTarget.dataset.maxHeight)\n this.contentTarget.style.maxHeight = `${this.maxHeightPx}px`\n this.refresh()\n }\n\n refresh() {\n if (!this.hasButtonTarget) return\n const overflows = this.contentTarget.offsetHeight >= (this.maxHeightPx - 1)\n this.buttonTarget.classList.toggle(\"hide\", !overflows)\n this.contentTarget.classList.toggle(\"co-fade-overflow\", overflows)\n }\n\n displayAll() {\n this.contentTarget.style.maxHeight = null\n this.buttonTarget.parentElement.removeChild(this.buttonTarget)\n this.contentTarget.classList.remove(\"co-fade-overflow\")\n }\n}\n"],"names":["unfold_component_controller","Controller","overflows","__publicField"],"mappings":"mNAEe,MAAKA,UAASC,CAAW,CAGtC,SAAU,CACR,KAAK,YAAc,OAAO,KAAK,cAAc,QAAQ,SAAS,EAC9D,KAAK,cAAc,MAAM,UAAY,GAAG,KAAK,WAAW,KACxD,KAAK,QAAS,CACf,CAED,SAAU,CACR,GAAI,CAAC,KAAK,gBAAiB,OAC3B,MAAMC,EAAY,KAAK,cAAc,cAAiB,KAAK,YAAc,EACzE,KAAK,aAAa,UAAU,OAAO,OAAQ,CAACA,CAAS,EACrD,KAAK,cAAc,UAAU,OAAO,mBAAoBA,CAAS,CAClE,CAED,YAAa,CACX,KAAK,cAAc,MAAM,UAAY,KACrC,KAAK,aAAa,cAAc,YAAY,KAAK,YAAY,EAC7D,KAAK,cAAc,UAAU,OAAO,kBAAkB,CACvD,CACH,CApBEC,EADkBH,EACX,UAAU,CAAC,UAAW,QAAQ"}