{"version":3,"sources":["jsdelivr-header.js","/npm/preact-flickity-component@1.0.1/src/FlickityComponent.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,EAAG,cAAiB,gBACtB,aAAc,0BAEN,MAAM,0BAA0B,UAC7C,WAAA,CAAa,GACX,MAAM,GAEN,KAAK,SAAW,KAChB,KAAK,MAAQ,IACf,CAEA,MAAA,GACM,KAAK,WACP,KAAK,MAAQ,IAAI,SAAS,KAAK,SAAU,KAAK,MAAM,SAEhD,KAAK,MAAM,aACb,KAAK,MAAM,YAAY,KAAK,OAGlC,CAEA,OAAA,GACM,KAAK,QACP,KAAK,MAAM,UACX,KAAK,MAAQ,KACb,KAAK,SAAW,KAEpB,CAEA,mBAAA,GACE,KAAK,SACP,CAEA,kBAAA,GACE,KAAK,QACP,CAEA,oBAAA,GACE,KAAK,SACP,CAEA,iBAAA,GACE,KAAK,QACP,CAEA,MAAA,CAAQ,GACN,OAAO,EAAE,KAAK,MAAM,YAAa,CAC/B,UAAW,KAAK,MAAM,UACtB,IAAK,IAAO,KAAK,SAAW,IAC3B,KAAK,MAAM,SAChB,EAGF,kBAAkB,aAAe,CAC/B,QAAS,CAAC,EACV,UAAW,GACX,YAAa","file":"/npm/preact-flickity-component@1.0.1/src/FlickityComponent.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/preact-flickity-component@1.0.1/src/FlickityComponent.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { h, Component } from 'preact'\nimport Flickity from 'flickity'\n\nexport default class FlickityComponent extends Component {\n  constructor (props) {\n    super(props)\n\n    this.carousel = null\n    this.flkty = null\n  }\n\n  create () {\n    if (this.carousel) {\n      this.flkty = new Flickity(this.carousel, this.props.options)\n\n      if (this.props.flickityRef) {\n        this.props.flickityRef(this.flkty)\n      }\n    }\n  }\n\n  destroy () {\n    if (this.flkty) {\n      this.flkty.destroy()\n      this.flkty = null\n      this.carousel = null\n    }\n  }\n\n  componentWillUpdate () {\n    this.destroy()\n  }\n\n  componentDidUpdate () {\n    this.create()\n  }\n\n  componentWillUnmount () {\n    this.destroy()\n  }\n\n  componentDidMount () {\n    this.create()\n  }\n\n  render (props) {\n    return h(this.props.elementType, {\n      className: this.props.className,\n      ref: c => { this.carousel = c }\n    }, this.props.children)\n  }\n}\n\nFlickityComponent.defaultProps = {\n  options: {},\n  className: '',\n  elementType: 'div'\n}\n"]}