!function(e,o){if("object"==typeof exports&&"object"==typeof module)module.exports=o(require("preact/compat"));else if("function"==typeof define&&define.amd)define(["preact/compat"],o);else{var t="object"==typeof exports?o(require("preact/compat")):o(e.PreactCompat);for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(Depicter,(e=>(()=>{"use strict";var o={585:o=>{o.exports=e}},t={};function r(e){var p=t[e];if(void 0!==p)return p.exports;var c=t[e]={exports:{}};return o[e](c,c.exports,r),c.exports}r.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return r.d(o,{a:o}),o},r.d=(e,o)=>{for(var t in o)r.o(o,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},r.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};r.r(p),r.d(p,{dpcCouponBox:()=>a});var c=r(585),n=r.n(c);const a={component:e=>{const{className:o,coupon:t,showButton:r=!0,buttonLabel:p="Copy",copiedLabel:a="Copied!",renderLabel:u}=e,[i,d]=n().useState(!1),s=(0,c.useCallback)((()=>{(!window).Depicter||(window.Depicter.utils.copyTextToClipboard(t),d(!0),setTimeout((()=>{d(!1)}),2e3))}),[t]),l=r?t:i?a:t,b=i?a:p;return Depicter.h("div",{className:`dpc-coupon-box ${o}`,onClick:r?void 0:s},u?.(t,"coupon","dpc-coupon-box-text")??Depicter.h("div",{className:"dpc-coupon-box-text"},l),(r&&u?.(p,"buttonLabel","dpc-coupon-box-button"))??Depicter.h("button",{type:"button",className:"dpc-coupon-box-button",onClick:s},b))},async:!1};return p})()));