well-petal 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/petal.js +123 -6
  2. package/package.json +3 -1
package/dist/petal.js CHANGED
@@ -20,6 +20,36 @@ return /******/ (() => { // webpackBootstrap
20
20
  /******/ "use strict";
21
21
  /******/ var __webpack_modules__ = ({
22
22
 
23
+ /***/ "./node_modules/css-loader/dist/cjs.js!./src/petal.css":
24
+ /*!*************************************************************!*\
25
+ !*** ./node_modules/css-loader/dist/cjs.js!./src/petal.css ***!
26
+ \*************************************************************/
27
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
28
+
29
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `/** BANNER **/\n.petal-hide-banner {\n display: none !important;\n}\n\n/** NAV **/\n\n/* Disable scrolling when mobile nav is open */\nbody:has([petal-el=\"nav\"] .w-nav-button.w--open):not(:has([petal-el=\"nav-desktop\"]:not(.w-condition-invisible))) {\n overflow: hidden;\n}\n`, \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://petal/./src/petal.css?./node_modules/css-loader/dist/cjs.js");
30
+
31
+ /***/ }),
32
+
33
+ /***/ "./node_modules/css-loader/dist/runtime/api.js":
34
+ /*!*****************************************************!*\
35
+ !*** ./node_modules/css-loader/dist/runtime/api.js ***!
36
+ \*****************************************************/
37
+ /***/ ((module) => {
38
+
39
+ eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};\n\n//# sourceURL=webpack://petal/./node_modules/css-loader/dist/runtime/api.js?");
40
+
41
+ /***/ }),
42
+
43
+ /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js":
44
+ /*!**************************************************************!*\
45
+ !*** ./node_modules/css-loader/dist/runtime/noSourceMaps.js ***!
46
+ \**************************************************************/
47
+ /***/ ((module) => {
48
+
49
+ eval("\n\nmodule.exports = function (i) {\n return i[1];\n};\n\n//# sourceURL=webpack://petal/./node_modules/css-loader/dist/runtime/noSourceMaps.js?");
50
+
51
+ /***/ }),
52
+
23
53
  /***/ "./node_modules/gsap/CSSPlugin.js":
24
54
  /*!****************************************!*\
25
55
  !*** ./node_modules/gsap/CSSPlugin.js ***!
@@ -50,6 +80,66 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
50
80
 
51
81
  /***/ }),
52
82
 
83
+ /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
84
+ /*!****************************************************************************!*\
85
+ !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
86
+ \****************************************************************************/
87
+ /***/ ((module) => {
88
+
89
+ eval("\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};\n\n//# sourceURL=webpack://petal/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?");
90
+
91
+ /***/ }),
92
+
93
+ /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js":
94
+ /*!********************************************************************!*\
95
+ !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
96
+ \********************************************************************/
97
+ /***/ ((module) => {
98
+
99
+ eval("\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;\n\n//# sourceURL=webpack://petal/./node_modules/style-loader/dist/runtime/insertBySelector.js?");
100
+
101
+ /***/ }),
102
+
103
+ /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js":
104
+ /*!**********************************************************************!*\
105
+ !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
106
+ \**********************************************************************/
107
+ /***/ ((module) => {
108
+
109
+ eval("\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;\n\n//# sourceURL=webpack://petal/./node_modules/style-loader/dist/runtime/insertStyleElement.js?");
110
+
111
+ /***/ }),
112
+
113
+ /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
114
+ /*!**********************************************************************************!*\
115
+ !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
116
+ \**********************************************************************************/
117
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
118
+
119
+ eval("\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = true ? __webpack_require__.nc : 0;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;\n\n//# sourceURL=webpack://petal/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js?");
120
+
121
+ /***/ }),
122
+
123
+ /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js":
124
+ /*!***************************************************************!*\
125
+ !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
126
+ \***************************************************************/
127
+ /***/ ((module) => {
128
+
129
+ eval("\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;\n\n//# sourceURL=webpack://petal/./node_modules/style-loader/dist/runtime/styleDomAPI.js?");
130
+
131
+ /***/ }),
132
+
133
+ /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js":
134
+ /*!*********************************************************************!*\
135
+ !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
136
+ \*********************************************************************/
137
+ /***/ ((module) => {
138
+
139
+ eval("\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;\n\n//# sourceURL=webpack://petal/./node_modules/style-loader/dist/runtime/styleTagTransform.js?");
140
+
141
+ /***/ }),
142
+
53
143
  /***/ "./src/animation.ts":
54
144
  /*!**************************!*\
55
145
  !*** ./src/animation.ts ***!
@@ -66,7 +156,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
66
156
  \***********************/
67
157
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
68
158
 
69
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initializeBanner: () => (/* binding */ initializeBanner)\n/* harmony export */ });\n/* harmony import */ var _lib_attributes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/attributes */ \"./src/lib/attributes.ts\");\n/* harmony import */ var _lib_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/helpers */ \"./src/lib/helpers.ts\");\n/* harmony import */ var _lib_memory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/memory */ \"./src/lib/memory.ts\");\n\n\n\nfunction initializeBanner() {\n const banners = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_1__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_BANNER);\n console.log(`🌸 Detected ${banners.length} banner(s)`);\n banners.forEach((banner) => {\n const name = banner.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_NAME);\n if (!name)\n return;\n console.log(` → Banner: \"${name}\"`);\n const closeButtons = banner.querySelectorAll(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_ELEMENT}=\"${_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_BANNER_CLOSE}\"]`);\n // Get session TTL in minutes (default: 1440 minutes = 24 hours)\n const sessionTTLMinutes = parseFloat(banner.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_SESSION_TTL) || \"1440\");\n // Create PetalElements object for memory functions\n const petal = {\n name,\n trigger: banner,\n popup: banner,\n mask: banner,\n slot: banner\n };\n // Check if banner was closed and session is still valid\n if ((0,_lib_memory__WEBPACK_IMPORTED_MODULE_2__.checkClosedState)(\"banner\", petal, sessionTTLMinutes)) {\n // If closed and session valid, hide the banner\n banner.style.display = \"none\";\n }\n // Add click event listeners to close buttons\n closeButtons.forEach((closeButton) => {\n closeButton.addEventListener(\"click\", () => {\n // Hide the banner\n banner.style.display = \"none\";\n // Store closed state in sessionStorage with timestamp\n (0,_lib_memory__WEBPACK_IMPORTED_MODULE_2__.storeClosedState)(\"banner\", petal);\n });\n });\n });\n}\n\n\n//# sourceURL=webpack://petal/./src/banner.ts?");
159
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ initializeBanner: () => (/* binding */ initializeBanner)\n/* harmony export */ });\n/* harmony import */ var _lib_attributes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/attributes */ \"./src/lib/attributes.ts\");\n/* harmony import */ var _lib_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/helpers */ \"./src/lib/helpers.ts\");\n/* harmony import */ var _lib_memory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/memory */ \"./src/lib/memory.ts\");\n\n\n\nfunction initializeBanner() {\n const banners = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_1__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_BANNER);\n console.log(`🌸 Detected ${banners.length} banner(s)`);\n banners.forEach((banner) => {\n const name = banner.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_NAME);\n // Check if this banner is allowed to be closed\n const allowClose = banner.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_ALLOW_CLOSE) !== \"false\";\n console.log(allowClose);\n const closeButtons = banner.querySelectorAll(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_ELEMENT}=\"${_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_BANNER_CLOSE}\"]`);\n // Get session TTL in minutes (default: 30 minutes)\n const sessionTTLMinutes = parseFloat(banner.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_0__.ATTR_PETAL_SESSION_TTL) || \"30\");\n if (!name)\n return;\n console.log(` → Banner: \"${name}\"`);\n // If banner doesn't allow close, hide close buttons and clear any stored memory\n if (!allowClose) {\n console.log(` - Closing disabled for this banner`);\n closeButtons.forEach((closeButton) => {\n closeButton.style.display = \"none\";\n });\n (0,_lib_memory__WEBPACK_IMPORTED_MODULE_2__.clearClosedState)(\"banner\", name);\n }\n // Check if banner was closed and session is still valid (only if allowClose is true)\n if (allowClose && (0,_lib_memory__WEBPACK_IMPORTED_MODULE_2__.checkClosedState)(\"banner\", name, sessionTTLMinutes)) {\n // If closed and session valid, hide the banner\n banner.classList.add(\"petal-hide-banner\");\n }\n // Add click event listeners to close buttons (only if allowClose is true)\n if (allowClose) {\n closeButtons.forEach((closeButton) => {\n closeButton.addEventListener(\"click\", () => {\n // Hide the banner\n banner.classList.add(\"petal-hide-banner\");\n // Store closed state in sessionStorage with timestamp\n (0,_lib_memory__WEBPACK_IMPORTED_MODULE_2__.storeClosedState)(\"banner\", name);\n });\n });\n }\n });\n}\n\n\n//# sourceURL=webpack://petal/./src/banner.ts?");
70
160
 
71
161
  /***/ }),
72
162
 
@@ -86,7 +176,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
86
176
  \*******************************/
87
177
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
88
178
 
89
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ATTR_PETAL_ANIM_CLOSE: () => (/* binding */ ATTR_PETAL_ANIM_CLOSE),\n/* harmony export */ ATTR_PETAL_ANIM_CLOSE_MOBILE: () => (/* binding */ ATTR_PETAL_ANIM_CLOSE_MOBILE),\n/* harmony export */ ATTR_PETAL_ANIM_OPEN: () => (/* binding */ ATTR_PETAL_ANIM_OPEN),\n/* harmony export */ ATTR_PETAL_ANIM_OPEN_MOBILE: () => (/* binding */ ATTR_PETAL_ANIM_OPEN_MOBILE),\n/* harmony export */ ATTR_PETAL_BANNER: () => (/* binding */ ATTR_PETAL_BANNER),\n/* harmony export */ ATTR_PETAL_BANNER_CLOSE: () => (/* binding */ ATTR_PETAL_BANNER_CLOSE),\n/* harmony export */ ATTR_PETAL_BANNER_CLOSED_CLASS: () => (/* binding */ ATTR_PETAL_BANNER_CLOSED_CLASS),\n/* harmony export */ ATTR_PETAL_CLOSE: () => (/* binding */ ATTR_PETAL_CLOSE),\n/* harmony export */ ATTR_PETAL_DURATION: () => (/* binding */ ATTR_PETAL_DURATION),\n/* harmony export */ ATTR_PETAL_ELEMENT: () => (/* binding */ ATTR_PETAL_ELEMENT),\n/* harmony export */ ATTR_PETAL_MASK: () => (/* binding */ ATTR_PETAL_MASK),\n/* harmony export */ ATTR_PETAL_MASK_CLOSE: () => (/* binding */ ATTR_PETAL_MASK_CLOSE),\n/* harmony export */ ATTR_PETAL_MASK_OPACITY: () => (/* binding */ ATTR_PETAL_MASK_OPACITY),\n/* harmony export */ ATTR_PETAL_NAME: () => (/* binding */ ATTR_PETAL_NAME),\n/* harmony export */ ATTR_PETAL_OPEN: () => (/* binding */ ATTR_PETAL_OPEN),\n/* harmony export */ ATTR_PETAL_POPUP: () => (/* binding */ ATTR_PETAL_POPUP),\n/* harmony export */ ATTR_PETAL_SESSION_TTL: () => (/* binding */ ATTR_PETAL_SESSION_TTL),\n/* harmony export */ ATTR_PETAL_SHOW_DELAY: () => (/* binding */ ATTR_PETAL_SHOW_DELAY),\n/* harmony export */ ATTR_PETAL_SHOW_ONCE: () => (/* binding */ ATTR_PETAL_SHOW_ONCE),\n/* harmony export */ ATTR_PETAL_SLOT: () => (/* binding */ ATTR_PETAL_SLOT)\n/* harmony export */ });\n// BASE\nconst ATTR_PETAL_NAME = \"petal\";\nconst ATTR_PETAL_ELEMENT = \"petal-el\";\n// BEHAVIOR\nconst ATTR_PETAL_SHOW_ONCE = \"petal-show-once\"; // Regardless of other settings, only show the popup once per user session\nconst ATTR_PETAL_SHOW_DELAY = \"petal-show-delay\"; // Time to wait before showing popup (in seconds)\nconst ATTR_PETAL_SESSION_TTL = \"petal-session-ttl\"; // Time to keep user session (in hours)\n/**-------------------------*\n * POPUP\n *--------------------------*/\n// ELEMENTS\nconst ATTR_PETAL_POPUP = \"popup\";\nconst ATTR_PETAL_OPEN = \"open\";\nconst ATTR_PETAL_CLOSE = \"close\";\nconst ATTR_PETAL_MASK = \"mask\";\nconst ATTR_PETAL_SLOT = \"slot\";\n// MASK\nconst ATTR_PETAL_MASK_OPACITY = \"petal-mask-opacity\";\nconst ATTR_PETAL_MASK_CLOSE = \"petal-mask-close\";\n// ANIMATIONS\nconst ATTR_PETAL_ANIM_OPEN = \"petal-anim-open\";\nconst ATTR_PETAL_ANIM_CLOSE = \"petal-anim-close\";\nconst ATTR_PETAL_ANIM_OPEN_MOBILE = \"petal-anim-open-mobile\";\nconst ATTR_PETAL_ANIM_CLOSE_MOBILE = \"petal-anim-close-mobile\";\nconst ATTR_PETAL_DURATION = \"petal-duration\";\n/**-------------------------*\n * BANNER\n *--------------------------*/\n// ELEMENTS\nconst ATTR_PETAL_BANNER = \"banner\";\nconst ATTR_PETAL_BANNER_CLOSE = \"banner-close\";\nconst ATTR_PETAL_BANNER_CLOSED_CLASS = \"petal-hide-nav-banner\";\n\n\n//# sourceURL=webpack://petal/./src/lib/attributes.ts?");
179
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ATTR_ALLOW_CLOSE: () => (/* binding */ ATTR_ALLOW_CLOSE),\n/* harmony export */ ATTR_PETAL_ANIM_CLOSE: () => (/* binding */ ATTR_PETAL_ANIM_CLOSE),\n/* harmony export */ ATTR_PETAL_ANIM_CLOSE_MOBILE: () => (/* binding */ ATTR_PETAL_ANIM_CLOSE_MOBILE),\n/* harmony export */ ATTR_PETAL_ANIM_OPEN: () => (/* binding */ ATTR_PETAL_ANIM_OPEN),\n/* harmony export */ ATTR_PETAL_ANIM_OPEN_MOBILE: () => (/* binding */ ATTR_PETAL_ANIM_OPEN_MOBILE),\n/* harmony export */ ATTR_PETAL_BANNER: () => (/* binding */ ATTR_PETAL_BANNER),\n/* harmony export */ ATTR_PETAL_BANNER_CLOSE: () => (/* binding */ ATTR_PETAL_BANNER_CLOSE),\n/* harmony export */ ATTR_PETAL_BANNER_CLOSED_CLASS: () => (/* binding */ ATTR_PETAL_BANNER_CLOSED_CLASS),\n/* harmony export */ ATTR_PETAL_CLOSE: () => (/* binding */ ATTR_PETAL_CLOSE),\n/* harmony export */ ATTR_PETAL_DURATION: () => (/* binding */ ATTR_PETAL_DURATION),\n/* harmony export */ ATTR_PETAL_ELEMENT: () => (/* binding */ ATTR_PETAL_ELEMENT),\n/* harmony export */ ATTR_PETAL_MASK: () => (/* binding */ ATTR_PETAL_MASK),\n/* harmony export */ ATTR_PETAL_MASK_CLOSE: () => (/* binding */ ATTR_PETAL_MASK_CLOSE),\n/* harmony export */ ATTR_PETAL_MASK_OPACITY: () => (/* binding */ ATTR_PETAL_MASK_OPACITY),\n/* harmony export */ ATTR_PETAL_NAME: () => (/* binding */ ATTR_PETAL_NAME),\n/* harmony export */ ATTR_PETAL_OPEN: () => (/* binding */ ATTR_PETAL_OPEN),\n/* harmony export */ ATTR_PETAL_POPUP: () => (/* binding */ ATTR_PETAL_POPUP),\n/* harmony export */ ATTR_PETAL_SESSION_TTL: () => (/* binding */ ATTR_PETAL_SESSION_TTL),\n/* harmony export */ ATTR_PETAL_SHOW_DELAY: () => (/* binding */ ATTR_PETAL_SHOW_DELAY),\n/* harmony export */ ATTR_PETAL_SHOW_ONCE: () => (/* binding */ ATTR_PETAL_SHOW_ONCE),\n/* harmony export */ ATTR_PETAL_SLOT: () => (/* binding */ ATTR_PETAL_SLOT)\n/* harmony export */ });\n// BASE\nconst ATTR_PETAL_NAME = \"petal\";\nconst ATTR_PETAL_ELEMENT = \"petal-el\";\n// BEHAVIOR\nconst ATTR_PETAL_SHOW_ONCE = \"petal-show-once\"; // Regardless of other settings, only show the popup once per user session\nconst ATTR_PETAL_SHOW_DELAY = \"petal-show-delay\"; // Time to wait before showing popup (in seconds)\nconst ATTR_PETAL_SESSION_TTL = \"petal-session-ttl\"; // Time to keep user session (in hours)\n/**-------------------------*\n * POPUP\n *--------------------------*/\n// ELEMENTS\nconst ATTR_PETAL_POPUP = \"popup\";\nconst ATTR_PETAL_OPEN = \"open\";\nconst ATTR_PETAL_CLOSE = \"close\";\nconst ATTR_PETAL_MASK = \"mask\";\nconst ATTR_PETAL_SLOT = \"slot\";\n// MASK\nconst ATTR_PETAL_MASK_OPACITY = \"petal-mask-opacity\";\nconst ATTR_PETAL_MASK_CLOSE = \"petal-mask-close\";\n// ANIMATIONS\nconst ATTR_PETAL_ANIM_OPEN = \"petal-anim-open\";\nconst ATTR_PETAL_ANIM_CLOSE = \"petal-anim-close\";\nconst ATTR_PETAL_ANIM_OPEN_MOBILE = \"petal-anim-open-mobile\";\nconst ATTR_PETAL_ANIM_CLOSE_MOBILE = \"petal-anim-close-mobile\";\nconst ATTR_PETAL_DURATION = \"petal-duration\";\n/**-------------------------*\n * BANNER\n *--------------------------*/\n// ELEMENTS\nconst ATTR_PETAL_BANNER = \"banner\";\nconst ATTR_PETAL_BANNER_CLOSE = \"banner-close\";\n// SETTINGS\nconst ATTR_ALLOW_CLOSE = \"petal-allow-close\";\n// CSS\nconst ATTR_PETAL_BANNER_CLOSED_CLASS = \"petal-hide-nav-banner\";\n\n\n//# sourceURL=webpack://petal/./src/lib/attributes.ts?");
90
180
 
91
181
  /***/ }),
92
182
 
@@ -126,7 +216,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
126
216
  \***************************/
127
217
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
128
218
 
129
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkClosedState: () => (/* binding */ checkClosedState),\n/* harmony export */ checkPopupClosedState: () => (/* binding */ checkPopupClosedState),\n/* harmony export */ storeClosedState: () => (/* binding */ storeClosedState),\n/* harmony export */ storePopupClosedState: () => (/* binding */ storePopupClosedState)\n/* harmony export */ });\nfunction storeClosedState(type, petal) {\n const { name } = petal;\n const now = new Date();\n sessionStorage.setItem(getMemoryKey(type, name), now.getTime().toString());\n}\n/**\n * Check Closed State in Session Storage\n * @param type The type of element (popup or banner)\n * @param petal The Petal to check\n * @param sessionTTLMinutes The length that the session is valid for (in minutes)\n * @returns True if the element has been closed in this session and the session is still valid, false otherwise\n */\nfunction checkClosedState(type, petal, sessionTTLMinutes) {\n const { name } = petal;\n const timestampStr = sessionStorage.getItem(getMemoryKey(type, name));\n if (!timestampStr)\n return false;\n const timestamp = parseInt(timestampStr, 10);\n if (isNaN(timestamp)) {\n sessionStorage.removeItem(getMemoryKey(type, name));\n return false;\n }\n const now = new Date();\n const itemTime = new Date(timestamp);\n const diffMinutes = (now.getTime() - itemTime.getTime()) / (1000 * 60);\n if (diffMinutes > sessionTTLMinutes) {\n // Session expired\n sessionStorage.removeItem(getMemoryKey(type, name));\n return false;\n }\n return true;\n}\n// Legacy function names for backward compatibility\nfunction storePopupClosedState(petal) {\n storeClosedState(\"popup\", petal);\n}\nfunction checkPopupClosedState(petal, sessionTTLMinutes) {\n return checkClosedState(\"popup\", petal, sessionTTLMinutes);\n}\nfunction getMemoryKey(key, name) {\n return `petal_memory_${key}_${name}`;\n}\n\n\n//# sourceURL=webpack://petal/./src/lib/memory.ts?");
219
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ checkClosedState: () => (/* binding */ checkClosedState),\n/* harmony export */ clearClosedState: () => (/* binding */ clearClosedState),\n/* harmony export */ storeClosedState: () => (/* binding */ storeClosedState)\n/* harmony export */ });\n/**\n * Store Closed State in Session Storage\n * @param type The type of element (popup or banner)\n * @param name The name of the Petal Element to store\n */\nfunction storeClosedState(type, name) {\n const now = new Date();\n sessionStorage.setItem(getMemoryKey(type, name), now.getTime().toString());\n}\n/**\n * Check Closed State in Session Storage\n * @param type The type of element (popup or banner)\n * @param name The name of the Petal Element to check\n * @param sessionTTLMinutes The length that the session is valid for (in minutes)\n * @returns True if the element has been closed in this session and the session is still valid, false otherwise\n */\nfunction checkClosedState(type, name, sessionTTLMinutes) {\n const timestampStr = sessionStorage.getItem(getMemoryKey(type, name));\n if (!timestampStr)\n return false;\n const timestamp = parseInt(timestampStr, 10);\n if (isNaN(timestamp)) {\n sessionStorage.removeItem(getMemoryKey(type, name));\n return false;\n }\n const now = new Date();\n const itemTime = new Date(timestamp);\n const diffMinutes = (now.getTime() - itemTime.getTime()) / (1000 * 60);\n if (diffMinutes > sessionTTLMinutes) {\n // Session expired\n sessionStorage.removeItem(getMemoryKey(type, name));\n return false;\n }\n return true;\n}\n/**\n * Clear Closed State from Session Storage\n * @param type The type of element (popup or banner)\n * @param name The name of the Petal Element to clear\n */\nfunction clearClosedState(type, name) {\n sessionStorage.removeItem(getMemoryKey(type, name));\n}\nfunction getMemoryKey(key, name) {\n return `petal_memory_${key}_${name}`;\n}\n\n\n//# sourceURL=webpack://petal/./src/lib/memory.ts?");
220
+
221
+ /***/ }),
222
+
223
+ /***/ "./src/petal.css":
224
+ /*!***********************!*\
225
+ !*** ./src/petal.css ***!
226
+ \***********************/
227
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
228
+
229
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ \"./node_modules/style-loader/dist/runtime/styleDomAPI.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ \"./node_modules/style-loader/dist/runtime/insertBySelector.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ \"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ \"./node_modules/style-loader/dist/runtime/insertStyleElement.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ \"./node_modules/style-loader/dist/runtime/styleTagTransform.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_petal_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./petal.css */ \"./node_modules/css-loader/dist/cjs.js!./src/petal.css\");\n\n \n \n \n \n \n \n \n \n \n\nvar options = {};\n\noptions.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());\noptions.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());\noptions.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, \"head\");\noptions.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());\noptions.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_petal_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"], options);\n\n\n\n\n /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_petal_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && _node_modules_css_loader_dist_cjs_js_petal_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals ? _node_modules_css_loader_dist_cjs_js_petal_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals : undefined);\n\n\n//# sourceURL=webpack://petal/./src/petal.css?");
130
230
 
