(()=>{"use strict";var t={d:(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{add_payment_info:()=>k,add_shipping_info:()=>b,add_to_cart:()=>w,begin_checkout:()=>v,purchase:()=>E,remove_from_cart:()=>g,search:()=>q,select_content:()=>A,view_item:()=>S,view_item_list:()=>f});const r=window.wp.i18n,o=window.wp.hooks,n=[],c=(t,e)=>null!=t&&null!=e&&String(t)===String(e),i=(t,e)=>{const r={};var o;t.variation&&(r.item_variant=(o=t.variation,Array.isArray(o)?o.map(({attribute:t,value:e})=>t&&e?`${t.toLowerCase()}: ${e}`:null).filter(Boolean).join(", "):o));const n={item_id:u(t),item_name:t.name,...m(t),quantity:t.quantity??e,price:s(t.totals?.line_total||t.prices.price,t.prices.currency_minor_unit),...r};return t?.price_after_coupon_discount<t.prices.price&&(n.discount=s(t.prices.price-t.price_after_coupon_discount,t.prices.currency_minor_unit),n.price=s(t.price_after_coupon_discount,t.prices.currency_minor_unit)),n},a=(t,e)=>({item_id:u(t),item_name:t.name,item_list_name:e,...m(t),price:s(t.prices.price,t.prices.currency_minor_unit)}),s=(t,e=2)=>parseInt(t,10)/10**e,d=(t,e,r)=>{(0,o.removeAction)(t,e),(0,o.addAction)(t,e,r)},u=t=>{const e=t.extensions?.woocommerce_google_analytics_integration?.identifier;return void 0!==e?e:"product_sku"===window.ga4w?.settings?.identifier?t.sku?t.sku:"#"+t.id:t.id},l=t=>t.coupons[0]?.code?{coupon:t.coupons[0]?.code}:{},m=t=>"categories"in t&&t.categories.length?p(t.categories):{},p=t=>Object.fromEntries(t.slice(0,5).map((t,e)=>[_(e),t.name])),_=t=>"item_category"+(t>0?t+1:""),y=(t,e,r)=>e?.find(({id:e})=>c(e,t))??r?.items?.find(({id:e})=>c(e,t))??n.find(({id:e})=>c(e,t)),f=({products:t,listName:e=(0,r.__)("Product List","woocommerce-google-analytics-integration")})=>!!t?.length&&{item_list_id:e.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/(^_+|_+$)/g,""),item_list_name:e,items:t.map((t,r)=>({...a(t,e),index:r+1}))},w=({product:t,quantity:e=1})=>({items:t?[i(t,e)]:[]}),g=({product:t,quantity:e=1})=>({items:t?[i(t,e)]:[]}),h=t=>{if(!t?.items?.length)return!1;const e=t.totals,r=t.items.reduce((t,e)=>t+parseInt(e.totals?.line_total??e.prices.price,10),0);return{currency:e.currency_code,value:s(r,e.currency_minor_unit),...l(t),items:t.items.map(i)}},v=({storeCart:t})=>h(t),b=({storeCart:t,shippingTier:e})=>{const r=h(t);return!!r&&{...r,...e?{shipping_tier:e}:{}}},k=({storeCart:t,paymentType:e})=>{const r=h(t);return!!r&&{...r,...e?{payment_type:e}:{}}},A=({product:t})=>!!t&&{content_type:"product",content_id:u(t)},q=({searchTerm:t})=>({search_term:t}),S=({product:t,listName:e=(0,r.__)("Product List","woocommerce-google-analytics-integration")})=>!!t&&{items:[a(t,e)]},E=({order:t})=>void 0!==t&&{transaction_id:t.id,affiliation:t.affiliation,currency:t.totals.currency_code,value:s(t.totals.total_price,t.totals.currency_minor_unit),tax:s(t.totals.tax_total,t.totals.currency_minor_unit),shipping:s(t.totals.shipping_total,t.totals.currency_minor_unit),items:t.items.map(i)},I='input[name="payment_method"]',C='input[name^="shipping_method"], select[name^="shipping_method"]',N=".woocommerce-cart-form .woocommerce-cart-form__cart-item, .woocommerce-cart-form .cart_item",$=t=>Array.from(document.querySelectorAll(t)).find(t=>t.checked||"SELECT"===t.tagName),L=t=>{if(!t)return;if("SELECT"===t.tagName){const e=t.options[t.selectedIndex];return e?.text?.trim()||t.value}const e=t.labels?.[0]||t.closest("label");return e?.textContent?.trim()||t.value},O=t=>{if(!t)return;const e=t.labels?.[0]||t.closest("label");if(e){const t=e.cloneNode(!0);t.querySelectorAll(".woocommerce-Price-amount").forEach(t=>t.remove());const r=t.textContent.replace(/[\s:]+$/,"").trim();if(r)return r}return L(t)};function j(t,{events:e,cart:r,products:o,product:n,added_to_cart:c,order:i,list_name:a}){let s=!1,d=!1,u=r;const l=new WeakSet,m=e=>{s=!0,t("add_shipping_info")({storeCart:r,shippingTier:e})},p=e=>{d=!0,t("add_payment_info")({storeCart:r,paymentType:e})};function _(e,i,a,s){const d=s?.[0]??s,u=parseInt(d?.dataset.product_id||d?.value);if(Number.isNaN(u)){const e=c??n;return e?void(Array.isArray(e)?e:[e]).filter(Boolean).forEach(e=>{t("add_to_cart")({product:e})}):void console.error("Google Analytics for WooCommerce: Could not read product ID from the button given in `added_to_cart` event. Check whether WooCommerce Core events or elements are malformed by other extensions.")}const l=n?.id===u?n:y(u,o,r);l&&t("add_to_cart")({product:l})}Object.values(e??{}).forEach(e=>{"add_to_cart"===e?(Array.isArray(c)?c:[c]).filter(Boolean).forEach(r=>{t(e)({product:r})}):t(e)({storeCart:r,products:o,product:n,order:i,listName:a})}),document.body.addEventListener("change",t=>{r?.items?.length&&t.target.closest?.("form.checkout")&&(t.target.matches(C)&&m(O(t.target)),t.target.matches(I)&&p(L(t.target)))}),document.querySelector("form.checkout")?.addEventListener("submit",()=>{if(r?.items?.length){if(!s){const t=$(C);t&&m(O(t))}d||p(L($(I)))}}),document.body.addEventListener("added_to_cart",t=>{_(t,...Array.isArray(t.detail)?t.detail:[t.detail?.fragments,t.detail?.cartHash,t.detail?.button])}),window.jQuery?.(document.body)?.on("added_to_cart",_);const f=()=>{document.querySelectorAll(".woocommerce-cart-form .woocommerce-cart-form__cart-item .remove[data-product_id]").forEach(t=>t.addEventListener("click",w))};function w(e){const r=parseInt(e.target?.dataset.product_id);Number.isNaN(r)?console.error("Google Analytics for WooCommerce: Could not read product ID from the target element given to remove from cart event. Check whether WooCommerce Core events or elements are malformed by other extensions."):t("remove_from_cart")({product:y(r,o,u)})}function g(t){const e=parseInt(t?.quantity,10),r=parseInt(t?.prices?.price,10);return!Number.isFinite(e)||e<1||!Number.isFinite(r)?null:r/e}function h(t,e){const r=g(t);return null===r?{...t,quantity:e}:{...t,quantity:e,prices:{...t.prices,price:Math.round(r)}}}function v(t,e){const r=function(t){const e=t.querySelector("input.qty")?.name;return e?.match(/^cart\[([^\]]+)\]\[qty]$/)?.[1]}(t),n=u?.items??[];if(r){const t=n.find(({key:t})=>t===r);if(t)return t}if(!Number.isNaN(e))return n.filter(({id:t})=>String(t)===String(e)).length>1?void 0:y(e,n,{items:o})}function b(){u?.items?.length&&document.querySelectorAll(N).forEach(e=>{const r=parseInt(e.querySelector("input.qty")?.value,10);if(!Number.isFinite(r))return;const o=parseInt(e.querySelector(".remove[data-product_id]")?.dataset.product_id,10),n=v(e,o),c=parseInt(n?.quantity,10);if(!n||!Number.isFinite(c)||r===c)return;const i=r>c?"add_to_cart":"remove_from_cart",a=Math.abs(r-c);t(i)({product:h(n,a)})})}function k(){const t=document.querySelector(".woocommerce-cart-form");t&&!l.has(t)&&(l.add(t),t.addEventListener("submit",b))}f(),k();const A=document.body.onupdated_wc_div;document.body.onupdated_wc_div=function(){"function"==typeof A&&A.apply(this,arguments),function(){if(!u?.items?.length)return;if(!document.querySelector(".woocommerce-cart-form"))return;const t=[];document.querySelectorAll(N).forEach(e=>{const r=parseInt(e.querySelector("input.qty")?.value,10),o=parseInt(e.querySelector(".remove[data-product_id]")?.dataset.product_id,10),n=v(e,o);n&&Number.isFinite(r)&&t.push(function(t,e){const r=g(t);return null===r?{...t,quantity:e}:{...t,quantity:e,prices:{...t.prices,price:Math.round(r*e)}}}(n,r))}),u={...u,items:t}}(),f(),k()};const q=document.body.onremoved_from_cart;document.body.onremoved_from_cart=function(t,e,r,o){"function"==typeof q&&q.apply(this,arguments),w({target:o?.[0]})},document.querySelectorAll(".products .product:not(.wp-block-post)")?.forEach(e=>{const n=e.querySelector("a[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",e=>{const c=e.target.closest(".woocommerce-loop-product__link"),i=e.target.classList.contains("button")&&e.target.hasAttribute("data-product_id"),a=e.target.classList.contains("add_to_cart_button")&&!e.target.classList.contains("product_type_variable");(c||i&&!a)&&t("select_content")({product:y(parseInt(n),o,r)})})}),document.querySelectorAll(".products-block-post-template .product, .wc-block-product-template .product, .wc-block-grid__product")?.forEach(e=>{const n=e.querySelector("[data-product_id]")?.getAttribute("data-product_id");n&&e.addEventListener("click",c=>{const i=c.target,a=i.closest(".wc-block-components-product-image a, .wc-block-grid__product-link"),s=i.closest(".wp-block-post-title a"),d=i.closest(".wc-block-components-product-button [data-product_id]");d&&d.classList.contains("add_to_cart_button")&&!d.classList.contains("product_type_variable")?t("add_to_cart")({product:y(parseInt(n),o,r)}):!e.closest(".wc-block-product-template")&&(a||d||s)&&t("select_content")({product:y(parseInt(n),o,r)})})})}const P="woocommerce-google-analytics",T="experimental__woocommerce_blocks",x=new Set;let F=!1,M=!1;const B=new Set;let G=!1,W=null;const D=new Map,R=t=>{Array.isArray(t?.items)&&t.items.forEach(t=>{null!=t?.key&&D.set(t.key,t)})},U=(t,e)=>{console.warn(`Google Analytics for WooCommerce: ${t}`,e)},z=(t,e,r)=>{try{t(e)(r)}catch(t){U(`could not track the ${e} event.`,t)}},J=t=>{const e=[];return null!=t?.key&&e.push(`key:${t.key}`),(t?.id||t?.name)&&e.push(`id:${t?.id??""}|${t?.name??""}`),e},H=t=>{J(t).forEach(t=>{B.add(t),setTimeout(()=>B.delete(t),200)})},Q=t=>J(t).some(t=>B.has(t));let K=null;const V=()=>window.ga4w?.settings?.currency,X=()=>{try{if(window.wp?.data?.select?.("wc/store/cart")){const t=window.wp.data.select("wc/store/cart").getCartData();if(t?.items?.length>0)return t}return window.ga4w?.data?.cart??null}catch(t){return U("could not read cart data.",t),null}},Y=t=>t?.key??t?.id??t?.name,Z=t=>t?.items?.length>0?t:window.ga4w?.data?.cart,tt=t=>t?.shippingRates??t?.shipping_rates??[],et=t=>window.wc?.wcSettings?.getSetting?.("paymentMethodData")?.[t]?.title||t,rt=t=>{const e=tt(window.wp?.data?.select?.("wc/store/cart")?.getCartData?.());return(e.length?e:tt(t)).flatMap(t=>t.shipping_rates??[])},ot=(t,e)=>rt(t).find(t=>t.rate_id===e)?.name,nt=(t,e,r={})=>{try{const o=Z(r.storeCart);return!!o?.items?.length&&(z(e,t,{...r,storeCart:o}),!0)}catch(e){return U(`could not prepare the ${t} event.`,e),!1}},ct=/\/wc\/store(?:\/v\d+)?\/cart\/add-item/,it=/\/wc\/store(?:\/v\d+)?\/cart\/update-item/,at=/\/wc\/store(?:\/v\d+)?\/batch/,st=(t,e={})=>{let r;try{r=new URL(t?.url??t?.toString?.(),window.location.origin)}catch{return null}return r.origin!==window.location.origin?null:{method:(e?.method??t?.method??"GET").toUpperCase(),pathname:r.searchParams.get("rest_route")??r.pathname}},dt=t=>{if(t instanceof FormData||t instanceof URLSearchParams)return Object.fromEntries(t.entries());if("string"==typeof t)try{return JSON.parse(t)}catch{return Object.fromEntries(new URLSearchParams(t).entries())}return t&&"object"==typeof t?t:{}},ut=(t,e=null)=>{const r=parseInt(t,10);return Number.isFinite(r)&&r>0?r:e},lt=t=>t?.key??t?.id,mt=(t,e)=>{const r=parseInt(t?.quantity,10),o=parseInt(t?.totals?.line_total,10);return Number.isFinite(o)&&Number.isFinite(r)&&Number.isFinite(e)&&r?{...t,totals:{...t.totals,line_total:String(Math.round(o*e/r))}}:t},pt=(t,e,r)=>{const{productId:o,quantity:n}=(t=>{const e=dt(t);return{productId:ut(e.id),quantity:ut(e.quantity,1)}})(t),c=((t,e,r)=>{if(Array.isArray(t?.items)&&t.items.length){if(Array.isArray(e?.items)){const r=t.items.find(t=>{const r=e.items.find(e=>lt(e)===lt(t));return!r||t.quantity>r.quantity});if(r)return r}return r?t.items.find(t=>parseInt(t.id,10)===r):void 0}})(e,r,o),i=c?((t,e,r)=>{const o=parseInt(t?.quantity,10);if(Array.isArray(e?.items)&&Number.isFinite(o)){const r=e.items.find(e=>lt(e)===lt(t)),n=parseInt(r?.quantity??0,10);if(Number.isFinite(n)){const t=o-n;if(t>0)return t}}return Number.isFinite(o)?Math.min(r,o):r})(c,r,n):n;return c?{eventName:"add_to_cart",product:mt(c,i),quantity:i,isAddItem:!0}:null},_t=(t,e,r)=>{const o=(n=t,dt(n)?.key??null);var n;if(!o)return null;const c=Array.isArray(e?.items)?e.items.find(t=>t.key===o):null,i=Array.isArray(r?.items)?r.items.find(t=>t.key===o):null,a=D.get(o);let s=0;a?s=a.quantity??0:i&&(s=i.quantity??0);const d=parseInt(c?.quantity??0,10)-parseInt(s,10);if(!Number.isFinite(d)||0===d)return null;const u=d>0?c:i??a;if(!u)return null;const l=Math.abs(d);return{eventName:d>0?"add_to_cart":"remove_from_cart",product:mt(u,l),quantity:l}},yt=t=>{if(W=(e,r)=>z(t,e,r),G||"function"!=typeof window.fetch)return;G=!0;const e=window.fetch;window.fetch=async function(...t){const[r,o]=t,n=((t,e={})=>{const r=st(t,e);return!!r&&"POST"===r.method&&ct.test(r.pathname)})(r,o),c=!n&&((t,e={})=>{const r=st(t,e);return!!r&&"POST"===r.method&&it.test(r.pathname)})(r,o),i=!n&&!c&&((t,e={})=>{const r=st(t,e);return!!r&&"POST"===r.method&&at.test(r.pathname)})(r,o),a=n||c||i,s=a?X():null,d=a?(async(t,e={})=>e?.body?e.body:"function"==typeof t?.clone?await t.clone().text():null)(r,o):null,u=await e.apply(this,t);if(!a||!u?.ok)return u;try{const t=await d,e=await u.clone().json();let r;i?r=((t,e,r)=>{const o=(t=>{if("string"==typeof t)try{return JSON.parse(t)}catch{return null}return t&&"object"==typeof t?t:null})(t)?.requests,n=e?.responses;if(!Array.isArray(o)||!Array.isArray(n))return[];const c=[];let i=r;return o.forEach((t,e)=>{const r=t?.path??"",o=ct.test(r),a=it.test(r);if(!o&&!a)return;const s=n[e],d=s?.status;if(!s||d<200||d>=300)return;const u=s.body,l=o?pt(t.body,u,i):_t(t.body,u,i);l&&c.push(l),R(u),i=u}),c})(t,e,s):c?(r=[_t(t,e,s)].filter(Boolean),R(e)):(r=[pt(t,e,s)].filter(Boolean),R(e));const o=i?25:0;r.forEach(({eventName:t,product:e,quantity:r,isAddItem:n})=>{"remove_from_cart"!==t&&n?setTimeout(()=>{Q(e)||(H(e),W(t,{product:{...e,quantity:r}}))},o):W(t,{product:{...e,quantity:r}})})}catch(t){return U("could not parse the Store API cart response for cart change tracking.",t),u}return u}},ft=t=>{d(`${T}-product-render`,P,e=>z(t,"view_item",e)),d(`${T}-cart-remove-item`,P,e=>{try{const r=Y(e?.product);r&&(x.add(r),setTimeout(()=>x.delete(r),200)),z(t,"remove_from_cart",e)}catch(t){U("could not process Blocks remove_from_cart tracking.",t)}}),(t=>{document.body.addEventListener("click",e=>{try{const r=e.target?.closest?.(".wc-block-cart-item__remove-link");if(!r)return;const o=r.closest(".wc-block-cart-items__row");if(!o)return;let n=null;const c=o.querySelector(".wc-block-components-product-name"),i=c?.getAttribute("href"),a=c?.textContent?.trim();let s=null;if(i){const t=i.match(/[?&]p=(\d+)/);t&&(s=parseInt(t[1],10))}const d=X();if(Array.isArray(d?.items)&&(s?n=y(s,[],d):a&&(n=d.items.find(t=>t.name===a))),n||(n=(t=>{const e=t.querySelector(".wc-block-components-product-name"),r=e?.textContent?.trim();if(!r)return null;const o=t.querySelector(".wc-block-components-quantity-selector__input"),n=o&&parseInt(o.value,10)||1,c=t.querySelector(".wc-block-components-product-price__value ins .woocommerce-Price-amount")||t.querySelector(".wc-block-components-product-price__value .woocommerce-Price-amount")||t.querySelector(".wc-block-components-product-price__value"),i=X(),a=V(),s=i?.totals?.currency_minor_unit??a?.precision??2,d=c?(t=>{if(!t)return 0;const e=V();if(!e)return 0;const{decimalSeparator:r=".",thousandSeparator:o=","}=e;if("function"==typeof window.accounting?.unformat)return window.accounting.unformat(t,r);let n=t.replace(/[^\d.,]/g,"").trim();if(o){const t=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp(t,"g"),"")}return"."!==r&&(n=n.replace(r,".")),parseFloat(n)||0})(c.textContent):0;return{name:r,quantity:n,prices:{price:Math.round(d*10**s),currency_minor_unit:s}}})(o)),n){const e=Y(n);setTimeout(()=>{e&&x.has(e)||z(t,"remove_from_cart",{product:n})},0)}}catch(t){U("could not read mini-cart remove_from_cart data.",t)}})})(t),d(`${T}-checkout-render-checkout-form`,P,e=>{F=!1,M=!1,nt("begin_checkout",t,e)}),d(`${T}-checkout-set-selected-shipping-rate`,P,e=>{try{const r=Z(e.storeCart),o=e.shippingRateId;F=nt("add_shipping_info",t,{...e,shippingTier:ot(r,o)??o})}catch(t){F=!1,U("could not prepare the add_shipping_info event.",t)}}),d(`${T}-checkout-set-active-payment-method`,P,e=>{try{M=nt("add_payment_info",t,{...e,paymentType:et(e.paymentMethodSlug)})}catch(t){M=!1,U("could not prepare the add_payment_info event.",t)}}),d(`${T}-checkout-submit`,P,e=>{try{const r=(t=>{const e=rt(t).find(t=>t.selected);return e?.name??e?.rate_id})(e.storeCart);if(!F&&r&&(F=nt("add_shipping_info",t,{...e,shippingTier:r})),M)return;M=nt("add_payment_info",t,{...e,paymentType:et(window.wp?.data?.select?.("wc/store/payment")?.getActivePaymentMethod?.())})}catch(t){U("could not prepare checkout submit tracking.",t)}}),d(`${T}-cart-add-item`,P,e=>{try{const r=e?.product;if(Q(r))return;H(r),z(t,"add_to_cart",{product:r})}catch(t){U("could not process Blocks add_to_cart tracking.",t)}}),yt(t),d(`${T}-product-list-render`,P,e=>{var r;e?.products&&(r=e.products,Array.isArray(r)&&r.forEach(t=>{null==t?.id||n.some(({id:e})=>c(e,t.id))||n.push(t)})),z(t,"view_item_list",e)}),d(`${T}-product-view-link`,P,e=>z(t,"select_content",e)),K&&document.body.removeEventListener("wc-blocks_viewed_product",K),K=e=>{const{productId:r}=e.detail??{},o=String(r??"");if(/^[1-9]\d*$/.test(o)){const e=parseInt(o,10).toString(),r=y(e,[],null)??{id:e};z(t,"select_content",{product:r})}},document.body.addEventListener("wc-blocks_viewed_product",K)};(0,o.removeAction)(`${T}-checkout-submit`,P),(0,o.removeAction)(`${T}-checkout-set-email-address`,P),(0,o.removeAction)(`${T}-checkout-set-phone-number`,P),(0,o.removeAction)(`${T}-checkout-set-billing-address`,P),(0,o.removeAction)(`${T}-cart-set-item-quantity`,P),(0,o.removeAction)(`${T}-product-search`,P),(0,o.removeAction)(`${T}-store-notice-create`,P);const wt={statistics:["analytics_storage"],marketing:["ad_storage","ad_user_data","ad_personalization"]},gt={formatters:e,utils:{getProductFieldObject:i,getProductImpressionObject:a,formatPrice:s,getProductId:u,getCartCoupon:l}};function ht(){window.wcGoogleAnalyticsIntegration={...window.wcGoogleAnalyticsIntegration??{},...gt},Object.assign(window.ga4w,gt),(({tracker_function_name:t})=>{if("function"==typeof wp_has_consent){void 0===window.wp_consent_type&&(window.wp_consent_type="optin");const e={};for(const[t,r]of Object.entries(wt))if(""!==consent_api_get_cookie(window.consent_api.cookie_prefix+"_"+t)){const o=wp_has_consent(t)?"granted":"denied";r.forEach(t=>{e[t]=o})}Object.keys(e).length>0&&window[t]("consent","update",e)}})(window.ga4w.settings),(({tracker_function_name:t})=>{document.addEventListener("wp_listen_for_consent_change",e=>{const r={},o=wt[Object.keys(e.detail)[0]],n="allow"===Object.values(e.detail)[0]?"granted":"denied";void 0!==o&&(o.forEach(t=>{r[t]=n}),Object.keys(r).length>0&&window[t]("consent","update",r))})})(window.ga4w.settings);const t=function({events:t,tracker_function_name:r}){return function(o){const n=e[o];if("function"!=typeof n)throw new Error(`Event ${o} is not supported.`);return function(e){const c=n(e);t.includes(o)&&c&&window[r]("event",o,c)}}}(window.ga4w.settings);j(t,window.ga4w.data),ft(t)}function vt(){window.ga4w||console.warn("Google Analytics for WooCommerce: Configuration and tracking data not found after the page was fully loaded. Make sure the `woocommerce-google-analytics-integration-data` script gets eventually loaded.")}window.ga4w?ht():(document.addEventListener("ga4w:ready",ht),"complete"===document.readyState?vt():window.addEventListener("load",vt))})();