web-push-notifications 3.58.0 → 3.59.0
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.
- package/modules/Api/Api.d.ts +3 -0
- package/modules/ApiClient/ApiClient.d.ts +1 -0
- package/modules/ApiClient/ApiClient.types.d.ts +8 -1
- package/npm.js +1 -1
- package/npm.js.map +1 -1
- package/package.json +1 -1
- package/service-worker.js +1 -1
- package/service-worker.js.map +1 -1
- package/widget-web-popups.js +1 -1
- package/widget-web-popups.js.map +1 -1
- package/pushwoosh-web-notifications.d.ts +0 -1
- package/pushwoosh-widget-inbox.d.ts +0 -1
- package/pushwoosh-widget-subscribe-popup.d.ts +0 -1
- package/pushwoosh-widget-subscription-button.d.ts +0 -1
- package/pushwoosh-widget-subscription-prompt.d.ts +0 -1
- package/pushwoosh-widget-web-popups.d.ts +0 -1
- package/widgets/WebPopups/helpers.d.ts +0 -2
package/widget-web-popups.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{WebPopupsWidget:()=>ln});const n="pushwoosh-web-popups";var o,r,i,u,l,_,a,c,s,d,p,f,h,m,v,y={},g=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function x(e,t){for(var n in t)e[n]=t[n];return e}function k(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e,t,n){var r,i,u,l={};for(u in t)"key"==u?r=t[u]:"ref"==u?i=t[u]:l[u]=t[u];if(arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===l[u]&&(l[u]=e.defaultProps[u]);return S(e,l,r,i,null)}function S(e,t,n,o,u){var l={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:u??++i,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(l),l}function C(e){return e.children}function P(e,t){this.props=e,this.context=t}function N(e,t){if(null==t)return e.__?N(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?N(e):null}function I(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],u=x({},t);u.__v=t.__v+1,r.vnode&&r.vnode(u),H(e.__P,u,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??N(t),!!(32&t.__u),i),u.__v=t.__v,u.__.__k[u.__i]=u,j(o,u,i),t.__e=t.__=null,u.__e!=n&&R(u)}}function R(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),R(e)}function T(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!O.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||_)(O)}function O(){try{for(var e,t=1;u.length;)u.length>t&&u.sort(a),e=u.shift(),t=u.length,I(e)}finally{u.length=O.__r=0}}function $(e,t,n,o,r,i,u,l,_,a,c){var s,d,p,f,h,m,v,b=o&&o.__k||g,w=t.length;for(_=F(n,t,b,_,w),s=0;s<w;s++)null!=(p=n.__k[s])&&(d=-1!=p.__i&&b[p.__i]||y,p.__i=s,m=H(e,p,d,r,i,u,l,_,a,c),f=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&z(d.ref,null,p),c.push(p.ref,p.__c||f,p)),null==h&&null!=f&&(h=f),(v=!!(4&p.__u))||d.__k===p.__k?(_=A(p,_,e,v),v&&d.__e&&(d.__e=null)):"function"==typeof p.type&&void 0!==m?_=m:f&&(_=f.nextSibling),p.__u&=-7);return n.__e=h,_}function F(e,t,n,o,r){var i,u,l,_,a,c=n.length,s=c,d=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(u=t[i])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[i]=S(null,u,null,null,null):w(u)?u=e.__k[i]=S(C,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[i]=S(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[i]=u,_=i+d,u.__=e,u.__b=e.__b+1,l=null,-1!=(a=u.__i=D(u,n,_,s))&&(s--,(l=n[a])&&(l.__u|=2)),null==l||null==l.__v?(-1==a&&(r>c?d--:r<c&&d++),"function"!=typeof u.type&&(u.__u|=4)):a!=_&&(a==_-1?d--:a==_+1?d++:(a>_?d--:d++,u.__u|=4))):e.__k[i]=null;if(s)for(i=0;i<c;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==o&&(o=N(l)),q(l,l));return o}function A(e,t,n,o){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=A(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=N(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function U(e,t){return t=t||[],null==e||"boolean"==typeof e||(w(e)?e.some(function(e){U(e,t)}):t.push(e)),t}function D(e,t,n,o){var r,i,u,l=e.key,_=e.type,a=t[n],c=null!=a&&!(2&a.__u);if(null===a&&null==l||c&&l==a.key&&_==a.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||i<t.length;)if(null!=(a=t[u=r>=0?r--:i++])&&!(2&a.__u)&&l==a.key&&_==a.type)return u;return-1}function W(e,t,n){"-"==t[0]?e.setProperty(t,n??""):e[t]=null==n?"":"number"!=typeof n||b.test(t)?n:n+"px"}function M(e,t,n,o,r){var i,u;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||W(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||W(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(p,"$1")),u=t.toLowerCase(),t=u in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[d]=o[d]:(n[d]=f,e.addEventListener(t,i?m:h,i)):e.removeEventListener(t,i?m:h,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=n??"";break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function L(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[s])t[s]=f++;else if(t[s]<n[d])return;return n(r.event?r.event(t):t)}}}function H(e,t,n,o,i,u,l,_,a,c){var s,d,p,f,h,m,v,y,b,E,S,N,I,R,T,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),u=[_=t.__e=n.__e]),(s=r.__b)&&s(t);e:if("function"==typeof O)try{if(y=t.props,b=O.prototype&&O.prototype.render,E=(s=O.contextType)&&o[s.__c],S=s?E?E.props.value:s.__:o,n.__c?v=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new O(y,S):(t.__c=d=new P(y,S),d.constructor=O,d.render=Z),E&&E.sub(d),d.state||(d.state={}),d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=O.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=x({},d.__s)),x(d.__s,O.getDerivedStateFromProps(y,d.__s))),f=d.props,h=d.state,d.__v=t,p)b&&null==O.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==O.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,S),t.__v==n.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,S)){t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&l.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,S),b&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(f,h,m)})}if(d.context=S,d.props=y,d.__P=e,d.__e=!1,N=r.__r,I=0,b)d.state=d.__s,d.__d=!1,N&&N(t),s=d.render(d.props,d.state,d.context),g.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,N&&N(t),s=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(o=x(x({},o),d.getChildContext())),b&&!p&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(f,h)),R=null!=s&&s.type===C&&null==s.key?V(s.props.children):s,_=$(e,w(R)?R:[R],t,n,o,i,u,l,_,a,c),d.base=t.__e,t.__u&=-161,d.__h.length&&l.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,a||null!=u)if(e.then){for(t.__u|=a?160:128;_&&8==_.nodeType&&_.nextSibling;)_=_.nextSibling;u[u.indexOf(_)]=null,t.__e=_}else{for(T=u.length;T--;)k(u[T]);B(t)}else t.__e=n.__e,t.__k=n.__k,e.then||B(t);r.__e(e,t,n)}else null==u&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):_=t.__e=G(n.__e,t,n,o,i,u,l,a,c);return(s=r.diffed)&&s(t),128&t.__u?void 0:_}function B(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(B))}function j(e,t,n){for(var o=0;o<n.length;o++)z(n[o],n[++o],n[++o]);r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function V(e){return"object"!=typeof e||null==e||e.__b>0?e:w(e)?e.map(V):void 0!==e.constructor?null:x({},e)}function G(e,t,n,i,u,l,_,a,c){var s,d,p,f,h,m,v,g=n.props||y,b=t.props,x=t.type;if("svg"==x?u="http://www.w3.org/2000/svg":"math"==x?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=l)for(s=0;s<l.length;s++)if((h=l[s])&&"setAttribute"in h==!!x&&(x?h.localName==x:3==h.nodeType)){e=h,l[s]=null;break}if(null==e){if(null==x)return document.createTextNode(b);e=document.createElementNS(u,x,b.is&&b),a&&(r.__m&&r.__m(t,l),a=!1),l=null}if(null==x)g===b||a&&e.data==b||(e.data=b);else{if(l="textarea"==x&&null!=b.defaultValue?null:l&&o.call(e.childNodes),!a&&null!=l)for(g={},s=0;s<e.attributes.length;s++)g[(h=e.attributes[s]).name]=h.value;for(s in g)h=g[s],"dangerouslySetInnerHTML"==s?p=h:"children"==s||s in b||"value"==s&&"defaultValue"in b||"checked"==s&&"defaultChecked"in b||M(e,s,null,h,u);for(s in b)h=b[s],"children"==s?f=h:"dangerouslySetInnerHTML"==s?d=h:"value"==s?m=h:"checked"==s?v=h:a&&"function"!=typeof h||g[s]===h||M(e,s,h,g[s],u);if(d)a||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),$("template"==t.type?e.content:e,w(f)?f:[f],t,n,i,"foreignObject"==x?"http://www.w3.org/1999/xhtml":u,l,_,l?l[0]:n.__k&&N(n,0),a,c),null!=l)for(s=l.length;s--;)k(l[s]);a&&"textarea"!=x||(s="value","progress"==x&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[s]||"progress"==x&&!m||"option"==x&&m!=g[s])&&M(e,s,m,g[s],u),s="checked",null!=v&&v!=e[s]&&M(e,s,v,g[s],u))}return e}function z(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){r.__e(e,n)}}function q(e,t,n){var o,i;if(r.unmount&&r.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||z(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&q(o[i],t,n||"function"!=typeof e.type);n||k(e.__e),e.__c=e.__=e.__e=void 0}function Z(e,t,n){return this.constructor(e,n)}function K(e,t,n){var i,u,l,_;t==document&&(t=document.documentElement),r.__&&r.__(e,t),u=(i="function"==typeof n)?null:n&&n.__k||t.__k,l=[],_=[],H(t,e=(!i&&n||t).__k=E(C,null,[e]),u||y,y,t.namespaceURI,!i&&n?[n]:u?null:t.firstChild?o.call(t.childNodes):null,l,!i&&n?n:u?u.__e:t.firstChild,i,_),j(l,e,_)}function Q(e,t){K(e,t,Q)}function J(e,t,n){var r,i,u,l,_=x({},e.props);for(u in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==u?r=t[u]:"ref"==u?i=t[u]:_[u]=void 0===t[u]&&null!=l?l[u]:t[u];return arguments.length>2&&(_.children=arguments.length>3?o.call(arguments,2):n),S(e.type,_,r||e.key,i||e.ref,null)}function Y(e){function t(e){var n,o;return this.getChildContext||(n=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,T(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+v++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}o=g.slice,r={__e:function(e,t,n,o){for(var r,i,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),u=r.__d),u)return r.__E=r}catch(t){e=t}throw e}},i=0,P.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=x({},this.state),"function"==typeof e&&(e=e(x({},n),this.props)),e&&x(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},P.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},P.prototype.render=C,u=[],_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,c=Math.random().toString(8),s="__d"+c,d="__a"+c,p=/(PointerCapture)$|Capture$/i,f=0,h=L(!1),m=L(!0),v=0;var X=0;Array.isArray;function ee(e,t,n,o,i,u){t||(t={});var l,_,a=t;if("ref"in a)for(_ in a={},t)"ref"==_?l=t[_]:a[_]=t[_];var c={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--X,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(l=e.defaultProps))for(_ in l)void 0===a[_]&&(a[_]=l[_]);return r.vnode&&r.vnode(c),c}var te,ne,oe,re,ie=0,ue=[],le=r,_e=le.__b,ae=le.__r,ce=le.diffed,se=le.__c,de=le.unmount,pe=le.__;function fe(e,t){le.__h&&le.__h(ne,e,ie||t),ie=0;var n=ne.__H||(ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function he(e){return ie=1,me(Oe,e)}function me(e,t,n){var o=fe(te++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Oe(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=ne,!ne.__f)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!i||i.call(this,e,t,n);var u=o.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(u=!0)}}),i&&i.call(this,e,t,n)||u};ne.__f=!0;var i=ne.shouldComponentUpdate,u=ne.componentWillUpdate;ne.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}u&&u.call(this,e,t,n)},ne.shouldComponentUpdate=r}return o.__N||o.__}function ve(e,t){var n=fe(te++,3);!le.__s&&Te(n.__H,t)&&(n.__=e,n.u=t,ne.__H.__h.push(n))}function ye(e,t){var n=fe(te++,4);!le.__s&&Te(n.__H,t)&&(n.__=e,n.u=t,ne.__h.push(n))}function ge(e){return ie=5,we(function(){return{current:e}},[])}function be(e,t,n){ie=6,ye(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function we(e,t){var n=fe(te++,7);return Te(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function xe(e,t){return ie=8,we(function(){return e},t)}function ke(e){var t=ne.context[e.__c],n=fe(te++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ne)),t.props.value):e.__}function Ee(e,t){le.useDebugValue&&le.useDebugValue(t?t(e):e)}function Se(){var e=fe(te++,11);if(!e.__){for(var t=ne.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ce(){for(var e;e=ue.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ie),t.__h.some(Re),t.__h=[]}catch(n){t.__h=[],le.__e(n,e.__v)}}}le.__b=function(e){ne=null,_e&&_e(e)},le.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},le.__r=function(e){ae&&ae(e),te=0;var t=(ne=e.__c).__H;t&&(oe===ne?(t.__h=[],ne.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Ie),t.__h.some(Re),t.__h=[],te=0)),oe=ne},le.diffed=function(e){ce&&ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ue.push(t)&&re===le.requestAnimationFrame||((re=le.requestAnimationFrame)||Ne)(Ce)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),oe=ne=null},le.__c=function(e,t){t.some(function(e){try{e.__h.some(Ie),e.__h=e.__h.filter(function(e){return!e.__||Re(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],le.__e(n,e.__v)}}),se&&se(e,t)},le.unmount=function(e){de&&de(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Ie(e)}catch(e){t=e}}),n.__H=void 0,t&&le.__e(t,n.__v))};var Pe="function"==typeof requestAnimationFrame;function Ne(e){var t,n=function(){clearTimeout(o),Pe&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Pe&&(t=requestAnimationFrame(n))}function Ie(e){var t=ne,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ne=t}function Re(e){var t=ne;e.__c=e.__(),ne=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Oe(e,t){return"function"==typeof t?t(e):t}function $e(e,t){for(var n in t)e[n]=t[n];return e}function Fe(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Ae(e,t){var n=t(),o=he({t:{__:n,u:t}}),r=o[0].t,i=o[1];return ye(function(){r.__=n,r.u=t,Ue(r)&&i({t:r})},[e,n,t]),ve(function(){return Ue(r)&&i({t:r}),e(function(){Ue(r)&&i({t:r})})},[e]),n}function Ue(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function De(e){e()}function We(e){return e}function Me(){return[!1,De]}var Le=ye;function He(e,t){this.props=e,this.context=t}(He.prototype=new P).isPureReactComponent=!0,He.prototype.shouldComponentUpdate=function(e,t){return Fe(this.props,e)||Fe(this.state,t)};var Be=r.__b;r.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Be&&Be(e)};var je="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ve=function(e,t){return null==e?null:U(U(e).map(t))},Ge={map:Ve,forEach:Ve,count:function(e){return e?U(e).length:0},only:function(e){var t=U(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:U},ze=r.__e;r.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);ze(e,t,n,o)};var qe=r.unmount;function Ze(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=$e({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ze(e,t,n)})),e}function Ke(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ke(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Qe(){this.__u=0,this.o=null,this.__b=null}function Je(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Ye(){this.i=null,this.l=null}r.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),qe&&qe(e)},(Qe.prototype=new P).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=Je(o.__v),i=!1,u=function(){i||o.__z||(i=!0,n.__R=null,r?r(_):_())};n.__R=u;var l=n.__P;n.__P=null;var _=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=Ke(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=l,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(u,u)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ze(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&E(C,null,e.fallback);return r&&(r.__u&=-33),[E(C,null,t.__a?null:e.children),r]};var Xe=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function et(e){return this.getChildContext=function(){return e.context},e.children}function tt(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){K(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}K(E(et,{context:t.context},e.__v),t.v)}(Ye.prototype=new P).__a=function(e){var t=this,n=Je(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Xe(t,e,o)):r()};n?n(i):i()}},Ye.prototype.render=function(e){this.i=null,this.l=new Map;var t=U(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ye.prototype.componentDidUpdate=Ye.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xe(e,n,t)})};var nt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ot=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,rt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,it=/[A-Z0-9]/g,ut="undefined"!=typeof document,lt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};P.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(P.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var _t=r.event;r.event=function(e){return _t&&(e=_t(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var at,ct={configurable:!0,get:function(){return this.class}},st=r.vnode;r.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1==n.indexOf("-");for(var i in t){var u=t[i];if(!("value"===i&&"defaultValue"in t&&null==u||ut&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===u?u="":"translate"===l&&"no"===u?u=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||lt(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":rt.test(i)&&(i=l):l=i="oninput":r&&ot.test(i)?i=i.replace(it,"-$&").toLowerCase():null===u&&(u=void 0),"oninput"===l&&o[i=l]&&(i="oninputCapture"),o[i]=u}}"select"==n&&(o.multiple&&Array.isArray(o.value)&&(o.value=U(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=U(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",ct)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=nt,st&&st(e)};var dt=r.__r;r.__r=function(e){dt&&dt(e),at=e.__c};var pt=r.diffed;r.diffed=function(e){pt&&pt(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),at=null};var ft={ReactCurrentDispatcher:{current:{readContext:function(e){return at.__n[e.__c].props.value},useCallback:xe,useContext:ke,useDebugValue:Ee,useDeferredValue:We,useEffect:ve,useId:Se,useImperativeHandle:be,useInsertionEffect:Le,useLayoutEffect:ye,useMemo:we,useReducer:me,useRef:ge,useState:he,useSyncExternalStore:Ae,useTransition:Me}}};function ht(e){return!!e&&e.$$typeof===nt}var mt={useState:he,useId:Se,useReducer:me,useEffect:ve,useLayoutEffect:ye,useInsertionEffect:Le,useTransition:Me,useDeferredValue:We,useSyncExternalStore:Ae,startTransition:De,useRef:ge,useImperativeHandle:be,useMemo:we,useCallback:xe,useContext:ke,useDebugValue:Ee,version:"18.3.1",Children:Ge,render:function(e,t,n){return null==t.__k&&(t.textContent=""),K(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return Q(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(K(null,e),!0)},createPortal:function(e,t){var n=E(tt,{__v:e,h:t});return n.containerInfo=t,n},createElement:E,createContext:Y,createFactory:function(e){return E.bind(null,e)},cloneElement:function(e){return ht(e)?J.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:C,isValidElement:ht,isElement:ht,isFragment:function(e){return ht(e)&&e.type===C},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&0==e.displayName.indexOf("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:P,PureComponent:He,memo:function(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&("function"==typeof n?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:Fe(this.props,e)}function o(t){return this.shouldComponentUpdate=n,E(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o},forwardRef:function(e){function t(t){var n=$e({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=je,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){var n=r.debounceRendering;r.debounceRendering=function(e){return e()};var o=e(t);return r.debounceRendering=n,o},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:C,Suspense:Qe,SuspenseList:Ye,lazy:function(e){var t,n,o,r=null;function i(i){if(t||(t=e()).then(function(e){e&&(r=e.default||e),o=!0},function(e){n=e,o=!0}),n)throw n;if(!o)throw t;return r?E(r,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ft};const vt=/^(https?:|mailto:|tel:)/i,yt=Y({textVariants:{}});function gt(e){if(!e)return;const t={};return e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.borderColor&&e.borderWidth&&(t.border=`${e.borderWidth}px solid ${e.borderColor}`),e.borderRadius&&(t.borderRadius=`${e.borderRadius}px`),Object.keys(t).length?t:void 0}function bt(e){return!!e&&e.value>0&&"CARD_IMAGE_SIZE_UNIT_UNSPECIFIED"!==e.unit}function wt(e){return bt(e)?function(e){return bt(e)&&"CARD_IMAGE_SIZE_UNIT_PERCENT"===e.unit}(e)?{width:"100%",height:"auto",aspectRatio:`100 / ${e.value}`}:{width:"100%",height:`${e.value}px`}:{}}function xt(e){return e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?`${e.top}px`:e.top===e.bottom&&e.left===e.right?`${e.top}px ${e.right}px`:`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`}function kt(e,t){return e[t]??{fontSize:14,fontWeight:400,lineHeight:1.5}}function Et(e,t,n){const o=kt(e,t),r={fontSize:`${o.fontSize}px`};400!==o.fontWeight&&(r.fontWeight=o.fontWeight),1.5!==o.lineHeight&&(r.lineHeight=o.lineHeight);const i=o.fontFamily||n;return i&&(r.fontFamily=i),r}function St({block:e,items:t,defaults:n}){if("placeholder"===e.itemType)return null;const o={...n,...e.styles};let r;return r="card"===e.itemType?mt.createElement(Nt,{card:e}):"columns"===e.itemType?mt.createElement(It,{columns:e}):"content"===e.itemType?mt.createElement(Ct,{leaf:e}):mt.createElement(Pt,{group:e,items:t,defaults:n}),mt.createElement("div",{style:gt(o)},r)}function Ct({leaf:e}){return mt.createElement(Tt,{body:e.content})}function Pt({group:e,items:t,defaults:n}){const o=function(e,t){return e.filter(e=>e.parentId===t)}(t,e.id);if(0===o.length)return null;const r={display:"flex",flexDirection:"GROUP_DIRECTION_HORIZONTAL"===e.direction?"row":"column",gap:`${e.gap??0}px`,alignItems:(i=e.align,"GROUP_ALIGN_CENTER"===i?"center":"GROUP_ALIGN_END"===i?"flex-end":"flex-start")};var i;return e.padding&&(r.padding=xt(e.padding)),e.margin&&(r.margin=xt(e.margin)),mt.createElement("div",{style:r},o.map(e=>mt.createElement(St,{key:e.id,block:e,items:t,defaults:n})))}function Nt({card:e}){const{cardDefaults:t}=ke(yt),n=(e.cardStyles??{}).contentPadding??t?.contentPadding,o=("CARD_IMAGE_FIT_COVER"===(r=e.imageFit)?"cover":"CARD_IMAGE_FIT_CONTAIN"===r?"contain":"CARD_IMAGE_FIT_FILL"===r?"fill":void 0)??"cover";var r;const i=(u=e.imagePosition,`${u?.x??50}% ${u?.y??50}%`);var u;const l=mt.createElement("div",{style:n?{padding:xt(n)}:void 0},mt.createElement(Tt,{body:e.content}));if("no"===e.layout)return l;if("background"===e.layout&&e.image?.src)return mt.createElement("div",{style:{position:"relative",overflow:"hidden",borderRadius:"4px"}},mt.createElement(Ut,{image:e.image,style:{width:"100%",display:"block",objectFit:o,objectPosition:i,...wt(e.imageSize)}}),mt.createElement("div",{style:{position:"absolute",inset:0,padding:"16px",backgroundColor:"rgba(0,0,0,0.4)",color:"#ffffff",display:"flex",flexDirection:"column",justifyContent:"center"}},l));if("left"===e.layout||"right"===e.layout){const t=function(e){if(bt(e))return"CARD_IMAGE_SIZE_UNIT_PERCENT"===e.unit?`${e.value}%`:`${e.value}px`}(e.imageSize)??"200px",n=e.image?.src?mt.createElement("div",{style:{position:"relative",flexShrink:0,alignSelf:"stretch",width:t}},mt.createElement(Ut,{image:e.image,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:o,objectPosition:i}})):null;return mt.createElement("div",{style:{display:"flex",alignItems:"stretch"}},"left"===e.layout&&n,mt.createElement("div",{style:{flex:1,minWidth:0}},l),"right"===e.layout&&n)}return mt.createElement("div",null,e.image?.src&&mt.createElement(Ut,{image:e.image,style:{width:"100%",display:"block",objectFit:o,objectPosition:i,...wt(e.imageSize)}}),l)}function It({columns:e}){const{columnsDefaults:t}=ke(yt),n=e.columnsStyles??{},o=e.gap||t?.gap||16,r=n.padding??t?.padding,i=n.columnPadding??t?.columnPadding,u={display:"flex",gap:`${o}px`};return r&&(u.padding=xt(r)),mt.createElement("div",{style:u},e.columns.map((e,t)=>mt.createElement(Rt,{key:t,column:e,columnPadding:i})))}function Rt({column:e,columnPadding:t}){const n={flex:e.width?`0 1 ${e.width}`:"1 1 0",minWidth:0};return t&&(n.padding=xt(t)),mt.createElement("div",{style:n},e.image?.src&&mt.createElement(Ut,{image:e.image,style:{width:"100%",display:"block"}}),mt.createElement(Tt,{body:e.content}))}function Tt({body:e}){if(!e)return null;const t=function(e){const t={};return e.margin&&(t.margin=xt(e.margin)),e.padding&&(t.padding=xt(e.padding)),t}(e),n=Object.keys(t).length>0,o=e.items.map((e,t)=>mt.createElement(Ot,{key:t,item:e}));return n?mt.createElement("div",{style:t},o):mt.createElement(mt.Fragment,null,o)}function Ot({item:e}){return"buttonGroup"===e.itemType?mt.createElement(Ft,{group:e}):mt.createElement($t,{item:e})}function $t({item:e}){const{textVariants:t,baseFontFamily:n}=ke(yt),o={...Et(t,e.variant,n),padding:"2px 0"};return mt.createElement("div",{style:o,dangerouslySetInnerHTML:{__html:e.text}})}function Ft({group:e}){const{buttonGroupDefaults:t}=ke(yt);if(!e.buttons.length)return null;const n=e.styles??{},o=n.gap??t?.gap??8,r=n.padding??t?.padding,i=n.backgroundColor||t?.backgroundColor,u={display:"flex",flexWrap:"wrap",gap:`${o}px`,justifyContent:(l=e.align,"BUTTON_GROUP_ALIGN_CENTER"===l?"center":"BUTTON_GROUP_ALIGN_RIGHT"===l?"flex-end":"flex-start")};var l;return r&&(u.padding=xt(r)),i&&(u.backgroundColor=i),mt.createElement("div",{style:u},e.buttons.map((e,t)=>mt.createElement(At,{key:t,button:e})))}function At({button:e}){const{buttonDefaults:t,baseFontFamily:n}=ke(yt),o=e.styles??{},r={display:"inline-block",textDecoration:"none",padding:"8px 16px"},i=o.backgroundColor||t?.backgroundColor;i&&(r.backgroundColor=i);const u=o.textColor||t?.textColor;u&&(r.color=u);const l=o.borderWidth||t?.borderWidth;if(l){const e=o.borderColor||t?.borderColor||"#000";r.border=`${l}px solid ${e}`}const _=o.borderRadius||t?.borderRadius;_&&(r.borderRadius=`${_}px`);const a=o.fontSize||t?.fontSize;a&&(r.fontSize=`${a}px`);const c=o.fontFamily||t?.fontFamily||n;c&&(r.fontFamily=c);const s=function(e){const t=(e||"").trim();if(t)return t.startsWith("#")||t.startsWith("/")||t.startsWith("?")||vt.test(t)?t:void 0}(e.url);return mt.createElement("a",{href:s||"#",target:"_blank",rel:"noreferrer",style:r},e.text||"Button")}function Ut({image:e,style:t}){return e.src?mt.createElement("img",{src:e.src,alt:e.alt||"",style:{maxWidth:"100%",...t}}):null}const Dt="\n@keyframes pw-popup-fade { from { opacity: 0; } }\n@keyframes pw-popup-slide { from { opacity: 0; translate: 0 16px; } }\n@keyframes pw-popup-overlay { from { opacity: 0; } }\n";function Wt(e){const t={};e.borderRadius>0&&(t.borderRadius=`${e.borderRadius}px`),e.boxShadow&&(t.boxShadow=e.boxShadow);const n="POPUP_ANIMATION_FADE"===(o=e.animation)?"pw-popup-fade":"POPUP_ANIMATION_SLIDE"===o?"pw-popup-slide":void 0;var o;return n&&(t.animation=`${n} 0.2s ease-out backwards`),t}function Mt(e,t){const n=void 0!==e.top,o=void 0!==e.bottom,r=void 0!==e.left,i=void 0!==e.right,u={position:"fixed",boxSizing:"border-box",overflow:"auto",...Wt(e)};r&&i?(u.left=`${e.left}px`,u.right=`${e.right}px`):(u.width=`${t}px`,r?u.left=`${e.left}px`:i?u.right=`${e.right}px`:u.left="50%"),n&&o?(u.top=`${e.top}px`,u.bottom=`${e.bottom}px`):(n?u.top=`${e.top}px`:o?u.bottom=`${e.bottom}px`:u.top="50%",u.maxHeight=`calc(100% - ${(e.top??0)+(e.bottom??0)}px)`);const l=r||i?"0":"-50%",_=n||o?"0":"-50%";return"0"===l&&"0"===_||(u.transform=`translate(${l}, ${_})`),u}function Lt(e,t){return{position:"relative",boxSizing:"border-box",width:`${t}px`,...Wt(e)}}function Ht(e){const{document:t,mode:n}=e,{items:o,settings:r,textVariants:i,popupSettings:u}=t,l=o??[],_=function(e){return e.filter(e=>!e.parentId)}(l),a=r?.blockGap||16,c=r?.width||600,s=r?.defaultStyles?.common,d=r?.fontFamily||'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',p={maxWidth:`${c}px`,margin:"0 auto",fontFamily:d};r?.backgroundColor&&(p.backgroundColor=r.backgroundColor),r?.textColor&&(p.color=r.textColor),r?.padding&&(p.padding=xt(r.padding));const f={textVariants:i,baseFontFamily:d,cardDefaults:r?.defaultStyles?.card,columnsDefaults:r?.defaultStyles?.columns,buttonGroupDefaults:r?.defaultStyles?.buttonGroup,buttonDefaults:r?.defaultStyles?.button},h=mt.createElement(mt.Fragment,null,_.map((e,t)=>mt.createElement("div",{key:e.id||t,style:t>0?{marginTop:`${a}px`}:void 0},mt.createElement(St,{block:e,items:l,defaults:s}))));if("popup"===n&&u){const e=u.overlay,t=e&&e.color?{position:"fixed",inset:0,backgroundColor:e.color,opacity:e.opacity,animation:"pw-popup-overlay 0.2s ease-out backwards"}:void 0,n={...p,maxWidth:"none",margin:0};return mt.createElement(yt.Provider,{value:f},mt.createElement("style",null,Dt),t&&mt.createElement("div",{style:t}),mt.createElement("div",{style:Mt(u,c)},mt.createElement("div",{style:n},h)))}if("popup-preview"===n&&u){const e={...p,maxWidth:"none",margin:0};return mt.createElement(yt.Provider,{value:f},mt.createElement("style",null,Dt),mt.createElement("div",{style:Lt(u,c)},mt.createElement("div",{style:e},h)))}return mt.createElement(yt.Provider,{value:f},mt.createElement("div",{style:p},h))}const Bt=e=>{try{return JSON.parse(e)}catch{return null}},jt="keyValue",Vt="messages",Gt="log",zt="inboxMessages";function qt(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}const Zt=[qt(jt,function(e){e.createObjectStore(jt,{keyPath:"key"})}),qt(Gt,function(e){const t=e.createObjectStore(Gt,{keyPath:"id",autoIncrement:!0});t.createIndex("environment","environment",{unique:!1}),t.createIndex("date","date",{unique:!1}),t.createIndex("type","type",{unique:!1})}),qt(Vt,function(e){e.createObjectStore(Vt,{keyPath:"id",autoIncrement:!0}).createIndex("date","date",{unique:!1})}),qt(zt,function(e){const t="status",n=e.createObjectStore(zt,{keyPath:"inbox_id",autoIncrement:!1});n.createIndex(t,t,{unique:!1,multiEntry:!0}),n.createIndex("rt","rt",{unique:!1,multiEntry:!0})})];class Kt{get all(){return Zt}}class Qt{constructor(e,t=new Kt){this.db=e,this.migrationsBuilder=t}applyMigrations(){this.applyMigrationsPack(this.migrationsBuilder.all)}applyMigrationsPack(e){e.forEach(e=>{e(this.db)})}}function Jt(e,t){console.info("onversionchange",t),e.close()}let Yt;function Xt(e){return(Yt||(Yt=new Promise((e,t)=>{const n=indexedDB.open("PUSHWOOSH_SDK_STORE",7);n.onsuccess=n=>{const o=n.target.result;o.onversionchange=Jt.bind(null,o,t),e(o)},n.onerror=()=>t(n.error),n.onupgradeneeded=e=>{const n=e.target.result;n.onversionchange=Jt.bind(null,n,t),new Qt(n).applyMigrations()}})),Yt).then(t=>new Promise((n,o)=>e(t,n,o)))}class en{_add(e){return Xt((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).add(e);r.onsuccess=()=>{n(e)},r.onerror=()=>{o(r.error)}}).then(e=>this.getAll().then(t=>{if(Array.isArray(t)){const n=t.map(e=>e.id).sort((e,t)=>e==t?0:e<t?1:-1);if(n.length>this.maxItems)return Promise.all(n.slice(this.maxItems).map(e=>this.delete(e))).then(()=>e)}return e}))}delete(e){return Xt((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).delete(e);r.onsuccess=()=>{n(r.result)},r.onerror=()=>{o(r.error)}})}getAll(){return Xt((e,t,n)=>{const o=[],r=e.transaction(this.name).objectStore(this.name).openCursor();r.onsuccess=e=>{const n=e.target.result;n?(n.value&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{n(r.error)}})}}tn=jt;var tn;const nn=new class extends en{constructor(){super(...arguments),this.name=Gt,this.maxItems=100,this.environment="undefined"!=typeof self&&self.registration?"worker":"browser"}add(e,t,n){const o={type:e,environment:this.environment,message:`${t}`,date:new Date};return t instanceof Error&&(o.stack=t.stack),n&&(o.additional=n),this._add(o)}},on=(new class extends en{constructor(){super(...arguments),this.name=Vt,this.maxItems=25}add(e){return this._add({...e,date:new Date})}},{error:1,info:2,debug:3});let rn=3;const un={setLevel(e){on[e]||(e="error"),rn=on[e]},write(e,t,n){return"error"===e?this.error(t):this.info(t),nn.add(e,t,n)}};Object.keys(on).forEach(e=>{const t=on[e];un[e]=(...n)=>{t<=rn&&(console.groupCollapsed(e),console.info("",...n),console.trace("trace"),console.groupEnd())}});class ln{lockBodyScroll(){0===this.openPopupsCount&&(this.bodyOverflowBeforeLock=document.body.style.overflow,document.body.style.overflow="hidden"),this.openPopupsCount+=1}unlockBodyScroll(){this.openPopupsCount=Math.max(0,this.openPopupsCount-1),0===this.openPopupsCount&&null!==this.bodyOverflowBeforeLock&&(document.body.style.overflow=this.bodyOverflowBeforeLock,this.bodyOverflowBeforeLock=null)}constructor(e){this.isRecurringVisitor=!1,this.loadedPopups=new Map,this.pendingTimers=new Map,this.isNavigationSubscribed=!1,this.openPopupsCount=0,this.bodyOverflowBeforeLock=null,this.pw=e}async run(){const{pw:e}=this;this.isRecurringVisitor=await e.data.getIsRecurringVisitor();const t=(e=>{if("object"!=typeof e||null===e)return[];const t=e.popup_forms;return Array.isArray(t)?t:[]})(await e.data.getFeatures());(await Promise.allSettled(t.map(e=>this.loadWebPopup(e)))).forEach((e,n)=>{"rejected"===e.status&&un.error(e.reason,`Failed to load web popup "${t[n].code}"`)}),this.subscribeToNavigation(),this.renderForCurrentPage(),await e.data.setIsRecurringVisitor(!0)}async loadWebPopup(e){if(!await this.checkStrongCondition(e))return;const t=await this.pw.api.getPopupFormContent(e.popup_form_content_code);this.loadedPopups.set(e.code,{popup:e,content:t})}renderForCurrentPage(){this.cancelPendingForUnmatchedPages();const e=[];this.loadedPopups.forEach((t,n)=>{this.checkSoftCondition(t.popup)&&e.push([n,t])}),e.forEach(([e,{popup:t,content:n}])=>{this.addToQueue(t,n),this.loadedPopups.delete(e)})}cancelPendingForUnmatchedPages(){this.pendingTimers.forEach(({timeoutId:e,loaded:t},n)=>{this.checkSoftCondition(t.popup)||(window.clearTimeout(e),this.pendingTimers.delete(n),this.loadedPopups.set(n,t))})}subscribeToNavigation(){if(this.isNavigationSubscribed)return;this.isNavigationSubscribed=!0;const e=()=>this.renderForCurrentPage(),t=window.navigation;if(t&&"function"==typeof t.addEventListener)return void t.addEventListener("currententrychange",e);window.addEventListener("popstate",e),window.addEventListener("hashchange",e);let n=window.location.href;window.setInterval(()=>{window.location.href!==n&&(n=window.location.href,e())},500)}async checkStrongCondition(e){return(await Promise.all([this.checkCanBeShownByDeviceTypeCondition(e),this.checkCanBeShownByFrequencyCondition(e),this.checkCanBeShownByVisitorsTypeCondition(e)])).every(e=>e)}checkSoftCondition(e){return this.checkCanBeShownByMatchingPagesCondition(e)}checkCanBeShownByDeviceTypeCondition(e){const{device_type:t}=e,n=this.pw.platformChecker.formFactor;return"ALL"===t||t===n}async checkCanBeShownByFrequencyCondition(e){const{frequency:t,code:n}=e;if("ONCE"===t){return!(await this.pw.data.getShownWebPopups()).includes(n)}return"ONCE_PER_SESSION"!==t||null===sessionStorage.getItem(this.getSessionStorageKey(n))}checkCanBeShownByMatchingPagesCondition(e){const{matching_pages:t}=e;return!t||(0===t.length||t.includes(window.location.pathname))}checkCanBeShownByVisitorsTypeCondition(e){const{visitors_type:t}=e;return"NEW"===t?!this.isRecurringVisitor:"RECURRING"!==t||this.isRecurringVisitor}async markAsShown(e){this.pw.api.recordPopupFormEvent(e.code,2).catch(t=>{un.error(t,`Failed to record web popup shown event for "${e.code}"`)});const{frequency:t,code:n}=e;"ONCE"!==t?"ONCE_PER_SESSION"===t&&sessionStorage.setItem(this.getSessionStorageKey(n),"1"):await this.pw.data.addShownWebPopup(n)}getSessionStorageKey(e){return`${n}.shown.${e}`}addToQueue(e,t){this.pw.api.recordPopupFormEvent(e.code,1).catch(t=>{un.error(t,`Failed to record web popup queued event for "${e.code}"`)});const o=window.setTimeout(()=>{this.pendingTimers.delete(e.code);const o=document.createElement("div");o.id=`${n}-${e.code}`,o.style.position="fixed",o.style.inset="0",o.style.zIndex=String(2147483647),document.body.appendChild(o);const r=o.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent="\n .close {\n position: fixed;\n top: 16px;\n right: 16px;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.9);\n cursor: pointer;\n font-size: 24px;\n line-height: 1;\n color: #333;\n }\n";const u=document.createElement("button");u.type="button",u.className="close",u.setAttribute("aria-label","Close"),u.textContent="×";const l=document.createElement("div");r.appendChild(i),r.appendChild(l),r.appendChild(u),this.lockBodyScroll();const _=()=>{this.unlockBodyScroll(),o.remove(),this.pw.dispatchEvent("hide-web-popup",{code:e.code})};u.addEventListener("click",_),((e,t)=>{const n=Bt(t.json);if(!n)return;const o=n.settings?.width??600;e.style.width=`${o}px`,e.style.maxWidth="100%",K(ee(Ht,{document:n,mode:"popup"}),e)})(l,t);const a=l.lastElementChild;l.addEventListener("click",e=>{a&&a.contains(e.target)||_()}),this.markAsShown(e).catch(t=>{un.error(t,`Failed to mark web popup "${e.code}" as shown`)}),this.pw.dispatchEvent("show-web-popup",{code:e.code})},1e3*e.delay);this.pendingTimers.set(e.code,{timeoutId:o,loaded:{popup:e,content:t}})}}return t})());
|
|
1
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(this,()=>(()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{WebPopupsWidget:()=>ln});const n="pushwoosh-web-popups";var o,r,i,u,l,_,a,c,s,d,p,f,h,m,v,y={},g=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,w=Array.isArray;function x(e,t){for(var n in t)e[n]=t[n];return e}function k(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function E(e,t,n){var r,i,u,l={};for(u in t)"key"==u?r=t[u]:"ref"==u?i=t[u]:l[u]=t[u];if(arguments.length>2&&(l.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===l[u]&&(l[u]=e.defaultProps[u]);return S(e,l,r,i,null)}function S(e,t,n,o,u){var l={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:u??++i,__i:-1,__u:0};return null==u&&null!=r.vnode&&r.vnode(l),l}function C(e){return e.children}function P(e,t){this.props=e,this.context=t}function N(e,t){if(null==t)return e.__?N(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?N(e):null}function I(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,o=[],i=[],u=x({},t);u.__v=t.__v+1,r.vnode&&r.vnode(u),H(e.__P,u,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,o,n??N(t),!!(32&t.__u),i),u.__v=t.__v,u.__.__k[u.__i]=u,j(o,u,i),t.__e=t.__=null,u.__e!=n&&R(u)}}function R(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(function(t){if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),R(e)}function T(e){(!e.__d&&(e.__d=!0)&&u.push(e)&&!O.__r++||l!=r.debounceRendering)&&((l=r.debounceRendering)||_)(O)}function O(){try{for(var e,t=1;u.length;)u.length>t&&u.sort(a),e=u.shift(),t=u.length,I(e)}finally{u.length=O.__r=0}}function $(e,t,n,o,r,i,u,l,_,a,c){var s,d,p,f,h,m,v,b=o&&o.__k||g,w=t.length;for(_=F(n,t,b,_,w),s=0;s<w;s++)null!=(p=n.__k[s])&&(d=-1!=p.__i&&b[p.__i]||y,p.__i=s,m=H(e,p,d,r,i,u,l,_,a,c),f=p.__e,p.ref&&d.ref!=p.ref&&(d.ref&&z(d.ref,null,p),c.push(p.ref,p.__c||f,p)),null==h&&null!=f&&(h=f),(v=!!(4&p.__u))||d.__k===p.__k?(_=A(p,_,e,v),v&&d.__e&&(d.__e=null)):"function"==typeof p.type&&void 0!==m?_=m:f&&(_=f.nextSibling),p.__u&=-7);return n.__e=h,_}function F(e,t,n,o,r){var i,u,l,_,a,c=n.length,s=c,d=0;for(e.__k=new Array(r),i=0;i<r;i++)null!=(u=t[i])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[i]=S(null,u,null,null,null):w(u)?u=e.__k[i]=S(C,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[i]=S(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[i]=u,_=i+d,u.__=e,u.__b=e.__b+1,l=null,-1!=(a=u.__i=D(u,n,_,s))&&(s--,(l=n[a])&&(l.__u|=2)),null==l||null==l.__v?(-1==a&&(r>c?d--:r<c&&d++),"function"!=typeof u.type&&(u.__u|=4)):a!=_&&(a==_-1?d--:a==_+1?d++:(a>_?d--:d++,u.__u|=4))):e.__k[i]=null;if(s)for(i=0;i<c;i++)null!=(l=n[i])&&!(2&l.__u)&&(l.__e==o&&(o=N(l)),q(l,l));return o}function A(e,t,n,o){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=A(r[i],t,n,o));return t}e.__e!=t&&(o&&(t&&e.type&&!t.parentNode&&(t=N(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function U(e,t){return t=t||[],null==e||"boolean"==typeof e||(w(e)?e.some(function(e){U(e,t)}):t.push(e)),t}function D(e,t,n,o){var r,i,u,l=e.key,_=e.type,a=t[n],c=null!=a&&!(2&a.__u);if(null===a&&null==l||c&&l==a.key&&_==a.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||i<t.length;)if(null!=(a=t[u=r>=0?r--:i++])&&!(2&a.__u)&&l==a.key&&_==a.type)return u;return-1}function W(e,t,n){"-"==t[0]?e.setProperty(t,n??""):e[t]=null==n?"":"number"!=typeof n||b.test(t)?n:n+"px"}function M(e,t,n,o,r){var i,u;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||W(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||W(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(p,"$1")),u=t.toLowerCase(),t=u in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?o?n[d]=o[d]:(n[d]=f,e.addEventListener(t,i?m:h,i)):e.removeEventListener(t,i?m:h,i);else{if("http://www.w3.org/2000/svg"==r)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=n??"";break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function L(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t[s])t[s]=f++;else if(t[s]<n[d])return;return n(r.event?r.event(t):t)}}}function H(e,t,n,o,i,u,l,_,a,c){var s,d,p,f,h,m,v,y,b,E,S,N,I,R,T,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(a=!!(32&n.__u),u=[_=t.__e=n.__e]),(s=r.__b)&&s(t);e:if("function"==typeof O)try{if(y=t.props,b=O.prototype&&O.prototype.render,E=(s=O.contextType)&&o[s.__c],S=s?E?E.props.value:s.__:o,n.__c?v=(d=t.__c=n.__c).__=d.__E:(b?t.__c=d=new O(y,S):(t.__c=d=new P(y,S),d.constructor=O,d.render=Z),E&&E.sub(d),d.state||(d.state={}),d.__n=o,p=d.__d=!0,d.__h=[],d._sb=[]),b&&null==d.__s&&(d.__s=d.state),b&&null!=O.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=x({},d.__s)),x(d.__s,O.getDerivedStateFromProps(y,d.__s))),f=d.props,h=d.state,d.__v=t,p)b&&null==O.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),b&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(b&&null==O.getDerivedStateFromProps&&y!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,S),t.__v==n.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,S)){t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&l.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,S),b&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(f,h,m)})}if(d.context=S,d.props=y,d.__P=e,d.__e=!1,N=r.__r,I=0,b)d.state=d.__s,d.__d=!1,N&&N(t),s=d.render(d.props,d.state,d.context),g.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,N&&N(t),s=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++I<25);d.state=d.__s,null!=d.getChildContext&&(o=x(x({},o),d.getChildContext())),b&&!p&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(f,h)),R=null!=s&&s.type===C&&null==s.key?V(s.props.children):s,_=$(e,w(R)?R:[R],t,n,o,i,u,l,_,a,c),d.base=t.__e,t.__u&=-161,d.__h.length&&l.push(d),v&&(d.__E=d.__=null)}catch(e){if(t.__v=null,a||null!=u)if(e.then){for(t.__u|=a?160:128;_&&8==_.nodeType&&_.nextSibling;)_=_.nextSibling;u[u.indexOf(_)]=null,t.__e=_}else{for(T=u.length;T--;)k(u[T]);B(t)}else t.__e=n.__e,t.__k=n.__k,e.then||B(t);r.__e(e,t,n)}else null==u&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):_=t.__e=G(n.__e,t,n,o,i,u,l,a,c);return(s=r.diffed)&&s(t),128&t.__u?void 0:_}function B(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(B))}function j(e,t,n){for(var o=0;o<n.length;o++)z(n[o],n[++o],n[++o]);r.__c&&r.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){r.__e(e,t.__v)}})}function V(e){return"object"!=typeof e||null==e||e.__b>0?e:w(e)?e.map(V):void 0!==e.constructor?null:x({},e)}function G(e,t,n,i,u,l,_,a,c){var s,d,p,f,h,m,v,g=n.props||y,b=t.props,x=t.type;if("svg"==x?u="http://www.w3.org/2000/svg":"math"==x?u="http://www.w3.org/1998/Math/MathML":u||(u="http://www.w3.org/1999/xhtml"),null!=l)for(s=0;s<l.length;s++)if((h=l[s])&&"setAttribute"in h==!!x&&(x?h.localName==x:3==h.nodeType)){e=h,l[s]=null;break}if(null==e){if(null==x)return document.createTextNode(b);e=document.createElementNS(u,x,b.is&&b),a&&(r.__m&&r.__m(t,l),a=!1),l=null}if(null==x)g===b||a&&e.data==b||(e.data=b);else{if(l="textarea"==x&&null!=b.defaultValue?null:l&&o.call(e.childNodes),!a&&null!=l)for(g={},s=0;s<e.attributes.length;s++)g[(h=e.attributes[s]).name]=h.value;for(s in g)h=g[s],"dangerouslySetInnerHTML"==s?p=h:"children"==s||s in b||"value"==s&&"defaultValue"in b||"checked"==s&&"defaultChecked"in b||M(e,s,null,h,u);for(s in b)h=b[s],"children"==s?f=h:"dangerouslySetInnerHTML"==s?d=h:"value"==s?m=h:"checked"==s?v=h:a&&"function"!=typeof h||g[s]===h||M(e,s,h,g[s],u);if(d)a||p&&(d.__html==p.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),$("template"==t.type?e.content:e,w(f)?f:[f],t,n,i,"foreignObject"==x?"http://www.w3.org/1999/xhtml":u,l,_,l?l[0]:n.__k&&N(n,0),a,c),null!=l)for(s=l.length;s--;)k(l[s]);a&&"textarea"!=x||(s="value","progress"==x&&null==m?e.removeAttribute("value"):null!=m&&(m!==e[s]||"progress"==x&&!m||"option"==x&&m!=g[s])&&M(e,s,m,g[s],u),s="checked",null!=v&&v!=e[s]&&M(e,s,v,g[s],u))}return e}function z(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){r.__e(e,n)}}function q(e,t,n){var o,i;if(r.unmount&&r.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||z(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){r.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&q(o[i],t,n||"function"!=typeof e.type);n||k(e.__e),e.__c=e.__=e.__e=void 0}function Z(e,t,n){return this.constructor(e,n)}function K(e,t,n){var i,u,l,_;t==document&&(t=document.documentElement),r.__&&r.__(e,t),u=(i="function"==typeof n)?null:n&&n.__k||t.__k,l=[],_=[],H(t,e=(!i&&n||t).__k=E(C,null,[e]),u||y,y,t.namespaceURI,!i&&n?[n]:u?null:t.firstChild?o.call(t.childNodes):null,l,!i&&n?n:u?u.__e:t.firstChild,i,_),j(l,e,_)}function Q(e,t){K(e,t,Q)}function J(e,t,n){var r,i,u,l,_=x({},e.props);for(u in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)"key"==u?r=t[u]:"ref"==u?i=t[u]:_[u]=void 0===t[u]&&null!=l?l[u]:t[u];return arguments.length>2&&(_.children=arguments.length>3?o.call(arguments,2):n),S(e.type,_,r||e.key,i||e.ref,null)}function Y(e){function t(e){var n,o;return this.getChildContext||(n=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,T(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+v++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}o=g.slice,r={__e:function(e,t,n,o){for(var r,i,u;t=t.__;)if((r=t.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(e)),u=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(e,o||{}),u=r.__d),u)return r.__E=r}catch(t){e=t}throw e}},i=0,P.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=x({},this.state),"function"==typeof e&&(e=e(x({},n),this.props)),e&&x(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),T(this))},P.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),T(this))},P.prototype.render=C,u=[],_="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,c=Math.random().toString(8),s="__d"+c,d="__a"+c,p=/(PointerCapture)$|Capture$/i,f=0,h=L(!1),m=L(!0),v=0;var X=0;Array.isArray;function ee(e,t,n,o,i,u){t||(t={});var l,_,a=t;if("ref"in a)for(_ in a={},t)"ref"==_?l=t[_]:a[_]=t[_];var c={type:e,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--X,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(l=e.defaultProps))for(_ in l)void 0===a[_]&&(a[_]=l[_]);return r.vnode&&r.vnode(c),c}var te,ne,oe,re,ie=0,ue=[],le=r,_e=le.__b,ae=le.__r,ce=le.diffed,se=le.__c,de=le.unmount,pe=le.__;function fe(e,t){le.__h&&le.__h(ne,e,ie||t),ie=0;var n=ne.__H||(ne.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function he(e){return ie=1,me(Oe,e)}function me(e,t,n){var o=fe(te++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Oe(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=ne,!ne.__f)){var r=function(e,t,n){if(!o.__c.__H)return!0;var r=o.__c.__H.__.filter(function(e){return e.__c});if(r.every(function(e){return!e.__N}))return!i||i.call(this,e,t,n);var u=o.__c.props!==e;return r.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(u=!0)}}),i&&i.call(this,e,t,n)||u};ne.__f=!0;var i=ne.shouldComponentUpdate,u=ne.componentWillUpdate;ne.componentWillUpdate=function(e,t,n){if(this.__e){var o=i;i=void 0,r(e,t,n),i=o}u&&u.call(this,e,t,n)},ne.shouldComponentUpdate=r}return o.__N||o.__}function ve(e,t){var n=fe(te++,3);!le.__s&&Te(n.__H,t)&&(n.__=e,n.u=t,ne.__H.__h.push(n))}function ye(e,t){var n=fe(te++,4);!le.__s&&Te(n.__H,t)&&(n.__=e,n.u=t,ne.__h.push(n))}function ge(e){return ie=5,we(function(){return{current:e}},[])}function be(e,t,n){ie=6,ye(function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}},null==n?n:n.concat(e))}function we(e,t){var n=fe(te++,7);return Te(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function xe(e,t){return ie=8,we(function(){return e},t)}function ke(e){var t=ne.context[e.__c],n=fe(te++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(ne)),t.props.value):e.__}function Ee(e,t){le.useDebugValue&&le.useDebugValue(t?t(e):e)}function Se(){var e=fe(te++,11);if(!e.__){for(var t=ne.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ce(){for(var e;e=ue.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ie),t.__h.some(Re),t.__h=[]}catch(n){t.__h=[],le.__e(n,e.__v)}}}le.__b=function(e){ne=null,_e&&_e(e)},le.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pe&&pe(e,t)},le.__r=function(e){ae&&ae(e),te=0;var t=(ne=e.__c).__H;t&&(oe===ne?(t.__h=[],ne.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Ie),t.__h.some(Re),t.__h=[],te=0)),oe=ne},le.diffed=function(e){ce&&ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ue.push(t)&&re===le.requestAnimationFrame||((re=le.requestAnimationFrame)||Ne)(Ce)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),oe=ne=null},le.__c=function(e,t){t.some(function(e){try{e.__h.some(Ie),e.__h=e.__h.filter(function(e){return!e.__||Re(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],le.__e(n,e.__v)}}),se&&se(e,t)},le.unmount=function(e){de&&de(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Ie(e)}catch(e){t=e}}),n.__H=void 0,t&&le.__e(t,n.__v))};var Pe="function"==typeof requestAnimationFrame;function Ne(e){var t,n=function(){clearTimeout(o),Pe&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);Pe&&(t=requestAnimationFrame(n))}function Ie(e){var t=ne,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ne=t}function Re(e){var t=ne;e.__c=e.__(),ne=t}function Te(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Oe(e,t){return"function"==typeof t?t(e):t}function $e(e,t){for(var n in t)e[n]=t[n];return e}function Fe(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var o in t)if("__source"!==o&&e[o]!==t[o])return!0;return!1}function Ae(e,t){var n=t(),o=he({t:{__:n,u:t}}),r=o[0].t,i=o[1];return ye(function(){r.__=n,r.u=t,Ue(r)&&i({t:r})},[e,n,t]),ve(function(){return Ue(r)&&i({t:r}),e(function(){Ue(r)&&i({t:r})})},[e]),n}function Ue(e){try{return!((t=e.__)===(n=e.u())&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}var t,n}function De(e){e()}function We(e){return e}function Me(){return[!1,De]}var Le=ye;function He(e,t){this.props=e,this.context=t}(He.prototype=new P).isPureReactComponent=!0,He.prototype.shouldComponentUpdate=function(e,t){return Fe(this.props,e)||Fe(this.state,t)};var Be=r.__b;r.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Be&&Be(e)};var je="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ve=function(e,t){return null==e?null:U(U(e).map(t))},Ge={map:Ve,forEach:Ve,count:function(e){return e?U(e).length:0},only:function(e){var t=U(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:U},ze=r.__e;r.__e=function(e,t,n,o){if(e.then)for(var r,i=t;i=i.__;)if((r=i.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);ze(e,t,n,o)};var qe=r.unmount;function Ze(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=$e({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Ze(e,t,n)})),e}function Ke(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Ke(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Qe(){this.__u=0,this.o=null,this.__b=null}function Je(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Ye(){this.i=null,this.l=null}r.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),qe&&qe(e)},(Qe.prototype=new P).__c=function(e,t){var n=t.__c,o=this;null==o.o&&(o.o=[]),o.o.push(n);var r=Je(o.__v),i=!1,u=function(){i||o.__z||(i=!0,n.__R=null,r?r(_):_())};n.__R=u;var l=n.__P;n.__P=null;var _=function(){if(! --o.__u){if(o.state.__a){var e=o.state.__a;o.__v.__k[0]=Ke(e,e.__c.__P,e.__c.__O)}var t;for(o.setState({__a:o.__b=null});t=o.o.pop();)t.__P=l,t.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(u,u)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ze(this.__b,n,o.__O=o.__P)}this.__b=null}var r=t.__a&&E(C,null,e.fallback);return r&&(r.__u&=-33),[E(C,null,t.__a?null:e.children),r]};var Xe=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function et(e){return this.getChildContext=function(){return e.context},e.children}function tt(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){K(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},namespaceURI:n.namespaceURI,insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}K(E(et,{context:t.context},e.__v),t.v)}(Ye.prototype=new P).__a=function(e){var t=this,n=Je(t.__v),o=t.l.get(e);return o[0]++,function(r){var i=function(){t.props.revealOrder?(o.push(r),Xe(t,e,o)):r()};n?n(i):i()}},Ye.prototype.render=function(e){this.i=null,this.l=new Map;var t=U(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ye.prototype.componentDidUpdate=Ye.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Xe(e,n,t)})};var nt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,ot=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,rt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,it=/[A-Z0-9]/g,ut="undefined"!=typeof document,lt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};P.prototype.isReactComponent=!0,["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(P.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var _t=r.event;r.event=function(e){return _t&&(e=_t(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var at,ct={configurable:!0,get:function(){return this.class}},st=r.vnode;r.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},r=-1==n.indexOf("-");for(var i in t){var u=t[i];if(!("value"===i&&"defaultValue"in t&&null==u||ut&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var l=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===u?u="":"translate"===l&&"no"===u?u=!1:"o"===l[0]&&"n"===l[1]?"ondoubleclick"===l?i="ondblclick":"onchange"!==l||"input"!==n&&"textarea"!==n||lt(t.type)?"onfocus"===l?i="onfocusin":"onblur"===l?i="onfocusout":rt.test(i)&&(i=l):l=i="oninput":r&&ot.test(i)?i=i.replace(it,"-$&").toLowerCase():null===u&&(u=void 0),"oninput"===l&&o[i=l]&&(i="oninputCapture"),o[i]=u}}"select"==n&&(o.multiple&&Array.isArray(o.value)&&(o.value=U(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),null!=o.defaultValue&&(o.value=U(t.children).forEach(function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",ct)):t.className&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=nt,st&&st(e)};var dt=r.__r;r.__r=function(e){dt&&dt(e),at=e.__c};var pt=r.diffed;r.diffed=function(e){pt&&pt(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),at=null};var ft={ReactCurrentDispatcher:{current:{readContext:function(e){return at.__n[e.__c].props.value},useCallback:xe,useContext:ke,useDebugValue:Ee,useDeferredValue:We,useEffect:ve,useId:Se,useImperativeHandle:be,useInsertionEffect:Le,useLayoutEffect:ye,useMemo:we,useReducer:me,useRef:ge,useState:he,useSyncExternalStore:Ae,useTransition:Me}}};function ht(e){return!!e&&e.$$typeof===nt}var mt={useState:he,useId:Se,useReducer:me,useEffect:ve,useLayoutEffect:ye,useInsertionEffect:Le,useTransition:Me,useDeferredValue:We,useSyncExternalStore:Ae,startTransition:De,useRef:ge,useImperativeHandle:be,useMemo:we,useCallback:xe,useContext:ke,useDebugValue:Ee,version:"18.3.1",Children:Ge,render:function(e,t,n){return null==t.__k&&(t.textContent=""),K(e,t),"function"==typeof n&&n(),e?e.__c:null},hydrate:function(e,t,n){return Q(e,t),"function"==typeof n&&n(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(K(null,e),!0)},createPortal:function(e,t){var n=E(tt,{__v:e,h:t});return n.containerInfo=t,n},createElement:E,createContext:Y,createFactory:function(e){return E.bind(null,e)},cloneElement:function(e){return ht(e)?J.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:C,isValidElement:ht,isElement:ht,isFragment:function(e){return ht(e)&&e.type===C},isMemo:function(e){return!!e&&"string"==typeof e.displayName&&0==e.displayName.indexOf("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:P,PureComponent:He,memo:function(e,t){function n(e){var n=this.props.ref;return n!=e.ref&&n&&("function"==typeof n?n(null):n.current=null),t?!t(this.props,e)||n!=e.ref:Fe(this.props,e)}function o(t){return this.shouldComponentUpdate=n,E(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.__f=o.prototype.isReactComponent=!0,o.type=e,o},forwardRef:function(e){function t(t){var n=$e({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=je,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){var n=r.debounceRendering;r.debounceRendering=function(e){return e()};var o=e(t);return r.debounceRendering=n,o},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:C,Suspense:Qe,SuspenseList:Ye,lazy:function(e){var t,n,o,r=null;function i(i){if(t||(t=e()).then(function(e){e&&(r=e.default||e),o=!0},function(e){n=e,o=!0}),n)throw n;if(!o)throw t;return r?E(r,i):null}return i.displayName="Lazy",i.__f=!0,i},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:ft};const vt=/^(https?:|mailto:|tel:)/i,yt=Y({textVariants:{}});function gt(e){if(!e)return;const t={};return e.backgroundColor&&(t.backgroundColor=e.backgroundColor),e.borderColor&&e.borderWidth&&(t.border=`${e.borderWidth}px solid ${e.borderColor}`),e.borderRadius&&(t.borderRadius=`${e.borderRadius}px`),Object.keys(t).length?t:void 0}function bt(e){return!!e&&e.value>0&&"CARD_IMAGE_SIZE_UNIT_UNSPECIFIED"!==e.unit}function wt(e){return bt(e)?function(e){return bt(e)&&"CARD_IMAGE_SIZE_UNIT_PERCENT"===e.unit}(e)?{width:"100%",height:"auto",aspectRatio:`100 / ${e.value}`}:{width:"100%",height:`${e.value}px`}:{}}function xt(e){return e.top===e.right&&e.right===e.bottom&&e.bottom===e.left?`${e.top}px`:e.top===e.bottom&&e.left===e.right?`${e.top}px ${e.right}px`:`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`}function kt(e,t){return e[t]??{fontSize:14,fontWeight:400,lineHeight:1.5}}function Et(e,t,n){const o=kt(e,t),r={fontSize:`${o.fontSize}px`};400!==o.fontWeight&&(r.fontWeight=o.fontWeight),1.5!==o.lineHeight&&(r.lineHeight=o.lineHeight);const i=o.fontFamily||n;return i&&(r.fontFamily=i),r}function St({block:e,items:t,defaults:n}){if("placeholder"===e.itemType)return null;const o={...n,...e.styles};let r;return r="card"===e.itemType?mt.createElement(Nt,{card:e}):"columns"===e.itemType?mt.createElement(It,{columns:e}):"content"===e.itemType?mt.createElement(Ct,{leaf:e}):mt.createElement(Pt,{group:e,items:t,defaults:n}),mt.createElement("div",{style:gt(o)},r)}function Ct({leaf:e}){return mt.createElement(Tt,{body:e.content})}function Pt({group:e,items:t,defaults:n}){const o=function(e,t){return e.filter(e=>e.parentId===t)}(t,e.id);if(0===o.length)return null;const r={display:"flex",flexDirection:"GROUP_DIRECTION_HORIZONTAL"===e.direction?"row":"column",gap:`${e.gap??0}px`,alignItems:(i=e.align,"GROUP_ALIGN_CENTER"===i?"center":"GROUP_ALIGN_END"===i?"flex-end":"flex-start")};var i;return e.padding&&(r.padding=xt(e.padding)),e.margin&&(r.margin=xt(e.margin)),mt.createElement("div",{style:r},o.map(e=>mt.createElement(St,{key:e.id,block:e,items:t,defaults:n})))}function Nt({card:e}){const{cardDefaults:t}=ke(yt),n=(e.cardStyles??{}).contentPadding??t?.contentPadding,o=("CARD_IMAGE_FIT_COVER"===(r=e.imageFit)?"cover":"CARD_IMAGE_FIT_CONTAIN"===r?"contain":"CARD_IMAGE_FIT_FILL"===r?"fill":void 0)??"cover";var r;const i=(u=e.imagePosition,`${u?.x??50}% ${u?.y??50}%`);var u;const l=mt.createElement("div",{style:n?{padding:xt(n)}:void 0},mt.createElement(Tt,{body:e.content}));if("no"===e.layout)return l;if("background"===e.layout&&e.image?.src)return mt.createElement("div",{style:{position:"relative",overflow:"hidden",borderRadius:"4px"}},mt.createElement(Ut,{image:e.image,style:{width:"100%",display:"block",objectFit:o,objectPosition:i,...wt(e.imageSize)}}),mt.createElement("div",{style:{position:"absolute",inset:0,padding:"16px",backgroundColor:"rgba(0,0,0,0.4)",color:"#ffffff",display:"flex",flexDirection:"column",justifyContent:"center"}},l));if("left"===e.layout||"right"===e.layout){const t=function(e){if(bt(e))return"CARD_IMAGE_SIZE_UNIT_PERCENT"===e.unit?`${e.value}%`:`${e.value}px`}(e.imageSize)??"200px",n=e.image?.src?mt.createElement("div",{style:{position:"relative",flexShrink:0,alignSelf:"stretch",width:t}},mt.createElement(Ut,{image:e.image,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:o,objectPosition:i}})):null;return mt.createElement("div",{style:{display:"flex",alignItems:"stretch"}},"left"===e.layout&&n,mt.createElement("div",{style:{flex:1,minWidth:0}},l),"right"===e.layout&&n)}return mt.createElement("div",null,e.image?.src&&mt.createElement(Ut,{image:e.image,style:{width:"100%",display:"block",objectFit:o,objectPosition:i,...wt(e.imageSize)}}),l)}function It({columns:e}){const{columnsDefaults:t}=ke(yt),n=e.columnsStyles??{},o=e.gap||t?.gap||16,r=n.padding??t?.padding,i=n.columnPadding??t?.columnPadding,u={display:"flex",gap:`${o}px`};return r&&(u.padding=xt(r)),mt.createElement("div",{style:u},e.columns.map((e,t)=>mt.createElement(Rt,{key:t,column:e,columnPadding:i})))}function Rt({column:e,columnPadding:t}){const n={flex:e.width?`0 1 ${e.width}`:"1 1 0",minWidth:0};return t&&(n.padding=xt(t)),mt.createElement("div",{style:n},e.image?.src&&mt.createElement(Ut,{image:e.image,style:{width:"100%",display:"block"}}),mt.createElement(Tt,{body:e.content}))}function Tt({body:e}){if(!e)return null;const t=function(e){const t={};return e.margin&&(t.margin=xt(e.margin)),e.padding&&(t.padding=xt(e.padding)),t}(e),n=Object.keys(t).length>0,o=e.items.map((e,t)=>mt.createElement(Ot,{key:t,item:e}));return n?mt.createElement("div",{style:t},o):mt.createElement(mt.Fragment,null,o)}function Ot({item:e}){return"buttonGroup"===e.itemType?mt.createElement(Ft,{group:e}):mt.createElement($t,{item:e})}function $t({item:e}){const{textVariants:t,baseFontFamily:n}=ke(yt),o={...Et(t,e.variant,n),padding:"2px 0"};return mt.createElement("div",{style:o,dangerouslySetInnerHTML:{__html:e.text}})}function Ft({group:e}){const{buttonGroupDefaults:t}=ke(yt);if(!e.buttons.length)return null;const n=e.styles??{},o=n.gap??t?.gap??8,r=n.padding??t?.padding,i=n.backgroundColor||t?.backgroundColor,u={display:"flex",flexWrap:"wrap",gap:`${o}px`,justifyContent:(l=e.align,"BUTTON_GROUP_ALIGN_CENTER"===l?"center":"BUTTON_GROUP_ALIGN_RIGHT"===l?"flex-end":"flex-start")};var l;return r&&(u.padding=xt(r)),i&&(u.backgroundColor=i),mt.createElement("div",{style:u},e.buttons.map((e,t)=>mt.createElement(At,{key:t,button:e})))}function At({button:e}){const{buttonDefaults:t,baseFontFamily:n}=ke(yt),o=e.styles??{},r={display:"inline-block",textDecoration:"none",padding:"8px 16px"},i=o.backgroundColor||t?.backgroundColor;i&&(r.backgroundColor=i);const u=o.textColor||t?.textColor;u&&(r.color=u);const l=o.borderWidth||t?.borderWidth;if(l){const e=o.borderColor||t?.borderColor||"#000";r.border=`${l}px solid ${e}`}const _=o.borderRadius||t?.borderRadius;_&&(r.borderRadius=`${_}px`);const a=o.fontSize||t?.fontSize;a&&(r.fontSize=`${a}px`);const c=o.fontFamily||t?.fontFamily||n;c&&(r.fontFamily=c);const s=function(e){const t=(e||"").trim();if(t)return t.startsWith("#")||t.startsWith("/")||t.startsWith("?")||vt.test(t)?t:void 0}(e.url);return mt.createElement("a",{href:s||"#",target:"_blank",rel:"noreferrer",style:r},e.text||"Button")}function Ut({image:e,style:t}){return e.src?mt.createElement("img",{src:e.src,alt:e.alt||"",style:{maxWidth:"100%",...t}}):null}const Dt="\n@keyframes pw-popup-fade { from { opacity: 0; } }\n@keyframes pw-popup-slide { from { opacity: 0; translate: 0 16px; } }\n@keyframes pw-popup-overlay { from { opacity: 0; } }\n";function Wt(e){const t={};e.borderRadius>0&&(t.borderRadius=`${e.borderRadius}px`),e.boxShadow&&(t.boxShadow=e.boxShadow);const n="POPUP_ANIMATION_FADE"===(o=e.animation)?"pw-popup-fade":"POPUP_ANIMATION_SLIDE"===o?"pw-popup-slide":void 0;var o;return n&&(t.animation=`${n} 0.2s ease-out backwards`),t}function Mt(e,t){const n=void 0!==e.top,o=void 0!==e.bottom,r=void 0!==e.left,i=void 0!==e.right,u={position:"fixed",boxSizing:"border-box",overflow:"auto",...Wt(e)};r&&i?(u.left=`${e.left}px`,u.right=`${e.right}px`):(u.width=`${t}px`,r?u.left=`${e.left}px`:i?u.right=`${e.right}px`:u.left="50%"),n&&o?(u.top=`${e.top}px`,u.bottom=`${e.bottom}px`):(n?u.top=`${e.top}px`:o?u.bottom=`${e.bottom}px`:u.top="50%",u.maxHeight=`calc(100% - ${(e.top??0)+(e.bottom??0)}px)`);const l=r||i?"0":"-50%",_=n||o?"0":"-50%";return"0"===l&&"0"===_||(u.transform=`translate(${l}, ${_})`),u}function Lt(e,t){return{position:"relative",boxSizing:"border-box",width:`${t}px`,...Wt(e)}}function Ht(e){const{document:t,mode:n}=e,{items:o,settings:r,textVariants:i,popupSettings:u}=t,l=o??[],_=function(e){return e.filter(e=>!e.parentId)}(l),a=r?.blockGap||16,c=r?.width||600,s=r?.defaultStyles?.common,d=r?.fontFamily||'-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',p={maxWidth:`${c}px`,margin:"0 auto",fontFamily:d};r?.backgroundColor&&(p.backgroundColor=r.backgroundColor),r?.textColor&&(p.color=r.textColor),r?.padding&&(p.padding=xt(r.padding));const f={textVariants:i,baseFontFamily:d,cardDefaults:r?.defaultStyles?.card,columnsDefaults:r?.defaultStyles?.columns,buttonGroupDefaults:r?.defaultStyles?.buttonGroup,buttonDefaults:r?.defaultStyles?.button},h=mt.createElement(mt.Fragment,null,_.map((e,t)=>mt.createElement("div",{key:e.id||t,style:t>0?{marginTop:`${a}px`}:void 0},mt.createElement(St,{block:e,items:l,defaults:s}))));if("popup"===n&&u){const e=u.overlay,t=e&&e.color?{position:"fixed",inset:0,backgroundColor:e.color,opacity:e.opacity,animation:"pw-popup-overlay 0.2s ease-out backwards"}:void 0,n={...p,maxWidth:"none",margin:0};return mt.createElement(yt.Provider,{value:f},mt.createElement("style",null,Dt),t&&mt.createElement("div",{style:t}),mt.createElement("div",{style:Mt(u,c)},mt.createElement("div",{style:n},h)))}if("popup-preview"===n&&u){const e={...p,maxWidth:"none",margin:0};return mt.createElement(yt.Provider,{value:f},mt.createElement("style",null,Dt),mt.createElement("div",{style:Lt(u,c)},mt.createElement("div",{style:e},h)))}return mt.createElement(yt.Provider,{value:f},mt.createElement("div",{style:p},h))}const Bt=e=>{try{return JSON.parse(e)}catch{return null}},jt="keyValue",Vt="messages",Gt="log",zt="inboxMessages";function qt(e,t){return function(n){n.objectStoreNames.contains(e)||t(n)}}const Zt=[qt(jt,function(e){e.createObjectStore(jt,{keyPath:"key"})}),qt(Gt,function(e){const t=e.createObjectStore(Gt,{keyPath:"id",autoIncrement:!0});t.createIndex("environment","environment",{unique:!1}),t.createIndex("date","date",{unique:!1}),t.createIndex("type","type",{unique:!1})}),qt(Vt,function(e){e.createObjectStore(Vt,{keyPath:"id",autoIncrement:!0}).createIndex("date","date",{unique:!1})}),qt(zt,function(e){const t="status",n=e.createObjectStore(zt,{keyPath:"inbox_id",autoIncrement:!1});n.createIndex(t,t,{unique:!1,multiEntry:!0}),n.createIndex("rt","rt",{unique:!1,multiEntry:!0})})];class Kt{get all(){return Zt}}class Qt{constructor(e,t=new Kt){this.db=e,this.migrationsBuilder=t}applyMigrations(){this.applyMigrationsPack(this.migrationsBuilder.all)}applyMigrationsPack(e){e.forEach(e=>{e(this.db)})}}function Jt(e,t){console.info("onversionchange",t),e.close()}let Yt;function Xt(e){return(Yt||(Yt=new Promise((e,t)=>{const n=indexedDB.open("PUSHWOOSH_SDK_STORE",7);n.onsuccess=n=>{const o=n.target.result;o.onversionchange=Jt.bind(null,o,t),e(o)},n.onerror=()=>t(n.error),n.onupgradeneeded=e=>{const n=e.target.result;n.onversionchange=Jt.bind(null,n,t),new Qt(n).applyMigrations()}})),Yt).then(t=>new Promise((n,o)=>e(t,n,o)))}class en{_add(e){return Xt((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).add(e);r.onsuccess=()=>{n(e)},r.onerror=()=>{o(r.error)}}).then(e=>this.getAll().then(t=>{if(Array.isArray(t)){const n=t.map(e=>e.id).sort((e,t)=>e==t?0:e<t?1:-1);if(n.length>this.maxItems)return Promise.all(n.slice(this.maxItems).map(e=>this.delete(e))).then(()=>e)}return e}))}delete(e){return Xt((t,n,o)=>{const r=t.transaction([this.name],"readwrite").objectStore(this.name).delete(e);r.onsuccess=()=>{n(r.result)},r.onerror=()=>{o(r.error)}})}getAll(){return Xt((e,t,n)=>{const o=[],r=e.transaction(this.name).objectStore(this.name).openCursor();r.onsuccess=e=>{const n=e.target.result;n?(n.value&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{n(r.error)}})}}tn=jt;var tn;const nn=new class extends en{constructor(){super(...arguments),this.name=Gt,this.maxItems=100,this.environment="undefined"!=typeof self&&self.registration?"worker":"browser"}add(e,t,n){const o={type:e,environment:this.environment,message:`${t}`,date:new Date};return t instanceof Error&&(o.stack=t.stack),n&&(o.additional=n),this._add(o)}},on=(new class extends en{constructor(){super(...arguments),this.name=Vt,this.maxItems=25}add(e){return this._add({...e,date:new Date})}},{error:1,info:2,debug:3});let rn=3;const un={setLevel(e){on[e]||(e="error"),rn=on[e]},write(e,t,n){return"error"===e?this.error(t):this.info(t),nn.add(e,t,n)}};Object.keys(on).forEach(e=>{const t=on[e];un[e]=(...n)=>{t<=rn&&(console.groupCollapsed(e),console.info("",...n),console.trace("trace"),console.groupEnd())}});class ln{lockBodyScroll(){0===this.openPopupsCount&&(this.bodyOverflowBeforeLock=document.body.style.overflow,document.body.style.overflow="hidden"),this.openPopupsCount+=1}unlockBodyScroll(){this.openPopupsCount=Math.max(0,this.openPopupsCount-1),0===this.openPopupsCount&&null!==this.bodyOverflowBeforeLock&&(document.body.style.overflow=this.bodyOverflowBeforeLock,this.bodyOverflowBeforeLock=null)}constructor(e){this.isRecurringVisitor=!1,this.loadedPopups=new Map,this.pendingTimers=new Map,this.isNavigationSubscribed=!1,this.openPopupsCount=0,this.bodyOverflowBeforeLock=null,this.pw=e}async run(){const{pw:e}=this;await e.api.ensureDeviceRegistered(),this.isRecurringVisitor=await e.data.getIsRecurringVisitor();const t=await e.api.getPopupForms();(await Promise.allSettled(t.map(e=>this.loadWebPopup(e)))).forEach((e,n)=>{"rejected"===e.status&&un.error(e.reason,`Failed to load web popup "${t[n].code}"`)}),this.subscribeToNavigation(),this.renderForCurrentPage(),await e.data.setIsRecurringVisitor(!0)}async loadWebPopup(e){if(!await this.checkStrongCondition(e))return;const t=await this.pw.api.getPopupFormContent(e.popup_form_content_code);this.loadedPopups.set(e.code,{popup:e,content:t})}renderForCurrentPage(){this.cancelPendingForUnmatchedPages();const e=[];this.loadedPopups.forEach((t,n)=>{this.checkSoftCondition(t.popup)&&e.push([n,t])}),e.forEach(([e,{popup:t,content:n}])=>{this.addToQueue(t,n),this.loadedPopups.delete(e)})}cancelPendingForUnmatchedPages(){this.pendingTimers.forEach(({timeoutId:e,loaded:t},n)=>{this.checkSoftCondition(t.popup)||(window.clearTimeout(e),this.pendingTimers.delete(n),this.loadedPopups.set(n,t))})}subscribeToNavigation(){if(this.isNavigationSubscribed)return;this.isNavigationSubscribed=!0;const e=()=>this.renderForCurrentPage(),t=window.navigation;if(t&&"function"==typeof t.addEventListener)return void t.addEventListener("currententrychange",e);window.addEventListener("popstate",e),window.addEventListener("hashchange",e);let n=window.location.href;window.setInterval(()=>{window.location.href!==n&&(n=window.location.href,e())},500)}async checkStrongCondition(e){return(await Promise.all([this.checkCanBeShownByDeviceTypeCondition(e),this.checkCanBeShownByFrequencyCondition(e),this.checkCanBeShownByVisitorsTypeCondition(e)])).every(e=>e)}checkSoftCondition(e){return this.checkCanBeShownByMatchingPagesCondition(e)}checkCanBeShownByDeviceTypeCondition(e){const{device_type:t}=e,n=this.pw.platformChecker.formFactor;return"ALL"===t||t===n}async checkCanBeShownByFrequencyCondition(e){const{frequency:t,code:n}=e;if("ONCE"===t){return!(await this.pw.data.getShownWebPopups()).includes(n)}return"ONCE_PER_SESSION"!==t||null===sessionStorage.getItem(this.getSessionStorageKey(n))}checkCanBeShownByMatchingPagesCondition(e){const{matching_pages:t}=e;return!t||(0===t.length||t.includes(window.location.pathname))}checkCanBeShownByVisitorsTypeCondition(e){const{visitors_type:t}=e;return"NEW"===t?!this.isRecurringVisitor:"RECURRING"!==t||this.isRecurringVisitor}async markAsShown(e){this.pw.api.recordPopupFormEvent(e.code,2).catch(t=>{un.error(t,`Failed to record web popup shown event for "${e.code}"`)});const{frequency:t,code:n}=e;"ONCE"!==t?"ONCE_PER_SESSION"===t&&sessionStorage.setItem(this.getSessionStorageKey(n),"1"):await this.pw.data.addShownWebPopup(n)}getSessionStorageKey(e){return`${n}.shown.${e}`}addToQueue(e,t){this.pw.api.recordPopupFormEvent(e.code,1).catch(t=>{un.error(t,`Failed to record web popup queued event for "${e.code}"`)});const o=window.setTimeout(()=>{this.pendingTimers.delete(e.code);const o=document.createElement("div");o.id=`${n}-${e.code}`,o.style.position="fixed",o.style.inset="0",o.style.zIndex=String(2147483647),document.body.appendChild(o);const r=o.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent="\n .close {\n position: fixed;\n top: 16px;\n right: 16px;\n width: 32px;\n height: 32px;\n padding: 0;\n border: none;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.9);\n cursor: pointer;\n font-size: 24px;\n line-height: 1;\n color: #333;\n }\n";const u=document.createElement("button");u.type="button",u.className="close",u.setAttribute("aria-label","Close"),u.textContent="×";const l=document.createElement("div");r.appendChild(i),r.appendChild(l),r.appendChild(u),this.lockBodyScroll();const _=()=>{this.unlockBodyScroll(),o.remove(),this.pw.dispatchEvent("hide-web-popup",{code:e.code})};u.addEventListener("click",_),((e,t)=>{const n=Bt(t.json);if(!n)return;const o=n.settings?.width??600;e.style.width=`${o}px`,e.style.maxWidth="100%",K(ee(Ht,{document:n,mode:"popup"}),e)})(l,t);const a=l.lastElementChild;l.addEventListener("click",e=>{a&&a.contains(e.target)||_()}),this.markAsShown(e).catch(t=>{un.error(t,`Failed to mark web popup "${e.code}" as shown`)}),this.pw.dispatchEvent("show-web-popup",{code:e.code})},1e3*e.delay);this.pendingTimers.set(e.code,{timeoutId:o,loaded:{popup:e,content:t}})}}return t})());
|
|
2
2
|
//# sourceMappingURL=widget-web-popups.js.map
|