131
231
  /***/ }),
132
232
 
@@ -136,7 +236,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
136
236
  \**********************/
137
237
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
138
238
 
139
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./popup */ \"./src/popup.ts\");\n/* harmony import */ var _banner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./banner */ \"./src/banner.ts\");\n\n\nconsole.log(`🌸 Hello from Wellflow Petal v${\"0.0.25\"}`);\n(0,_popup__WEBPACK_IMPORTED_MODULE_0__.initializeAllPopups)();\n(0,_popup__WEBPACK_IMPORTED_MODULE_0__.initializePopupTriggers)();\n(0,_banner__WEBPACK_IMPORTED_MODULE_1__.initializeBanner)();\n\n\n//# sourceURL=webpack://petal/./src/petal.ts?");
239
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _popup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./popup */ \"./src/popup.ts\");\n/* harmony import */ var _banner__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./banner */ \"./src/banner.ts\");\n/* harmony import */ var _petal_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./petal.css */ \"./src/petal.css\");\n\n\n\nconsole.log(`🌸 Hello from Wellflow Petal v${\"0.0.26\"}`);\n(0,_popup__WEBPACK_IMPORTED_MODULE_0__.initializeAllPopups)();\n(0,_popup__WEBPACK_IMPORTED_MODULE_0__.initializePopupTriggers)();\n(0,_banner__WEBPACK_IMPORTED_MODULE_1__.initializeBanner)();\n\n\n//# sourceURL=webpack://petal/./src/petal.ts?");
140
240
 
141
241
  /***/ }),
142
242
 
@@ -146,7 +246,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _pop
146
246
  \**********************/
147
247
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
148
248
 
