8889841cindex.asset.php000064400000000202150515357340007504 0ustar00 array('react', 'wp-api-fetch', 'wp-hooks'), 'version' => '31f22d13a0a269744149456720758bf2');index.js000064400000127511150515357340006230 0ustar00/*! For license information please see index.js.LICENSE.txt */ !function(){var e={2864:function(e,t,r){"use strict";var n=r(28487),o=r(25592),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},25592:function(e,t,r){"use strict";var n=r(22698),o=r(28487),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),c=o("%Reflect.apply%",!0)||n.call(a,i),p=o("%Object.getOwnPropertyDescriptor%",!0),l=o("%Object.defineProperty%",!0),u=o("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){var t=c(n,a,arguments);if(p&&l){var r=p(t,"length");r.configurable&&l(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var s=function(){return c(n,i,arguments)};l?l(e.exports,"apply",{value:s}):e.exports.apply=s},6922:function(e,t){"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},o=t||{},a=e.split(";"),c=o.decode||r,p=0;p1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=P(e),n=r.length>0?r[0]:"",i=N("%"+n+"%",t),c=i.name,l=i.value,u=!1,s=i.alias;s&&(n=s[0],S(r,w([0,1],s)));for(var f=1,y=!0;f=r.length){var v=p(l,m);l=(y=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:l[m]}else y=b(l,m),l=l[m];y&&!u&&(d[c]=l)}}return l}},72770:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(69578);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},69578:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},22786:function(e,t,r){"use strict";var n=r(22698);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},52458:function(e){"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,c,p=o(e),l=1;l-1e3&&e<1e3||x.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-j(-e):j(e);if(n!==e){var o=String(n),i=v.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var D=r(50189),M=D.custom,U=$(M)?M:null;function W(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function C(e){return b.call(String(e),/"/g,""")}function B(e){return!("[object Array]"!==z(e)||k&&"object"==typeof e&&k in e)}function L(e){return!("[object RegExp]"!==z(e)||k&&"object"==typeof e&&k in e)}function $(e){if(I)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!_)return!1;try{return _.call(e),!0}catch(e){}return!1}e.exports=function e(t,r,n,o){var c=r||{};if(q(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var p=!q(c,"customInspect")||c.customInspect;if("boolean"!=typeof p&&"symbol"!==p)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var d=c.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return V(t,c);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var w=String(t);return d?T(t,w):w}if("bigint"==typeof t){var x=String(t)+"n";return d?T(t,x):x}var j=void 0===c.depth?5:c.depth;if(void 0===n&&(n=0),n>=j&&j>0&&"object"==typeof t)return B(t)?"[Array]":"[Object]";var N,M=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.call(Array(t+1),r)}}(c,n);if(void 0===o)o=[];else if(H(o,t)>=0)return"[Circular]";function G(t,r,i){if(r&&(o=O.call(o)).push(r),i){var a={depth:c.depth};return q(c,"quoteStyle")&&(a.quoteStyle=c.quoteStyle),e(t,a,n+1,o)}return e(t,c,n+1,o)}if("function"==typeof t&&!L(t)){var J=function(e){if(e.name)return e.name;var t=h.call(g.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ee=X(t,G);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(ee.length>0?" { "+A.call(ee,", ")+" }":"")}if($(t)){var te=I?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):_.call(t);return"object"!=typeof t||I?te:Q(te)}if((N=t)&&"object"==typeof N&&("undefined"!=typeof HTMLElement&&N instanceof HTMLElement||"string"==typeof N.nodeName&&"function"==typeof N.getAttribute)){for(var re="<"+S.call(String(t.nodeName)),ne=t.attributes||[],oe=0;oe"}if(B(t)){if(0===t.length)return"[]";var ie=X(t,G);return M&&!function(e){for(var t=0;t=0)return!1;return!0}(ie)?"["+K(ie,M)+"]":"[ "+A.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==z(e)||k&&"object"==typeof e&&k in e)}(t)){var ae=X(t,G);return"cause"in Error.prototype||!("cause"in t)||F.call(t,"cause")?0===ae.length?"["+String(t)+"]":"{ ["+String(t)+"] "+A.call(ae,", ")+" }":"{ ["+String(t)+"] "+A.call(E.call("[cause]: "+G(t.cause),ae),", ")+" }"}if("object"==typeof t&&p){if(U&&"function"==typeof t[U]&&D)return D(t,{depth:j-n});if("symbol"!==p&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ce=[];return a.call(t,(function(e,r){ce.push(G(r,t,!0)+" => "+G(e,t))})),Z("Map",i.call(t),ce,M)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var pe=[];return u.call(t,(function(e){pe.push(G(e,t))})),Z("Set",l.call(t),pe,M)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e,s);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Y("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{s.call(e,s)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Y("WeakSet");if(function(e){if(!y||!e||"object"!=typeof e)return!1;try{return y.call(e),!0}catch(e){}return!1}(t))return Y("WeakRef");if(function(e){return!("[object Number]"!==z(e)||k&&"object"==typeof e&&k in e)}(t))return Q(G(Number(t)));if(function(e){if(!e||"object"!=typeof e||!P)return!1;try{return P.call(e),!0}catch(e){}return!1}(t))return Q(G(P.call(t)));if(function(e){return!("[object Boolean]"!==z(e)||k&&"object"==typeof e&&k in e)}(t))return Q(m.call(t));if(function(e){return!("[object String]"!==z(e)||k&&"object"==typeof e&&k in e)}(t))return Q(G(String(t)));if(!function(e){return!("[object Date]"!==z(e)||k&&"object"==typeof e&&k in e)}(t)&&!L(t)){var le=X(t,G),ue=R?R(t)===Object.prototype:t instanceof Object||t.constructor===Object,se=t instanceof Object?"":"null prototype",fe=!ue&&k&&Object(t)===t&&k in t?v.call(z(t),8,-1):se?"Object":"",ye=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||se?"["+A.call(E.call([],fe||[],se||[]),": ")+"] ":"");return 0===le.length?ye+"{}":M?ye+"{"+K(le,M)+"}":ye+"{ "+A.call(le,", ")+" }"}return String(t)};var G=Object.prototype.hasOwnProperty||function(e){return e in this};function q(e,t){return G.call(e,t)}function z(e){return d.call(e)}function H(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;rt.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return V(v.call(e,0,t.maxStringLength),t)+n}return W(b.call(b.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,J),"single",t)}function J(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function Q(e){return"Object("+e+")"}function Y(e){return e+" { ? }"}function Z(e,t,r,n){return e+" ("+t+") {"+(n?K(r,n):A.call(r,", "))+"}"}function K(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.call(e,","+r)+"\n"+t.prev}function X(e,t){var r=B(e),n=[];if(r){n.length=e.length;for(var o=0;o-1?e.split(","):e},l=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(i),l=c?i.slice(0,c.index):i,u=[];if(l){if(!r.plainObjects&&o.call(Object.prototype,l)&&!r.allowPrototypes)return;u.push(l)}for(var s=0;r.depth>0&&null!==(c=a.exec(i))&&s=0;--i){var a,c=e[i];if("[]"===c&&r.parseArrays)a=[].concat(o);else{a=r.plainObjects?Object.create(null):{};var l="["===c.charAt(0)&&"]"===c.charAt(c.length-1)?c.slice(1,-1):c,u=parseInt(l,10);r.parseArrays||""!==l?!isNaN(u)&&c!==l&&String(u)===l&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(a=[])[u]=o:"__proto__"!==l&&(a[l]=o):a={0:o}}o=a}return o}(u,t,r,n)}};e.exports=function(e,t){var r=function(e){if(!e)return a;if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=void 0===e.charset?a.charset:e.charset;return{allowDots:void 0===e.allowDots?a.allowDots:!!e.allowDots,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:a.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:a.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:a.comma,decoder:"function"==typeof e.decoder?e.decoder:a.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:a.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:a.depth,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:a.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:a.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:a.strictNullHandling}}(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};for(var u="string"==typeof e?function(e,t){var r,l={},u=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,f=u.split(t.delimiter,s),y=-1,m=t.charset;if(t.charsetSentinel)for(r=0;r-1&&(g=i(g)?[g]:g),o.call(l,d)?l[d]=n.combine(l[d],g):l[d]=g}return l}(e,r):e,s=r.plainObjects?Object.create(null):{},f=Object.keys(u),y=0;y0?A.join(",")||null:void 0}];else if(p(f))R=f;else{var D=Object.keys(A);R=y?D.sort(y):D}for(var M=0;M0?w+b:""}},7173:function(e,t,r){"use strict";var n=r(38243),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),c=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===n.RFC1738&&(40===u||41===u)?p+=c.charAt(l):u<128?p+=a[u]:u<2048?p+=a[192|u>>6]+a[128|63&u]:u<55296||u>=57344?p+=a[224|u>>12]+a[128|u>>6&63]+a[128|63&u]:(l+=1,u=65536+((1023&u)<<10|1023&c.charCodeAt(l)),p+=a[240|u>>18]+a[128|u>>12&63]+a[128|u>>6&63]+a[128|63&u])}return p},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;n({experimentName:e,variationName:null,retrievedTimestamp:t(),ttl:Math.max(60,r),isFallbackExperimentAssignment:!0}),a={_data:{},setItem:function(e,t){this._data[e]=t},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:void 0},removeItem:function(e){delete this._data[e]},clear:function(){this._data={}},get length(){return Object.keys(this._data).length},key:function(e){return Object.keys(this._data)[e]}};var c="undefined"!=typeof window&&window.localStorage?window.localStorage:a;function p(e){return"object"==typeof e&&null!==e}function l(e){return"string"==typeof e&&""!==e}function u(e){if(!function(e){return p(e)&&l(e.experimentName)&&(l(e.variationName)||null===e.variationName)&&"number"==typeof e.retrievedTimestamp&&"number"==typeof e.ttl&&0!==e.ttl}(e))throw new Error("Invalid ExperimentAssignment");return e}const s="explat-experiment-",f=e=>`explat-experiment--${e}`;function y(e){u(e);const t=m(e.experimentName);if(t&&e.retrievedTimestamp{const r=await e();if(r)return c.setItem(h,r),c.setItem(v,String(t())),r;const n=c.getItem(h),o=c.getItem(v);return n&&o&&t()-parseInt(o,10)<864e5?n:null};Error;const w="undefined"==typeof window?function(e){return{loadExperimentAssignment:async t=>(e.logError({message:"Attempting to load ExperimentAssignment in SSR context",experimentName:t}),i(t)),dangerouslyGetExperimentAssignment:t=>(e.logError({message:"Attempting to dangerously get ExperimentAssignment in SSR context",experimentName:t}),i(t)),config:e}}:function(e){if("undefined"==typeof window)throw new Error("Running outside of a browser context.");const r=r=>function(n){let a=null;return()=>(a||(a=(async()=>{const n=await async function(e,r){const n=t(),{variations:a,ttl:c}=function(e){if(function(e){return p(e)&&p(e.variations)&&"number"==typeof e.ttl&&0({experimentName:e,variationName:t,retrievedTimestamp:n,ttl:l}))).map(u);if(s.length>1)throw new Error("Received multiple experiment assignments while trying to fetch exactly one.");if(0===s.length)return i(r,l);const f=s[0];if(f.experimentName!==r)throw new Error("Newly fetched ExperimentAssignment's experiment name does not match request.");if(!o(f))throw new Error("Newly fetched experiment isn't alive.");return f}(e,r);return y(n),n})().finally((()=>{a=null}))),a)}(),n={},a=(...t)=>{try{e.logError(...t)}catch(e){}};try{(s=c.length,[...Array(s).keys()]).map((e=>c.key(e))).filter(d).map(g).filter((e=>{try{if(o(m(e)))return!1}catch(e){}return!0})).map(f).map((e=>c.removeItem(e)))}catch(e){a({message:e.message,source:"removeExpiredExperimentAssignments-error"})}var s;return{loadExperimentAssignment:async e=>{try{if(!l(e))throw new Error(`Invalid experimentName: "${e}"`);const i=m(e);if(i&&o(i))return i;void 0===n[e]&&(n[e]=r(e));let a=1e4;Math.random()>.5&&(a=5e3);const p=await(t=n[e](),c=a,Promise.race([t,new Promise(((e,t)=>setTimeout((()=>t(new Error(`Promise has timed-out after ${c}ms.`))),c)))]));if(!p)throw new Error("Could not fetch ExperimentAssignment");return p}catch(t){a({message:t.message,experimentName:e,source:"loadExperimentAssignment-initialError"})}var t,c;try{const t=m(e);if(t)return t;const r=i(e);return y(r),r}catch(t){return a({message:t.message,experimentName:e,source:"loadExperimentAssignment-fallbackError"}),i(e)}},dangerouslyGetExperimentAssignment:r=>{try{if(!l(r))throw new Error(`Invalid experimentName: ${r}`);const n=m(r);if(!n)throw new Error("Trying to dangerously get an ExperimentAssignment that hasn't loaded.");return e.isDevelopmentMode&&n&&t()-n.retrievedTimestamp<1e3&&a({message:"Warning: Trying to dangerously get an ExperimentAssignment too soon after loading it.",experimentName:r,source:"dangerouslyGetExperimentAssignment"}),n}catch(e){return a({message:e.message,experimentName:r,source:"dangerouslyGetExperimentAssignment-error"}),i(r)}},config:e}};var S=r(61250),x=r(99196);const E={isEligible:!0};function A(e){const t=(t,r={})=>{const n={...E,...r},[o]=(0,x.useState)(t),[i,a]=(0,x.useState)([!0,null]);return(0,x.useEffect)((()=>{let r=!0;return n.isEligible&&e.loadExperimentAssignment(t).then((e=>{r&&a([!1,e])})),()=>{r=!1}}),[t,n.isEligible]),t===o||o.startsWith("explat_test")||e.config.logError({message:"[ExPlat] useExperiment: experimentName should never change between renders!"}),n.isEligible?i:[!1,null]};return{useExperiment:t,Experiment:({defaultExperience:e,treatmentExperience:r,loadingExperience:n,name:o,options:i})=>{const[a,c]=t(o,i);return a?(0,S.jsx)(S.Fragment,{children:n},void 0):c?.variationName?(0,S.jsx)(S.Fragment,{children:r},void 0):(0,S.jsx)(S.Fragment,{children:e},void 0)},ProvideExperimentData:({children:e,name:r,options:n})=>{const[o,i]=t(r,n);return e(o,i)}}}const O=!1,j=e=>{var t;const r=e=>{};try{const{message:n,...o}=e,i={message:n,properties:{...o,context:"explat",explat_client:"woocommerce"}};{if(!(null===(t=window.wcTracks)||void 0===t?void 0:t.isEnabled))throw new Error("Tracking is disabled, can't send error to the server");const e=new window.FormData;e.append("error",JSON.stringify(i)),window.fetch("https://public-api.wordpress.com/rest/v1.1/js-error",{method:"POST",body:e}).catch(r)}}catch(e){}};var P=r(79119),N=window.wp.hooks,_=window.wp.apiFetch,I=r.n(_);const k=e=>{let{experimentName:t,anonId:r}=e;var n,o,i,a,c,p,l,u,s,f;const y=(0,N.applyFilters)("woocommerce_explat_request_args",{experiment_name:t,anon_id:null!=r?r:void 0,woo_country_code:(null===(i=null===(o=null===(n=window.wcSettings)||void 0===n?void 0:n.preloadSettings)||void 0===o?void 0:o.general)||void 0===i?void 0:i.woocommerce_default_country)||(null===(l=null===(p=null===(c=null===(a=window.wcSettings)||void 0===a?void 0:a.admin)||void 0===c?void 0:c.preloadSettings)||void 0===p?void 0:p.general)||void 0===l?void 0:l.woocommerce_default_country),woo_wcadmin_install_timestamp:null===(f=null===(s=null===(u=window.wcSettings)||void 0===u?void 0:u.admin)||void 0===s?void 0:s.preloadOptions)||void 0===f?void 0:f.woocommerce_admin_install_timestamp});if(!(e=>e.hasOwnProperty("experiment_name")&&e.hasOwnProperty("woo_country_code")&&e.hasOwnProperty("woo_wcadmin_install_timestamp"))(y))throw new Error(`Invalid query Params: ${JSON.stringify(y)}`);if(!/^[A-Za-z0-9_]+$/.test(y.experiment_name))throw new Error(`Invalid A/B test name: ${y.experiment_name}`);return y};var F=r(6922);let R=null;const T=async()=>{var e;return(null===(e=window.wcTracks)||void 0===e?void 0:e.isEnabled)?await R:null},D=()=>{var e;(null===(e=window.wcTracks)||void 0===e?void 0:e.isEnabled)&&(async()=>{let e=0;return R=new Promise((t=>{const r=()=>{const n=F.parse(document.cookie).tk_ai||null;"string"!=typeof n||""===n?99<=e?t(null):(e+=1,setTimeout(r,50)):t(n)};r()})),R})().catch((e=>j({message:e.message})))};D();const M=w({fetchExperimentAssignment:async e=>{let{experimentName:t,anonId:r}=e;var n;if(!(null===(n=window.wcTracks)||void 0===n?void 0:n.isEnabled))throw new Error("Tracking is disabled, can't fetch experimentAssignment");const o=k({experimentName:t,anonId:r});if(!o.anon_id)throw new Error("Can't fetch experiment assignment without an anonId or auth, please initialize anonId first or use fetchExperimentAssignmentWithAuth instead.");const i=await window.fetch(`https://public-api.wordpress.com/wpcom/v2/experiments/0.1.0/assignments/woocommerce?${(0,P.stringify)(o)}`);return await i.json()},getAnonId:T,logError:j,isDevelopmentMode:O}),{loadExperimentAssignment:U,dangerouslyGetExperimentAssignment:W}=M,{useExperiment:C,Experiment:B,ProvideExperimentData:L}=A(M),$=w({fetchExperimentAssignment:async e=>{let{experimentName:t,anonId:r}=e;var n;if(!(null===(n=window.wcTracks)||void 0===n?void 0:n.isEnabled))throw new Error("Tracking is disabled, can't fetch experimentAssignment");return await I()({path:`/wc-admin/experiments/assignment?${(0,P.stringify)(k({experimentName:t,anonId:r}))}`})},getAnonId:T,logError:j,isDevelopmentMode:O}),{loadExperimentAssignment:G,dangerouslyGetExperimentAssignment:q}=$,{useExperiment:z,Experiment:H,ProvideExperimentData:V}=A($)}(),(window.wc=window.wc||{}).explat=n}();index.js.LICENSE.txt000064400000000656150515357340010127 0ustar00/* object-assign (c) Sindre Sorhus @license MIT */ /*! * cookie * Copyright(c) 2012-2014 Roman Shtylman * Copyright(c) 2015 Douglas Christopher Wilson * MIT Licensed */ /** @license React v17.0.2 * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */