FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
surecart
/
dist
Edit File: 8017.js
"use strict";(self.webpackChunk_surecart_surecart=self.webpackChunk_surecart_surecart||[]).push([[8017],{9271:function(t,e,n){n.d(e,{a:function(){return pt},b:function(){return V},c:function(){return ht},f:function(){return T},o:function(){return W},s:function(){return B}});var r=n(9394),o=n(45),i=n(2284),a=n(4467),s=n(467),c=n(9280),l=n.n(c),u=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],d=["mainAxis","crossAxis","limiter"],f=["apply"];function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function h(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach((function(e){(0,a.A)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function v(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function b(t){return["top","bottom"].includes(v(t))?"x":"y"}function g(t){return"y"===t?"height":"width"}function y(t,e,n){var r,o=t.reference,i=t.floating,a=o.x+o.width/2-i.width/2,s=o.y+o.height/2-i.height/2,c=b(e),l=g(c),u=o[l]/2-i[l]/2,d="x"===c;switch(v(e)){case"top":r={x:a,y:o.y-i.height};break;case"bottom":r={x:a,y:o.y+o.height};break;case"right":r={x:o.x+o.width,y:s};break;case"left":r={x:o.x-i.width,y:s};break;default:r={x:o.x,y:o.y}}switch(m(e)){case"start":r[c]-=u*(n&&d?-1:1);break;case"end":r[c]+=u*(n&&d?-1:1)}return r}var x=function(){var t=(0,s.A)(l().mark((function t(e,n,r){var o,s,c,u,d,f,p,v,m,b,g,x,w,k,A,_,E,O,L,C,R,P,H,D,T;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=r.placement,s=void 0===o?"bottom":o,c=r.strategy,u=void 0===c?"absolute":c,d=r.middleware,f=void 0===d?[]:d,p=r.platform,t.next=3,null==p.isRTL?void 0:p.isRTL(n);case 3:return v=t.sent,t.next=6,p.getElementRects({reference:e,floating:n,strategy:u});case 6:m=t.sent,b=y(m,s,v),g=b.x,x=b.y,w=s,k={},A=0,_=0;case 12:if(!(_<f.length)){t.next=45;break}return E=f[_],O=E.name,L=E.fn,t.next=16,L({x:g,y:x,initialPlacement:s,placement:w,strategy:u,middlewareData:k,rects:m,platform:p,elements:{reference:e,floating:n}});case 16:if(C=t.sent,R=C.x,P=C.y,H=C.data,D=C.reset,g=null!=R?R:g,x=null!=P?P:x,k=h(h({},k),{},(0,a.A)({},O,h(h({},k[O]),H))),!(D&&A<=50)){t.next=42;break}if(A++,"object"!==(0,i.A)(D)){t.next=40;break}if(D.placement&&(w=D.placement),!D.rects){t.next=37;break}if(!0!==D.rects){t.next=35;break}return t.next=32,p.getElementRects({reference:e,floating:n,strategy:u});case 32:t.t0=t.sent,t.next=36;break;case 35:t.t0=D.rects;case 36:m=t.t0;case 37:T=y(m,w,v),g=T.x,x=T.y;case 40:return _=-1,t.abrupt("continue",42);case 42:_++,t.next=12;break;case 45:return t.abrupt("return",{x:g,y:x,placement:w,strategy:u,middlewareData:k});case 46:case"end":return t.stop()}}),t)})));return function(_x,e,n){return t.apply(this,arguments)}}();function w(t){return h(h({},t),{},{top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height})}function k(t,e){return A.apply(this,arguments)}function A(){return A=(0,s.A)(l().mark((function t(e,n){var r,o,i,a,s,c,u,d,f,p,v,m,b,g,y,x,k,A,_,E,O,L;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return void 0===n&&(n={}),o=e.x,i=e.y,a=e.platform,s=e.rects,c=e.elements,u=e.strategy,f=(d=n).boundary,p=void 0===f?"clippingAncestors":f,v=d.rootBoundary,m=void 0===v?"viewport":v,b=d.elementContext,g=void 0===b?"floating":b,y=d.altBoundary,x=void 0!==y&&y,k=d.padding,A="number"!=typeof(l=void 0===k?0:k)?function(t){return h({top:0,right:0,bottom:0,left:0},t)}(l):{top:l,right:l,bottom:l,left:l},_="floating"===g?"reference":"floating",E=c[x?_:g],t.t0=w,t.t1=a,t.next=10,null==a.isElement?void 0:a.isElement(E);case 10:if(t.t2=r=t.sent,null==t.t2){t.next=15;break}t.t3=r,t.next=16;break;case 15:t.t3=!0;case 16:if(!t.t3){t.next=20;break}t.t4=E,t.next=26;break;case 20:if(t.t5=E.contextElement,t.t5){t.next=25;break}return t.next=24,null==a.getDocumentElement?void 0:a.getDocumentElement(c.floating);case 24:t.t5=t.sent;case 25:t.t4=t.t5;case 26:return t.t6=t.t4,t.t7=p,t.t8=m,t.t9=u,t.t10={element:t.t6,boundary:t.t7,rootBoundary:t.t8,strategy:t.t9},t.next=33,t.t1.getClippingRect.call(t.t1,t.t10);case 33:if(t.t11=t.sent,O=(0,t.t0)(t.t11),t.t12=w,!a.convertOffsetParentRelativeRectToViewportRelativeRect){t.next=49;break}return t.t14=a,t.t15="floating"===g?h(h({},s.floating),{},{x:o,y:i}):s.reference,t.next=41,null==a.getOffsetParent?void 0:a.getOffsetParent(c.floating);case 41:return t.t16=t.sent,t.t17=u,t.t18={rect:t.t15,offsetParent:t.t16,strategy:t.t17},t.next=46,t.t14.convertOffsetParentRelativeRectToViewportRelativeRect.call(t.t14,t.t18);case 46:t.t13=t.sent,t.next=50;break;case 49:t.t13=s[g];case 50:return t.t19=t.t13,L=(0,t.t12)(t.t19),t.abrupt("return",{top:O.top-L.top+A.top,bottom:L.bottom-O.bottom+A.bottom,left:O.left-L.left+A.left,right:L.right-O.right+A.right});case 53:case"end":return t.stop()}var l}),t)}))),A.apply(this,arguments)}var _=Math.min,E=Math.max;function O(t,e,n){return E(t,_(e,n))}var L={left:"right",right:"left",bottom:"top",top:"bottom"};function C(t){return t.replace(/left|right|bottom|top/g,(function(t){return L[t]}))}function R(t,e,n){void 0===n&&(n=!1);var r=m(t),o=b(t),i=g(o),a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=C(a)),{main:a,cross:C(a)}}var P={start:"end",end:"start"};function H(t){return t.replace(/start|end/g,(function(t){return P[t]}))}function D(t){var e=C(t);return[H(t),e,H(e)]}var T=function(t){return void 0===t&&(t={}),{name:"flip",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var i,a,s,c,d,f,p,h,m,b,g,y,x,w,A,_,E,O,L,P,H,T,S,j,W,B,V,z,F,N,K,I,M,q,X;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.placement,s=e.middlewareData,c=e.rects,d=e.initialPlacement,f=e.platform,p=e.elements,m=(h=t).mainAxis,b=void 0===m||m,g=h.crossAxis,y=void 0===g||g,x=h.fallbackPlacements,w=h.fallbackStrategy,A=void 0===w?"bestFit":w,_=h.flipAlignment,E=void 0===_||_,O=(0,o.A)(h,u),L=v(a),P=L===d,H=x||(P||!E?[C(d)]:D(d)),T=[d].concat((0,r.A)(H)),n.next=8,k(e,O);case 8:if(S=n.sent,j=[],W=(null==(i=s.flip)?void 0:i.overflows)||[],b&&j.push(S[L]),!y){n.next=23;break}return n.t0=R,n.t1=a,n.t2=c,n.next=18,null==f.isRTL?void 0:f.isRTL(p.floating);case 18:n.t3=n.sent,B=(0,n.t0)(n.t1,n.t2,n.t3),V=B.main,z=B.cross,j.push(S[V],S[z]);case 23:if(W=[].concat((0,r.A)(W),[{placement:a,overflows:j}]),j.every((function(t){return t<=0}))){n.next=40;break}if(K=(null!=(F=null==(N=s.flip)?void 0:N.index)?F:0)+1,!(I=T[K])){n.next=29;break}return n.abrupt("return",{data:{index:K,overflows:W},reset:{placement:I}});case 29:M="bottom",n.t4=A,n.next="bestFit"===n.t4?33:"initialPlacement"===n.t4?36:38;break;case 33:return X=null==(q=W.map((function(t){return[t,t.overflows.filter((function(t){return t>0})).reduce((function(t,e){return t+e}),0)]})).sort((function(t,e){return t[1]-e[1]}))[0])?void 0:q[0].placement,X&&(M=X),n.abrupt("break",38);case 36:return M=d,n.abrupt("break",38);case 38:if(a===M){n.next=40;break}return n.abrupt("return",{reset:{placement:M}});case 40:return n.abrupt("return",{});case 41:case"end":return n.stop()}}),n)})))()}}};function S(t,e){return j.apply(this,arguments)}function j(){return j=(0,s.A)(l().mark((function t(e,n){var r,o,i,a,s,c,u,d,f,p,g,y,x,w;return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.placement,o=e.platform,i=e.elements,t.next=3,null==o.isRTL?void 0:o.isRTL(i.floating);case 3:return a=t.sent,s=v(r),c=m(r),u="x"===b(r),d=["left","top"].includes(s)?-1:1,f=a&&u?-1:1,p="function"==typeof n?n(e):n,g="number"==typeof p?{mainAxis:p,crossAxis:0,alignmentAxis:null}:h({mainAxis:0,crossAxis:0,alignmentAxis:null},p),y=g.mainAxis,x=g.crossAxis,w=g.alignmentAxis,c&&"number"==typeof w&&(x="end"===c?-1*w:w),t.abrupt("return",u?{x:x*f,y:y*d}:{x:y*d,y:x*f});case 13:case"end":return t.stop()}}),t)}))),j.apply(this,arguments)}var W=function(t){return void 0===t&&(t=0),{name:"offset",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var r,o,i;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.x,o=e.y,n.next=3,S(e,t);case 3:return i=n.sent,n.abrupt("return",{x:r+i.x,y:o+i.y,data:i});case 5:case"end":return n.stop()}}),n)})))()}}},B=function(t){return void 0===t&&(t={}),{name:"shift",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var r,i,s,c,u,f,p,m,g,y,x,w,A,_,E,L,C,R,P,H,D,T,S,j;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.x,i=e.y,s=e.placement,u=(c=t).mainAxis,f=void 0===u||u,p=c.crossAxis,m=void 0!==p&&p,g=c.limiter,y=void 0===g?{fn:function(t){return{x:t.x,y:t.y}}}:g,x=(0,o.A)(c,d),w={x:r,y:i},n.next=5,k(e,x);case 5:return A=n.sent,_=b(v(s)),E="x"===_?"y":"x",L=w[_],C=w[E],f&&(R="y"===_?"bottom":"right",P=L+A["y"===_?"top":"left"],H=L-A[R],L=O(P,L,H)),m&&(D="y"===E?"bottom":"right",T=C+A["y"===E?"top":"left"],S=C-A[D],C=O(T,C,S)),j=y.fn(h(h({},e),{},(0,a.A)((0,a.A)({},_,L),E,C))),n.abrupt("return",h(h({},j),{},{data:{x:j.x-r,y:j.y-i}}));case 14:case"end":return n.stop()}}),n)})))()}}},V=function(t){return void 0===t&&(t={}),{name:"size",options:t,fn:function(e){return(0,s.A)(l().mark((function n(){var r,i,a,s,c,u,d,p,b,g,y,x,w,A,_,O,L,C,R;return l().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=e.placement,i=e.rects,a=e.platform,s=e.elements,u=(c=t).apply,d=(0,o.A)(c,f),n.next=4,k(e,d);case 4:if(p=n.sent,b=v(r),g=m(r),"top"!==b&&"bottom"!==b){n.next=26;break}return y=b,n.t0=g,n.next=12,null==a.isRTL?void 0:a.isRTL(s.floating);case 12:if(!n.sent){n.next=16;break}n.t1="start",n.next=17;break;case 16:n.t1="end";case 17:if(n.t2=n.t1,n.t0!==n.t2){n.next=22;break}n.t3="left",n.next=23;break;case 22:n.t3="right";case 23:x=n.t3,n.next=28;break;case 26:x=b,y="end"===g?"top":"bottom";case 28:return w=E(p.left,0),A=E(p.right,0),_=E(p.top,0),O=E(p.bottom,0),L={availableHeight:i.floating.height-(["left","right"].includes(r)?2*(0!==_||0!==O?_+O:E(p.top,p.bottom)):p[y]),availableWidth:i.floating.width-(["top","bottom"].includes(r)?2*(0!==w||0!==A?w+A:E(p.left,p.right)):p[x])},n.next=35,a.getDimensions(s.floating);case 35:return C=n.sent,null==u||u(h(h({},e),L)),n.next=39,a.getDimensions(s.floating);case 39:if(R=n.sent,C.width===R.width&&C.height===R.height){n.next=42;break}return n.abrupt("return",{reset:{rects:!0}});case 42:return n.abrupt("return",{});case 43:case"end":return n.stop()}}),n)})))()}}};function z(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function F(t){if(null==t)return window;if(!z(t)){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function N(t){return F(t).getComputedStyle(t)}function K(t){return z(t)?"":t?(t.nodeName||"").toLowerCase():""}function I(){var t=navigator.userAgentData;return null!=t&&t.brands?t.brands.map((function(t){return t.brand+"/"+t.version})).join(" "):navigator.userAgent}function M(t){return t instanceof F(t).HTMLElement}function q(t){return t instanceof F(t).Element}function X(t){return"undefined"!=typeof ShadowRoot&&(t instanceof F(t).ShadowRoot||t instanceof ShadowRoot)}function Y(t){var e=N(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function G(t){return["table","td","th"].includes(K(t))}function J(t){var e=/firefox/i.test(I()),n=N(t);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||e&&"filter"===n.willChange||e&&!!n.filter&&"none"!==n.filter}function Q(){return!/^((?!chrome|android).)*safari/i.test(I())}var U=Math.min,Z=Math.max,$=Math.round;function tt(t,e,n){var r,o,i,a;void 0===e&&(e=!1),void 0===n&&(n=!1);var s=t.getBoundingClientRect(),c=1,l=1;e&&M(t)&&(c=t.offsetWidth>0&&$(s.width)/t.offsetWidth||1,l=t.offsetHeight>0&&$(s.height)/t.offsetHeight||1);var u=q(t)?F(t):window,d=!Q()&&n,f=(s.left+(d&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/c,p=(s.top+(d&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/l,h=s.width/c,v=s.height/l;return{width:h,height:v,top:p,right:f+h,bottom:p+v,left:f,x:f,y:p}}function et(t){return(e=t,(e instanceof F(e).Node?t.ownerDocument:t.document)||window.document).documentElement;var e}function nt(t){return q(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function rt(t){return tt(et(t)).left+nt(t).scrollLeft}function ot(t,e,n){var r=M(e),o=et(e),i=tt(t,r&&function(t){var e=tt(t);return $(e.width)!==t.offsetWidth||$(e.height)!==t.offsetHeight}(e),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==K(e)||Y(o))&&(a=nt(e)),M(e)){var c=tt(e,!0);s.x=c.x+e.clientLeft,s.y=c.y+e.clientTop}else o&&(s.x=rt(o));return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}function it(t){return"html"===K(t)?t:t.assignedSlot||t.parentNode||(X(t)?t.host:null)||et(t)}function at(t){return M(t)&&"fixed"!==getComputedStyle(t).position?t.offsetParent:null}function st(t){for(var e=F(t),n=at(t);n&&G(n)&&"static"===getComputedStyle(n).position;)n=at(n);return n&&("html"===K(n)||"body"===K(n)&&"static"===getComputedStyle(n).position&&!J(n))?e:n||function(t){var e=it(t);for(X(e)&&(e=e.host);M(e)&&!["html","body"].includes(K(e));){if(J(e))return e;e=e.parentNode}return null}(t)||e}function ct(t){if(M(t))return{width:t.offsetWidth,height:t.offsetHeight};var e=tt(t);return{width:e.width,height:e.height}}function lt(t){var e=it(t);return["html","body","#document"].includes(K(e))?t.ownerDocument.body:M(e)&&Y(e)?e:lt(e)}function ut(t,e){var n;void 0===e&&(e=[]);var r=lt(t),o=r===(null==(n=t.ownerDocument)?void 0:n.body),i=F(r),a=o?[i].concat(i.visualViewport||[],Y(r)?r:[]):r,s=e.concat(a);return o?s:s.concat(ut(a))}function dt(t,e,n){return"viewport"===e?w(function(t,e){var n=F(t),r=et(t),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,c=0;if(o){i=o.width,a=o.height;var l=Q();(l||!l&&"fixed"===e)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:s,y:c}}(t,n)):q(e)?function(t,e){var n=tt(t,!1,"fixed"===e),r=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:r,left:o,x:o,y:r,right:o+t.clientWidth,bottom:r+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}(e,n):w(function(t){var e,n=et(t),r=nt(t),o=null==(e=t.ownerDocument)?void 0:e.body,i=Z(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Z(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+rt(t),c=-r.scrollTop;return"rtl"===N(o||n).direction&&(s+=Z(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}(et(t)))}var ft={getClippingRect:function(t){var e=t.element,n=t.boundary,o=t.rootBoundary,i=t.strategy,a="clippingAncestors"===n?function(t){var e=ut(t),n=["absolute","fixed"].includes(N(t).position)&&M(t)?st(t):t;return q(n)?e.filter((function(t){return q(t)&&function(t,e){var n=null==e.getRootNode?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&X(n)){var r=e;do{if(r&&t===r)return!0;r=r.parentNode||r.host}while(r)}return!1}(t,n)&&"body"!==K(t)})):[]}(e):[].concat(n),s=[].concat((0,r.A)(a),[o]),c=s[0],l=s.reduce((function(t,n){var r=dt(e,n,i);return t.top=Z(r.top,t.top),t.right=U(r.right,t.right),t.bottom=U(r.bottom,t.bottom),t.left=Z(r.left,t.left),t}),dt(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(t){var e=t.rect,n=t.offsetParent,r=t.strategy,o=M(n),i=et(n);if(n===i)return e;var a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==K(n)||Y(i))&&(a=nt(n)),M(n))){var c=tt(n,!0);s.x=c.x+n.clientLeft,s.y=c.y+n.clientTop}return h(h({},e),{},{x:e.x-a.scrollLeft+s.x,y:e.y-a.scrollTop+s.y})},isElement:q,getDimensions:ct,getOffsetParent:st,getDocumentElement:et,getElementRects:function(t){var e=t.reference,n=t.floating,r=t.strategy;return{reference:ot(e,st(n),r),floating:h(h({},ct(n)),{},{x:0,y:0})}},getClientRects:function(t){return Array.from(t.getClientRects())},isRTL:function(t){return"rtl"===N(t).direction}};function pt(t,e,n,o){void 0===o&&(o={});var i=o,a=i.ancestorScroll,s=void 0===a||a,c=i.ancestorResize,l=void 0===c||c,u=i.elementResize,d=void 0===u||u,f=i.animationFrame,p=void 0!==f&&f,h=s&&!p,v=l&&!p,m=h||v?[].concat((0,r.A)(q(t)?ut(t):[]),(0,r.A)(ut(e))):[];m.forEach((function(t){h&&t.addEventListener("scroll",n,{passive:!0}),v&&t.addEventListener("resize",n)}));var b,g=null;if(d){var y=!0;g=new ResizeObserver((function(){y||n(),y=!1})),q(t)&&!p&&g.observe(t),g.observe(e)}var x=p?tt(t):null;return p&&function e(){var r=tt(t);!x||r.x===x.x&&r.y===x.y&&r.width===x.width&&r.height===x.height||n(),x=r,b=requestAnimationFrame(e)}(),n(),function(){var t;m.forEach((function(t){h&&t.removeEventListener("scroll",n),v&&t.removeEventListener("resize",n)})),null==(t=g)||t.disconnect(),g=null,p&&cancelAnimationFrame(b)}}var ht=function(t,e,n){return x(t,e,h({platform:ft},n))}},6402:function(t,e,n){function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite",e=document.createElement("div");e.id="a11y-speak-".concat(t),e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");var n=document.body;return n&&n.appendChild(e),e}n.d(e,{s:function(){return a}});var o,i="";function a(t,e){!function(){for(var t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text"),n=0;n<t.length;n++)t[n].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/g," "),i===t&&(t+=" "),i=t,t}(t);var n=document.getElementById("a11y-speak-intro-text"),r=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");r&&"assertive"===e?r.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}o=function(){var t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){var t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=wp.i18n.__("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");var e=document.body;e&&e.appendChild(t)}(),null===e&&r("assertive"),null===n&&r("polite")},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",o):o())},8017:function(t,e,n){n.r(e),n.d(e,{sc_popover:function(){return c}});var r=n(3029),o=n(2901),i=n(1346),a=n(9271),s=n(6402),c=function(){return(0,o.A)((function t(e){var n=this;(0,r.A)(this,t),(0,i.r)(this,e),this.scShow=(0,i.c)(this,"scShow",7),this.scHide=(0,i.c)(this,"scHide",7),this.boundHandleOutsideClick=function(t){return n.handleOutsideClick(t)},this.boundHandleKeyDown=function(t){return n.handleKeyDown(t)},this.boundHandleFocusOut=function(t){return n.handleFocusOut(t)},this.disabled=void 0,this.open=!1,this.placement="bottom-start",this.distance=0,this.skidding=0,this.hoist=!1,this.isVisible=void 0}),[{key:"handleOpenChange",value:function(){this.open?this.show():this.hide()}},{key:"handleOutsideClick",value:function(t){var e=this;t.composedPath().some((function(t){return t===e.el}))||(this.open=!1)}},{key:"handleKeyDown",value:function(t){"Escape"===t.key&&(t.stopPropagation(),this.hide())}},{key:"handleTriggerKeyDown",value:function(t){if("Enter"===t.key||" "===t.key){if(t.preventDefault(),this.disabled)return;this.open?this.hide():this.show()}}},{key:"handleFocusOut",value:function(t){var e=t.relatedTarget;e&&!this.el.contains(e)&&(this.open=!1)}},{key:"startPositioner",value:function(){this.stopPositioner(),this.updatePositioner(),this.positionerCleanup=(0,a.a)(this.trigger,this.positioner,this.updatePositioner.bind(this))}},{key:"updatePositioner",value:function(){var t=this;this.open&&this.trigger&&this.positioner&&(0,a.c)(this.trigger,this.positioner,{placement:this.placement,middleware:[(0,a.o)({mainAxis:this.distance,crossAxis:this.skidding}),(0,a.f)(),(0,a.s)(),(0,a.b)({apply:function(e){var n=e.availableWidth,r=e.availableHeight;Object.assign(t.panel.style,{maxWidth:"".concat(n,"px"),maxHeight:"".concat(r,"px")})},padding:8})],strategy:this.hoist?"fixed":"absolute"}).then((function(e){var n=e.x,r=e.y,o=e.placement;t.positioner.setAttribute("data-placement",o),Object.assign(t.positioner.style,{position:t.hoist?"fixed":"absolute",left:"".concat(n,"px"),top:"".concat(r,"px"),right:"auto"})}))}},{key:"stopPositioner",value:function(){var t;this.positionerCleanup&&(this.positionerCleanup(),this.positionerCleanup=void 0,null===(t=this.positioner)||void 0===t||t.removeAttribute("data-placement"))}},{key:"show",value:function(){(0,s.s)(wp.i18n.__("Popover opened. Press Escape to close.","surecart"),"assertive"),this.scShow.emit(),this.isVisible||(this.isVisible=!0,this.open=!0,this.startPositioner(),document.addEventListener("keydown",this.boundHandleKeyDown),this.el.addEventListener("focusout",this.boundHandleFocusOut),this.panel.focus())}},{key:"hide",value:function(){var t;if((0,s.s)(wp.i18n.__("Popover closed.","surecart"),"assertive"),this.scHide.emit(),this.isVisible){this.stopPositioner(),document.removeEventListener("keydown",this.boundHandleKeyDown),this.el.removeEventListener("focusout",this.boundHandleFocusOut),this.isVisible=!1,this.open=!1;var e=this.el.shadowRoot.querySelector('slot[name="trigger"]').assignedElements({flatten:!0})[0];null===(t=null==e?void 0:e.focus)||void 0===t||t.call(e)}}},{key:"componentWillLoad",value:function(){document.addEventListener("mousedown",this.boundHandleOutsideClick)}},{key:"disconnectedCallback",value:function(){document.removeEventListener("mousedown",this.boundHandleOutsideClick),document.removeEventListener("keydown",this.boundHandleKeyDown),this.el.removeEventListener("focusout",this.boundHandleFocusOut)}},{key:"handleHide",value:function(){this.open=!1,this.trigger.focus()}},{key:"render",value:function(){var t=this;return(0,i.h)("div",{key:"4476ca548c15fe56a44eae155f62ef71aeddace7",part:"base",class:{popover:!0,"popover--open":this.open,"popover--disabled":this.disabled}},(0,i.h)("span",{key:"6a9808307b807e7447d6c3462ab996327107fef1",part:"trigger",class:"popover__trigger",ref:function(e){return t.trigger=e},onClick:function(){t.disabled||(t.open?t.hide():setTimeout((function(){t.show()}),0))},onKeyDown:function(e){return t.handleTriggerKeyDown(e)},tabindex:"0",role:"button","aria-expanded":this.open?"true":"false","aria-haspopup":"dialog","aria-label":wp.i18n.__("Press Enter to open popover","surecart")},(0,i.h)("slot",{key:"db33d95a8adcea45e00440c5b57e25ad1f3cc4bd",name:"trigger"})),(0,i.h)("div",{key:"a0784e3aad7390b51f77ae8d681cfeaab28cefff",class:"popover__positioner",ref:function(e){return t.positioner=e}},(0,i.h)("div",{key:"558c5a05a654f5f606087dfe7349a2b707d4bc57",part:"panel",class:"popover__panel",role:"dialog","aria-modal":"false",tabindex:"-1",ref:function(e){return t.panel=e}},(0,i.h)("div",{key:"1156def1e343a3e85b914ea3e8f60e14b8b14bcb",class:"popover__header"},(0,i.h)("slot",{key:"3734de42a6f231ee4217867bdf3a7c477a1e2f90",name:"title"}),(0,i.h)("button",{key:"de0de0b7e33fdbe2d34fe9120f7acecdb5c66762",type:"button",class:"popover__header-close-button",onClick:function(){return t.handleHide()},onKeyDown:function(e){return"Enter"===e.key&&t.handleHide()},"aria-label":wp.i18n.__("Close","surecart")},(0,i.h)("sc-icon",{key:"d2143106c34526da7989fc52aca6c38a3f82d7fe",class:"popover__header-close-icon",name:"x"}))),(0,i.h)("slot",{key:"756a9284b3a5598e3545ecfaa4d356e6bbb158d5",name:"content"}),(0,i.h)("div",{key:"d870a248537c405adbf15cb30bb71810b615bc15",class:"popover__footer"},(0,i.h)("slot",{key:"8a8ad84cb03161e43e1869243dcf9761fd7e31ae",name:"footer"})))))}},{key:"el",get:function(){return(0,i.a)(this)}}],[{key:"watchers",get:function(){return{open:["handleOpenChange"]}}}])}();c.style=':host{display:inline-block;--panel-height:75vh}slot[name=title]{font-weight:600;font-size:14px}.popover{position:relative}.popover.popover--open .popover__positioner{visibility:visible;opacity:1;transform:scale(1)}.popover__header{display:flex;justify-content:space-between;padding-bottom:1em}.popover__header-close-button{display:flex;align-items:center;justify-content:center;padding:0;margin:0;border:none;background:transparent;cursor:pointer;border-radius:var(--sc-border-radius-small)}.popover__header-close-button:focus{outline:2px solid var(--sc-focus-ring-color, var(--sc-color-primary-500));outline-offset:2px}.popover__header-close-button:hover{opacity:0.7}.popover__header-close-icon{vertical-align:middle;width:1.5em;height:1.5em}.popover__footer{border-top:1px solid var(--sc-input-border-color);padding-top:0.5em;margin-top:1em}.popover__trigger{display:block;cursor:pointer;border-width:0;outline:none;background-color:unset}.popover--disabled,.popover--disabled .popover__trigger{cursor:not-allowed}.popover__positioner{position:absolute;right:0;width:100%;z-index:var(--sc-z-index-popover);opacity:0;visibility:hidden;transform:scale(0.9);min-width:var(--panel-width, "fit-content")}.popover__panel{transform-origin:top left;box-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);max-height:var(--panel-height);font-family:var(--sc-font-sans);font-size:var(--sc-font-size-medium);font-weight:var(--sc-font-weight-normal);color:var(--sc-input-label-color);background-color:var(--sc-panel-background-color);border:solid 1px var(--sc-panel-border-color);border-radius:var(--sc-border-radius-x-large);box-shadow:var(--sc-shadow-large);overflow:auto;overscroll-behavior:none;transition:var(--sc-transition-fast) opacity, var(--sc-transition-fast) transform;z-index:5;padding:var(--sc-spacing-medium)}'}}]);
Save
Back