149
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ closePopup: () => (/* binding */ closePopup),\n/* harmony export */ findPetal: () => (/* binding */ findPetal),\n/* harmony export */ findPopupElement: () => (/* binding */ findPopupElement),\n/* harmony export */ forEachPopupTrigger: () => (/* binding */ forEachPopupTrigger),\n/* harmony export */ initializeAllPopups: () => (/* binding */ initializeAllPopups),\n/* harmony export */ initializePopupTriggers: () => (/* binding */ initializePopupTriggers),\n/* harmony export */ openPopup: () => (/* binding */ openPopup)\n/* harmony export */ });\n/* harmony import */ var gsap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gsap */ \"./node_modules/gsap/index.js\");\n/* harmony import */ var _animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./animation */ \"./src/animation.ts\");\n/* harmony import */ var _lib_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/console */ \"./src/lib/console.ts\");\n/* harmony import */ var _lib_animations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/animations */ \"./src/lib/animations.ts\");\n/* harmony import */ var _lib_attributes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/attributes */ \"./src/lib/attributes.ts\");\n/* harmony import */ var _lib_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/helpers */ \"./src/lib/helpers.ts\");\n/* harmony import */ var _lib_memory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/memory */ \"./src/lib/memory.ts\");\n/* harmony import */ var _video__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./video */ \"./src/video.ts\");\n\n\n\n\n\n\n\n\nfunction initializeAllPopups() {\n const popups = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_POPUP);\n console.log(`🌸 Detected ${popups.length} popup(s)`);\n popups.forEach((popup) => {\n const popupElement = popup;\n const name = popup.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME) || \"unknown\";\n console.log(` → Popup: \"${name}\"`);\n const mask = findPopupElement(popup, \"mask\");\n const slot = findPopupElement(popup, \"slot\");\n // Set slot opacity to 0\n if (slot)\n slot.style.opacity = \"0\";\n // Set mask opacity to 0\n if (mask)\n mask.style.opacity = \"0\";\n // Set popup display to none\n popupElement.style.display = \"none\";\n });\n}\nfunction openPopup(petal) {\n const { name, popup, slot, mask } = petal;\n const tl = gsap__WEBPACK_IMPORTED_MODULE_7__.gsap.timeline();\n // Set Popup display to flex\n tl.set(popup, { display: \"flex\" });\n // Animate Mask open\n const maskOpacity = parseFloat((mask === null || mask === void 0 ? void 0 : mask.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_MASK_OPACITY)) || \"0.15\");\n tl.fromTo(mask, (0,_lib_animations__WEBPACK_IMPORTED_MODULE_2__.animateMaskOpen)(maskOpacity).from, (0,_lib_animations__WEBPACK_IMPORTED_MODULE_2__.animateMaskOpen)(maskOpacity).to, \"<\");\n // Animate Slot Open\n const anim = (0,_animation__WEBPACK_IMPORTED_MODULE_0__.getPopupGSAPAnimation)(popup, \"open\");\n tl.set(slot, { clearProps: \"x,y,scale,transform\" });\n tl.fromTo(slot, anim.from, anim.to);\n}\nfunction closePopup(petal) {\n const { name, popup, slot, mask } = petal;\n const tl = gsap__WEBPACK_IMPORTED_MODULE_7__.gsap.timeline();\n // VIDEO: Pause any videos inside the popup\n (0,_video__WEBPACK_IMPORTED_MODULE_6__.pauseVideo)(popup);\n // SESSION: Store popup closed state\n (0,_lib_memory__WEBPACK_IMPORTED_MODULE_5__.storePopupClosedState)(petal);\n // Animate the Slot Closed\n const anim = (0,_animation__WEBPACK_IMPORTED_MODULE_0__.getPopupGSAPAnimation)(popup, \"close\");\n tl.fromTo(slot, anim.from, anim.to);\n // Animate Mask Closed\n if (mask)\n tl.to(mask, (0,_lib_animations__WEBPACK_IMPORTED_MODULE_2__.animateMaskClosed)(0).to, \"<\");\n // Hide the Popup and clear transforms so they don't persist\n tl.set(popup, { display: \"none\" });\n tl.set(slot, { clearProps: \"x,y,scale,transform\" });\n}\nfunction initializePopupTriggers() {\n // Initialize Popup Open Triggers\n const openTriggers = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_OPEN);\n console.log(`🌸 Detected ${openTriggers.length} open trigger(s)`);\n forEachPopupTrigger(openTriggers, (petal) => {\n const { trigger } = petal;\n console.log(` → Open trigger for: \"${petal.name}\"`);\n trigger.addEventListener(\"click\", () => openPopup(petal));\n });\n // Initialize Popup Close Triggers\n const closeTriggers = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_CLOSE);\n console.log(`🌸 Detected ${closeTriggers.length} close trigger(s)`);\n forEachPopupTrigger(closeTriggers, (petal) => {\n const { trigger } = petal;\n console.log(` → Close trigger for: \"${petal.name}\"`);\n trigger.addEventListener(\"click\", () => closePopup(petal));\n });\n // Initialize Mask Close Triggers (masks with petal-mask-close=\"true\")\n const popups = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_POPUP);\n popups.forEach((popup) => {\n const mask = findPopupElement(popup, \"mask\");\n const maskClose = popup.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_MASK_CLOSE) === \"true\";\n if (mask && maskClose) {\n mask.addEventListener(\"click\", () => {\n const slot = findPopupElement(popup, \"slot\");\n const name = popup.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME) || popup.id;\n if (slot) {\n closePopup({ name, popup: popup, slot, mask, trigger: mask });\n }\n });\n }\n });\n}\nfunction findPetal(el) {\n const popupName = el.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME);\n if (!popupName)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingNameError(el);\n const popup = document.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME}='${popupName}'][${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_POPUP}']`);\n if (!popup)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingPopupError(popupName, el);\n return popup;\n}\nfunction findPopupElement(popup, attr) {\n return popup.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='${attr}']`);\n}\n// Helper to iterate over triggers with error handling\nfunction forEachPopupTrigger(triggers, callback) {\n triggers.forEach((trigger) => {\n try {\n const popup = findPetal(trigger);\n const name = trigger.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME) || \"unknown\";\n const mask = popup.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='mask']`);\n if (!mask)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingMaskError(name, trigger);\n const slot = popup.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='slot']`);\n if (!slot)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingSlotError(name, trigger);\n callback({ name, trigger: trigger, popup, mask, slot });\n }\n catch (error) {\n if (error instanceof _lib_console__WEBPACK_IMPORTED_MODULE_1__.PetalError) {\n // Log and skip invalid triggers\n console.error(`[${error.name}]:`, error.message, error.element);\n }\n else {\n throw error; // Re-throw unexpected errors\n }\n }\n });\n}\n\n\n//# sourceURL=webpack://petal/./src/popup.ts?");
249
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ closePopup: () => (/* binding */ closePopup),\n/* harmony export */ findPetal: () => (/* binding */ findPetal),\n/* harmony export */ findPopupElement: () => (/* binding */ findPopupElement),\n/* harmony export */ forEachPopupTrigger: () => (/* binding */ forEachPopupTrigger),\n/* harmony export */ initializeAllPopups: () => (/* binding */ initializeAllPopups),\n/* harmony export */ initializePopupTriggers: () => (/* binding */ initializePopupTriggers),\n/* harmony export */ openPopup: () => (/* binding */ openPopup)\n/* harmony export */ });\n/* harmony import */ var gsap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gsap */ \"./node_modules/gsap/index.js\");\n/* harmony import */ var _animation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./animation */ \"./src/animation.ts\");\n/* harmony import */ var _lib_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/console */ \"./src/lib/console.ts\");\n/* harmony import */ var _lib_animations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/animations */ \"./src/lib/animations.ts\");\n/* harmony import */ var _lib_attributes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lib/attributes */ \"./src/lib/attributes.ts\");\n/* harmony import */ var _lib_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/helpers */ \"./src/lib/helpers.ts\");\n/* harmony import */ var _lib_memory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lib/memory */ \"./src/lib/memory.ts\");\n/* harmony import */ var _video__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./video */ \"./src/video.ts\");\n\n\n\n\n\n\n\n\nfunction initializeAllPopups() {\n const popups = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_POPUP);\n console.log(`🌸 Detected ${popups.length} popup(s)`);\n popups.forEach((popup) => {\n const popupElement = popup;\n const name = popup.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME) || \"unknown\";\n console.log(` → Popup: \"${name}\"`);\n const mask = findPopupElement(popup, \"mask\");\n const slot = findPopupElement(popup, \"slot\");\n // Set slot opacity to 0\n if (slot)\n slot.style.opacity = \"0\";\n // Set mask opacity to 0\n if (mask)\n mask.style.opacity = \"0\";\n // Set popup display to none\n popupElement.style.display = \"none\";\n });\n}\nfunction openPopup(petal) {\n const { name, popup, slot, mask } = petal;\n const tl = gsap__WEBPACK_IMPORTED_MODULE_7__.gsap.timeline();\n // Set Popup display to flex\n tl.set(popup, { display: \"flex\" });\n // Animate Mask open\n const maskOpacity = parseFloat((mask === null || mask === void 0 ? void 0 : mask.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_MASK_OPACITY)) || \"0.15\");\n tl.fromTo(mask, (0,_lib_animations__WEBPACK_IMPORTED_MODULE_2__.animateMaskOpen)(maskOpacity).from, (0,_lib_animations__WEBPACK_IMPORTED_MODULE_2__.animateMaskOpen)(maskOpacity).to, \"<\");\n // Animate Slot Open\n const anim = (0,_animation__WEBPACK_IMPORTED_MODULE_0__.getPopupGSAPAnimation)(popup, \"open\");\n tl.set(slot, { clearProps: \"x,y,scale,transform\" });\n tl.fromTo(slot, anim.from, anim.to);\n}\nfunction closePopup(petal) {\n const { name, popup, slot, mask } = petal;\n const tl = gsap__WEBPACK_IMPORTED_MODULE_7__.gsap.timeline();\n // VIDEO: Pause any videos inside the popup\n (0,_video__WEBPACK_IMPORTED_MODULE_6__.pauseVideo)(popup);\n // SESSION: Store popup closed state\n (0,_lib_memory__WEBPACK_IMPORTED_MODULE_5__.storeClosedState)(\"popup\", name);\n // Animate the Slot Closed\n const anim = (0,_animation__WEBPACK_IMPORTED_MODULE_0__.getPopupGSAPAnimation)(popup, \"close\");\n tl.fromTo(slot, anim.from, anim.to);\n // Animate Mask Closed\n if (mask)\n tl.to(mask, (0,_lib_animations__WEBPACK_IMPORTED_MODULE_2__.animateMaskClosed)(0).to, \"<\");\n // Hide the Popup and clear transforms so they don't persist\n tl.set(popup, { display: \"none\" });\n tl.set(slot, { clearProps: \"x,y,scale,transform\" });\n}\nfunction initializePopupTriggers() {\n // Initialize Popup Open Triggers\n const openTriggers = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_OPEN);\n console.log(`🌸 Detected ${openTriggers.length} open trigger(s)`);\n forEachPopupTrigger(openTriggers, (petal) => {\n const { trigger } = petal;\n console.log(` → Open trigger for: \"${petal.name}\"`);\n trigger.addEventListener(\"click\", () => openPopup(petal));\n });\n // Initialize Popup Close Triggers\n const closeTriggers = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_CLOSE);\n console.log(`🌸 Detected ${closeTriggers.length} close trigger(s)`);\n forEachPopupTrigger(closeTriggers, (petal) => {\n const { trigger } = petal;\n console.log(` → Close trigger for: \"${petal.name}\"`);\n trigger.addEventListener(\"click\", () => closePopup(petal));\n });\n // Initialize Mask Close Triggers (masks with petal-mask-close=\"true\")\n const popups = (0,_lib_helpers__WEBPACK_IMPORTED_MODULE_4__.getAllPetalElementsOfType)(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_POPUP);\n popups.forEach((popup) => {\n const mask = findPopupElement(popup, \"mask\");\n const maskClose = popup.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_MASK_CLOSE) === \"true\";\n if (mask && maskClose) {\n mask.addEventListener(\"click\", () => {\n const slot = findPopupElement(popup, \"slot\");\n const name = popup.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME) || popup.id;\n if (slot) {\n closePopup({ name, popup: popup, slot, mask, trigger: mask });\n }\n });\n }\n });\n}\nfunction findPetal(el) {\n const popupName = el.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME);\n if (!popupName)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingNameError(el);\n const popup = document.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME}='${popupName}'][${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_POPUP}']`);\n if (!popup)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingPopupError(popupName, el);\n return popup;\n}\nfunction findPopupElement(popup, attr) {\n return popup.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='${attr}']`);\n}\n// Helper to iterate over triggers with error handling\nfunction forEachPopupTrigger(triggers, callback) {\n triggers.forEach((trigger) => {\n try {\n const popup = findPetal(trigger);\n const name = trigger.getAttribute(_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_NAME) || \"unknown\";\n const mask = popup.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='mask']`);\n if (!mask)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingMaskError(name, trigger);\n const slot = popup.querySelector(`[${_lib_attributes__WEBPACK_IMPORTED_MODULE_3__.ATTR_PETAL_ELEMENT}='slot']`);\n if (!slot)\n throw new _lib_console__WEBPACK_IMPORTED_MODULE_1__.MissingSlotError(name, trigger);\n callback({ name, trigger: trigger, popup, mask, slot });\n }\n catch (error) {\n if (error instanceof _lib_console__WEBPACK_IMPORTED_MODULE_1__.PetalError) {\n // Log and skip invalid triggers\n console.error(`[${error.name}]:`, error.message, error.element);\n }\n else {\n throw error; // Re-throw unexpected errors\n }\n }\n });\n}\n\n\n//# sourceURL=webpack://petal/./src/popup.ts?");
150
250
 
151
251
  /***/ }),
152
252
 
@@ -174,7 +274,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
174
274
  /******/ }
175
275
  /******/ // Create a new module (and put it into the cache)
176
276
  /******/ var module = __webpack_module_cache__[moduleId] = {
177
- /******/ // no module.id needed
277
+ /******/ id: moduleId,
178
278
  /******/ // no module.loaded needed
179
279
  /******/ exports: {}
180
280
  /******/ };
@@ -187,6 +287,18 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
187
287
  /******/ }
188
288
  /******/
189
289
  /************************************************************************/
290
+ /******/ /* webpack/runtime/compat get default export */
291
+ /******/ (() => {
292
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
293
+ /******/ __webpack_require__.n = (module) => {
294
+ /******/ var getter = module && module.__esModule ?
295
+ /******/ () => (module['default']) :
296
+ /******/ () => (module);
297
+ /******/ __webpack_require__.d(getter, { a: getter });
298
+ /******/ return getter;
299
+ /******/ };
300
+ /******/ })();
301
+ /******/
190
302
  /******/ /* webpack/runtime/define property getters */
191
303
  /******/ (() => {
192
304
  /******/ // define getter functions for harmony exports
@@ -215,6 +327,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
215
327
  /******/ };
216
328
  /******/ })();
217
329
  /******/
330
+ /******/ /* webpack/runtime/nonce */
331
+ /******/ (() => {
332
+ /******/ __webpack_require__.nc = undefined;
333
+ /******/ })();
334
+ /******/
218
335
  /************************************************************************/
219
336
  /******/
220
337
  /******/ // startup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "well-petal",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Webflow Popups powered by attributes",
5
5
  "main": "dist/petal.js",
6
6
  "files": [
@@ -21,11 +21,13 @@
21
21
  "@types/webpack": "^5.28.5",
22
22
  "@typescript-eslint/eslint-plugin": "^8.26.1",
23
23
  "@typescript-eslint/parser": "^8.26.1",
24
+ "css-loader": "^7.1.2",
24
25
  "eslint": "^9.22.0",
25
26
  "eslint-config-prettier": "^9.1.0",
26
27
  "eslint-plugin-prettier": "^5.2.1",
27
28
  "gsap": "*",
28
29
  "prettier": "^3.5.3",
30
+ "style-loader": "^4.0.0",
29
31
  "ts-loader": "^9.5.1",
30
32
  "typescript": "^5.7.3",
31
33
  "webpack": "^5.96.1",