(function() {
function executeScript() {

window.addEventListener('error', (event) => {
  const isCheckoutInit = window.zigzag;

  if (isCheckoutInit || typeof ZigzagPosthogScript === 'undefined' || !event) {
    return;
  }

  const urls = ["worldshopping.jp","worldshopping.global"];
  const ignore = ["securityerror","syntaxerror"];

  if (event.filename && urls.find((u) => event.filename.includes(u))) {
    const message = event.message || '';
    const messageLower = message.toLowerCase();
    if (!ignore.find((e) => messageLower.includes(e))) {
      ZigzagPosthogScript.capture('script_error', {
        src: event.filename,
        error: message,
        line: event.lineno,
        column: event.colno
      });
    }
  }
});



  function calculatePrecedence(index, requestShopKey) {
    var precedence = index;
    if (requestShopKey.indexOf('__') !== -1) {
      precedence += 100;
    }
    return precedence;
  }
  function isHighestPrecedence() {
    var nodes = document.querySelectorAll('script[src*="https://checkout-js.worldshopping.jp/checkout-[version].js"]');
    var thisPrecedence = 0;
    var precedences = [];
    if (nodes.length >= 2) {
      for (var i = 0; i < nodes.length; i += 1) {
        var precedence = calculatePrecedence(i, 'store_wacoal_jp');
        precedences.push(precedence);
        if(nodes[i].src.indexOf('store_wacoal_jp') > -1) {
          thisPrecedence = precedence;
        }
      }
      return thisPrecedence === Math.max.apply(null, precedences);
    } else {
      return true;
    }
  }
  if(!isHighestPrecedence()) {
    return;
  }
  

  var head = document.getElementsByTagName('head')[0];
  var script = document.createElement('script');
  script.id = 'zigzag-worldshopping-inline-script';
  script.type = 'text/javascript';
  script.charset = 'UTF-8';
  script.setAttribute('crossorigin', 'anonymous');
  script.src = 'https://shop-js.worldshopping.jp/store_wacoal_jp.js?versionId=2SVnIakxD03C0m3IEgvSFl.AikuRfmAw';
  script.onerror = function() {
    if (typeof ZigzagPosthogScript !== 'undefined') {
      ZigzagPosthogScript.capture('script_load_fail', { src: 'https://shop-js.worldshopping.jp/store_wacoal_jp.js?versionId=2SVnIakxD03C0m3IEgvSFl.AikuRfmAw' })
    }
  };
  head.appendChild(script);


  var req = new XMLHttpRequest();
  req.onreadystatechange = function() {
    var result = document.getElementById('result');
    if (req.readyState == 4 && req.status == 200) {
      var response = JSON.parse(req.responseText);
      if (response && response.country !== 'JP') {

        function kickZigzag() {
          var i = setInterval(function() {
            if (window.zigzag && window.onLoadZigZag && document.readyState !== 'loading' && window.document.body) {

              window.zigzag.sourceSettings = {"domesticDeliveryDiscountedFee":0,"serviceFee":10,"flowControlOptOut":true,"internationalShippingFee":null,"serviceFeeType":"PERCENT","ecSystem":"OTHER","negativeMatchWords":[],"shopName":"WACOAL WEB STORE","domesticDeliveryBaseFee":599,"negativeMatchArea":[],"salesTaxRoundingType":"floor","domesticDeliveryDiscountThresholdItemPrice":11000,"salesTaxType":"inclusive","shopLogoUrl":"https://static-contents.worldshopping.jp/shops/store_wacoal_jp/logo.svg","key":"store_wacoal_jp","__context__":{},"metaPixelContentType":"","bannerLinksJson":null,"googleConversionId":null,"metaPixelId":null,"googleConversionLabel":null,"metaPixelTypesOfPersonalInfo":null,"googleConversionLinkerDomain":null,"deferFirstVisitInSec":7,"type":"WSC_NORMAL","shopCategory":"FASHION","wscEsm":false,"hasAccessLinkEnabled":false};
              window.zigzag.shopData = {"settings":[["sheetNo","sheetRule","sheetName","sheetType","sheetMatchingType","補足&キャプチャ","dev memo"],["1","byCountry","byCountry","blacklist","exact"],["2","byUrl","byUrl","blacklist","partial"],["3","byItemName","byItemName","blacklist","forward"],["4","byCategory","byBrand","blacklist","exact"],["5","byItemDescription","byItemDescription","blacklist","partial"],["6","byUrl","【運営側記入シート】byUrl","blacklist","forward"],["7","byItemName","【運営側記入シート】byItemName","blacklist","forward"]],"byUrl":[["url","countries","description"],["https://store.wacoal.jp/disp/01_ZRA100.html","ALL"],["https://store.wacoal.jp/disp/01_ZRA200.html","ALL"],["https://dev-store.wacoal.jp/disp/01_WPS001.html","ALL"],["https://store.wacoal.jp/disp/01_WZA102.html","ALL"],["https://store.wacoal.jp/disp/01_AZ1000.html","ALL"],["https://store.wacoal.jp/disp/01_AZ1001.html","ALL"],["https://store.wacoal.jp/disp/01_AZ1002.html","ALL"],["https://store.wacoal.jp/disp/01_AZ1004.html","ALL"],["https://store.wacoal.jp/disp/01_AZ1005.html","ALL"],["https://store.wacoal.jp/disp/01_AZ7000.html","ALL"],["https://store.wacoal.jp/disp/01_AZ7001.html","ALL"],["https://store.wacoal.jp/disp/01_AZ7002.html","ALL"],["https://store.wacoal.jp/disp/01_AZ7003.html","ALL"],["https://store.wacoal.jp/disp/01_WPS001.html","ALL"],["https://store.wacoal.jp/disp/01_BCL064.html","ALL"],["https://store.wacoal.jp/disp/01_ZPJ028.html","ALL"],["https://store.wacoal.jp/disp/01_ZPJ029.html","ALL"],["https://store.wacoal.jp/disp/01_ZPJ062.html","ALL"],["https://store.wacoal.jp/disp/01_ZPJ088.html","ALL"],["https://store.wacoal.jp/disp/01_HTY048.html","ALL"],["https://store.wacoal.jp/disp/01_HTY049.html","ALL"],["https://store.wacoal.jp/disp/01_HYO048.html","ALL"],["https://store.wacoal.jp/disp/01_VCY048.html","ALL"],["https://store.wacoal.jp/disp/01_VCY049.html","ALL"],["https://store.wacoal.jp/disp/01_BCR624.html","ALL"],["https://store.wacoal.jp/disp/01_DHO624.html","ALL"],["https://store.wacoal.jp/disp/01_DLR624.html","ALL"],["https://store.wacoal.jp/disp/01_HTY048.html","ALL"],["https://store.wacoal.jp/disp/01_HTY049.html","ALL"],["https://store.wacoal.jp/disp/01_HUO624.html","ALL"],["https://store.wacoal.jp/disp/01_HXO624.html","ALL"],["https://store.wacoal.jp/disp/01_HYO048.html","ALL"],["https://store.wacoal.jp/disp/01_HYO624.html","ALL"],["https://store.wacoal.jp/disp/01_LNO300.html","ALL"],["https://store.wacoal.jp/disp/01_LNO500.html","ALL"],["https://store.wacoal.jp/disp/01_LNO501.html","ALL"],["https://store.wacoal.jp/disp/01_LNO503.html","ALL"],["https://store.wacoal.jp/disp/01_LNO504.html","ALL"],["https://store.wacoal.jp/disp/01_LNO505.html","ALL"],["https://store.wacoal.jp/disp/01_LNR600.html","ALL"],["https://store.wacoal.jp/disp/01_LNR701.html","ALL"],["https://store.wacoal.jp/disp/01_LNR702.html","ALL"],["https://store.wacoal.jp/disp/01_LNR703.html","ALL"],["https://store.wacoal.jp/disp/01_LNY100.html","ALL"],["https://store.wacoal.jp/disp/01_LNY110.html","ALL"],["https://store.wacoal.jp/disp/01_LNY300.html","ALL"],["https://store.wacoal.jp/disp/01_LNY500.html","ALL"],["https://store.wacoal.jp/disp/01_LNY501.html","ALL"],["https://store.wacoal.jp/disp/01_LNY502.html","ALL"],["https://store.wacoal.jp/disp/01_LNY504.html","ALL"],["https://store.wacoal.jp/disp/01_LNY505.html","ALL"],["https://store.wacoal.jp/disp/01_VCO624.html","ALL"],["https://store.wacoal.jp/disp/01_VCY048.html","ALL"],["https://store.wacoal.jp/disp/01_VCY049.html","ALL"]],"byBrand":[["brand","countries","description"],["ワコール／ラブボディ","ALL"],["ハウスオブローゼ","ALL"],["ワコールウェブストアセレクション","ALL"],["シモーヌペレール","ALL"],["ハンロ","ALL"],["PEACH JOHN","ALL"],["SALON by PEACH JOHN","ALL"]],"byItemName":[["itemName","countries","description"]],"byItemDescription":[["text","countries","description"],["コラボ","ALL","除外"]],"byCountry":[["countryCode"],["MY"],["TW"],["KR"]],"'【運営側記入シート】byUrl'":[["url","countries","description","※本シートはWorldshoppingオペレーションチームが必要に応じてお取り扱い不可の商品を除外登録するシートになります。※ショップサイト様はこちらのシートを変更しないようお願いします。"]],"'【運営側記入シート】byItemName'":[["itemName","countries","description","※本シートはWorldshoppingオペレーションチームが必要に応じてお取り扱い不可の商品を除外登録するシートになります。※ショップサイト様はこちらのシートを変更しないようお願いします。"]]};
              window.zigzag.supportedArea = [["AF","Afghanistan","OPT_OUT"],["AL","Albania","OPT_OUT"],["DZ","Algeria","OPT_OUT"],["AS","American Samoa","OPT_OUT"],["AD","Andorra","OPT_OUT"],["AO","Angola","OPT_OUT"],["AI","Anguilla","OPT_OUT"],["AG","Antigua and Barbuda","OPT_OUT"],["AR","Argentina","OPT_OUT"],["AM","Armenia","OPT_OUT"],["AW","Aruba","OPT_OUT"],["AU","Australia","OPT_OUT"],["AT","Austria","OPT_IN"],["AZ","Azerbaijan","OPT_OUT"],["BS","Bahamas","OPT_OUT"],["BH","Bahrain","OPT_OUT"],["BD","Bangladesh","OPT_OUT"],["BB","Barbados","OPT_OUT"],["BE","Belgium","OPT_IN"],["BZ","Belize","OPT_OUT"],["BJ","Benin","OPT_OUT"],["BM","Bermuda","OPT_OUT"],["BT","Bhutan","OPT_OUT"],["BO","Bolivia, Plurinational State of","OPT_OUT"],["BQ","Bonaire, Sint Eustatius and Saba","OPT_OUT"],["BA","Bosnia and Herzegovina","OPT_OUT"],["BW","Botswana","OPT_OUT"],["BR","Brazil","OPT_OUT"],["BN","Brunei Darussalam","OPT_OUT"],["BG","Bulgaria","OPT_IN"],["BF","Burkina Faso","OPT_OUT"],["BI","Burundi","OPT_OUT"],["KH","Cambodia","OPT_OUT"],["CM","Cameroon","OPT_OUT"],["CA","Canada","OPT_IN"],["CV","Cape Verde","OPT_OUT"],["KY","Cayman Islands","OPT_OUT"],["CF","Central African Republic","OPT_OUT"],["TD","Chad","OPT_OUT"],["CL","Chile","OPT_OUT"],["CN","China","OPT_IN"],["CO","Colombia","OPT_OUT"],["KM","Comoros","OPT_OUT"],["CG","Congo","OPT_OUT"],["CD","Congo, the Democratic Republic of the","OPT_OUT"],["CK","Cook Islands","OPT_OUT"],["CR","Costa Rica","OPT_OUT"],["HR","Croatia","OPT_IN"],["CU","Cuba","OPT_OUT"],["CW","Curaçao","OPT_OUT"],["CY","Cyprus","OPT_IN"],["CZ","Czech Republic","OPT_IN"],["CI","Côte d'Ivoire","OPT_OUT"],["DK","Denmark","OPT_IN"],["DJ","Djibouti","OPT_OUT"],["DM","Dominica","OPT_OUT"],["DO","Dominican Republic","OPT_OUT"],["EC","Ecuador","OPT_OUT"],["EG","Egypt","OPT_OUT"],["SV","El Salvador","OPT_OUT"],["GQ","Equatorial Guinea","OPT_OUT"],["ER","Eritrea","OPT_OUT"],["EE","Estonia","OPT_IN"],["ET","Ethiopia","OPT_OUT"],["FK","Falkland Islands (Malvinas)","OPT_OUT"],["FO","Faroe Islands","OPT_OUT"],["FJ","Fiji","OPT_OUT"],["FI","Finland","OPT_IN"],["FR","France","OPT_IN"],["GF","French Guiana","OPT_OUT"],["PF","French Polynesia","OPT_OUT"],["GA","Gabon","OPT_OUT"],["GM","Gambia","OPT_OUT"],["GE","Georgia","OPT_OUT"],["DE","Germany","OPT_IN"],["GH","Ghana","OPT_OUT"],["GI","Gibraltar","OPT_OUT"],["GR","Greece","OPT_IN"],["GL","Greenland","OPT_OUT"],["GD","Grenada","OPT_OUT"],["GP","Guadeloupe","OPT_OUT"],["GU","Guam","OPT_OUT"],["GT","Guatemala","OPT_OUT"],["GG","Guernsey","OPT_OUT"],["GN","Guinea","OPT_OUT"],["GW","Guinea-Bissau","OPT_OUT"],["GY","Guyana","OPT_OUT"],["HT","Haiti","OPT_OUT"],["VA","Holy See (Vatican City State)","OPT_OUT"],["HN","Honduras","OPT_OUT"],["HK","Hong Kong","OPT_OUT"],["HU","Hungary","OPT_IN"],["IS","Iceland","OPT_OUT"],["IN","India","OPT_OUT"],["ID","Indonesia","OPT_OUT"],["IR","Iran, Islamic Republic of","OPT_OUT"],["IQ","Iraq","OPT_OUT"],["IE","Ireland","OPT_IN"],["IM","Isle of Man","OPT_OUT"],["IL","Israel","OPT_OUT"],["IT","Italy","OPT_IN"],["JM","Jamaica","OPT_OUT"],["JE","Jersey","OPT_OUT"],["JO","Jordan","OPT_OUT"],["KZ","Kazakhstan","OPT_OUT"],["KE","Kenya","OPT_OUT"],["KI","Kiribati","OPT_OUT"],["KR","South Korea","OPT_IN"],["KW","Kuwait","OPT_OUT"],["KG","Kyrgyzstan","OPT_OUT"],["LA","Lao People's Democratic Republic","OPT_OUT"],["LV","Latvia","OPT_IN"],["LB","Lebanon","OPT_OUT"],["LS","Lesotho","OPT_OUT"],["LR","Liberia","OPT_OUT"],["LY","Libya","OPT_OUT"],["LI","Liechtenstein","OPT_OUT"],["LT","Lithuania","OPT_IN"],["LU","Luxembourg","OPT_IN"],["MO","Macau","OPT_OUT"],["MK","Macedonia, the Former Yugoslav Republic of","OPT_OUT"],["MG","Madagascar","OPT_OUT"],["MW","Malawi","OPT_OUT"],["MY","Malaysia","OPT_OUT"],["MV","Maldives","OPT_OUT"],["ML","Mali","OPT_OUT"],["MT","Malta","OPT_IN"],["MH","Marshall Islands","OPT_OUT"],["MQ","Martinique","OPT_OUT"],["MR","Mauritania","OPT_OUT"],["MU","Mauritius","OPT_OUT"],["YT","Mayotte","OPT_OUT"],["MX","Mexico","OPT_OUT"],["FM","Micronesia, Federated States of","OPT_OUT"],["MD","Moldova, Republic of","OPT_OUT"],["MC","Monaco","OPT_OUT"],["MN","Mongolia","OPT_OUT"],["ME","Montenegro","OPT_OUT"],["MS","Montserrat","OPT_OUT"],["MA","Morocco","OPT_OUT"],["MZ","Mozambique","OPT_OUT"],["MM","Myanmar","OPT_OUT"],["NA","Namibia","OPT_OUT"],["NR","Nauru","OPT_OUT"],["NP","Nepal","OPT_OUT"],["NL","Netherlands","OPT_IN"],["NC","New Caledonia","OPT_OUT"],["NZ","New Zealand","OPT_OUT"],["NI","Nicaragua","OPT_OUT"],["NE","Niger","OPT_OUT"],["NG","Nigeria","OPT_OUT"],["NU","Niue","OPT_OUT"],["MP","Northern Mariana Islands","OPT_OUT"],["NO","Norway","OPT_OUT"],["OM","Oman","OPT_OUT"],["PK","Pakistan","OPT_OUT"],["PW","Palau","OPT_OUT"],["PS","Palestine, State of","OPT_OUT"],["PA","Panama","OPT_OUT"],["PG","Papua New Guinea","OPT_OUT"],["PY","Paraguay","OPT_OUT"],["PE","Peru","OPT_OUT"],["PH","Philippines","OPT_OUT"],["PL","Poland","OPT_IN"],["PT","Portugal","OPT_IN"],["PR","Puerto Rico","OPT_OUT"],["QA","Qatar","OPT_OUT"],["RO","Romania","OPT_IN"],["RW","Rwanda","OPT_OUT"],["RE","Réunion","OPT_OUT"],["SH","Saint Helena, Ascension and Tristan da Cunha","OPT_OUT"],["KN","Saint Kitts and Nevis","OPT_OUT"],["LC","Saint Lucia","OPT_OUT"],["MF","Saint Martin (French part)","OPT_OUT"],["VC","Saint Vincent and the Grenadines","OPT_OUT"],["WS","Samoa","OPT_OUT"],["SM","San Marino","OPT_OUT"],["ST","Sao Tome and Principe","OPT_OUT"],["SA","Saudi Arabia","OPT_OUT"],["SN","Senegal","OPT_OUT"],["RS","Serbia","OPT_OUT"],["SC","Seychelles","OPT_OUT"],["SL","Sierra Leone","OPT_OUT"],["SG","Singapore","OPT_IN"],["SK","Slovakia","OPT_IN"],["SI","Slovenia","OPT_IN"],["SB","Solomon Islands","OPT_OUT"],["SO","Somalia","OPT_OUT"],["ZA","South Africa","OPT_OUT"],["SS","South Sudan","OPT_OUT"],["ES","Spain","OPT_IN"],["LK","Sri Lanka","OPT_OUT"],["SD","Sudan","OPT_OUT"],["SR","Suriname","OPT_OUT"],["SZ","Swaziland","OPT_OUT"],["SE","Sweden","OPT_IN"],["CH","Switzerland","OPT_OUT"],["TW","Taiwan","OPT_IN"],["TJ","Tajikistan","OPT_OUT"],["TZ","Tanzania, United Republic of","OPT_OUT"],["TH","Thailand","OPT_OUT"],["TL","Timor-Leste","OPT_OUT"],["TG","Togo","OPT_OUT"],["TO","Tonga","OPT_OUT"],["TT","Trinidad and Tobago","OPT_OUT"],["TN","Tunisia","OPT_OUT"],["TR","Turkey","OPT_OUT"],["TM","Turkmenistan","OPT_OUT"],["TC","Turks and Caicos Islands","OPT_OUT"],["TV","Tuvalu","OPT_OUT"],["UG","Uganda","OPT_OUT"],["UA","Ukraine","OPT_OUT"],["AE","United Arab Emirates","OPT_OUT"],["GB","United Kingdom","OPT_IN"],["US","United States","OPT_OUT"],["UY","Uruguay","OPT_OUT"],["UZ","Uzbekistan","OPT_OUT"],["VU","Vanuatu","OPT_OUT"],["VE","Venezuela, Bolivarian Republic of","OPT_OUT"],["VN","Vietnam","OPT_OUT"],["VG","Virgin Islands, British","OPT_OUT"],["VI","Virgin Islands, U.S.","OPT_OUT"],["WF","Wallis and Futuna","OPT_OUT"],["YE","Yemen","OPT_OUT"],["ZM","Zambia","OPT_OUT"],["ZW","Zimbabwe","OPT_OUT"]];
              window.zigzag.defaultNegativeMatchWords = [["word","labelJa","labelEn","labelCh","labelTw","labelKo","wscVisibility"],["デジタルマガジン","デジタルマガジン","Digital Magazine","电子杂志","電子雜誌","디지털 매거진",false],["香水","香水","Perfume","香水","香水","향수",true],["パフューム","パフューム","Parfume","香水","香水","퍼퓸",true],["フレグランス","フレグランス","Fragrance","香水","香水","프레이그런스",true],["アロマ","アロマ","Aroma","芳香","芳香","아로마",false],["コンバース","コンバース","Converse","匡威","匡威","컨버스",true],["マニキュア","マニキュア","Manicure","指甲油","指甲油","매니큐어",false],["医薬品","医薬品","Medicine","非处方药","藥品","의약품",true],["マホガニー(?!.*(色|風|のような))","マホガニー","Mahogany","桃花心木","桃花心木","마호가니",false],["芳香剤","芳香剤","Air refresher","芳香剂","芳香劑","방향제",false],["ドライフラワー","ドライフラワー","Dry flower","干花","乾花","드라이 플라워",true],["オイル","オイル","Oil","油","油","오일",false],["毛皮","毛皮","Fur","毛皮","毛皮","모피",false],["押し花","押し花","Pressed flowers","压花","壓花","압화",true],["薬用育毛剤","薬用育毛剤","Hair regrowth tonics","药用生发剂","藥用生髮劑","약용 육모제",true],["育毛美容液","育毛美容液","Hair growth serum","生发剂","生髮劑","육모제",true],["発毛促進剤","発毛促進剤","Hair regrowth tonics","生发剂","生髮劑","발모 촉진제",true],["アルコール","アルコール","Alcohol","酒精","酒精","알코올",true],["ディフューザー","ディフューザー","Diffuser","芳香剂","芳香劑","디퓨저",true],["レジン液","レジン液","Resin liquid","液体树脂","液體樹脂","레진 액",true],["モバイルバッテリー","モバイルバッテリー","Mobile battery","充电宝","行動電源","모바일 배터리",true],["オイルワックス","オイルワックス","Oil wax","油蜡","油蠟","오일 왁스",true],["ヘアクリーム","ヘアクリーム","Hair cream","发胶","髮膠","헤어크림",false],["アダルト","アダルト","Adult","成人用品","成人用品","성인 용품",false],["クロコダイル(?!.*(柄|のような))","クロコダイル","Crocodile","鳄鱼皮","鱷魚皮","악어 가죽",true],["制汗剤","制汗剤","Deodorant","止汗露","止汗劑","데오드란트",true],["蜂蜜","蜂蜜","Honey","蜂蜜","蜂蜜","꿀",false],["万年筆（カートリッジ付き）","万年筆（カートリッジ付き）","Fountain pen (with ink)","钢笔（附带墨水替换芯）","鋼筆（附帶墨水替換芯）","만년필(카트리지 포함)",false],["ダウンロード","ダウンロード","Download","下载","下載","다운로드",false],["ワニ革(?!.*(風|のような))","ワニ革(?!.*(風|のような))","Crocodile Skin","鳄鱼皮","鱷魚皮","악어 가죽(?!.*(풍 같은))",true],["マニキュアリムーバー","マニキュアリムーバー","Manicure Remover","洗甲水","去光水","매니큐어 리무버",true],["ヘアカラー","ヘアカラー","Hair dye","染发剂","染髮劑","헤어 컬러",true],["毛染め剤","毛染め剤","Hair dye","染发剂","染髮劑","염색제",true],["シェーバー洗浄液","シェーバー洗浄液","Shaver cleaner","剃须刀清洗液","刮鬍刀清潔液","면도기 세정액",true],["ネイルケア","ネイルケア","Nailcare product","甲护产品","護甲產品","네일케어",true],["日本刀","日本刀","Japanese sword","日本刀","日本刀","일본도",false],["ヘビ革(?!.*(風|のような))","ヘビ革","Snake Skin","蛇皮","蛇皮","뱀 가죽",false],["CONVERSE","CONVERSE","CONVERSE","匡威","匡威","CONVERSE",true],["カンガルー(?!.*(風|のような))","カンガルー","kangaroo leather","","","",false],["ジェルネイル","ジェルネイル","gel nail","凝胶甲","","",false],["zippo","ジッポ","zippo","","","",false],["松ぼっくり","","","","","",false],["ZIPPO","","","","","",false],["ライター","","","","","",false],["Zippo","","","","","",false],["Nail","","","","","",false],["スプレー","","","","","",false],["居合刀","","","","","",false],["冷凍","","","","","",false],["冷蔵","","","","","",false],["ペットフード","","","","","",false],["模造刀","","","","","",false],["接着剤","","","","","",false],["ランタン","","","","","",false],["インク","","","","","",false],["医薬部外品","","","","","",false],["薬品","","","","","",false],["医療","","","","","",false],["電子タバコ","","","","","",false],["アイコス","","","","","",false],["PERFUME","","","","","",false],["SIMカード","","","","","",false],["simカード","","","","","",false],["ハーバリウム","","","","","",false],["perfume","","","","","",false],["畳","","","","","",false],["イ草","","","","","",false],["い草","","","","","",false],["はちみつ","","","","","",false],["イベント","","","","","",false],["gucci","グッチ","gucci","","","",false],["GUCCI","グッチ","GUCCI","","","",false],["グッチ","グッチ","gucci","","","",false],["ポータブル電源","","","","","",false],["ハチミツ","","","","","",false],["ムビチケ","","","","","",false],["PARFUM","","","","","",false],["オールスター","","","","","",false],["ALL STAR","","","","","",false],["ALLSTAR","","","","","",false],["オードパルファム","","","","","",false],["ディフューザー","ディフューザー","Diffuser","芳香剂","芳香劑","디퓨저",false],["Diffuser","Diffuser","Diffuser","","","",false],["diffuser","diffuser","diffuser","","","",false],["CONVERSE","","","","","",false],["生豆","生豆","","","","",false],["生ごま","生ごま","","","","",false],["生ゴマ","生ゴマ","","","","",false],["薬用","薬用","","","","",false],["防災リュック","防災リュック","","","","",false],["防災セット","防災セット","","","","",false],["ヘルメット","ヘルメット","Helmet","","","",false],["トイガン","","","","","",false],["ガンパーツ","","","","","",false],["拳銃","","","","","",false],["Converse","","","","","",false],["converse","","","","","",false]];
              window.zigzag.shopCoupons = [];
              window.zigzag.exchangeRates = [["USD",0.00636401,"MUFG","2026-01-09"]];
              
              window.zigzag.location = {
                ipAddress: response.ipAddress,
                country: response.country
              };
              window.zigzag.isPreviewMode && document.dispatchEvent(new Event("zigzag:beforeOnLoadZigzag"));
              onLoadZigZag();
              window.zigzag.isPreviewMode && document.dispatchEvent(new Event("zigzag:afterOnLoadZigzag"));
              clearInterval(i);
            }
          }, 10);
        }

        function loadJs() {
          var head = document.getElementsByTagName('head')[0];
          var script = document.createElement('script');
          script.id = 'zigzag-worldshopping-checkout-js';
          script.type = 'text/javascript';
          script.charset = 'UTF-8';
          script.async = true;
          script.onreadystatechange = function() {
            if (this.readyState === 'complete') {
              kickZigzag();
            }
          }
          script.onload = function() { kickZigzag(); };
          script.setAttribute('crossorigin', 'anonymous');
          script.src = 'https://checkout-js.worldshopping.jp/checkout-3_44_0-v1_b8b1d8d8.js';
          script.onerror = function() {
            if (typeof ZigzagPosthogScript !== 'undefined') {
              ZigzagPosthogScript.capture('script_load_fail', { src: 'https://checkout-js.worldshopping.jp/checkout-3_44_0-v1_b8b1d8d8.js' })
            }
          };
          head.appendChild(script);
        }
        loadJs();
      }
    }
  }
  req.open('GET', 'https://checkout-api.worldshopping.jp/v1/geolocation', true);
  req.send(null);

}


const deferMilliseconds = 0;
const isFirstVisit = window.localStorage
  && window.localStorage.getItem('zigzag') === null
  && window.localStorage.getItem('zigzag-checkout-script') === null;
const firstVisitDeferMilliseconds = 7000;

window.zigzagLoadingStartedAt = new Date().getTime();
if (isFirstVisit && firstVisitDeferMilliseconds > 0) {

// Execute immediately on user action
const removeListeners = function() {
  window.removeEventListener('mousemove', userActionHandler);
  window.removeEventListener('touchstart', userActionHandler);
};

const timerId = setTimeout(function() {
  window.localStorage && window.localStorage.setItem('zigzag-checkout-script', 'true');
  removeListeners();

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof zigzag_define&&zigzag_define.amd?zigzag_define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZigzagPosthogScript={})}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(c){a=!0,i=c}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var v=String.fromCharCode,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",b={};function w(e,t){if(!b[e]){b[e]={};for(var n=0;n<e.length;n++)b[e][e.charAt(n)]=n}return b[e][t]}var k={compressToBase64:function(e){if(null==e)return"";var t=k._compress(e,6,(function(e){return y.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:k._decompress(e.length,32,(function(t){return w(y,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":k._compress(e,15,(function(e){return v(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:k._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=k.compress(e),n=new Uint8Array(2*t.length),r=0,i=t.length;r<i;r++){var o=t.charCodeAt(r);n[2*r]=o>>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return k.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var i=[];return t.forEach((function(e){i.push(v(e))})),k.decompress(i.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":k._compress(e,6,(function(e){return m.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),k._decompress(e.length,32,(function(t){return w(m,e.charAt(t))})))},compress:function(e){return k._compress(e,16,(function(e){return v(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,i,o,s="",a="",c="",u=2,l=3,d=2,p=0,f=0,h={},_={},g=[];for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(h,s)||(h[s]=l++,_[s]=!0),a=c+s,Object.prototype.hasOwnProperty.call(h,a))c=a;else{if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++),h[a]=l++,c=String(s)}if(""!==c){if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++)}for(i=2,r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:k._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,i,o,s,a,c,u,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,_=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(o=0,a=Math.pow(2,2),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 2:return""}for(l[3]=u,i=u,d.push(u);;){if(p.index>e)return"";for(o=0,a=Math.pow(2,_),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(u=o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,_),_++),l[u])g=l[u];else{if(u!==h)return null;g=i+i.charAt(0)}d.push(g),l[h++]=i+g.charAt(0),i=g,0==--f&&(f=Math.pow(2,_),_++)}}},S={DEBUG:!1,LIB_VERSION:"1.51.5"},F=Array.prototype,I=Object.prototype,O=I.toString,E=I.hasOwnProperty,P="undefined"!=typeof window?window:{},A=P.navigator||{userAgent:""},x=P.document||{},C=A.userAgent,T=F.forEach,R=F.indexOf,$=Array.isArray,M={},j=function(){if(S.DEBUG&&!Q(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(i){B(n,(function(t){e(t)}))}}},q=function(){if(S.DEBUG&&!Q(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(o){B(r,(function(e){i(e)}))}}},D=function(){if(!Q(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(o){B(r,(function(e){i(e)}))}}},N=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function L(e,t,n){if(null!=e)if(T&&Array.isArray(e)&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===M)return}else for(var o in e)if(E.call(e,o)&&t.call(n,e[o],o)===M)return}function B(e,t,n){if(Array.isArray(e))if(T&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===M)return}var H=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return B(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},U=$||function(e){return"[object Array]"===O.call(e)},V=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}};function W(e,t){return-1!==e.indexOf(t)}var z=function(e){return e===Object(e)&&!U(e)},Q=function(e){return void 0===e},G=function(e){return"[object String]"==O.call(e)},J=function(e){return"[object Number]"==O.call(e)},Z=function e(t){return L(t,(function(n,r){var i;i=n,"[object Date]"!=O.call(i)?z(n)&&(t[r]=e(n)):t[r]=X(n)})),t},X=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Y=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){D("Implementation error. Please turn on debug and contact support@posthog.com."),D(i)}}},K=function(e){var t={};return L(e,(function(e,n){G(e)&&e.length>0&&(t[n]=e)})),t},ee=["$performance_raw"];function te(e,t){return n=e,r=function(e,n){return n&&ee.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),U(t)?(o=[],B(t,(function(t){o.push(e(t))}))):(o={},L(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function ne(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=ie(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(u=l.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}var re,ie=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},oe=(re=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return re()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=C,r=0,i=[];function o(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=i[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(r=o(r,i),i=[]);return i.length>0&&(r=o(r,i)),r.toString(16)}()+"-"+e+"-"+re()}),se=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(o){q("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},ae=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},ce=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=(c=t,u=r,l=a,function(t){if(t=t||e(window.event)){var n,r=!0;V(l)&&(n=l(t));var i=u.call(c,t);return!1!==n&&!1!==i||(r=!1),r}})}else q("No valid element provided to register_event");var c,u,l}}(),ue={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return L(e,(function(e){var n=se(x.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=ue.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=se(e,n);i.length&&(r.ph_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||W(e," OPR/")?W(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":W(e,"IEMobile")||W(e,"WPDesktop")?"Internet Explorer Mobile":W(e,"SamsungBrowser/")?"Samsung Internet":W(e,"Edge")||W(e,"Edg/")?"Microsoft Edge":W(e,"FBIOS")?"Facebook Mobile":W(e,"Chrome")?"Chrome":W(e,"CriOS")?"Chrome iOS":W(e,"UCWEB")||W(e,"UCBrowser")?"UC Browser":W(e,"FxiOS")?"Firefox iOS":W(t,"Apple")?W(e,"Mobile")?"Mobile Safari":"Safari":W(e,"Android")?"Android Mobile":W(e,"Konqueror")?"Konqueror":W(e,"Firefox")?"Firefox":W(e,"MSIE")||W(e,"Trident/")?"Internet Explorer":W(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[ue.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return A.language||A.userLanguage},os:function(){var e=C;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return H(K({$os:ue.os(),$browser:ue.browser(C,A.vendor,P.opera),$device:ue.device(C),$device_type:ue.deviceType(C)}),{$current_url:null==P?void 0:P.location.href,$host:null==P?void 0:P.location.host,$pathname:null==P?void 0:P.location.pathname,$browser_version:ue.browserVersion(C,A.vendor,P.opera),$browser_language:ue.browserLanguage(),$screen_height:null==P?void 0:P.screen.height,$screen_width:null==P?void 0:P.screen.width,$viewport_height:null==P?void 0:P.innerHeight,$viewport_width:null==P?void 0:P.innerWidth,$lib:"web",$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return H(K({$os:ue.os(),$browser:ue.browser(C,A.vendor,P.opera)}),{$browser_version:ue.browserVersion(C,A.vendor,P.opera)})}};function le(e){switch(r(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function de(e){var t="";return ve(e)&&!ye(e)&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){he(e)&&e.textContent&&(t+=N(e.textContent).split(/(\s+)/).filter(me).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),N(t)}function pe(e){return!!e&&1===e.nodeType}function fe(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function he(e){return!!e&&3===e.nodeType}function _e(e){return!!e&&11===e.nodeType}var ge=["a","button","form","input","select","textarea","label"];function ve(e){for(var t=e;t.parentNode&&!fe(t,"body");t=t.parentNode){var n=le(t).split(" ");if(W(n,"ph-sensitive")||W(n,"ph-no-capture"))return!1}if(W(le(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return"string"!=typeof i||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function ye(e){return!!(fe(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fe(e,"select")||fe(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function me(e){if(null===e||Q(e))return!1;if("string"==typeof e){if(e=N(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function be(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,i=document.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):document.body.appendChild(n)}function we(e){var t=de(e);return me(t="".concat(t," ").concat(ke(e)).trim())?t:""}function ke(e){var t="";return e&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=de(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ke(e)).trim())}catch(i){console.error(i)}})),t}var Se=function(){function e(t){i(this,e),this.clicks=[],this.enabled=t}return s(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),Fe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Ie={is_supported:function(){return!0},error:function(e){q("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(o){}return null},parse:function(e){var t;try{t=JSON.parse(Ie.get(e))||{}}catch(n){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var c=document.location.hostname.match(Fe),u=c?c[0]:"";o=u?"; domain=."+u:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(p){return}},remove:function(e,t){try{Ie.set(e,"",-1,t)}catch(n){return}}},Oe=null,Ee={is_supported:function(){if(null!==Oe)return Oe;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";Ee.set(t,"xyz"),'"xyz"'!==Ee.get(t)&&(e=!1),Ee.remove(t)}catch(n){e=!1}else e=!1;return e||q("localStorage unsupported; falling back to cookie store"),Oe=e,e},error:function(e){q("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ee.error(t)}return null},parse:function(e){try{return JSON.parse(Ee.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){Ee.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ee.error(t)}}},Pe=n(n({},Ee),{},{parse:function(e){try{var t={};try{(t=Ie.parse(e)||{}).distinct_id&&Ie.set(e,{distinct_id:t.distinct_id})}catch(r){}var n=H(t,JSON.parse(Ee.get(e)||"{}"));return Ee.set(e,n),n}catch(r){}return null},set:function(e,t,n,r,i){try{Ee.set(e,t),t.distinct_id&&Ie.set(e,{distinct_id:t.distinct_id},n,r,i)}catch(o){Ee.error(o)}},remove:function(e,t){try{window.localStorage.removeItem(e),Ie.remove(e,t)}catch(n){Ee.error(n)}}}),Ae={},xe={is_supported:function(){return!0},error:function(e){q("memoryStorage error: "+e)},get:function(e){return Ae[e]||null},parse:function(e){return Ae[e]||null},set:function(e,t){Ae[e]=t},remove:function(e){delete Ae[e]}},Ce=null,Te={is_supported:function(){if(null!==Ce)return Ce;if(Ce=!0,"undefined"!=typeof window)try{var e="__support__";Te.set(e,"xyz"),'"xyz"'!==Te.get(e)&&(Ce=!1),Te.remove(e)}catch(t){Ce=!1}else Ce=!1;return Ce},error:function(e){S.DEBUG&&q("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(t){Te.error(t)}return null},parse:function(e){try{return JSON.parse(Te.get(e))||null}catch(t){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Te.error(n)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(t){Te.error(t)}}},Re="$people_distinct_id",$e="__alias",Me="__timers",je="$autocapture_disabled_server_side",qe="$session_recording_enabled_server_side",De="$console_log_recording_enabled_server_side",Ne="$session_recording_recorder_version_server_side",Le="$sesid",Be="$enabled_feature_flags",He="$user_state",Ue=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",Re,$e,"__cmpns",Me,qe,Le,Be,He],Ve=function(){function e(t){i(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var r=t.persistence.toLowerCase();"cookie"!==r&&-1===r.indexOf("localstorage")&&"memory"!==r&&(D("Unknown persistence type "+r+"; falling back to cookie"),r=t.persistence="cookie"),"localstorage"===r&&Ee.is_supported()?this.storage=Ee:"localstorage+cookie"===r&&Pe.is_supported()?this.storage=Pe:this.storage="memory"===r?xe:Ie,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return s(e,[{key:"properties",value:function(){var e={};return L(this.props,(function(t,n){if(n===Be&&"object"===r(t))for(var i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else a=n,c=!1,(null===(s=Ue)?c:R&&s.indexOf===R?-1!=s.indexOf(a):(L(s,(function(e){if(c||(c=e===a))return M})),c))||(e[n]=t);var s,a,c})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=H({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(z(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var i=!1;if(L(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(z(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(L(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ue.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(ue.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:ue.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return K({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return L(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Me]||{};n[e]=t,this.props[Me]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Me]||{})[e];return Q(t)||(delete this.props[Me][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[He]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[He]=e,this.save()}}]),e}(),We={_initializedTokens:[],_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t=!!e.get_property(je),n=!!e.get_config("autocapture");this._isAutocaptureEnabled=n&&!t},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!pe(t));return t},_getAugmentPropertiesFromElement:function(e){if(!ve(e))return{};var t={};return L(e.attributes,(function(e){if(e.name.startsWith("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&me(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),i={tag_name:r};ge.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?i.$el_text=we(e):i.$el_text=de(e));var o=le(e);o.length>0&&(i.classes=o.split(" ").filter((function(e){return""!==e}))),L(e.attributes,(function(n){var r;ye(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&me(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(i["attr__"+n.name]=n.value)}));for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return i.nth_child=s,i.nth_of_type=a,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return L(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),me(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return L(this._customProperties,(function(r){L(r.event_selectors,(function(i){L(document.querySelectorAll(i),(function(i){W(e,i)&&ve(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);if(he(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"),o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||fe(e,"html")||!pe(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var s=n.element_allowlist;if(s&&!s.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some((function(t){return e.matches(t)})))return!1}for(var c=!1,u=[e],l=!0,d=e;d.parentNode&&!fe(d,"body");)if(_e(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(ge.indexOf(l.tagName.toLowerCase())>-1)c=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}u.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return c?"click"===t.type:"click"===t.type&&(ge.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s=[o],a=o;a.parentNode&&!fe(a,"body");)_e(a.parentNode)?(s.push(a.parentNode.host),a=a.parentNode.host):(s.push(a.parentNode),a=a.parentNode);var c,u=[],l={},d=!1;if(L(s,(function(e){var n=ve(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&me(c)&&c),W(le(e).split(" "),"ph-no-capture")&&(d=!0),u.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var i=r._getAugmentPropertiesFromElement(e);H(l,i)})),t.get_config("mask_all_text")||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?u[0].$el_text=we(o):u[0].$el_text=de(o)),c&&(u[0].attr__href=c),d)return!1;var p=H(this._getDefaultProperties(e.type),{$elements:u},this._getCustomProperties(s),l);return t.capture(i,p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ce(document,"submit",n,!1,!0),ce(document,"change",n,!1,!0),ce(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new Se(e.get_config("rageclick"))},afterDecideResponse:function(e,t){this._setIsAutocaptureEnabled(t);var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?j('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(a({},je,!!e.autocapture_opt_out)),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Q(t)?10:t,n=Q(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return V(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(We),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Y(e[t]))}(We);var ze="__ph_opt_in_out_";function Qe(e,t){tt(!0,e,t)}function Ge(e,t){tt(!1,e,t)}function Je(e,t){return"1"===et(e,t)}function Ze(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||P,n=t.navigator||{},r=!1;return L([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){W([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===et(e,t)}function Xe(e,t){Ye(t=t||{}).remove(Ke(e,t),!!t.crossSubdomainCookie)}function Ye(e){return"localStorage"===(e=e||{}).persistenceType?Ee:"localStorage+cookie"===e.persistenceType?Pe:Ie}function Ke(e,t){return((t=t||{}).persistencePrefix||ze)+e}function et(e,t){return Ye(t).get(Ke(e,t))}function tt(e,t,n){G(t)&&t.length?(Ye(n=n||{}).set(Ke(t,n),e?1:0,J(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function nt(e,t){var n=!1;try{var r=e.get_config("token"),i=e.get_config("respect_dnt"),o=e.get_config("opt_out_capturing_persistence_type"),s=e.get_config("opt_out_capturing_cookie_prefix")||void 0,a=e.get_config("window");r&&(n=Ze(r,{respectDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(c){t||console.error("Unexpected error when checking capturing opt-out status: "+c)}return n}function rt(e,t,n){return function(){for(var r=nt(e,n),i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];if(!r)return t.apply(this,o);var a=o[o.length-1];"function"==typeof a&&a(0)}}var it="$set",ot=function(){function e(t){var n=this;i(this,e),this._posthog=t,this.set=rt(t,(function(e,t,r){var i=n.set_action(e,t);return z(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),i[it]=H({},ue.people_properties(),n._posthog.persistence.get_referrer_info(),i[it]),n._send_request(i,r)})),this.set_once=rt(t,(function(e,t,r){var i=n.set_once_action(e,t);return z(e)&&(r=t),n._send_request(i,r)}))}return s(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),i=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=Z(e),s=te(o,this._get_config("properties_string_max_length")),a=ne(JSON.stringify(o));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:a},{},this._posthog._prepare_callback(t,s)),s}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(it,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,i={},o={};return z(t)?L(t,(function(e,t){r._is_reserved_property(t)||(o[t]=e)})):o[t]=n,i[e]=o,i}}]),e}(),st="$active_feature_flags",at="$enabled_feature_flags",ct="$override_feature_flags",ut="$feature_flag_payloads",lt=function(){function e(t){i(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return s(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(at),t=this.instance.get_property(ct);if(!t)return e||{};for(var n=H({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ut)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=this.instance.get_config("token"),n=ne(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var c,u={};if(o)for(var l=0;l<o.length;l++)u[o[l]]=!0;t&&t.register((a(c={},st,o),a(c,at,u),c))}else{var d,p=o,f=s;e.errorsWhileComputingFlags&&(p=n(n({},r),p),f=n(n({},i),f)),t&&t.register((a(d={},st,Object.keys(p||{})),a(d,at,p||{}),a(d,ut,f||{}),d))}else t&&(t.unregister(st),t.unregister(at),t.unregister(ut))}(e,this.instance.persistence,t,r);var i=this._prepareFeatureFlagsForCallbacks(),o=i.flags,s=i.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,s)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ct);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(a({},ct,t))}else this.instance.persistence.register(a({},ct,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}}]),e}(),dt=2,pt=4,ft=function(){function e(t){i(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return s(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(qe),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(De),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Ne);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((a(o={},qe,!!e.sessionRecording),a(o,De,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),a(o,Ne,null===(i=e.sessionRecording)||void 0===i?void 0:i.recorderVersion),o)),null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint),null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0;var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?be(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(S.LIB_VERSION),this._onScriptLoaded.bind(this)):this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),r=this.instance.sessionManager.checkAndGetSessionAndWindowId(n,e.timestamp),i=r.windowId,o=r.sessionId;if(this.captureStarted&&(this.windowId!==i||this.sessionId!==o)&&-1===[dt,pt].indexOf(e.type))try{var s;null===(s=this.rrwebRecord)||void 0===s||s.takeFullSnapshot()}catch(a){q("Error taking full snapshot.",a)}this.windowId=i,this.sessionId=o}},{key:"_onScriptLoaded",value:function(){var e=this,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),o=0,s=Object.entries(i||{});o<s.length;o++){var a=p(s[o],2),c=a[0],u=a[1];c in t&&(t[c]=u)}this.rrwebRecord?(this.stopRrweb=this.rrwebRecord(n({emit:function(t){t=function(e){if(e&&"object"===r(e)&&6===e.type&&"object"===r(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===r(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,i=g(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(i.s();!(n=i.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(s){i.e(s)}finally{i.f()}}return JSON.parse(t)}return e}(t)),e._updateWindowAndSessionIds(t);var n={$snapshot_data:t,$session_id:e.sessionId,$window_id:e.windowId};e.instance._captureMetrics.incr("rrweb-record"),e.instance._captureMetrics.incr("rrweb-record-".concat(t.type)),e.emit?e._captureSnapshot(n):e.snapshots.push(n)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},t)),this.instance._addCaptureHook((function(t){try{var n;"$pageview"===t&&(null===(n=e.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}catch(r){q("Could not add $pageview to rrweb session",r)}}))):q("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===dt}})}}]),e}(),ht={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},_t=["first-input","navigation","paint","resource"],gt=["/s/","/e/"],vt=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))})),PerformanceObserver.supportedEntryTypes.filter((function(e){return _t.includes(e)})).forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(t){console.error("PostHog failed to start performance observer",t),this.stopObserving()}}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.get_config("capture_performance"))&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(gt.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},i=Math.floor(Date.now()-performance.now());for(var o in r[ht.timeOrigin]=i,r[ht.timestamp]=Math.floor(i+e.startTime),ht)void 0!==n[o]&&(r[ht[o]]=n[o]);if(this.capturePerformanceEvent(r),yt(e)){var s,c=g(e.serverTiming||[]);try{for(c.s();!(s=c.n()).done;){var u,l=s.value;this.capturePerformanceEvent((a(u={},ht.timeOrigin,i),a(u,ht.timestamp,Math.floor(i+e.startTime)),a(u,ht.name,l.name),a(u,ht.duration,l.duration),a(u,ht.entryType,"serverTiming"),u))}}catch(d){c.e(d)}finally{c.f()}}}},{key:"capturePerformanceEvent",value:function(e){this.instance.capture("$performance_event",e,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"performanceEvent"})}}]),e}(),yt=function(e){return"navigation"===e.entryType||"resource"===e.entryType},mt=function(){function e(t){i(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return s(e,[{key:"call",value:function(){var e=this,t=ne(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),We.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var i,o={},s=g(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)o[i.value]=!0}catch(d){s.e(d)}finally{s.f()}this.instance.compression=o}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var a,c=this.instance.get_config("api_host"),u=g(e.siteApps);try{var l=function(){var e=a.value,t=e.id,n=e.url,i=document.createElement("script");i.src=[c,"/"===c[c.length-1]&&"/"===n[0]?n.substring(1):n].join(""),i.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(i)};for(u.s();!(a=u.n()).done;)l()}catch(d){u.e(d)}finally{u.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),bt=["https://app.posthog.com","https://eu.posthog.com"],wt=["source"],kt=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(n(n({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(s){return!1}t=window.localStorage}var r,i=ae(e.hash,"__posthog")||ae(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token||(this.loadToolbar(r),0))}catch(s){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),o="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),s=!bt.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),a=n(n({apiURL:r,jsURL:r,token:this.instance.get_config("token")},e),s?{instrument:!1}:{});a.source;var c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(a,wt);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),be(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(a,t.instance)})),ce(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(a)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),St=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;i(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return s(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Ft=function(e){c(r,St);var t=d(r);function r(e,n){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return i(this,r),(o=t.call(this,s)).handlePollRequest=n,o.captureMetrics=e,o}return s(r,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;L(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(i.slice(i.length-2))),e.captureMetrics.incr("batch-handle",o.length),e.captureMetrics.incr("batch-handle-".concat(i.slice(i.length-2)),o.length)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,i=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",i.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),i.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var r=Object.values(t);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var r=t.url,i=t.data,o=t.options;e.handlePollRequest(r,i,n(n({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return L(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),r}(),It=function(){function e(t){i(this,e),this.enabled=t,this.metrics={}}return s(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),Ot=Uint8Array,Et=Uint16Array,Pt=Uint32Array,At=new Ot([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xt=new Ot([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ct=new Ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tt=function(e,t){for(var n=new Et(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Pt(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Rt=Tt(At,2),$t=Rt[0],Mt=Rt[1];$t[28]=258,Mt[258]=28;for(var jt=Tt(xt,0)[1],qt=new Et(32768),Dt=0;Dt<32768;++Dt){var Nt=(43690&Dt)>>>1|(21845&Dt)<<1;Nt=(61680&(Nt=(52428&Nt)>>>2|(13107&Nt)<<2))>>>4|(3855&Nt)<<4,qt[Dt]=((65280&Nt)>>>8|(255&Nt)<<8)>>>1}var Lt=function(e,t,n){for(var r=e.length,i=0,o=new Et(t);i<r;++i)++o[e[i]-1];var s,a=new Et(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Et(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)s[qt[d]>>>c]=u}else for(s=new Et(r),i=0;i<r;++i)s[i]=qt[a[e[i]-1]++]>>>15-e[i];return s},Bt=new Ot(288);for(Dt=0;Dt<144;++Dt)Bt[Dt]=8;for(Dt=144;Dt<256;++Dt)Bt[Dt]=9;for(Dt=256;Dt<280;++Dt)Bt[Dt]=7;for(Dt=280;Dt<288;++Dt)Bt[Dt]=8;var Ht=new Ot(32);for(Dt=0;Dt<32;++Dt)Ht[Dt]=5;var Ut,Vt,Wt=Lt(Bt,9,0),zt=Lt(Ht,5,0),Qt=function(e){return(e/8>>0)+(7&e&&1)},Gt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Et?Et:e instanceof Pt?Pt:Ot)(n-t);return r.set(e.subarray(t,n)),r},Jt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Zt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Xt=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Ot(0),0];if(1==i){var s=new Ot(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[d].f?u++:d++],c=n[u!=l&&n[u].f<n[d].f?u++:d++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var f=new Et(p+1),h=Yt(n[l-1],f,0);if(h>t){r=0;var _=0,g=h-t,v=1<<g;for(o.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(f[y]>t))break;_+=v-(1<<h-f[y]),f[y]=t}for(_>>>=g;_>0;){var m=o[r].s;f[m]<t?_-=1<<t-f[m]++-1:++r}for(;r>=0&&_;--r){var b=o[r].s;f[b]==t&&(--f[b],++_)}h=t}return[new Ot(f),h]},Yt=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},Kt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Et(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},en=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},tn=function(e,t,n){var r=n.length,i=Qt(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},nn=function(e,t,n,r,i,o,s,a,c,u,l){Jt(t,l++,n),++i[256];for(var d=Xt(i,15),p=d[0],f=d[1],h=Xt(o,15),_=h[0],g=h[1],v=Kt(p),y=v[0],m=v[1],b=Kt(_),w=b[0],k=b[1],S=new Et(19),F=0;F<y.length;++F)S[31&y[F]]++;for(F=0;F<w.length;++F)S[31&w[F]]++;for(var I=Xt(S,7),O=I[0],E=I[1],P=19;P>4&&!O[Ct[P-1]];--P);var A,x,C,T,R=u+5<<3,$=en(i,Bt)+en(o,Ht)+s,M=en(i,p)+en(o,_)+s+14+3*P+en(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(R<=$&&R<=M)return tn(t,l,e.subarray(c,c+u));if(Jt(t,l,1+(M<$)),l+=2,M<$){A=Lt(p,f,0),x=p,C=Lt(_,g,0),T=_;var j=Lt(O,E,0);for(Jt(t,l,m-257),Jt(t,l+5,k-1),Jt(t,l+10,P-4),l+=14,F=0;F<P;++F)Jt(t,l+3*F,O[Ct[F]]);l+=3*P;for(var q=[y,w],D=0;D<2;++D){var N=q[D];for(F=0;F<N.length;++F){var L=31&N[F];Jt(t,l,j[L]),l+=O[L],L>15&&(Jt(t,l,N[F]>>>5&127),l+=N[F]>>>12)}}}else A=Wt,x=Bt,C=zt,T=Ht;for(F=0;F<a;++F)if(r[F]>255){L=r[F]>>>18&31,Zt(t,l,A[L+257]),l+=x[L+257],L>7&&(Jt(t,l,r[F]>>>23&31),l+=At[L]);var B=31&r[F];Zt(t,l,C[B]),l+=T[B],B>3&&(Zt(t,l,r[F]>>>5&8191),l+=xt[B])}else Zt(t,l,A[r[F]]),l+=x[r[F]];return Zt(t,l,A[256]),l+x[256]},rn=new Pt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),on=new Ot(0),sn=function(){for(var e=new Pt(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),an=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cn(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=sn[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Ot(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?u=tn(c,u,e.subarray(l,d)):(c[l]=o,u=tn(c,u,e.subarray(l,s)))}else{for(var p=rn[t-1],f=p>>>13,h=8191&p,_=(1<<n)-1,g=new Et(32768),v=new Et(_+1),y=Math.ceil(n/3),m=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<m)&_},w=new Pt(25e3),k=new Et(288),S=new Et(32),F=0,I=0,O=(l=0,0),E=0,P=0;l<s;++l){var A=b(l),x=32767&l,C=v[A];if(g[x]=C,v[A]=x,E<=l){var T=s-l;if((F>7e3||O>24576)&&T>423){u=nn(e,c,0,w,k,S,I,O,P,l-P,u),O=F=I=0,P=l;for(var R=0;R<286;++R)k[R]=0;for(R=0;R<30;++R)S[R]=0}var $=2,M=0,j=h,q=x-C&32767;if(T>2&&A==b(l-q))for(var D=Math.min(f,T)-1,N=Math.min(32767,l),L=Math.min(258,T);q<=N&&--j&&x!=C;){if(e[l+$]==e[l+$-q]){for(var B=0;B<L&&e[l+B]==e[l+B-q];++B);if(B>$){if($=B,M=q,B>D)break;var H=Math.min(q,B-2),U=0;for(R=0;R<H;++R){var V=l-q+R+32768&32767,W=V-g[V]+32768&32767;W>U&&(U=W,C=V)}}}q+=(x=C)-(C=g[x])+32768&32767}if(M){w[O++]=268435456|Mt[$]<<18|jt[M];var z=31&Mt[$],Q=31&jt[M];I+=At[z]+xt[Q],++k[257+z],++S[Q],E=l+$,++F}else w[O++]=e[l],++k[e[l]]}}u=nn(e,c,o,w,k,S,I,O,P,l-P,u),o||(u=tn(c,u,on))}return Gt(a,0,r+Qt(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=i.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&an(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(i,t),an(i,o-8,n.d()),an(i,o-4,r),i}function un(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ot(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new Ot(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Gt(r,0,i)}(Vt=Ut||(Ut={})).GZipJS="gzip-js",Vt.LZ64="lz64",Vt.Base64="base64";var ln,dn,pn,fn=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i,o},hn=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.captureMetrics,s=e.callback,a=e.retriesPerformedSoFar,c=e.retryQueue,u=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(i.method||"GET",t,!0);var f=fn(n,i);o.incr("_send_request"),o.incr("_send_request_inflight"),L(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(o.incr("xhr-response"),o.incr("xhr-response-".concat(p.status)),o.decr("_send_request_inflight"),200===p.status){if(s){var e;try{e=JSON.parse(p.responseText)}catch(l){return void q(l)}s(e)}}else"function"==typeof u&&u(p),[401,403,404,500].indexOf(p.status)<0&&c.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:s}),s&&s({status:0})},p.send(f)},_n=function(e){c(r,St);var t=d(r);function r(e,n){var o;return i(this,r),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=n,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return s(r,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(o){r.e(o)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=g(this.queue);try{for(t.s();!(e=t.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;try{window.navigator.sendBeacon(i,fn(o,n(n({},s),{},{sendBeacon:!0})))}catch(a){S.DEBUG&&console.error(a)}}}catch(a){t.e(a)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;hn({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}(),gn=function(){function e(t,n){i(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",!this.persistence.disabled&&Te.is_supported()){var o=Te.parse(this.window_id_storage_key),s=Te.parse(this.primary_window_exists_storage_key);o&&!s?this._windowId=o:Te.remove(this.window_id_storage_key),Te.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return s(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&Te.is_supported()&&Te.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&Te.is_supported()?Te.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(a({},Le,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Le];return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&Te.is_supported()&&Te.remove(e.primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=p(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],s=this._getWindowId(),a=o&&o>0&&Math.abs(t-o)>864e5;!i||!e&&Math.abs(t-r)>18e5||a?(i=oe(),s=oe(),o=t):s||(s=oe());var c=0===r||!e||a?t:r,u=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,c,u),{sessionId:i,windowId:s}}}]),e}(),vn=s((function e(t,n,r,o){i(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,s,a;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var c=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=c+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=c+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var u=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(s=u[0])||void 0===s?void 0:s.value,$sentry_exception_type:null===(a=u[0])||void 0===a?void 0:a.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),yn=function(){function e(){i(this,e),a(this,"_seenFirstPageView",!1)}return s(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=oe()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=oe()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(ln||(ln={}));var mn=function(){},bn={},wn="posthog",kn=P.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Sn=!kn&&-1===C.indexOf("MSIE")&&-1===C.indexOf("Mozilla"),Fn=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==x||null===(e=x.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:mn,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==P||null===(n=P.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:mn,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},In=function(e,t,n,r){var i,o=n!==wn&&pn?n?pn[n]:void 0:pn,s={initComplete:!1,syncCode:!1},a=function(e){return function(t){s[e]||(s[e]=!0,s.initComplete&&s.syncCode&&(null==r||r(t)))}};if(o&&dn===ln.INIT_MODULE)i=o;else{if(o&&!U(o))return void console.error("You have already initialized "+n);i=new On}return i._init(e,t,n,a("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new ft(i),i.sessionRecording.startRecordingIfEnabled(),i.webPerformance=new vt(i),i.webPerformance.startObservingIfEnabled(),i.__autocapture=i.get_config("autocapture"),We._setIsAutocaptureEnabled(i),We._isAutocaptureEnabled&&(i.__autocapture=i.get_config("autocapture"),We.enabledForProject(i.get_config("token"),100,100)?We.isBrowserSupported()?We.init(i):(i.__autocapture=!1,j("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,j("Not in active bucket: disabling Automatic Event Collection."))),S.DEBUG=S.DEBUG||i.get_config("debug"),void 0!==o&&U(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),a("syncCode")(i),i},On=function(){function e(){var t=this;i(this,e),this.config=Fn(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=vn,this.segmentIntegration=function(){return function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new ot(this),this.featureFlags=new lt(this),this.feature_flags=this.featureFlags,this.toolbar=new kt(this),this.pageViewIdManager=new yn,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return s(e,[{key:"init",value:function(e,t,n){if(Q(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==wn){var r=In(e,t,n,(function(e){pn[n]=e,e._loaded()}));return pn[n]=r,r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var a,c={segmentRegister:!1,syncCode:!1},u=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==s||s(r)))}};if(this.set_config(H({},Fn(),i,{name:o,token:e,callback_fn:(o===wn?o:wn+"."+o)+"._jsc"})),this._jsc=function(){},(null!=P&&null!==(t=P.rrweb)&&void 0!==t&&t.record||null!=P&&P.rrwebRecord)&&(this.__loaded_recorder_version=null==P||null===(a=P.rrweb)||void 0===a?void 0:a.version),this._captureMetrics=new It(this.get_config("_capture_metrics")),this._requestQueue=new Ft(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new _n(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new Ve(this.config),this.sessionManager=new gn(this.config,this.persistence),this._gdpr_init(),i.segment?(this.config.get_device_id=function(){return i.segment.user().anonymousId()},i.segment.user().id()&&(this.register({distinct_id:i.segment.user().id()}),this.persistence.set_user_state("identified")),i.segment.register(this.segmentIntegration()).then(u("segmentRegister"))):u("segmentRegister")(),void 0!==(null===(n=i.bootstrap)||void 0===n?void 0:n.distinctID)){var l,d,p=this.get_config("get_device_id")(oe()),f=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?p:i.bootstrap.distinctID;this.persistence.set_user_state(null!==(d=i.bootstrap)&&void 0!==d&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var h,_,g=Object.keys((null===(h=i.bootstrap)||void 0===h?void 0:h.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),v=Object.keys((null===(_=i.bootstrap)||void 0===_?void 0:_.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,r,o,s;return null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]),e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v})}if(!this.get_distinct_id()){var y=this.get_config("get_device_id")(oe());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}P.addEventListener&&P.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),u("syncCode")()}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new mt(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||B(this.__request_queue,(function(t){e._send_request.apply(e,f(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(Q(e))return null;if(kn)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||bn,mn)}},{key:"__compress_and_send_json_request",value:function(e,t,r,i){var o,s,a,c,u=p((s=(o=this.compression)[Ut.GZipJS]?Ut.GZipJS:o[Ut.LZ64]?Ut.LZ64:Ut.Base64,a=t,c=r,s===Ut.LZ64?[{data:k.compressToBase64(a),compression:Ut.LZ64},c]:s===Ut.GZipJS?[cn(un(a),{mtime:0}),n(n({},c),{},{blob:!0,urlQueryArgs:{compression:Ut.GZipJS}})]:[{data:ne(a)},c]),2),l=u[0],d=u[1];this._send_request(e,l,d,i)}},{key:"_send_request",value:function(e,t,r,i){if(Sn)this.__request_queue.push([e,t,r,i]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=H(o,r||{}),kn||(r.method="GET");var s="sendBeacon"in P.navigator&&"sendBeacon"===r.transport;if(e=function(t,n,r){var i=n||{};i.ip=r.ip?1:0,i._=(new Date).getTime().toString(),i.ver=S.LIB_VERSION;var o=t.split("?");if(o.length>1){var s,a=g(o[1].split("&"));try{for(a.s();!(s=a.n()).done;){var c=s.value.split("=")[0];i[c]&&delete i[c]}}catch(e){a.e(e)}finally{a.f()}}var u=t.indexOf("?")>-1?"&":"?";return t+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return L(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(i)}(e,r.urlQueryArgs||{},{ip:this.get_config("ip")}),z(t)&&this.get_config("img")){var a=x.createElement("img");a.src=e,x.body.appendChild(a)}else if(s)try{P.navigator.sendBeacon(e,fn(t,n(n({},r),{},{sendBeacon:!0})))}catch(d){this.get_config("debug")&&console.error(d)}else if(kn)try{hn({url:e,data:t,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(d){console.error(d)}else{var c,u=x.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=x.getElementsByTagName("script")[0];null===(c=l.parentNode)||void 0===c||c.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];B(e,(function(e){e&&(t=e[0],U(t)?o.push(e):"function"==typeof e?e.call(n):U(e)&&"alias"===t?r.push(e):U(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?o.push(e):i.push(e))}));var s=function(e,t){B(e,(function(e){if(U(e[0])){var n=t;L(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bn;if(this.__loaded&&!nt(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||bn).transport;if(r&&(n.transport=r),Q(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler)/i.test(e)}(C)){this.persistence.update_search_keyword(x.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(x.referrer);var i={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(i.$set=n.$set),(i=te(i,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&j("PostHog.js send",i);var o=JSON.stringify(i),s=this.get_config("api_host")+(n.endpoint||"/e/"),a=n!==bn;return!this.get_config("request_batching")||a&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(s,o,n):this._requestQueue.enqueue(s,i,n),this._invokeCaptureHooks(e,i),i}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),L(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var r,i=this.persistence.remove_event_timer(e),o=n({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var s=this.persistence.properties();return o.distinct_id=s.distinct_id,o}var a=ue.properties();if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(),u=c.sessionId,l=c.windowId;o.$session_id=u,o.$window_id=l}if(null!==(r=this.webPerformance)&&void 0!==r&&r.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=H(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=a.$current_url,o}if(void 0!==i){var p=(new Date).getTime()-i;o.$duration=parseFloat((p/1e3).toFixed(3))}o=H({},a,this.persistence.properties(),o);var f=this.get_config("property_blacklist");U(f)?L(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(a({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(n){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property($e)&&(this.unregister($e),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,r){if(e&&t){this._captureMetrics.incr("group");var i=this.getGroups();this.register({$groups:n(n({},i),{},a({},e,t))}),r&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),i[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(oe());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(Re)?(D("Attempting to create alias for existing People user - aborting."),-2):(Q(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single($e,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t=n({},this.config);z(e)&&(H(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Ee.is_supported()&&"true"===Ee.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(S.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:wn;return t!==wn&&(t=wn+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&Ee.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!Ie.get("ph_optout")||(Ie.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=H({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),Ee.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=H({enable_persistence:!0},e||{}),this._gdpr_call_func(Qe,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=H({clear_persistence:!0},e||{});this._gdpr_call_func(Ge,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Je,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Ze,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=H({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Xe,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(P.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(P.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return k.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Y(e.prototype[t[n]])}(On,["identify"]);var En={},Pn=(dn=ln.INIT_MODULE,(pn=new On).init=function(e,t,n){if(n)return pn[n]||(pn[n]=En[n]=In(e||"",t||{},n,(function(e){pn[n]=En[n]=e,e._loaded()}))),pn[n];var r=pn;return En[wn]?r=En[wn]:e&&(r=In(e,t||{},wn,(function(e){En[wn]=e,e._loaded()})),En[wn]=r),pn=r,dn===ln.INIT_SNIPPET&&(P[wn]=pn),L(En,(function(e,t){t!==wn&&(pn[t]=e)})),r},pn.init(),function(){function e(){e.done||(e.done=!0,Sn=!1,L(En,(function(e){e._dom_loaded()})))}x.addEventListener&&("complete"===x.readyState?e():x.addEventListener("DOMContentLoaded",e,!1)),ce(P,"load",e,!0)}(),pn);const An={stage:"v1",posthog:{token:"phc_tnQZyAK9BM0WkS5fdAZAxA1bNnyKUlWSACWzmxDfVrA",url:"https://posthog.worldshopping.global",debug:!1,cookieDisabledDomains:["online.euglena.jp"]},release:{dynamoDbTable:"v1PosthogScript"}},xn=["require.js","prototype.js"];function Cn(e){!function(e){const t=document.getElementsByTagName("script");for(const n of t){const t=n.getAttribute("src");Tn(t)&&e.capture("script_conflict_detect",{src:t})}}(e),function(e){const t=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.addedNodes.forEach((t=>{if("script"===t.nodeName.toLowerCase()){const n=t.getAttribute("src");Tn(n)&&e.capture("script_conflict_detect",{src:n})}}))}))})),n={childList:!0,attributes:!0,subtree:!0},r=document.querySelector("body"),i=document.querySelector("head");r&&t.observe(r,n),i&&t.observe(i,n)}(e)}function Tn(e){return!!(e&&xn.find((t=>e.includes(t))))}let Rn;e.capture=function(e,t){Rn.capture(e,t)},e.checkConflictScripts=function(){Rn?Cn(Rn):console.warn("ZigzagPosthogScript not initialized")},e.init=function(e,t){Rn=Pn.init(An.posthog.token,{api_host:An.posthog.url,debug:An.posthog.debug,autocapture:!1,capture_pageview:!1,persistence:An.posthog.cookieDisabledDomains.includes(window.location.hostname)?"localStorage":"localStorage+cookie",loaded:void 0,advanced_disable_decide:!0,...null!=t?t:{}},"zigzag"),Rn.register({shop_key:e})},e.initPreConsent=function(e,t){Rn=Pn.init(An.posthog.token,{api_host:An.posthog.url,debug:An.posthog.debug,autocapture:!1,capture_pageview:!1,persistence:"memory",loaded:function(e){e.identify("00000000000000-00000000000000-00000000-000000-00000000000000")},advanced_disable_decide:!0,...null!=t?t:{}},"zigzag"),Rn.register({shop_key:e})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
;
if (typeof ZigzagPosthogScript !== 'undefined') {
  try {
    ZigzagPosthogScript.initPreConsent('store_wacoal_jp');
    ZigzagPosthogScript.checkConflictScripts();
  } catch (error) {
    console.warn('WorldShopping: error when initialize posthog-script ' + (error.message || ''));
  }
}

  const zigzagLoadedEndedAt = new Date().getTime();
  ZigzagPosthogScript.capture('checkout_script_init', {
    first_visit: true,
    trigger: 'timeout',
    duration: (zigzagLoadedEndedAt - window.zigzagLoadingStartedAt) / 1000
  });
  executeScript();
}, firstVisitDeferMilliseconds);

const userActionHandler = function(event) {
  clearTimeout(timerId);
  window.localStorage && window.localStorage.setItem('zigzag-checkout-script', 'true');
  removeListeners();

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof zigzag_define&&zigzag_define.amd?zigzag_define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZigzagPosthogScript={})}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(c){a=!0,i=c}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var v=String.fromCharCode,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",b={};function w(e,t){if(!b[e]){b[e]={};for(var n=0;n<e.length;n++)b[e][e.charAt(n)]=n}return b[e][t]}var k={compressToBase64:function(e){if(null==e)return"";var t=k._compress(e,6,(function(e){return y.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:k._decompress(e.length,32,(function(t){return w(y,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":k._compress(e,15,(function(e){return v(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:k._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=k.compress(e),n=new Uint8Array(2*t.length),r=0,i=t.length;r<i;r++){var o=t.charCodeAt(r);n[2*r]=o>>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return k.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var i=[];return t.forEach((function(e){i.push(v(e))})),k.decompress(i.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":k._compress(e,6,(function(e){return m.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),k._decompress(e.length,32,(function(t){return w(m,e.charAt(t))})))},compress:function(e){return k._compress(e,16,(function(e){return v(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,i,o,s="",a="",c="",u=2,l=3,d=2,p=0,f=0,h={},_={},g=[];for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(h,s)||(h[s]=l++,_[s]=!0),a=c+s,Object.prototype.hasOwnProperty.call(h,a))c=a;else{if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++),h[a]=l++,c=String(s)}if(""!==c){if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++)}for(i=2,r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:k._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,i,o,s,a,c,u,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,_=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(o=0,a=Math.pow(2,2),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 2:return""}for(l[3]=u,i=u,d.push(u);;){if(p.index>e)return"";for(o=0,a=Math.pow(2,_),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(u=o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,_),_++),l[u])g=l[u];else{if(u!==h)return null;g=i+i.charAt(0)}d.push(g),l[h++]=i+g.charAt(0),i=g,0==--f&&(f=Math.pow(2,_),_++)}}},S={DEBUG:!1,LIB_VERSION:"1.51.5"},F=Array.prototype,I=Object.prototype,O=I.toString,E=I.hasOwnProperty,P="undefined"!=typeof window?window:{},A=P.navigator||{userAgent:""},x=P.document||{},C=A.userAgent,T=F.forEach,R=F.indexOf,$=Array.isArray,M={},j=function(){if(S.DEBUG&&!Q(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(i){B(n,(function(t){e(t)}))}}},q=function(){if(S.DEBUG&&!Q(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(o){B(r,(function(e){i(e)}))}}},D=function(){if(!Q(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(o){B(r,(function(e){i(e)}))}}},N=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function L(e,t,n){if(null!=e)if(T&&Array.isArray(e)&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===M)return}else for(var o in e)if(E.call(e,o)&&t.call(n,e[o],o)===M)return}function B(e,t,n){if(Array.isArray(e))if(T&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===M)return}var H=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return B(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},U=$||function(e){return"[object Array]"===O.call(e)},V=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}};function W(e,t){return-1!==e.indexOf(t)}var z=function(e){return e===Object(e)&&!U(e)},Q=function(e){return void 0===e},G=function(e){return"[object String]"==O.call(e)},J=function(e){return"[object Number]"==O.call(e)},Z=function e(t){return L(t,(function(n,r){var i;i=n,"[object Date]"!=O.call(i)?z(n)&&(t[r]=e(n)):t[r]=X(n)})),t},X=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Y=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){D("Implementation error. Please turn on debug and contact support@posthog.com."),D(i)}}},K=function(e){var t={};return L(e,(function(e,n){G(e)&&e.length>0&&(t[n]=e)})),t},ee=["$performance_raw"];function te(e,t){return n=e,r=function(e,n){return n&&ee.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),U(t)?(o=[],B(t,(function(t){o.push(e(t))}))):(o={},L(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function ne(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=ie(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(u=l.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}var re,ie=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},oe=(re=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return re()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=C,r=0,i=[];function o(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=i[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(r=o(r,i),i=[]);return i.length>0&&(r=o(r,i)),r.toString(16)}()+"-"+e+"-"+re()}),se=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(o){q("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},ae=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},ce=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=(c=t,u=r,l=a,function(t){if(t=t||e(window.event)){var n,r=!0;V(l)&&(n=l(t));var i=u.call(c,t);return!1!==n&&!1!==i||(r=!1),r}})}else q("No valid element provided to register_event");var c,u,l}}(),ue={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return L(e,(function(e){var n=se(x.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=ue.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=se(e,n);i.length&&(r.ph_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||W(e," OPR/")?W(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":W(e,"IEMobile")||W(e,"WPDesktop")?"Internet Explorer Mobile":W(e,"SamsungBrowser/")?"Samsung Internet":W(e,"Edge")||W(e,"Edg/")?"Microsoft Edge":W(e,"FBIOS")?"Facebook Mobile":W(e,"Chrome")?"Chrome":W(e,"CriOS")?"Chrome iOS":W(e,"UCWEB")||W(e,"UCBrowser")?"UC Browser":W(e,"FxiOS")?"Firefox iOS":W(t,"Apple")?W(e,"Mobile")?"Mobile Safari":"Safari":W(e,"Android")?"Android Mobile":W(e,"Konqueror")?"Konqueror":W(e,"Firefox")?"Firefox":W(e,"MSIE")||W(e,"Trident/")?"Internet Explorer":W(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[ue.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return A.language||A.userLanguage},os:function(){var e=C;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return H(K({$os:ue.os(),$browser:ue.browser(C,A.vendor,P.opera),$device:ue.device(C),$device_type:ue.deviceType(C)}),{$current_url:null==P?void 0:P.location.href,$host:null==P?void 0:P.location.host,$pathname:null==P?void 0:P.location.pathname,$browser_version:ue.browserVersion(C,A.vendor,P.opera),$browser_language:ue.browserLanguage(),$screen_height:null==P?void 0:P.screen.height,$screen_width:null==P?void 0:P.screen.width,$viewport_height:null==P?void 0:P.innerHeight,$viewport_width:null==P?void 0:P.innerWidth,$lib:"web",$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return H(K({$os:ue.os(),$browser:ue.browser(C,A.vendor,P.opera)}),{$browser_version:ue.browserVersion(C,A.vendor,P.opera)})}};function le(e){switch(r(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function de(e){var t="";return ve(e)&&!ye(e)&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){he(e)&&e.textContent&&(t+=N(e.textContent).split(/(\s+)/).filter(me).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),N(t)}function pe(e){return!!e&&1===e.nodeType}function fe(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function he(e){return!!e&&3===e.nodeType}function _e(e){return!!e&&11===e.nodeType}var ge=["a","button","form","input","select","textarea","label"];function ve(e){for(var t=e;t.parentNode&&!fe(t,"body");t=t.parentNode){var n=le(t).split(" ");if(W(n,"ph-sensitive")||W(n,"ph-no-capture"))return!1}if(W(le(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return"string"!=typeof i||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function ye(e){return!!(fe(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fe(e,"select")||fe(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function me(e){if(null===e||Q(e))return!1;if("string"==typeof e){if(e=N(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function be(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,i=document.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):document.body.appendChild(n)}function we(e){var t=de(e);return me(t="".concat(t," ").concat(ke(e)).trim())?t:""}function ke(e){var t="";return e&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=de(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ke(e)).trim())}catch(i){console.error(i)}})),t}var Se=function(){function e(t){i(this,e),this.clicks=[],this.enabled=t}return s(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),Fe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Ie={is_supported:function(){return!0},error:function(e){q("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(o){}return null},parse:function(e){var t;try{t=JSON.parse(Ie.get(e))||{}}catch(n){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var c=document.location.hostname.match(Fe),u=c?c[0]:"";o=u?"; domain=."+u:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(p){return}},remove:function(e,t){try{Ie.set(e,"",-1,t)}catch(n){return}}},Oe=null,Ee={is_supported:function(){if(null!==Oe)return Oe;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";Ee.set(t,"xyz"),'"xyz"'!==Ee.get(t)&&(e=!1),Ee.remove(t)}catch(n){e=!1}else e=!1;return e||q("localStorage unsupported; falling back to cookie store"),Oe=e,e},error:function(e){q("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ee.error(t)}return null},parse:function(e){try{return JSON.parse(Ee.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){Ee.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ee.error(t)}}},Pe=n(n({},Ee),{},{parse:function(e){try{var t={};try{(t=Ie.parse(e)||{}).distinct_id&&Ie.set(e,{distinct_id:t.distinct_id})}catch(r){}var n=H(t,JSON.parse(Ee.get(e)||"{}"));return Ee.set(e,n),n}catch(r){}return null},set:function(e,t,n,r,i){try{Ee.set(e,t),t.distinct_id&&Ie.set(e,{distinct_id:t.distinct_id},n,r,i)}catch(o){Ee.error(o)}},remove:function(e,t){try{window.localStorage.removeItem(e),Ie.remove(e,t)}catch(n){Ee.error(n)}}}),Ae={},xe={is_supported:function(){return!0},error:function(e){q("memoryStorage error: "+e)},get:function(e){return Ae[e]||null},parse:function(e){return Ae[e]||null},set:function(e,t){Ae[e]=t},remove:function(e){delete Ae[e]}},Ce=null,Te={is_supported:function(){if(null!==Ce)return Ce;if(Ce=!0,"undefined"!=typeof window)try{var e="__support__";Te.set(e,"xyz"),'"xyz"'!==Te.get(e)&&(Ce=!1),Te.remove(e)}catch(t){Ce=!1}else Ce=!1;return Ce},error:function(e){S.DEBUG&&q("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(t){Te.error(t)}return null},parse:function(e){try{return JSON.parse(Te.get(e))||null}catch(t){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Te.error(n)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(t){Te.error(t)}}},Re="$people_distinct_id",$e="__alias",Me="__timers",je="$autocapture_disabled_server_side",qe="$session_recording_enabled_server_side",De="$console_log_recording_enabled_server_side",Ne="$session_recording_recorder_version_server_side",Le="$sesid",Be="$enabled_feature_flags",He="$user_state",Ue=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",Re,$e,"__cmpns",Me,qe,Le,Be,He],Ve=function(){function e(t){i(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var r=t.persistence.toLowerCase();"cookie"!==r&&-1===r.indexOf("localstorage")&&"memory"!==r&&(D("Unknown persistence type "+r+"; falling back to cookie"),r=t.persistence="cookie"),"localstorage"===r&&Ee.is_supported()?this.storage=Ee:"localstorage+cookie"===r&&Pe.is_supported()?this.storage=Pe:this.storage="memory"===r?xe:Ie,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return s(e,[{key:"properties",value:function(){var e={};return L(this.props,(function(t,n){if(n===Be&&"object"===r(t))for(var i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else a=n,c=!1,(null===(s=Ue)?c:R&&s.indexOf===R?-1!=s.indexOf(a):(L(s,(function(e){if(c||(c=e===a))return M})),c))||(e[n]=t);var s,a,c})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=H({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(z(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var i=!1;if(L(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(z(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(L(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ue.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(ue.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:ue.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return K({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return L(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Me]||{};n[e]=t,this.props[Me]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Me]||{})[e];return Q(t)||(delete this.props[Me][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[He]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[He]=e,this.save()}}]),e}(),We={_initializedTokens:[],_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t=!!e.get_property(je),n=!!e.get_config("autocapture");this._isAutocaptureEnabled=n&&!t},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!pe(t));return t},_getAugmentPropertiesFromElement:function(e){if(!ve(e))return{};var t={};return L(e.attributes,(function(e){if(e.name.startsWith("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&me(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),i={tag_name:r};ge.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?i.$el_text=we(e):i.$el_text=de(e));var o=le(e);o.length>0&&(i.classes=o.split(" ").filter((function(e){return""!==e}))),L(e.attributes,(function(n){var r;ye(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&me(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(i["attr__"+n.name]=n.value)}));for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return i.nth_child=s,i.nth_of_type=a,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return L(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),me(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return L(this._customProperties,(function(r){L(r.event_selectors,(function(i){L(document.querySelectorAll(i),(function(i){W(e,i)&&ve(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);if(he(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"),o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||fe(e,"html")||!pe(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var s=n.element_allowlist;if(s&&!s.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some((function(t){return e.matches(t)})))return!1}for(var c=!1,u=[e],l=!0,d=e;d.parentNode&&!fe(d,"body");)if(_e(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(ge.indexOf(l.tagName.toLowerCase())>-1)c=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}u.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return c?"click"===t.type:"click"===t.type&&(ge.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s=[o],a=o;a.parentNode&&!fe(a,"body");)_e(a.parentNode)?(s.push(a.parentNode.host),a=a.parentNode.host):(s.push(a.parentNode),a=a.parentNode);var c,u=[],l={},d=!1;if(L(s,(function(e){var n=ve(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&me(c)&&c),W(le(e).split(" "),"ph-no-capture")&&(d=!0),u.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var i=r._getAugmentPropertiesFromElement(e);H(l,i)})),t.get_config("mask_all_text")||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?u[0].$el_text=we(o):u[0].$el_text=de(o)),c&&(u[0].attr__href=c),d)return!1;var p=H(this._getDefaultProperties(e.type),{$elements:u},this._getCustomProperties(s),l);return t.capture(i,p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ce(document,"submit",n,!1,!0),ce(document,"change",n,!1,!0),ce(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new Se(e.get_config("rageclick"))},afterDecideResponse:function(e,t){this._setIsAutocaptureEnabled(t);var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?j('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(a({},je,!!e.autocapture_opt_out)),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Q(t)?10:t,n=Q(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return V(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(We),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Y(e[t]))}(We);var ze="__ph_opt_in_out_";function Qe(e,t){tt(!0,e,t)}function Ge(e,t){tt(!1,e,t)}function Je(e,t){return"1"===et(e,t)}function Ze(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||P,n=t.navigator||{},r=!1;return L([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){W([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===et(e,t)}function Xe(e,t){Ye(t=t||{}).remove(Ke(e,t),!!t.crossSubdomainCookie)}function Ye(e){return"localStorage"===(e=e||{}).persistenceType?Ee:"localStorage+cookie"===e.persistenceType?Pe:Ie}function Ke(e,t){return((t=t||{}).persistencePrefix||ze)+e}function et(e,t){return Ye(t).get(Ke(e,t))}function tt(e,t,n){G(t)&&t.length?(Ye(n=n||{}).set(Ke(t,n),e?1:0,J(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function nt(e,t){var n=!1;try{var r=e.get_config("token"),i=e.get_config("respect_dnt"),o=e.get_config("opt_out_capturing_persistence_type"),s=e.get_config("opt_out_capturing_cookie_prefix")||void 0,a=e.get_config("window");r&&(n=Ze(r,{respectDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(c){t||console.error("Unexpected error when checking capturing opt-out status: "+c)}return n}function rt(e,t,n){return function(){for(var r=nt(e,n),i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];if(!r)return t.apply(this,o);var a=o[o.length-1];"function"==typeof a&&a(0)}}var it="$set",ot=function(){function e(t){var n=this;i(this,e),this._posthog=t,this.set=rt(t,(function(e,t,r){var i=n.set_action(e,t);return z(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),i[it]=H({},ue.people_properties(),n._posthog.persistence.get_referrer_info(),i[it]),n._send_request(i,r)})),this.set_once=rt(t,(function(e,t,r){var i=n.set_once_action(e,t);return z(e)&&(r=t),n._send_request(i,r)}))}return s(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),i=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=Z(e),s=te(o,this._get_config("properties_string_max_length")),a=ne(JSON.stringify(o));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:a},{},this._posthog._prepare_callback(t,s)),s}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(it,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,i={},o={};return z(t)?L(t,(function(e,t){r._is_reserved_property(t)||(o[t]=e)})):o[t]=n,i[e]=o,i}}]),e}(),st="$active_feature_flags",at="$enabled_feature_flags",ct="$override_feature_flags",ut="$feature_flag_payloads",lt=function(){function e(t){i(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return s(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(at),t=this.instance.get_property(ct);if(!t)return e||{};for(var n=H({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ut)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=this.instance.get_config("token"),n=ne(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var c,u={};if(o)for(var l=0;l<o.length;l++)u[o[l]]=!0;t&&t.register((a(c={},st,o),a(c,at,u),c))}else{var d,p=o,f=s;e.errorsWhileComputingFlags&&(p=n(n({},r),p),f=n(n({},i),f)),t&&t.register((a(d={},st,Object.keys(p||{})),a(d,at,p||{}),a(d,ut,f||{}),d))}else t&&(t.unregister(st),t.unregister(at),t.unregister(ut))}(e,this.instance.persistence,t,r);var i=this._prepareFeatureFlagsForCallbacks(),o=i.flags,s=i.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,s)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ct);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(a({},ct,t))}else this.instance.persistence.register(a({},ct,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}}]),e}(),dt=2,pt=4,ft=function(){function e(t){i(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return s(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(qe),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(De),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Ne);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((a(o={},qe,!!e.sessionRecording),a(o,De,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),a(o,Ne,null===(i=e.sessionRecording)||void 0===i?void 0:i.recorderVersion),o)),null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint),null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0;var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?be(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(S.LIB_VERSION),this._onScriptLoaded.bind(this)):this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),r=this.instance.sessionManager.checkAndGetSessionAndWindowId(n,e.timestamp),i=r.windowId,o=r.sessionId;if(this.captureStarted&&(this.windowId!==i||this.sessionId!==o)&&-1===[dt,pt].indexOf(e.type))try{var s;null===(s=this.rrwebRecord)||void 0===s||s.takeFullSnapshot()}catch(a){q("Error taking full snapshot.",a)}this.windowId=i,this.sessionId=o}},{key:"_onScriptLoaded",value:function(){var e=this,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),o=0,s=Object.entries(i||{});o<s.length;o++){var a=p(s[o],2),c=a[0],u=a[1];c in t&&(t[c]=u)}this.rrwebRecord?(this.stopRrweb=this.rrwebRecord(n({emit:function(t){t=function(e){if(e&&"object"===r(e)&&6===e.type&&"object"===r(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===r(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,i=g(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(i.s();!(n=i.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(s){i.e(s)}finally{i.f()}}return JSON.parse(t)}return e}(t)),e._updateWindowAndSessionIds(t);var n={$snapshot_data:t,$session_id:e.sessionId,$window_id:e.windowId};e.instance._captureMetrics.incr("rrweb-record"),e.instance._captureMetrics.incr("rrweb-record-".concat(t.type)),e.emit?e._captureSnapshot(n):e.snapshots.push(n)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},t)),this.instance._addCaptureHook((function(t){try{var n;"$pageview"===t&&(null===(n=e.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}catch(r){q("Could not add $pageview to rrweb session",r)}}))):q("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===dt}})}}]),e}(),ht={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},_t=["first-input","navigation","paint","resource"],gt=["/s/","/e/"],vt=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))})),PerformanceObserver.supportedEntryTypes.filter((function(e){return _t.includes(e)})).forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(t){console.error("PostHog failed to start performance observer",t),this.stopObserving()}}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.get_config("capture_performance"))&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(gt.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},i=Math.floor(Date.now()-performance.now());for(var o in r[ht.timeOrigin]=i,r[ht.timestamp]=Math.floor(i+e.startTime),ht)void 0!==n[o]&&(r[ht[o]]=n[o]);if(this.capturePerformanceEvent(r),yt(e)){var s,c=g(e.serverTiming||[]);try{for(c.s();!(s=c.n()).done;){var u,l=s.value;this.capturePerformanceEvent((a(u={},ht.timeOrigin,i),a(u,ht.timestamp,Math.floor(i+e.startTime)),a(u,ht.name,l.name),a(u,ht.duration,l.duration),a(u,ht.entryType,"serverTiming"),u))}}catch(d){c.e(d)}finally{c.f()}}}},{key:"capturePerformanceEvent",value:function(e){this.instance.capture("$performance_event",e,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"performanceEvent"})}}]),e}(),yt=function(e){return"navigation"===e.entryType||"resource"===e.entryType},mt=function(){function e(t){i(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return s(e,[{key:"call",value:function(){var e=this,t=ne(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),We.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var i,o={},s=g(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)o[i.value]=!0}catch(d){s.e(d)}finally{s.f()}this.instance.compression=o}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var a,c=this.instance.get_config("api_host"),u=g(e.siteApps);try{var l=function(){var e=a.value,t=e.id,n=e.url,i=document.createElement("script");i.src=[c,"/"===c[c.length-1]&&"/"===n[0]?n.substring(1):n].join(""),i.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(i)};for(u.s();!(a=u.n()).done;)l()}catch(d){u.e(d)}finally{u.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),bt=["https://app.posthog.com","https://eu.posthog.com"],wt=["source"],kt=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(n(n({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(s){return!1}t=window.localStorage}var r,i=ae(e.hash,"__posthog")||ae(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token||(this.loadToolbar(r),0))}catch(s){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),o="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),s=!bt.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),a=n(n({apiURL:r,jsURL:r,token:this.instance.get_config("token")},e),s?{instrument:!1}:{});a.source;var c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(a,wt);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),be(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(a,t.instance)})),ce(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(a)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),St=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;i(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return s(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Ft=function(e){c(r,St);var t=d(r);function r(e,n){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return i(this,r),(o=t.call(this,s)).handlePollRequest=n,o.captureMetrics=e,o}return s(r,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;L(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(i.slice(i.length-2))),e.captureMetrics.incr("batch-handle",o.length),e.captureMetrics.incr("batch-handle-".concat(i.slice(i.length-2)),o.length)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,i=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",i.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),i.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var r=Object.values(t);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var r=t.url,i=t.data,o=t.options;e.handlePollRequest(r,i,n(n({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return L(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),r}(),It=function(){function e(t){i(this,e),this.enabled=t,this.metrics={}}return s(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),Ot=Uint8Array,Et=Uint16Array,Pt=Uint32Array,At=new Ot([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xt=new Ot([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ct=new Ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tt=function(e,t){for(var n=new Et(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Pt(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Rt=Tt(At,2),$t=Rt[0],Mt=Rt[1];$t[28]=258,Mt[258]=28;for(var jt=Tt(xt,0)[1],qt=new Et(32768),Dt=0;Dt<32768;++Dt){var Nt=(43690&Dt)>>>1|(21845&Dt)<<1;Nt=(61680&(Nt=(52428&Nt)>>>2|(13107&Nt)<<2))>>>4|(3855&Nt)<<4,qt[Dt]=((65280&Nt)>>>8|(255&Nt)<<8)>>>1}var Lt=function(e,t,n){for(var r=e.length,i=0,o=new Et(t);i<r;++i)++o[e[i]-1];var s,a=new Et(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Et(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)s[qt[d]>>>c]=u}else for(s=new Et(r),i=0;i<r;++i)s[i]=qt[a[e[i]-1]++]>>>15-e[i];return s},Bt=new Ot(288);for(Dt=0;Dt<144;++Dt)Bt[Dt]=8;for(Dt=144;Dt<256;++Dt)Bt[Dt]=9;for(Dt=256;Dt<280;++Dt)Bt[Dt]=7;for(Dt=280;Dt<288;++Dt)Bt[Dt]=8;var Ht=new Ot(32);for(Dt=0;Dt<32;++Dt)Ht[Dt]=5;var Ut,Vt,Wt=Lt(Bt,9,0),zt=Lt(Ht,5,0),Qt=function(e){return(e/8>>0)+(7&e&&1)},Gt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Et?Et:e instanceof Pt?Pt:Ot)(n-t);return r.set(e.subarray(t,n)),r},Jt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Zt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Xt=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Ot(0),0];if(1==i){var s=new Ot(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[d].f?u++:d++],c=n[u!=l&&n[u].f<n[d].f?u++:d++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var f=new Et(p+1),h=Yt(n[l-1],f,0);if(h>t){r=0;var _=0,g=h-t,v=1<<g;for(o.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(f[y]>t))break;_+=v-(1<<h-f[y]),f[y]=t}for(_>>>=g;_>0;){var m=o[r].s;f[m]<t?_-=1<<t-f[m]++-1:++r}for(;r>=0&&_;--r){var b=o[r].s;f[b]==t&&(--f[b],++_)}h=t}return[new Ot(f),h]},Yt=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},Kt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Et(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},en=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},tn=function(e,t,n){var r=n.length,i=Qt(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},nn=function(e,t,n,r,i,o,s,a,c,u,l){Jt(t,l++,n),++i[256];for(var d=Xt(i,15),p=d[0],f=d[1],h=Xt(o,15),_=h[0],g=h[1],v=Kt(p),y=v[0],m=v[1],b=Kt(_),w=b[0],k=b[1],S=new Et(19),F=0;F<y.length;++F)S[31&y[F]]++;for(F=0;F<w.length;++F)S[31&w[F]]++;for(var I=Xt(S,7),O=I[0],E=I[1],P=19;P>4&&!O[Ct[P-1]];--P);var A,x,C,T,R=u+5<<3,$=en(i,Bt)+en(o,Ht)+s,M=en(i,p)+en(o,_)+s+14+3*P+en(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(R<=$&&R<=M)return tn(t,l,e.subarray(c,c+u));if(Jt(t,l,1+(M<$)),l+=2,M<$){A=Lt(p,f,0),x=p,C=Lt(_,g,0),T=_;var j=Lt(O,E,0);for(Jt(t,l,m-257),Jt(t,l+5,k-1),Jt(t,l+10,P-4),l+=14,F=0;F<P;++F)Jt(t,l+3*F,O[Ct[F]]);l+=3*P;for(var q=[y,w],D=0;D<2;++D){var N=q[D];for(F=0;F<N.length;++F){var L=31&N[F];Jt(t,l,j[L]),l+=O[L],L>15&&(Jt(t,l,N[F]>>>5&127),l+=N[F]>>>12)}}}else A=Wt,x=Bt,C=zt,T=Ht;for(F=0;F<a;++F)if(r[F]>255){L=r[F]>>>18&31,Zt(t,l,A[L+257]),l+=x[L+257],L>7&&(Jt(t,l,r[F]>>>23&31),l+=At[L]);var B=31&r[F];Zt(t,l,C[B]),l+=T[B],B>3&&(Zt(t,l,r[F]>>>5&8191),l+=xt[B])}else Zt(t,l,A[r[F]]),l+=x[r[F]];return Zt(t,l,A[256]),l+x[256]},rn=new Pt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),on=new Ot(0),sn=function(){for(var e=new Pt(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),an=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cn(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=sn[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Ot(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?u=tn(c,u,e.subarray(l,d)):(c[l]=o,u=tn(c,u,e.subarray(l,s)))}else{for(var p=rn[t-1],f=p>>>13,h=8191&p,_=(1<<n)-1,g=new Et(32768),v=new Et(_+1),y=Math.ceil(n/3),m=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<m)&_},w=new Pt(25e3),k=new Et(288),S=new Et(32),F=0,I=0,O=(l=0,0),E=0,P=0;l<s;++l){var A=b(l),x=32767&l,C=v[A];if(g[x]=C,v[A]=x,E<=l){var T=s-l;if((F>7e3||O>24576)&&T>423){u=nn(e,c,0,w,k,S,I,O,P,l-P,u),O=F=I=0,P=l;for(var R=0;R<286;++R)k[R]=0;for(R=0;R<30;++R)S[R]=0}var $=2,M=0,j=h,q=x-C&32767;if(T>2&&A==b(l-q))for(var D=Math.min(f,T)-1,N=Math.min(32767,l),L=Math.min(258,T);q<=N&&--j&&x!=C;){if(e[l+$]==e[l+$-q]){for(var B=0;B<L&&e[l+B]==e[l+B-q];++B);if(B>$){if($=B,M=q,B>D)break;var H=Math.min(q,B-2),U=0;for(R=0;R<H;++R){var V=l-q+R+32768&32767,W=V-g[V]+32768&32767;W>U&&(U=W,C=V)}}}q+=(x=C)-(C=g[x])+32768&32767}if(M){w[O++]=268435456|Mt[$]<<18|jt[M];var z=31&Mt[$],Q=31&jt[M];I+=At[z]+xt[Q],++k[257+z],++S[Q],E=l+$,++F}else w[O++]=e[l],++k[e[l]]}}u=nn(e,c,o,w,k,S,I,O,P,l-P,u),o||(u=tn(c,u,on))}return Gt(a,0,r+Qt(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=i.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&an(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(i,t),an(i,o-8,n.d()),an(i,o-4,r),i}function un(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ot(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new Ot(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Gt(r,0,i)}(Vt=Ut||(Ut={})).GZipJS="gzip-js",Vt.LZ64="lz64",Vt.Base64="base64";var ln,dn,pn,fn=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i,o},hn=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.captureMetrics,s=e.callback,a=e.retriesPerformedSoFar,c=e.retryQueue,u=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(i.method||"GET",t,!0);var f=fn(n,i);o.incr("_send_request"),o.incr("_send_request_inflight"),L(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(o.incr("xhr-response"),o.incr("xhr-response-".concat(p.status)),o.decr("_send_request_inflight"),200===p.status){if(s){var e;try{e=JSON.parse(p.responseText)}catch(l){return void q(l)}s(e)}}else"function"==typeof u&&u(p),[401,403,404,500].indexOf(p.status)<0&&c.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:s}),s&&s({status:0})},p.send(f)},_n=function(e){c(r,St);var t=d(r);function r(e,n){var o;return i(this,r),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=n,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return s(r,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(o){r.e(o)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=g(this.queue);try{for(t.s();!(e=t.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;try{window.navigator.sendBeacon(i,fn(o,n(n({},s),{},{sendBeacon:!0})))}catch(a){S.DEBUG&&console.error(a)}}}catch(a){t.e(a)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;hn({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}(),gn=function(){function e(t,n){i(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",!this.persistence.disabled&&Te.is_supported()){var o=Te.parse(this.window_id_storage_key),s=Te.parse(this.primary_window_exists_storage_key);o&&!s?this._windowId=o:Te.remove(this.window_id_storage_key),Te.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return s(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&Te.is_supported()&&Te.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&Te.is_supported()?Te.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(a({},Le,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Le];return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&Te.is_supported()&&Te.remove(e.primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=p(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],s=this._getWindowId(),a=o&&o>0&&Math.abs(t-o)>864e5;!i||!e&&Math.abs(t-r)>18e5||a?(i=oe(),s=oe(),o=t):s||(s=oe());var c=0===r||!e||a?t:r,u=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,c,u),{sessionId:i,windowId:s}}}]),e}(),vn=s((function e(t,n,r,o){i(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,s,a;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var c=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=c+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=c+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var u=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(s=u[0])||void 0===s?void 0:s.value,$sentry_exception_type:null===(a=u[0])||void 0===a?void 0:a.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),yn=function(){function e(){i(this,e),a(this,"_seenFirstPageView",!1)}return s(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=oe()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=oe()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(ln||(ln={}));var mn=function(){},bn={},wn="posthog",kn=P.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Sn=!kn&&-1===C.indexOf("MSIE")&&-1===C.indexOf("Mozilla"),Fn=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==x||null===(e=x.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:mn,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==P||null===(n=P.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:mn,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},In=function(e,t,n,r){var i,o=n!==wn&&pn?n?pn[n]:void 0:pn,s={initComplete:!1,syncCode:!1},a=function(e){return function(t){s[e]||(s[e]=!0,s.initComplete&&s.syncCode&&(null==r||r(t)))}};if(o&&dn===ln.INIT_MODULE)i=o;else{if(o&&!U(o))return void console.error("You have already initialized "+n);i=new On}return i._init(e,t,n,a("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new ft(i),i.sessionRecording.startRecordingIfEnabled(),i.webPerformance=new vt(i),i.webPerformance.startObservingIfEnabled(),i.__autocapture=i.get_config("autocapture"),We._setIsAutocaptureEnabled(i),We._isAutocaptureEnabled&&(i.__autocapture=i.get_config("autocapture"),We.enabledForProject(i.get_config("token"),100,100)?We.isBrowserSupported()?We.init(i):(i.__autocapture=!1,j("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,j("Not in active bucket: disabling Automatic Event Collection."))),S.DEBUG=S.DEBUG||i.get_config("debug"),void 0!==o&&U(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),a("syncCode")(i),i},On=function(){function e(){var t=this;i(this,e),this.config=Fn(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=vn,this.segmentIntegration=function(){return function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new ot(this),this.featureFlags=new lt(this),this.feature_flags=this.featureFlags,this.toolbar=new kt(this),this.pageViewIdManager=new yn,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return s(e,[{key:"init",value:function(e,t,n){if(Q(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==wn){var r=In(e,t,n,(function(e){pn[n]=e,e._loaded()}));return pn[n]=r,r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var a,c={segmentRegister:!1,syncCode:!1},u=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==s||s(r)))}};if(this.set_config(H({},Fn(),i,{name:o,token:e,callback_fn:(o===wn?o:wn+"."+o)+"._jsc"})),this._jsc=function(){},(null!=P&&null!==(t=P.rrweb)&&void 0!==t&&t.record||null!=P&&P.rrwebRecord)&&(this.__loaded_recorder_version=null==P||null===(a=P.rrweb)||void 0===a?void 0:a.version),this._captureMetrics=new It(this.get_config("_capture_metrics")),this._requestQueue=new Ft(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new _n(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new Ve(this.config),this.sessionManager=new gn(this.config,this.persistence),this._gdpr_init(),i.segment?(this.config.get_device_id=function(){return i.segment.user().anonymousId()},i.segment.user().id()&&(this.register({distinct_id:i.segment.user().id()}),this.persistence.set_user_state("identified")),i.segment.register(this.segmentIntegration()).then(u("segmentRegister"))):u("segmentRegister")(),void 0!==(null===(n=i.bootstrap)||void 0===n?void 0:n.distinctID)){var l,d,p=this.get_config("get_device_id")(oe()),f=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?p:i.bootstrap.distinctID;this.persistence.set_user_state(null!==(d=i.bootstrap)&&void 0!==d&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var h,_,g=Object.keys((null===(h=i.bootstrap)||void 0===h?void 0:h.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),v=Object.keys((null===(_=i.bootstrap)||void 0===_?void 0:_.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,r,o,s;return null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]),e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v})}if(!this.get_distinct_id()){var y=this.get_config("get_device_id")(oe());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}P.addEventListener&&P.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),u("syncCode")()}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new mt(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||B(this.__request_queue,(function(t){e._send_request.apply(e,f(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(Q(e))return null;if(kn)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||bn,mn)}},{key:"__compress_and_send_json_request",value:function(e,t,r,i){var o,s,a,c,u=p((s=(o=this.compression)[Ut.GZipJS]?Ut.GZipJS:o[Ut.LZ64]?Ut.LZ64:Ut.Base64,a=t,c=r,s===Ut.LZ64?[{data:k.compressToBase64(a),compression:Ut.LZ64},c]:s===Ut.GZipJS?[cn(un(a),{mtime:0}),n(n({},c),{},{blob:!0,urlQueryArgs:{compression:Ut.GZipJS}})]:[{data:ne(a)},c]),2),l=u[0],d=u[1];this._send_request(e,l,d,i)}},{key:"_send_request",value:function(e,t,r,i){if(Sn)this.__request_queue.push([e,t,r,i]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=H(o,r||{}),kn||(r.method="GET");var s="sendBeacon"in P.navigator&&"sendBeacon"===r.transport;if(e=function(t,n,r){var i=n||{};i.ip=r.ip?1:0,i._=(new Date).getTime().toString(),i.ver=S.LIB_VERSION;var o=t.split("?");if(o.length>1){var s,a=g(o[1].split("&"));try{for(a.s();!(s=a.n()).done;){var c=s.value.split("=")[0];i[c]&&delete i[c]}}catch(e){a.e(e)}finally{a.f()}}var u=t.indexOf("?")>-1?"&":"?";return t+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return L(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(i)}(e,r.urlQueryArgs||{},{ip:this.get_config("ip")}),z(t)&&this.get_config("img")){var a=x.createElement("img");a.src=e,x.body.appendChild(a)}else if(s)try{P.navigator.sendBeacon(e,fn(t,n(n({},r),{},{sendBeacon:!0})))}catch(d){this.get_config("debug")&&console.error(d)}else if(kn)try{hn({url:e,data:t,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(d){console.error(d)}else{var c,u=x.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=x.getElementsByTagName("script")[0];null===(c=l.parentNode)||void 0===c||c.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];B(e,(function(e){e&&(t=e[0],U(t)?o.push(e):"function"==typeof e?e.call(n):U(e)&&"alias"===t?r.push(e):U(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?o.push(e):i.push(e))}));var s=function(e,t){B(e,(function(e){if(U(e[0])){var n=t;L(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bn;if(this.__loaded&&!nt(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||bn).transport;if(r&&(n.transport=r),Q(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler)/i.test(e)}(C)){this.persistence.update_search_keyword(x.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(x.referrer);var i={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(i.$set=n.$set),(i=te(i,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&j("PostHog.js send",i);var o=JSON.stringify(i),s=this.get_config("api_host")+(n.endpoint||"/e/"),a=n!==bn;return!this.get_config("request_batching")||a&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(s,o,n):this._requestQueue.enqueue(s,i,n),this._invokeCaptureHooks(e,i),i}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),L(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var r,i=this.persistence.remove_event_timer(e),o=n({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var s=this.persistence.properties();return o.distinct_id=s.distinct_id,o}var a=ue.properties();if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(),u=c.sessionId,l=c.windowId;o.$session_id=u,o.$window_id=l}if(null!==(r=this.webPerformance)&&void 0!==r&&r.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=H(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=a.$current_url,o}if(void 0!==i){var p=(new Date).getTime()-i;o.$duration=parseFloat((p/1e3).toFixed(3))}o=H({},a,this.persistence.properties(),o);var f=this.get_config("property_blacklist");U(f)?L(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(a({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(n){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property($e)&&(this.unregister($e),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,r){if(e&&t){this._captureMetrics.incr("group");var i=this.getGroups();this.register({$groups:n(n({},i),{},a({},e,t))}),r&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),i[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(oe());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(Re)?(D("Attempting to create alias for existing People user - aborting."),-2):(Q(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single($e,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t=n({},this.config);z(e)&&(H(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Ee.is_supported()&&"true"===Ee.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(S.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:wn;return t!==wn&&(t=wn+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&Ee.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!Ie.get("ph_optout")||(Ie.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=H({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),Ee.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=H({enable_persistence:!0},e||{}),this._gdpr_call_func(Qe,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=H({clear_persistence:!0},e||{});this._gdpr_call_func(Ge,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Je,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Ze,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=H({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Xe,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(P.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(P.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return k.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Y(e.prototype[t[n]])}(On,["identify"]);var En={},Pn=(dn=ln.INIT_MODULE,(pn=new On).init=function(e,t,n){if(n)return pn[n]||(pn[n]=En[n]=In(e||"",t||{},n,(function(e){pn[n]=En[n]=e,e._loaded()}))),pn[n];var r=pn;return En[wn]?r=En[wn]:e&&(r=In(e,t||{},wn,(function(e){En[wn]=e,e._loaded()})),En[wn]=r),pn=r,dn===ln.INIT_SNIPPET&&(P[wn]=pn),L(En,(function(e,t){t!==wn&&(pn[t]=e)})),r},pn.init(),function(){function e(){e.done||(e.done=!0,Sn=!1,L(En,(function(e){e._dom_loaded()})))}x.addEventListener&&("complete"===x.readyState?e():x.addEventListener("DOMContentLoaded",e,!1)),ce(P,"load",e,!0)}(),pn);const An={stage:"v1",posthog:{token:"phc_tnQZyAK9BM0WkS5fdAZAxA1bNnyKUlWSACWzmxDfVrA",url:"https://posthog.worldshopping.global",debug:!1,cookieDisabledDomains:["online.euglena.jp"]},release:{dynamoDbTable:"v1PosthogScript"}},xn=["require.js","prototype.js"];function Cn(e){!function(e){const t=document.getElementsByTagName("script");for(const n of t){const t=n.getAttribute("src");Tn(t)&&e.capture("script_conflict_detect",{src:t})}}(e),function(e){const t=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.addedNodes.forEach((t=>{if("script"===t.nodeName.toLowerCase()){const n=t.getAttribute("src");Tn(n)&&e.capture("script_conflict_detect",{src:n})}}))}))})),n={childList:!0,attributes:!0,subtree:!0},r=document.querySelector("body"),i=document.querySelector("head");r&&t.observe(r,n),i&&t.observe(i,n)}(e)}function Tn(e){return!!(e&&xn.find((t=>e.includes(t))))}let Rn;e.capture=function(e,t){Rn.capture(e,t)},e.checkConflictScripts=function(){Rn?Cn(Rn):console.warn("ZigzagPosthogScript not initialized")},e.init=function(e,t){Rn=Pn.init(An.posthog.token,{api_host:An.posthog.url,debug:An.posthog.debug,autocapture:!1,capture_pageview:!1,persistence:An.posthog.cookieDisabledDomains.includes(window.location.hostname)?"localStorage":"localStorage+cookie",loaded:void 0,advanced_disable_decide:!0,...null!=t?t:{}},"zigzag"),Rn.register({shop_key:e})},e.initPreConsent=function(e,t){Rn=Pn.init(An.posthog.token,{api_host:An.posthog.url,debug:An.posthog.debug,autocapture:!1,capture_pageview:!1,persistence:"memory",loaded:function(e){e.identify("00000000000000-00000000000000-00000000-000000-00000000000000")},advanced_disable_decide:!0,...null!=t?t:{}},"zigzag"),Rn.register({shop_key:e})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
;
if (typeof ZigzagPosthogScript !== 'undefined') {
  try {
    ZigzagPosthogScript.initPreConsent('store_wacoal_jp');
    ZigzagPosthogScript.checkConflictScripts();
  } catch (error) {
    console.warn('WorldShopping: error when initialize posthog-script ' + (error.message || ''));
  }
}

  const zigzagLoadedEndedAt = new Date().getTime();
  ZigzagPosthogScript.capture('checkout_script_init', {
    first_visit: true,
    trigger: event.type,
    duration: (zigzagLoadedEndedAt - window.zigzagLoadingStartedAt) / 1000
  });
  executeScript();
};

if (false) {
window.addEventListener('mousemove', userActionHandler, { once: true });
window.addEventListener('touchstart', userActionHandler, { once: true });
}

} else {

// Not first visit, or no delay
window.localStorage && window.localStorage.setItem('zigzag-checkout-script', 'true');
setTimeout(function() {

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof zigzag_define&&zigzag_define.amd?zigzag_define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZigzagPosthogScript={})}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function n(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?t(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=u(e);if(t){var i=u(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(c){a=!0,i=c}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){return function(e){if(Array.isArray(e))return _(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_(e,t):void 0}}function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function g(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=h(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}var v=String.fromCharCode,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",b={};function w(e,t){if(!b[e]){b[e]={};for(var n=0;n<e.length;n++)b[e][e.charAt(n)]=n}return b[e][t]}var k={compressToBase64:function(e){if(null==e)return"";var t=k._compress(e,6,(function(e){return y.charAt(e)}));switch(t.length%4){default:case 0:return t;case 1:return t+"===";case 2:return t+"==";case 3:return t+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:k._decompress(e.length,32,(function(t){return w(y,e.charAt(t))}))},compressToUTF16:function(e){return null==e?"":k._compress(e,15,(function(e){return v(e+32)}))+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:k._decompress(e.length,16384,(function(t){return e.charCodeAt(t)-32}))},compressToUint8Array:function(e){for(var t=k.compress(e),n=new Uint8Array(2*t.length),r=0,i=t.length;r<i;r++){var o=t.charCodeAt(r);n[2*r]=o>>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return k.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n<r;n++)t[n]=256*e[2*n]+e[2*n+1];var i=[];return t.forEach((function(e){i.push(v(e))})),k.decompress(i.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":k._compress(e,6,(function(e){return m.charAt(e)}))},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),k._decompress(e.length,32,(function(t){return w(m,e.charAt(t))})))},compress:function(e){return k._compress(e,16,(function(e){return v(e)}))},_compress:function(e,t,n){if(null==e)return"";var r,i,o,s="",a="",c="",u=2,l=3,d=2,p=0,f=0,h={},_={},g=[];for(o=0;o<e.length;o+=1)if(s=e.charAt(o),Object.prototype.hasOwnProperty.call(h,s)||(h[s]=l++,_[s]=!0),a=c+s,Object.prototype.hasOwnProperty.call(h,a))c=a;else{if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++),h[a]=l++,c=String(s)}if(""!==c){if(Object.prototype.hasOwnProperty.call(_,c)){if(c.charCodeAt(0)<256){for(r=0;r<d;r++)p<<=1,f==t-1?(f=0,g.push(n(p)),p=0):f++;for(i=c.charCodeAt(0),r=0;r<8;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}else{for(i=1,r=0;r<d;r++)p=p<<1|i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i=0;for(i=c.charCodeAt(0),r=0;r<16;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1}0==--u&&(u=Math.pow(2,d),d++),delete _[c]}else for(i=h[c],r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;0==--u&&(u=Math.pow(2,d),d++)}for(i=2,r=0;r<d;r++)p=p<<1|1&i,f==t-1?(f=0,g.push(n(p)),p=0):f++,i>>=1;for(;;){if(p<<=1,f==t-1){g.push(n(p));break}f++}return g.join("")},decompress:function(e){return null==e?"":""==e?null:k._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(e,t,n){var r,i,o,s,a,c,u,l=[],d=[],p={val:n(0),position:t,index:1},f=4,h=4,_=3,g="";for(r=0;r<3;r+=1)l[r]=r;for(o=0,a=Math.pow(2,2),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;u=v(o);break;case 2:return""}for(l[3]=u,i=u,d.push(u);;){if(p.index>e)return"";for(o=0,a=Math.pow(2,_),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;switch(u=o){case 0:for(o=0,a=Math.pow(2,8),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 1:for(o=0,a=Math.pow(2,16),c=1;c!=a;)s=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),o|=(s>0?1:0)*c,c<<=1;l[h++]=v(o),u=h-1,f--;break;case 2:return d.join("")}if(0==f&&(f=Math.pow(2,_),_++),l[u])g=l[u];else{if(u!==h)return null;g=i+i.charAt(0)}d.push(g),l[h++]=i+g.charAt(0),i=g,0==--f&&(f=Math.pow(2,_),_++)}}},S={DEBUG:!1,LIB_VERSION:"1.51.5"},F=Array.prototype,I=Object.prototype,O=I.toString,E=I.hasOwnProperty,P="undefined"!=typeof window?window:{},A=P.navigator||{userAgent:""},x=P.document||{},C=A.userAgent,T=F.forEach,R=F.indexOf,$=Array.isArray,M={},j=function(){if(S.DEBUG&&!Q(window.console)&&window.console){for(var e=("__rrweb_original__"in window.console.log?window.console.log.__rrweb_original__:window.console.log),t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];try{e.apply(window.console,n)}catch(i){B(n,(function(t){e(t)}))}}},q=function(){if(S.DEBUG&&!Q(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(o){B(r,(function(e){i(e)}))}}},D=function(){if(!Q(window.console)&&window.console){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=["PostHog error:"].concat(t),i="__rrweb_original__"in window.console.error?window.console.error.__rrweb_original__:window.console.error;try{i.apply(window.console,r)}catch(o){B(r,(function(e){i(e)}))}}},N=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function L(e,t,n){if(null!=e)if(T&&Array.isArray(e)&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===M)return}else for(var o in e)if(E.call(e,o)&&t.call(n,e[o],o)===M)return}function B(e,t,n){if(Array.isArray(e))if(T&&e.forEach===T)e.forEach(t,n);else if("length"in e&&e.length===+e.length)for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===M)return}var H=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return B(n,(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},U=$||function(e){return"[object Array]"===O.call(e)},V=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}};function W(e,t){return-1!==e.indexOf(t)}var z=function(e){return e===Object(e)&&!U(e)},Q=function(e){return void 0===e},G=function(e){return"[object String]"==O.call(e)},J=function(e){return"[object Number]"==O.call(e)},Z=function e(t){return L(t,(function(n,r){var i;i=n,"[object Date]"!=O.call(i)?z(n)&&(t[r]=e(n)):t[r]=X(n)})),t},X=function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},Y=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){D("Implementation error. Please turn on debug and contact support@posthog.com."),D(i)}}},K=function(e){var t={};return L(e,(function(e,n){G(e)&&e.length>0&&(t[n]=e)})),t},ee=["$performance_raw"];function te(e,t){return n=e,r=function(e,n){return n&&ee.indexOf(n)>-1?e:"string"==typeof e&&null!==t?e.slice(0,t):e},i=new Set,function e(t,n){return t!==Object(t)?r?r(t,n):t:i.has(t)?void 0:(i.add(t),U(t)?(o=[],B(t,(function(t){o.push(e(t))}))):(o={},L(t,(function(t,n){i.has(t)||(o[n]=e(t,n))}))),o);var o}(n);var n,r,i}function ne(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,c=0,u="",l=[];if(!e)return e;e=ie(e);do{t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,l[c++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i)}while(a<e.length);switch(u=l.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}var re,ie=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),null!==a&&(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},oe=(re=function(){for(var e=(new Date).valueOf(),t=0;e==(new Date).valueOf();)t++;return e.toString(16)+t.toString(16)},function(){var e="undefined"!=typeof window?(window.screen.height*window.screen.width).toString(16):"0";return re()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=C,r=0,i=[];function o(e,t){var n,r=0;for(n=0;n<t.length;n++)r|=i[n]<<8*n;return e^r}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(r=o(r,i),i=[]);return i.length>0&&(r=o(r,i)),r.toString(16)}()+"-"+e+"-"+re()}),se=function(e,t){var n=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),r=new RegExp("[\\?&]"+n+"=([^&#]*)").exec(e);if(null===r||r&&"string"!=typeof r[1]&&r[1].length)return"";var i=r[1];try{i=decodeURIComponent(i)}catch(o){q("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},ae=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},ce=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t)if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=(c=t,u=r,l=a,function(t){if(t=t||e(window.event)){var n,r=!0;V(l)&&(n=l(t));var i=u.call(c,t);return!1!==n&&!1!==i||(r=!1),r}})}else q("No valid element provided to register_event");var c,u,l}}(),ue={campaignParams:function(){var e="utm_source utm_medium utm_campaign utm_content utm_term gclid fbclid msclkid".split(" "),t={};return L(e,(function(e){var n=se(x.URL,e);n.length&&(t[e]=n)})),t},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=ue.searchEngine(e),n="yahoo"!=t?"q":"p",r={};if(null!==t){r.$search_engine=t;var i=se(e,n);i.length&&(r.ph_keyword=i)}return r},browser:function(e,t,n){return t=t||"",n||W(e," OPR/")?W(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":W(e,"IEMobile")||W(e,"WPDesktop")?"Internet Explorer Mobile":W(e,"SamsungBrowser/")?"Samsung Internet":W(e,"Edge")||W(e,"Edg/")?"Microsoft Edge":W(e,"FBIOS")?"Facebook Mobile":W(e,"Chrome")?"Chrome":W(e,"CriOS")?"Chrome iOS":W(e,"UCWEB")||W(e,"UCBrowser")?"UC Browser":W(e,"FxiOS")?"Firefox iOS":W(t,"Apple")?W(e,"Mobile")?"Mobile Safari":"Safari":W(e,"Android")?"Android Mobile":W(e,"Konqueror")?"Konqueror":W(e,"Firefox")?"Firefox":W(e,"MSIE")||W(e,"Trident/")?"Internet Explorer":W(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var r={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[ue.browser(e,t,n)];if(void 0===r)return null;var i=e.match(r);return i?parseFloat(i[i.length-2]):null},browserLanguage:function(){return A.language||A.userLanguage},os:function(){var e=C;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)&&!/Mobile/.test(e)?"Android Tablet":/Android/.test(e)?"Android":""},deviceType:function(e){var t=this.device(e);return"iPad"===t||"Android Tablet"===t?"Tablet":t?"Mobile":"Desktop"},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return H(K({$os:ue.os(),$browser:ue.browser(C,A.vendor,P.opera),$device:ue.device(C),$device_type:ue.deviceType(C)}),{$current_url:null==P?void 0:P.location.href,$host:null==P?void 0:P.location.host,$pathname:null==P?void 0:P.location.pathname,$browser_version:ue.browserVersion(C,A.vendor,P.opera),$browser_language:ue.browserLanguage(),$screen_height:null==P?void 0:P.screen.height,$screen_width:null==P?void 0:P.screen.width,$viewport_height:null==P?void 0:P.innerHeight,$viewport_width:null==P?void 0:P.innerWidth,$lib:"web",$lib_version:S.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:(Date.now=Date.now||function(){return+new Date},Date.now()/1e3)})},people_properties:function(){return H(K({$os:ue.os(),$browser:ue.browser(C,A.vendor,P.opera)}),{$browser_version:ue.browserVersion(C,A.vendor,P.opera)})}};function le(e){switch(r(e.className)){case"string":return e.className;case"object":return("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";default:return""}}function de(e){var t="";return ve(e)&&!ye(e)&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){he(e)&&e.textContent&&(t+=N(e.textContent).split(/(\s+)/).filter(me).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))})),N(t)}function pe(e){return!!e&&1===e.nodeType}function fe(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function he(e){return!!e&&3===e.nodeType}function _e(e){return!!e&&11===e.nodeType}var ge=["a","button","form","input","select","textarea","label"];function ve(e){for(var t=e;t.parentNode&&!fe(t,"body");t=t.parentNode){var n=le(t).split(" ");if(W(n,"ph-sensitive")||W(n,"ph-no-capture"))return!1}if(W(le(e).split(" "),"ph-include"))return!0;var r=e.type||"";if("string"==typeof r)switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return"string"!=typeof i||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function ye(e){return!!(fe(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||fe(e,"select")||fe(e,"textarea")||"true"===e.getAttribute("contenteditable"))}function me(e){if(null===e||Q(e))return!1;if("string"==typeof e){if(e=N(e),/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((e||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(e))return!1}return!0}function be(e,t){var n=document.createElement("script");n.type="text/javascript",n.src=e,n.onload=t;var r,i=document.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(n,i[0]):document.body.appendChild(n)}function we(e){var t=de(e);return me(t="".concat(t," ").concat(ke(e)).trim())?t:""}function ke(e){var t="";return e&&e.childNodes&&e.childNodes.length&&L(e.childNodes,(function(e){var n;if(e&&"span"===(null===(n=e.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=de(e);t="".concat(t," ").concat(r).trim(),e.childNodes&&e.childNodes.length&&(t="".concat(t," ").concat(ke(e)).trim())}catch(i){console.error(i)}})),t}var Se=function(){function e(t){i(this,e),this.clicks=[],this.enabled=t}return s(e,[{key:"isRageClick",value:function(e,t,n){if(!this.enabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}(),Fe=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Ie={is_supported:function(){return!0},error:function(e){q("cookieStore error: "+e)},get:function(e){try{for(var t=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(o){}return null},parse:function(e){var t;try{t=JSON.parse(Ie.get(e))||{}}catch(n){}return t},set:function(e,t,n,r,i){try{var o="",s="",a="";if(r){var c=document.location.hostname.match(Fe),u=c?c[0]:"";o=u?"; domain=."+u:""}if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(a="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+o+a;return document.cookie=d,d}catch(p){return}},remove:function(e,t){try{Ie.set(e,"",-1,t)}catch(n){return}}},Oe=null,Ee={is_supported:function(){if(null!==Oe)return Oe;var e=!0;if("undefined"!=typeof window)try{var t="__mplssupport__";Ee.set(t,"xyz"),'"xyz"'!==Ee.get(t)&&(e=!1),Ee.remove(t)}catch(n){e=!1}else e=!1;return e||q("localStorage unsupported; falling back to cookie store"),Oe=e,e},error:function(e){q("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ee.error(t)}return null},parse:function(e){try{return JSON.parse(Ee.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){Ee.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ee.error(t)}}},Pe=n(n({},Ee),{},{parse:function(e){try{var t={};try{(t=Ie.parse(e)||{}).distinct_id&&Ie.set(e,{distinct_id:t.distinct_id})}catch(r){}var n=H(t,JSON.parse(Ee.get(e)||"{}"));return Ee.set(e,n),n}catch(r){}return null},set:function(e,t,n,r,i){try{Ee.set(e,t),t.distinct_id&&Ie.set(e,{distinct_id:t.distinct_id},n,r,i)}catch(o){Ee.error(o)}},remove:function(e,t){try{window.localStorage.removeItem(e),Ie.remove(e,t)}catch(n){Ee.error(n)}}}),Ae={},xe={is_supported:function(){return!0},error:function(e){q("memoryStorage error: "+e)},get:function(e){return Ae[e]||null},parse:function(e){return Ae[e]||null},set:function(e,t){Ae[e]=t},remove:function(e){delete Ae[e]}},Ce=null,Te={is_supported:function(){if(null!==Ce)return Ce;if(Ce=!0,"undefined"!=typeof window)try{var e="__support__";Te.set(e,"xyz"),'"xyz"'!==Te.get(e)&&(Ce=!1),Te.remove(e)}catch(t){Ce=!1}else Ce=!1;return Ce},error:function(e){S.DEBUG&&q("sessionStorage error: ",e)},get:function(e){try{return window.sessionStorage.getItem(e)}catch(t){Te.error(t)}return null},parse:function(e){try{return JSON.parse(Te.get(e))||null}catch(t){}return null},set:function(e,t){try{window.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Te.error(n)}},remove:function(e){try{window.sessionStorage.removeItem(e)}catch(t){Te.error(t)}}},Re="$people_distinct_id",$e="__alias",Me="__timers",je="$autocapture_disabled_server_side",qe="$session_recording_enabled_server_side",De="$console_log_recording_enabled_server_side",Ne="$session_recording_recorder_version_server_side",Le="$sesid",Be="$enabled_feature_flags",He="$user_state",Ue=["__mps","__mpso","__mpus","__mpa","__mpap","__mpr","__mpu",Re,$e,"__cmpns",Me,qe,Le,Be,He],Ve=function(){function e(t){i(this,e);var n="";t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),this.props={},this.campaign_params_saved=!1,t.persistence_name?this.name="ph_"+t.persistence_name:this.name="ph_"+n+"_posthog";var r=t.persistence.toLowerCase();"cookie"!==r&&-1===r.indexOf("localstorage")&&"memory"!==r&&(D("Unknown persistence type "+r+"; falling back to cookie"),r=t.persistence="cookie"),"localstorage"===r&&Ee.is_supported()?this.storage=Ee:"localstorage+cookie"===r&&Pe.is_supported()?this.storage=Pe:this.storage="memory"===r?xe:Ie,this.user_state="anonymous",this.load(),this.update_config(t),this.save()}return s(e,[{key:"properties",value:function(){var e={};return L(this.props,(function(t,n){if(n===Be&&"object"===r(t))for(var i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else a=n,c=!1,(null===(s=Ue)?c:R&&s.indexOf===R?-1!=s.indexOf(a):(L(s,(function(e){if(c||(c=e===a))return M})),c))||(e[n]=t);var s,a,c})),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=H({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(z(e)){void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n;var i=!1;if(L(e,(function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)})),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(z(e)){this.expire_days=void 0===t?this.default_expiry:t;var r=!1;if(L(e,(function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)})),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(ue.campaignParams()),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(e){this.register(ue.searchInfo(e))}},{key:"update_referrer_info",value:function(e){this.register({$referrer:e||this.props.$referrer||"$direct",$referring_domain:ue.referringDomain(e)||this.props.$referring_domain||"$direct"})}},{key:"get_referrer_info",value:function(){return K({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"safe_merge",value:function(e){return L(this.props,(function(t,n){n in e||(e[n]=t)})),e}},{key:"update_config",value:function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[Me]||{};n[e]=t,this.props[Me]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[Me]||{})[e];return Q(t)||(delete this.props[Me][e],this.save()),t}},{key:"get_user_state",value:function(){return this.props[He]||"anonymous"}},{key:"set_user_state",value:function(e){this.props[He]=e,this.save()}}]),e}(),We={_initializedTokens:[],_isAutocaptureEnabled:!1,_setIsAutocaptureEnabled:function(e){var t=!!e.get_property(je),n=!!e.get_config("autocapture");this._isAutocaptureEnabled=n&&!t},_previousElementSibling:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!pe(t));return t},_getAugmentPropertiesFromElement:function(e){if(!ve(e))return{};var t={};return L(e.attributes,(function(e){if(e.name.startsWith("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&me(r)&&(t[n]=r)}})),t},_getPropertiesFromElement:function(e,t,n){var r=e.tagName.toLowerCase(),i={tag_name:r};ge.indexOf(r)>-1&&!n&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?i.$el_text=we(e):i.$el_text=de(e));var o=le(e);o.length>0&&(i.classes=o.split(" ").filter((function(e){return""!==e}))),L(e.attributes,(function(n){var r;ye(e)&&-1===["name","id","class"].indexOf(n.name)||!t&&me(n.value)&&("string"!=typeof(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))&&(i["attr__"+n.name]=n.value)}));for(var s=1,a=1,c=e;c=this._previousElementSibling(c);)s++,c.tagName===e.tagName&&a++;return i.nth_child=s,i.nth_of_type=a,i},_getDefaultProperties:function(e){return{$event_type:e,$ce_version:1}},_extractCustomPropertyValue:function(e){var t=[];return L(document.querySelectorAll(e.css_selector),(function(e){var n;["input","select"].indexOf(e.tagName.toLowerCase())>-1?n=e.value:e.textContent&&(n=e.textContent),me(n)&&t.push(n)})),t.join(", ")},_getCustomProperties:function(e){var t=this,n={};return L(this._customProperties,(function(r){L(r.event_selectors,(function(i){L(document.querySelectorAll(i),(function(i){W(e,i)&&ve(i)&&(n[r.name]=t._extractCustomPropertyValue(r))}))}))})),n},_getEventTarget:function(e){return void 0===e.target?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t},_captureEvent:function(e,t){var n,r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"$autocapture",o=this._getEventTarget(e);if(he(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,t,"$rageclick"),o&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!e||fe(e,"html")||!pe(e))return!1;if(null!=n&&n.url_allowlist){var r=window.location.href,i=n.url_allowlist;if(i&&!i.some((function(e){return r.match(e)})))return!1}if(null!=n&&n.dom_event_allowlist){var o=n.dom_event_allowlist;if(o&&!o.some((function(e){return t.type===e})))return!1}if(null!=n&&n.element_allowlist){var s=n.element_allowlist;if(s&&!s.some((function(t){return e.tagName.toLowerCase()===t})))return!1}if(null!=n&&n.css_selector_allowlist){var a=n.css_selector_allowlist;if(a&&!a.some((function(t){return e.matches(t)})))return!1}for(var c=!1,u=[e],l=!0,d=e;d.parentNode&&!fe(d,"body");)if(_e(d.parentNode))u.push(d.parentNode.host),d=d.parentNode.host;else{if(!(l=d.parentNode||!1))break;if(ge.indexOf(l.tagName.toLowerCase())>-1)c=!0;else{var p=window.getComputedStyle(l);p&&"pointer"===p.getPropertyValue("cursor")&&(c=!0)}u.push(l),d=l}var f=window.getComputedStyle(e);if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0;var h=e.tagName.toLowerCase();switch(h){case"html":return!1;case"form":return"submit"===t.type;case"input":case"select":case"textarea":return"change"===t.type||"click"===t.type;default:return c?"click"===t.type:"click"===t.type&&(ge.indexOf(h)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config)){for(var s=[o],a=o;a.parentNode&&!fe(a,"body");)_e(a.parentNode)?(s.push(a.parentNode.host),a=a.parentNode.host):(s.push(a.parentNode),a=a.parentNode);var c,u=[],l={},d=!1;if(L(s,(function(e){var n=ve(e);"a"===e.tagName.toLowerCase()&&(c=e.getAttribute("href"),c=n&&me(c)&&c),W(le(e).split(" "),"ph-no-capture")&&(d=!0),u.push(r._getPropertiesFromElement(e,t.get_config("mask_all_element_attributes"),t.get_config("mask_all_text")));var i=r._getAugmentPropertiesFromElement(e);H(l,i)})),t.get_config("mask_all_text")||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?u[0].$el_text=we(o):u[0].$el_text=de(o)),c&&(u[0].attr__href=c),d)return!1;var p=H(this._getDefaultProperties(e.type),{$elements:u},this._getCustomProperties(s),l);return t.capture(i,p),!0}},_navigate:function(e){window.location.href=e},_addDomEventHandlers:function(e){var t=this,n=function(n){n=n||window.event,t._captureEvent(n,e)};ce(document,"submit",n,!1,!0),ce(document,"change",n,!1,!0),ce(document,"click",n,!1,!0)},_customProperties:[],rageclicks:null,config:void 0,init:function(e){var t;"boolean"!=typeof e.__autocapture&&(this.config=e.__autocapture),null!==(t=this.config)&&void 0!==t&&t.url_allowlist&&(this.config.url_allowlist=this.config.url_allowlist.map((function(e){return new RegExp(e)}))),this.rageclicks=new Se(e.get_config("rageclick"))},afterDecideResponse:function(e,t){this._setIsAutocaptureEnabled(t);var n=t.get_config("token");this._initializedTokens.indexOf(n)>-1?j('autocapture already initialized for token "'+n+'"'):(t.persistence&&t.persistence.register(a({},je,!!e.autocapture_opt_out)),this._initializedTokens.push(n),e&&e.config&&e.config.enable_collect_everything&&this._isAutocaptureEnabled?(e.custom_properties&&(this._customProperties=e.custom_properties),this._addDomEventHandlers(t)):t.__autocapture=!1)},enabledForProject:function(e,t,n){if(!e)return!0;t=Q(t)?10:t,n=Q(n)?10:n;for(var r=0,i=0;i<e.length;i++)r+=e.charCodeAt(i);return r%t<n},isBrowserSupported:function(){return V(document.querySelectorAll)}};!function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=e[t].bind(e))}(We),function(e){for(var t in e)"function"==typeof e[t]&&(e[t]=Y(e[t]))}(We);var ze="__ph_opt_in_out_";function Qe(e,t){tt(!0,e,t)}function Ge(e,t){tt(!1,e,t)}function Je(e,t){return"1"===et(e,t)}function Ze(e,t){return!!function(e){if(e&&e.respectDnt){var t=e&&e.window||P,n=t.navigator||{},r=!1;return L([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){W([!0,1,"1","yes"],e)&&(r=!0)})),r}return!1}(t)||"0"===et(e,t)}function Xe(e,t){Ye(t=t||{}).remove(Ke(e,t),!!t.crossSubdomainCookie)}function Ye(e){return"localStorage"===(e=e||{}).persistenceType?Ee:"localStorage+cookie"===e.persistenceType?Pe:Ie}function Ke(e,t){return((t=t||{}).persistencePrefix||ze)+e}function et(e,t){return Ye(t).get(Ke(e,t))}function tt(e,t,n){G(t)&&t.length?(Ye(n=n||{}).set(Ke(t,n),e?1:0,J(n.cookieExpiration)?n.cookieExpiration:null,n.crossSubdomainCookie,n.secureCookie),n.capture&&e&&n.capture(n.captureEventName||"$opt_in",n.captureProperties||{},{send_instantly:!0})):console.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function nt(e,t){var n=!1;try{var r=e.get_config("token"),i=e.get_config("respect_dnt"),o=e.get_config("opt_out_capturing_persistence_type"),s=e.get_config("opt_out_capturing_cookie_prefix")||void 0,a=e.get_config("window");r&&(n=Ze(r,{respectDnt:i,persistenceType:o,persistencePrefix:s,window:a}))}catch(c){t||console.error("Unexpected error when checking capturing opt-out status: "+c)}return n}function rt(e,t,n){return function(){for(var r=nt(e,n),i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];if(!r)return t.apply(this,o);var a=o[o.length-1];"function"==typeof a&&a(0)}}var it="$set",ot=function(){function e(t){var n=this;i(this,e),this._posthog=t,this.set=rt(t,(function(e,t,r){var i=n.set_action(e,t);return z(e)&&(r=t),n._get_config("save_referrer")&&n._posthog.persistence.update_referrer_info(document.referrer),i[it]=H({},ue.people_properties(),n._posthog.persistence.get_referrer_info(),i[it]),n._send_request(i,r)})),this.set_once=rt(t,(function(e,t,r){var i=n.set_once_action(e,t);return z(e)&&(r=t),n._send_request(i,r)}))}return s(e,[{key:"toString",value:function(){return this._posthog.toString()+".people"}},{key:"_send_request",value:function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._posthog.get_distinct_id();var n=this._posthog.get_property("$device_id"),r=this._posthog.get_property("$user_id"),i=this._posthog.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),r&&(e.$user_id=r),i&&(e.$had_persisted_distinct_id=i);var o=Z(e),s=te(o,this._get_config("properties_string_max_length")),a=ne(JSON.stringify(o));return this._posthog._send_request(this._get_config("api_host")+"/engage/",{data:a},{},this._posthog._prepare_callback(t,s)),s}},{key:"_get_config",value:function(e){return this._posthog.get_config(e)}},{key:"_is_reserved_property",value:function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e}},{key:"set_action",value:function(e,t){return this.apiActionParser(it,e,t)}},{key:"set_once_action",value:function(e,t){return this.apiActionParser("$set_once",e,t)}},{key:"apiActionParser",value:function(e,t,n){var r=this,i={},o={};return z(t)?L(t,(function(e,t){r._is_reserved_property(t)||(o[t]=e)})):o[t]=n,i[e]=o,i}}]),e}(),st="$active_feature_flags",at="$enabled_feature_flags",ct="$override_feature_flags",ut="$feature_flag_payloads",lt=function(){function e(t){i(this,e),this.instance=t,this._override_warning=!1,this.flagCallReported={},this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return s(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(at),t=this.instance.get_property(ct);if(!t)return e||{};for(var n=H({},e),r=Object.keys(t),i=0;i<r.length;i++)!1===t[r[i]]?delete n[r[i]]:n[r[i]]=t[r[i]];return this._override_warning||(console.warn("[PostHog] Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(ut)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout((function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())}),5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;this.setReloadingPaused(!0);var t=this.instance.get_config("token"),n=ne(JSON.stringify({token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id}));this.instance._send_request(this.instance.get_config("api_host")+"/decide/?v=3",{data:n},{method:"POST"},this.instance._prepare_callback((function(t){e.$anon_distinct_id=void 0,e.receivedFeatureFlags(t),e.setReloadingPaused(!1),e._startReloadTimer()})))}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.getFlags())return console.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time."),!1;var n=this.getFlagVariants()[e];return!t.send_event&&"send_event"in t||this.flagCallReported[e]||(this.flagCallReported[e]=!0,this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getFlags()?!!this.getFeatureFlag(e,t):(console.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time."),!1)}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((function(t){return t!==e}))}},{key:"receivedFeatureFlags",value:function(e){this.instance.decideEndpointWasHit=!0;var t=this.getFlagVariants(),r=this.getFlagPayloads();!function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,s=e.featureFlagPayloads;if(o)if(Array.isArray(o)){var c,u={};if(o)for(var l=0;l<o.length;l++)u[o[l]]=!0;t&&t.register((a(c={},st,o),a(c,at,u),c))}else{var d,p=o,f=s;e.errorsWhileComputingFlags&&(p=n(n({},r),p),f=n(n({},i),f)),t&&t.register((a(d={},st,Object.keys(p||{})),a(d,at,p||{}),a(d,ut,f||{}),d))}else t&&(t.unregister(st),t.unregister(at),t.unregister(ut))}(e,this.instance.persistence,t,r);var i=this._prepareFeatureFlagsForCallbacks(),o=i.flags,s=i.flagVariants;this.featureFlagEventHandlers.forEach((function(e){return e(o,s)}))}},{key:"override",value:function(e){if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ct);else if(Array.isArray(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(a({},ct,t))}else this.instance.persistence.register(a({},ct,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks(),r=n.flags,i=n.flagVariants;e(r,i)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((function(e){return t[e]})),flagVariants:Object.keys(t).filter((function(e){return t[e]})).reduce((function(e,n){return e[n]=t[n],e}),{})}}}]),e}(),dt=2,pt=4,ft=function(){function e(t){i(this,e),this.instance=t,this.captureStarted=!1,this.snapshots=[],this.emit=!1,this.endpoint="/e/",this.stopRrweb=void 0,this.windowId=null,this.sessionId=null,this.receivedDecide=!1}return s(e,[{key:"startRecordingIfEnabled",value:function(){this.isRecordingEnabled()?this.startCaptureAndTrySendingQueuedSnapshots():this.stopRecording()}},{key:"started",value:function(){return this.captureStarted}},{key:"stopRecording",value:function(){this.captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this.captureStarted=!1)}},{key:"isRecordingEnabled",value:function(){var e=!!this.instance.get_property(qe),t=!this.instance.get_config("disable_session_recording");return e&&t}},{key:"isConsoleLogCaptureEnabled",value:function(){var e=!!this.instance.get_property(De),t=this.instance.get_config("enable_recording_console_log");return null!=t?t:e}},{key:"getRecordingVersion",value:function(){var e,t=this.instance.get_property(Ne);return(null===(e=this.instance.get_config("session_recording"))||void 0===e?void 0:e.recorderVersion)||t||"v1"}},{key:"afterDecideResponse",value:function(e){var t,n,r,i,o,s;this.receivedDecide=!0,this.instance.persistence&&this.instance.persistence.register((a(o={},qe,!!e.sessionRecording),a(o,De,null===(r=e.sessionRecording)||void 0===r?void 0:r.consoleLogRecordingEnabled),a(o,Ne,null===(i=e.sessionRecording)||void 0===i?void 0:i.recorderVersion),o)),null!==(t=e.sessionRecording)&&void 0!==t&&t.endpoint&&(this.endpoint=null===(s=e.sessionRecording)||void 0===s?void 0:s.endpoint),null!==(n=e.sessionRecording)&&void 0!==n&&n.recorderVersion&&(this.recorderVersion=e.sessionRecording.recorderVersion),this.startRecordingIfEnabled()}},{key:"startCaptureAndTrySendingQueuedSnapshots",value:function(){var e=this;this.receivedDecide&&(this.emit=!0,this.snapshots.forEach((function(t){return e._captureSnapshot(t)}))),this._startCapture()}},{key:"_startCapture",value:function(){if(void 0!==Object.assign&&!this.captureStarted&&!this.instance.get_config("disable_session_recording")){this.captureStarted=!0;var e="v2"===this.getRecordingVersion()?"recorder-v2.js":"recorder.js";this.instance.__loaded_recorder_version!==this.getRecordingVersion()?be(this.instance.get_config("api_host")+"/static/".concat(e,"?v=").concat(S.LIB_VERSION),this._onScriptLoaded.bind(this)):this._onScriptLoaded()}}},{key:"_updateWindowAndSessionIds",value:function(e){var t,n=3===e.type&&0===(null===(t=e.data)||void 0===t?void 0:t.source),r=this.instance.sessionManager.checkAndGetSessionAndWindowId(n,e.timestamp),i=r.windowId,o=r.sessionId;if(this.captureStarted&&(this.windowId!==i||this.sessionId!==o)&&-1===[dt,pt].indexOf(e.type))try{var s;null===(s=this.rrwebRecord)||void 0===s||s.takeFullSnapshot()}catch(a){q("Error taking full snapshot.",a)}this.windowId=i,this.sessionId=o}},{key:"_onScriptLoaded",value:function(){var e=this,t={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0};this.rrwebRecord=window.rrweb?window.rrweb.record:window.rrwebRecord;for(var i=this.instance.get_config("session_recording"),o=0,s=Object.entries(i||{});o<s.length;o++){var a=p(s[o],2),c=a[0],u=a[1];c in t&&(t[c]=u)}this.rrwebRecord?(this.stopRrweb=this.rrwebRecord(n({emit:function(t){t=function(e){if(e&&"object"===r(e)&&6===e.type&&"object"===r(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(function(e){if(e&&"object"===r(e)){var t=JSON.stringify(e);if(t.length>5e6){var n,i=g(t.matchAll(/data:([\w\/\-\.]+);(\w+),([^)"]*)/gim));try{for(i.s();!(n=i.n()).done;){var o=n.value;t="image/"===o[1].toLocaleLowerCase().slice(0,6)?t.replace(o[0],"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2IiBmaWxsPSJibGFjayIvPgo8cGF0aCBkPSJNOCAwSDE2TDAgMTZWOEw4IDBaIiBmaWxsPSIjMkQyRDJEIi8+CjxwYXRoIGQ9Ik0xNiA4VjE2SDhMMTYgOFoiIGZpbGw9IiMyRDJEMkQiLz4KPC9zdmc+Cg=="):t.replace(o[0],"")}}catch(s){i.e(s)}finally{i.f()}}return JSON.parse(t)}return e}(t)),e._updateWindowAndSessionIds(t);var n={$snapshot_data:t,$session_id:e.sessionId,$window_id:e.windowId};e.instance._captureMetrics.incr("rrweb-record"),e.instance._captureMetrics.incr("rrweb-record-".concat(t.type)),e.emit?e._captureSnapshot(n):e.snapshots.push(n)},plugins:window.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled()?[window.rrwebConsoleRecord.getRecordConsolePlugin()]:[]},t)),this.instance._addCaptureHook((function(t){try{var n;"$pageview"===t&&(null===(n=e.rrwebRecord)||void 0===n||n.addCustomEvent("$pageview",{href:window.location.href}))}catch(r){q("Could not add $pageview to rrweb session",r)}}))):q("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{transport:"XHR",method:"POST",endpoint:this.endpoint,_noTruncate:!0,_batchKey:"sessionRecording",_metrics:{rrweb_full_snapshot:e.$snapshot_data.type===dt}})}}]),e}(),ht={entryType:0,timeOrigin:1,name:2,startTime:3,redirectStart:4,redirectEnd:5,workerStart:6,fetchStart:7,domainLookupStart:8,domainLookupEnd:9,connectStart:10,secureConnectionStart:11,connectEnd:12,requestStart:13,responseStart:14,responseEnd:15,decodedBodySize:16,encodedBodySize:17,initiatorType:18,nextHopProtocol:19,renderBlockingStatus:20,responseStatus:21,transferSize:22,element:23,renderTime:24,loadTime:25,size:26,id:27,url:28,domComplete:29,domContentLoadedEvent:30,domInteractive:31,loadEventEnd:32,loadEventStart:33,redirectCount:34,navigationType:35,unloadEventEnd:36,unloadEventStart:37,duration:39,timestamp:40},_t=["first-input","navigation","paint","resource"],gt=["/s/","/e/"],vt=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:"startObservingIfEnabled",value:function(){this.isEnabled()?this.startObserving():this.stopObserving()}},{key:"startObserving",value:function(){var e=this;if(!this.observer)try{this.observer=new PerformanceObserver((function(t){t.getEntries().forEach((function(t){e._capturePerformanceEvent(t)}))})),PerformanceObserver.supportedEntryTypes.filter((function(e){return _t.includes(e)})).forEach((function(t){var n;null===(n=e.observer)||void 0===n||n.observe({type:t,buffered:!0})}))}catch(t){console.error("PostHog failed to start performance observer",t),this.stopObserving()}}},{key:"stopObserving",value:function(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},{key:"isObserving",value:function(){return!!this.observer}},{key:"isEnabled",value:function(){var e,t;return null!==(e=null!==(t=this.instance.get_config("capture_performance"))&&void 0!==t?t:this.remoteEnabled)&&void 0!==e&&e}},{key:"afterDecideResponse",value:function(e){this.remoteEnabled=e.capturePerformance||!1,this.isEnabled()&&this.startObserving()}},{key:"_capturePerformanceEvent",value:function(e){if(e.name.startsWith(this.instance.get_config("api_host"))){var t=e.name.replace(this.instance.get_config("api_host"),"");if(gt.find((function(e){return t.startsWith(e)})))return}var n=e.toJSON(),r={},i=Math.floor(Date.now()-performance.now());for(var o in r[ht.timeOrigin]=i,r[ht.timestamp]=Math.floor(i+e.startTime),ht)void 0!==n[o]&&(r[ht[o]]=n[o]);if(this.capturePerformanceEvent(r),yt(e)){var s,c=g(e.serverTiming||[]);try{for(c.s();!(s=c.n()).done;){var u,l=s.value;this.capturePerformanceEvent((a(u={},ht.timeOrigin,i),a(u,ht.timestamp,Math.floor(i+e.startTime)),a(u,ht.name,l.name),a(u,ht.duration,l.duration),a(u,ht.entryType,"serverTiming"),u))}}catch(d){c.e(d)}finally{c.f()}}}},{key:"capturePerformanceEvent",value:function(e){this.instance.capture("$performance_event",e,{transport:"XHR",method:"POST",endpoint:"/e/",_noTruncate:!0,_batchKey:"performanceEvent"})}}]),e}(),yt=function(e){return"navigation"===e.entryType||"resource"===e.entryType},mt=function(){function e(t){i(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return s(e,[{key:"call",value:function(){var e=this,t=ne(JSON.stringify({token:this.instance.get_config("token"),distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups()}));this.instance._send_request("".concat(this.instance.get_config("api_host"),"/decide/?v=3"),{data:t,verbose:!0},{method:"POST"},(function(t){return e.parseDecideResponse(t)}))}},{key:"parseDecideResponse",value:function(e){var t,n,r=this;if(0!==(null==e?void 0:e.status)){if(this.instance.decideEndpointWasHit=!0,!document||!document.body)return console.log("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((function(){r.parseDecideResponse(e)}),500);if(this.instance.toolbar.afterDecideResponse(e),null===(t=this.instance.sessionRecording)||void 0===t||t.afterDecideResponse(e),We.afterDecideResponse(e,this.instance),null===(n=this.instance.webPerformance)||void 0===n||n.afterDecideResponse(e),this.instance.featureFlags.receivedFeatureFlags(e),this.instance.compression={},e.supportedCompression&&!this.instance.get_config("disable_compression")){var i,o={},s=g(e.supportedCompression);try{for(s.s();!(i=s.n()).done;)o[i.value]=!0}catch(d){s.e(d)}finally{s.f()}this.instance.compression=o}if(e.siteApps)if(this.instance.get_config("opt_in_site_apps")){var a,c=this.instance.get_config("api_host"),u=g(e.siteApps);try{var l=function(){var e=a.value,t=e.id,n=e.url,i=document.createElement("script");i.src=[c,"/"===c[c.length-1]&&"/"===n[0]?n.substring(1):n].join(""),i.onerror=function(e){console.error("Error while initializing PostHog app with config id ".concat(t),e)},window["__$$ph_site_app_".concat(t)]=r.instance,document.body.appendChild(i)};for(u.s();!(a=u.n()).done;)l()}catch(d){u.e(d)}finally{u.f()}}else e.siteApps.length>0&&console.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}else console.error("Failed to fetch feature flags from PostHog.")}}]),e}(),bt=["https://app.posthog.com","https://eu.posthog.com"],wt=["source"],kt=function(){function e(t){i(this,e),this.instance=t}return s(e,[{key:"afterDecideResponse",value:function(e){var t=e.toolbarParams||e.editorParams||(e.toolbarVersion?{toolbarVersion:e.toolbarVersion}:{});e.isAuthenticated&&t.toolbarVersion&&0===t.toolbarVersion.indexOf("toolbar")&&this.loadToolbar(n(n({},t),{},{apiURL:this.instance.get_config("api_host")}))}},{key:"maybeLoadToolbar",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;try{if(!t){try{window.localStorage.setItem("test","test"),window.localStorage.removeItem("test")}catch(s){return!1}t=window.localStorage}var r,i=ae(e.hash,"__posthog")||ae(e.hash,"state"),o=i?JSON.parse(decodeURIComponent(i)):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:n?n.replaceState("",document.title,e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem("_postHogToolbarParams")||"{}")).source="localstorage",delete r.userIntent),r.apiURL||(r.apiURL=this.instance.get_config("api_host")),!(!r.token||this.instance.get_config("token")!==r.token||(this.loadToolbar(r),0))}catch(s){return!1}}},{key:"loadToolbar",value:function(e){var t=this;if(window._postHogToolbarLoaded)return!1;window._postHogToolbarLoaded=!0;var r=(null==e?void 0:e.apiURL)||this.instance.get_config("api_host"),i=3e4*Math.floor(Date.now()/3e4),o="".concat(r).concat(r.endsWith("/")?"":"/","static/toolbar.js?_ts=").concat(i),s=!bt.includes(this.instance.get_config("api_host"))&&this.instance.get_config("advanced_disable_toolbar_metrics"),a=n(n({apiURL:r,jsURL:r,token:this.instance.get_config("token")},e),s?{instrument:!1}:{});a.source;var c=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(a,wt);return window.localStorage.setItem("_postHogToolbarParams",JSON.stringify(c)),be(o,(function(){(window.ph_load_toolbar||window.ph_load_editor)(a,t.instance)})),ce(window,"turbolinks:load",(function(){window._postHogToolbarLoaded=!1,t.loadToolbar(a)})),!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.history;return this.maybeLoadToolbar(e,t,n)}}]),e}(),St=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;i(this,e),this.isPolling=!0,this._event_queue=[],this._empty_queue_count=0,this._poller=void 0,this._pollInterval=t}return s(e,[{key:"setPollInterval",value:function(e){this._pollInterval=e,this.isPolling&&this.poll()}},{key:"poll",value:function(){}},{key:"unload",value:function(){}},{key:"getTime",value:function(){return(new Date).getTime()}}]),e}(),Ft=function(e){c(r,St);var t=d(r);function r(e,n){var o,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3;return i(this,r),(o=t.call(this,s)).handlePollRequest=n,o.captureMetrics=e,o}return s(r,[{key:"enqueue",value:function(e,t,n){this.captureMetrics.incr("batch-enqueue"),this._event_queue.push({url:e,data:t,options:n}),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;clearTimeout(this._poller),this._poller=setTimeout((function(){if(e._event_queue.length>0){var t=e.formatQueue(),n=function(n){var r=t[n],i=r.url,o=r.data,s=r.options;L(o,(function(t,n){o[n].offset=Math.abs(o[n].timestamp-e.getTime()),delete o[n].timestamp})),e.handlePollRequest(i,o,s),e.captureMetrics.incr("batch-requests"),e.captureMetrics.incr("batch-requests-".concat(i.slice(i.length-2))),e.captureMetrics.incr("batch-handle",o.length),e.captureMetrics.incr("batch-handle-".concat(i.slice(i.length-2)),o.length)};for(var r in t)n(r);e._event_queue.length=0,e._empty_queue_count=0}else e._empty_queue_count++;e._empty_queue_count>4&&(e.isPolling=!1,e._empty_queue_count=0),e.isPolling&&e.poll()}),this._pollInterval)}},{key:"updateUnloadMetrics",value:function(){var e=this.formatQueue();for(var t in e){var n=e[t],r=n.url,i=n.data;this.captureMetrics.incr("batch-unload-requests"),this.captureMetrics.incr("batch-unload-requests-".concat(r.slice(r.length-2))),this.captureMetrics.incr("batch-unload",i.length),this.captureMetrics.incr("batch-unload-".concat(r.slice(r.length-2)),i.length)}}},{key:"unload",value:function(){var e=this;clearTimeout(this._poller);var t=this._event_queue.length>0?this.formatQueue():{};this._event_queue.length=0;var r=Object.values(t);[].concat(f(r.filter((function(e){return 0===e.url.indexOf("/e")}))),f(r.filter((function(e){return 0!==e.url.indexOf("/e")})))).map((function(t){var r=t.url,i=t.data,o=t.options;e.handlePollRequest(r,i,n(n({},o),{},{transport:"sendBeacon"}))}))}},{key:"formatQueue",value:function(){var e={};return L(this._event_queue,(function(t){var n=t.url,r=t.data,i=t.options,o=(i?i._batchKey:null)||n;void 0===e[o]&&(e[o]={data:[],url:n,options:i}),i&&e[o].options&&e[o].options._metrics&&!e[o].options._metrics.rrweb_full_snapshot&&(e[o].options._metrics.rrweb_full_snapshot=i._metrics.rrweb_full_snapshot),e[o].data.push(r)})),e}}]),r}(),It=function(){function e(t){i(this,e),this.enabled=t,this.metrics={}}return s(e,[{key:"incr",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)+t)}},{key:"decr",value:function(e){this.enabled&&(e="phjs-".concat(e),this.metrics[e]=(this.metrics[e]||0)-1)}}]),e}(),Ot=Uint8Array,Et=Uint16Array,Pt=Uint32Array,At=new Ot([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),xt=new Ot([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ct=new Ot([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Tt=function(e,t){for(var n=new Et(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new Pt(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},Rt=Tt(At,2),$t=Rt[0],Mt=Rt[1];$t[28]=258,Mt[258]=28;for(var jt=Tt(xt,0)[1],qt=new Et(32768),Dt=0;Dt<32768;++Dt){var Nt=(43690&Dt)>>>1|(21845&Dt)<<1;Nt=(61680&(Nt=(52428&Nt)>>>2|(13107&Nt)<<2))>>>4|(3855&Nt)<<4,qt[Dt]=((65280&Nt)>>>8|(255&Nt)<<8)>>>1}var Lt=function(e,t,n){for(var r=e.length,i=0,o=new Et(t);i<r;++i)++o[e[i]-1];var s,a=new Et(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new Et(1<<t);var c=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,p=d|(1<<l)-1;d<=p;++d)s[qt[d]>>>c]=u}else for(s=new Et(r),i=0;i<r;++i)s[i]=qt[a[e[i]-1]++]>>>15-e[i];return s},Bt=new Ot(288);for(Dt=0;Dt<144;++Dt)Bt[Dt]=8;for(Dt=144;Dt<256;++Dt)Bt[Dt]=9;for(Dt=256;Dt<280;++Dt)Bt[Dt]=7;for(Dt=280;Dt<288;++Dt)Bt[Dt]=8;var Ht=new Ot(32);for(Dt=0;Dt<32;++Dt)Ht[Dt]=5;var Ut,Vt,Wt=Lt(Bt,9,0),zt=Lt(Ht,5,0),Qt=function(e){return(e/8>>0)+(7&e&&1)},Gt=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Et?Et:e instanceof Pt?Pt:Ot)(n-t);return r.set(e.subarray(t,n)),r},Jt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Zt=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Xt=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new Ot(0),0];if(1==i){var s=new Ot(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(e,t){return e.f-t.f})),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,l=1,d=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=n[n[u].f<n[d].f?u++:d++],c=n[u!=l&&n[u].f<n[d].f?u++:d++],n[l++]={s:-1,f:a.f+c.f,l:a,r:c};var p=o[0].s;for(r=1;r<i;++r)o[r].s>p&&(p=o[r].s);var f=new Et(p+1),h=Yt(n[l-1],f,0);if(h>t){r=0;var _=0,g=h-t,v=1<<g;for(o.sort((function(e,t){return f[t.s]-f[e.s]||e.f-t.f}));r<i;++r){var y=o[r].s;if(!(f[y]>t))break;_+=v-(1<<h-f[y]),f[y]=t}for(_>>>=g;_>0;){var m=o[r].s;f[m]<t?_-=1<<t-f[m]++-1:++r}for(;r>=0&&_;--r){var b=o[r].s;f[b]==t&&(--f[b],++_)}h=t}return[new Ot(f),h]},Yt=function e(t,n,r){return-1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},Kt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Et(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},en=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},tn=function(e,t,n){var r=n.length,i=Qt(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},nn=function(e,t,n,r,i,o,s,a,c,u,l){Jt(t,l++,n),++i[256];for(var d=Xt(i,15),p=d[0],f=d[1],h=Xt(o,15),_=h[0],g=h[1],v=Kt(p),y=v[0],m=v[1],b=Kt(_),w=b[0],k=b[1],S=new Et(19),F=0;F<y.length;++F)S[31&y[F]]++;for(F=0;F<w.length;++F)S[31&w[F]]++;for(var I=Xt(S,7),O=I[0],E=I[1],P=19;P>4&&!O[Ct[P-1]];--P);var A,x,C,T,R=u+5<<3,$=en(i,Bt)+en(o,Ht)+s,M=en(i,p)+en(o,_)+s+14+3*P+en(S,O)+(2*S[16]+3*S[17]+7*S[18]);if(R<=$&&R<=M)return tn(t,l,e.subarray(c,c+u));if(Jt(t,l,1+(M<$)),l+=2,M<$){A=Lt(p,f,0),x=p,C=Lt(_,g,0),T=_;var j=Lt(O,E,0);for(Jt(t,l,m-257),Jt(t,l+5,k-1),Jt(t,l+10,P-4),l+=14,F=0;F<P;++F)Jt(t,l+3*F,O[Ct[F]]);l+=3*P;for(var q=[y,w],D=0;D<2;++D){var N=q[D];for(F=0;F<N.length;++F){var L=31&N[F];Jt(t,l,j[L]),l+=O[L],L>15&&(Jt(t,l,N[F]>>>5&127),l+=N[F]>>>12)}}}else A=Wt,x=Bt,C=zt,T=Ht;for(F=0;F<a;++F)if(r[F]>255){L=r[F]>>>18&31,Zt(t,l,A[L+257]),l+=x[L+257],L>7&&(Jt(t,l,r[F]>>>23&31),l+=At[L]);var B=31&r[F];Zt(t,l,C[B]),l+=T[B],B>3&&(Zt(t,l,r[F]>>>5&8191),l+=xt[B])}else Zt(t,l,A[r[F]]),l+=x[r[F]];return Zt(t,l,A[256]),l+x[256]},rn=new Pt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),on=new Ot(0),sn=function(){for(var e=new Pt(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),an=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cn(e,t){void 0===t&&(t={});var n=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=sn[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}}(),r=e.length;n.p(e);var i=function(e,t,n,r,i){return function(e,t,n,r,i,o){var s=e.length,a=new Ot(r+s+5*(1+Math.floor(s/7e3))+i),c=a.subarray(r,a.length-i),u=0;if(!t||s<8)for(var l=0;l<=s;l+=65535){var d=l+65535;d<s?u=tn(c,u,e.subarray(l,d)):(c[l]=o,u=tn(c,u,e.subarray(l,s)))}else{for(var p=rn[t-1],f=p>>>13,h=8191&p,_=(1<<n)-1,g=new Et(32768),v=new Et(_+1),y=Math.ceil(n/3),m=2*y,b=function(t){return(e[t]^e[t+1]<<y^e[t+2]<<m)&_},w=new Pt(25e3),k=new Et(288),S=new Et(32),F=0,I=0,O=(l=0,0),E=0,P=0;l<s;++l){var A=b(l),x=32767&l,C=v[A];if(g[x]=C,v[A]=x,E<=l){var T=s-l;if((F>7e3||O>24576)&&T>423){u=nn(e,c,0,w,k,S,I,O,P,l-P,u),O=F=I=0,P=l;for(var R=0;R<286;++R)k[R]=0;for(R=0;R<30;++R)S[R]=0}var $=2,M=0,j=h,q=x-C&32767;if(T>2&&A==b(l-q))for(var D=Math.min(f,T)-1,N=Math.min(32767,l),L=Math.min(258,T);q<=N&&--j&&x!=C;){if(e[l+$]==e[l+$-q]){for(var B=0;B<L&&e[l+B]==e[l+B-q];++B);if(B>$){if($=B,M=q,B>D)break;var H=Math.min(q,B-2),U=0;for(R=0;R<H;++R){var V=l-q+R+32768&32767,W=V-g[V]+32768&32767;W>U&&(U=W,C=V)}}}q+=(x=C)-(C=g[x])+32768&32767}if(M){w[O++]=268435456|Mt[$]<<18|jt[M];var z=31&Mt[$],Q=31&jt[M];I+=At[z]+xt[Q],++k[257+z],++S[Q],E=l+$,++F}else w[O++]=e[l],++k[e[l]]}}u=nn(e,c,o,w,k,S,I,O,P,l-P,u),o||(u=tn(c,u,on))}return Gt(a,0,r+Qt(u)+i)}(e,null==t.level?6:t.level,null==t.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!i)}(e,t,function(e){return 10+(e.filename&&e.filename.length+1||0)}(t),8),o=i.length;return function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&an(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(i,t),an(i,o-8,n.d()),an(i,o-4,r),i}function un(e,t){var n=e.length;if(!t&&"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new Ot(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new Ot(i+8+(n-s<<1));a.set(r),r=a}var c=e.charCodeAt(s);c<128||t?o(c):c<2048?(o(192|c>>>6),o(128|63&c)):c>55295&&c<57344?(o(240|(c=65536+(1047552&c)|1023&e.charCodeAt(++s))>>>18),o(128|c>>>12&63),o(128|c>>>6&63),o(128|63&c)):(o(224|c>>>12),o(128|c>>>6&63),o(128|63&c))}return Gt(r,0,i)}(Vt=Ut||(Ut={})).GZipJS="gzip-js",Vt.LZ64="lz64",Vt.Base64="base64";var ln,dn,pn,fn=function e(t,n){if(n.blob&&t.buffer)return new Blob([t.buffer],{type:"text/plain"});if(n.sendBeacon||n.blob){var r=e(t,{method:"POST"});return new Blob([r],{type:"application/x-www-form-urlencoded"})}return"POST"!==n.method?null:(i=Array.isArray(t)||(o=t,"[object Uint8Array]"===Object.prototype.toString.call(o))?"data="+encodeURIComponent(t):"data="+encodeURIComponent(t.data),"compression"in t&&t.compression&&(i+="&compression="+t.compression),i);var i,o},hn=function(e){var t=e.url,n=e.data,r=e.headers,i=e.options,o=e.captureMetrics,s=e.callback,a=e.retriesPerformedSoFar,c=e.retryQueue,u=e.onXHRError,l=e.timeout,d=void 0===l?1e4:l,p=new XMLHttpRequest;p.open(i.method||"GET",t,!0);var f=fn(n,i);o.incr("_send_request"),o.incr("_send_request_inflight"),L(r,(function(e,t){p.setRequestHeader(t,e)})),"POST"!==i.method||i.blob||p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.timeout=d,p.withCredentials=!0,p.onreadystatechange=function(){if(4===p.readyState)if(o.incr("xhr-response"),o.incr("xhr-response-".concat(p.status)),o.decr("_send_request_inflight"),200===p.status){if(s){var e;try{e=JSON.parse(p.responseText)}catch(l){return void q(l)}s(e)}}else"function"==typeof u&&u(p),[401,403,404,500].indexOf(p.status)<0&&c.enqueue({url:t,data:n,options:i,headers:r,retriesPerformedSoFar:(a||0)+1,callback:s}),s&&s({status:0})},p.send(f)},_n=function(e){c(r,St);var t=d(r);function r(e,n){var o;return i(this,r),(o=t.call(this)).captureMetrics=e,o.isPolling=!1,o.queue=[],o.areWeOnline=!0,o.onXHRError=n,"undefined"!=typeof window&&"onLine"in window.navigator&&(o.areWeOnline=window.navigator.onLine,window.addEventListener("online",(function(){o._handleWeAreNowOnline()})),window.addEventListener("offline",(function(){o.areWeOnline=!1}))),o}return s(r,[{key:"enqueue",value:function(e){var t=e.retriesPerformedSoFar||0;if(!(t>=10)){var n=3e3*Math.pow(2,t),r=new Date(Date.now()+n);console.warn("Enqueued failed request for retry in ".concat(n)),this.queue.push({retryAt:r,requestData:e}),this.isPolling||(this.isPolling=!0,this.poll())}}},{key:"poll",value:function(){var e=this;this._poller&&clearTimeout(this._poller),this._poller=setTimeout((function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()}),this._pollInterval)}},{key:"flush",value:function(){var e=new Date(Date.now()),t=this.queue.filter((function(t){return t.retryAt<e}));if(t.length>0){this.queue=this.queue.filter((function(t){return t.retryAt>=e}));var n,r=g(t);try{for(r.s();!(n=r.n()).done;){var i=n.value.requestData;this._executeXhrRequest(i)}}catch(o){r.e(o)}finally{r.f()}}}},{key:"unload",value:function(){this._poller&&(clearTimeout(this._poller),this._poller=void 0);var e,t=g(this.queue);try{for(t.s();!(e=t.n()).done;){var r=e.value.requestData,i=r.url,o=r.data,s=r.options;try{window.navigator.sendBeacon(i,fn(o,n(n({},s),{},{sendBeacon:!0})))}catch(a){S.DEBUG&&console.error(a)}}}catch(a){t.e(a)}finally{t.f()}this.queue=[]}},{key:"_executeXhrRequest",value:function(e){var t=e.url,n=e.data,r=e.options,i=e.headers,o=e.callback,s=e.retriesPerformedSoFar;hn({url:t,data:n||{},options:r||{},headers:i||{},retriesPerformedSoFar:s||0,callback:o,captureMetrics:this.captureMetrics,retryQueue:this,onXHRError:this.onXHRError})}},{key:"_handleWeAreNowOnline",value:function(){this.areWeOnline=!0,this.flush()}}]),r}(),gn=function(){function e(t,n){i(this,e),this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null;var r=t.persistence_name||t.token;if(this.window_id_storage_key="ph_"+r+"_window_id",this.primary_window_exists_storage_key="ph_"+r+"_primary_window_exists",!this.persistence.disabled&&Te.is_supported()){var o=Te.parse(this.window_id_storage_key),s=Te.parse(this.primary_window_exists_storage_key);o&&!s?this._windowId=o:Te.remove(this.window_id_storage_key),Te.set(this.primary_window_exists_storage_key,!0)}this._listenToReloadWindow()}return s(e,[{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,!this.persistence.disabled&&Te.is_supported()&&Te.set(this.window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:!this.persistence.disabled&&Te.is_supported()?Te.parse(this.window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(a({},Le,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[Le];return Array.isArray(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;window.addEventListener("beforeunload",(function(){!e.persistence.disabled&&Te.is_supported()&&Te.remove(e.primary_window_exists_storage_key)}))}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=p(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],s=this._getWindowId(),a=o&&o>0&&Math.abs(t-o)>864e5;!i||!e&&Math.abs(t-r)>18e5||a?(i=oe(),s=oe(),o=t):s||(s=oe());var c=0===r||!e||a?t:r,u=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,c,u),{sessionId:i,windowId:s}}}]),e}(),vn=s((function e(t,n,r,o){i(this,e),this.name="posthog-js",this.setupOnce=function(e){e((function(e){var i,s,a;if("error"!==e.level||!t.__loaded)return e;e.tags||(e.tags={});var c=t.config.ui_host||t.config.api_host;e.tags["PostHog Person URL"]=c+"/person/"+t.get_distinct_id(),t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=c+"/recordings/"+t.sessionManager.checkAndGetSessionAndWindowId(!0).sessionId);var u=(null===(i=e.exception)||void 0===i?void 0:i.values)||[],l={$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:null===(s=u[0])||void 0===s?void 0:s.value,$sentry_exception_type:null===(a=u[0])||void 0===a?void 0:a.type,$sentry_tags:e.tags};return n&&r&&(l.$sentry_url=(o||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+e.event_id),t.capture("$exception",l),e}))}})),yn=function(){function e(){i(this,e),a(this,"_seenFirstPageView",!1)}return s(e,[{key:"onPageview",value:function(){this._seenFirstPageView&&(this._pageViewId=oe()),this._seenFirstPageView=!0}},{key:"getPageViewId",value:function(){return this._pageViewId||(this._pageViewId=oe()),this._pageViewId}}]),e}();!function(e){e[e.INIT_MODULE=0]="INIT_MODULE",e[e.INIT_SNIPPET=1]="INIT_SNIPPET"}(ln||(ln={}));var mn=function(){},bn={},wn="posthog",kn=P.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Sn=!kn&&-1===C.indexOf("MSIE")&&-1===C.indexOf("Mozilla"),Fn=function(){var e,t,n;return{api_host:"https://app.posthog.com",api_method:"POST",api_transport:"XHR",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:-1===(null==x||null===(e=x.location)||void 0===e||null===(t=e.hostname)||void 0===t?void 0:t.indexOf("herokuapp.com")),persistence:"cookie",persistence_name:"",cookie_name:"",loaded:mn,store_google:!0,save_referrer:!0,test:!1,verbose:!1,img:!1,capture_pageview:!0,capture_pageleave:!0,debug:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_cookie:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==P||null===(n=P.location)||void 0===n?void 0:n.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_blacklist:[],respect_dnt:!1,sanitize_properties:null,xhr_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{blockClass:"ph-no-capture",blockSelector:null,ignoreClass:"ph-ignore-input",maskAllInputs:!0,maskInputOptions:{},maskInputFn:null,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_toolbar_metrics:!1,on_xhr_error:function(e){var t="Bad HTTP status: "+e.status+" "+e.statusText;console.error(t)},get_device_id:function(e){return e},_onCapture:mn,_capture_metrics:!1,capture_performance:void 0,name:"posthog",callback_fn:"posthog._jsc",bootstrap:{},disable_compression:!1}},In=function(e,t,n,r){var i,o=n!==wn&&pn?n?pn[n]:void 0:pn,s={initComplete:!1,syncCode:!1},a=function(e){return function(t){s[e]||(s[e]=!0,s.initComplete&&s.syncCode&&(null==r||r(t)))}};if(o&&dn===ln.INIT_MODULE)i=o;else{if(o&&!U(o))return void console.error("You have already initialized "+n);i=new On}return i._init(e,t,n,a("initComplete")),i.toolbar.maybeLoadToolbar(),i.sessionRecording=new ft(i),i.sessionRecording.startRecordingIfEnabled(),i.webPerformance=new vt(i),i.webPerformance.startObservingIfEnabled(),i.__autocapture=i.get_config("autocapture"),We._setIsAutocaptureEnabled(i),We._isAutocaptureEnabled&&(i.__autocapture=i.get_config("autocapture"),We.enabledForProject(i.get_config("token"),100,100)?We.isBrowserSupported()?We.init(i):(i.__autocapture=!1,j("Disabling Automatic Event Collection because this browser is not supported")):(i.__autocapture=!1,j("Not in active bucket: disabling Automatic Event Collection."))),S.DEBUG=S.DEBUG||i.get_config("debug"),void 0!==o&&U(o)&&(i._execute_array.call(i.people,o.people),i._execute_array(o)),a("syncCode")(i),i},On=function(){function e(){var t=this;i(this,e),this.config=Fn(),this.compression={},this.decideEndpointWasHit=!1,this.SentryIntegration=vn,this.segmentIntegration=function(){return function(e){var t=function(t,n){t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r=e._calculate_event_properties(n,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return t(e,e.event.event)},page:function(e){return t(e,"$pageview")},identify:function(e){return t(e,"$identify")},screen:function(e){return t(e,"$screen")}}}(t)},this.__captureHooks=[],this.__request_queue=[],this.__loaded=!1,this.__loaded_recorder_version=void 0,this.__autocapture=void 0,this._jsc=function(){},this.people=new ot(this),this.featureFlags=new lt(this),this.feature_flags=this.featureFlags,this.toolbar=new kt(this),this.pageViewIdManager=new yn,this._captureMetrics=void 0,this._requestQueue=void 0,this._retryQueue=void 0,this.persistence=void 0,this.sessionManager=void 0}return s(e,[{key:"init",value:function(e,t,n){if(Q(n))console.error("You must name your new library: init(token, config, name)");else{if(n!==wn){var r=In(e,t,n,(function(e){pn[n]=e,e._loaded()}));return pn[n]=r,r}console.error("You must initialize the main posthog object right after you include the PostHog js snippet")}}},{key:"_init",value:function(e){var t,n,r=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;this.__loaded=!0,this.config={},this._triggered_notifs=[];var a,c={segmentRegister:!1,syncCode:!1},u=function(e){return function(){c[e]||(c[e]=!0,c.segmentRegister&&c.syncCode&&(null==s||s(r)))}};if(this.set_config(H({},Fn(),i,{name:o,token:e,callback_fn:(o===wn?o:wn+"."+o)+"._jsc"})),this._jsc=function(){},(null!=P&&null!==(t=P.rrweb)&&void 0!==t&&t.record||null!=P&&P.rrwebRecord)&&(this.__loaded_recorder_version=null==P||null===(a=P.rrweb)||void 0===a?void 0:a.version),this._captureMetrics=new It(this.get_config("_capture_metrics")),this._requestQueue=new Ft(this._captureMetrics,this._handle_queued_event.bind(this)),this._retryQueue=new _n(this._captureMetrics,this.get_config("on_xhr_error")),this.__captureHooks=[],this.__request_queue=[],this.persistence=new Ve(this.config),this.sessionManager=new gn(this.config,this.persistence),this._gdpr_init(),i.segment?(this.config.get_device_id=function(){return i.segment.user().anonymousId()},i.segment.user().id()&&(this.register({distinct_id:i.segment.user().id()}),this.persistence.set_user_state("identified")),i.segment.register(this.segmentIntegration()).then(u("segmentRegister"))):u("segmentRegister")(),void 0!==(null===(n=i.bootstrap)||void 0===n?void 0:n.distinctID)){var l,d,p=this.get_config("get_device_id")(oe()),f=null!==(l=i.bootstrap)&&void 0!==l&&l.isIdentifiedID?p:i.bootstrap.distinctID;this.persistence.set_user_state(null!==(d=i.bootstrap)&&void 0!==d&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:f})}if(this._hasBootstrappedFeatureFlags()){var h,_,g=Object.keys((null===(h=i.bootstrap)||void 0===h?void 0:h.featureFlags)||{}).filter((function(e){var t,n;return!(null===(t=i.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])})).reduce((function(e,t){var n,r;return e[t]=(null===(n=i.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e}),{}),v=Object.keys((null===(_=i.bootstrap)||void 0===_?void 0:_.featureFlagPayloads)||{}).filter((function(e){return g[e]})).reduce((function(e,t){var n,r,o,s;return null!==(n=i.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(o=i.bootstrap)||void 0===o||null===(s=o.featureFlagPayloads)||void 0===s?void 0:s[t]),e}),{});this.featureFlags.receivedFeatureFlags({featureFlags:g,featureFlagPayloads:v})}if(!this.get_distinct_id()){var y=this.get_config("get_device_id")(oe());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_user_state("anonymous")}P.addEventListener&&P.addEventListener("onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),u("syncCode")()}},{key:"_loaded",value:function(){this.featureFlags.setReloadingPaused(!0);try{this.get_config("loaded")(this)}catch(e){console.error("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.get_config("capture_pageview")&&this.capture("$pageview",{},{send_instantly:!0}),this.get_config("advanced_disable_decide")||new mt(this).call(),this.featureFlags.resetRequestQueue(),this.featureFlags.setReloadingPaused(!1)}},{key:"_start_queue_if_opted_in",value:function(){this.has_opted_out_capturing()||this.get_config("request_batching")&&this._requestQueue.poll()}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||B(this.__request_queue,(function(t){e._send_request.apply(e,f(t))})),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_prepare_callback",value:function(e,t){if(Q(e))return null;if(kn)return function(n){e(n,t)};var n=this._jsc,r=""+Math.floor(1e8*Math.random()),i=this.get_config("callback_fn")+"["+r+"]";return n[r]=function(i){delete n[r],e(i,t)},i}},{key:"_handle_unload",value:function(){this.get_config("request_batching")?(this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave"),this.get_config("_capture_metrics")&&(this._requestQueue.updateUnloadMetrics(),this.capture("$capture_metrics",this._captureMetrics.metrics)),this._requestQueue.unload(),this._retryQueue.unload()):this.get_config("capture_pageview")&&this.get_config("capture_pageleave")&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_handle_queued_event",value:function(e,t,n){var r=JSON.stringify(t);this.__compress_and_send_json_request(e,r,n||bn,mn)}},{key:"__compress_and_send_json_request",value:function(e,t,r,i){var o,s,a,c,u=p((s=(o=this.compression)[Ut.GZipJS]?Ut.GZipJS:o[Ut.LZ64]?Ut.LZ64:Ut.Base64,a=t,c=r,s===Ut.LZ64?[{data:k.compressToBase64(a),compression:Ut.LZ64},c]:s===Ut.GZipJS?[cn(un(a),{mtime:0}),n(n({},c),{},{blob:!0,urlQueryArgs:{compression:Ut.GZipJS}})]:[{data:ne(a)},c]),2),l=u[0],d=u[1];this._send_request(e,l,d,i)}},{key:"_send_request",value:function(e,t,r,i){if(Sn)this.__request_queue.push([e,t,r,i]);else{var o={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")};r=H(o,r||{}),kn||(r.method="GET");var s="sendBeacon"in P.navigator&&"sendBeacon"===r.transport;if(e=function(t,n,r){var i=n||{};i.ip=r.ip?1:0,i._=(new Date).getTime().toString(),i.ver=S.LIB_VERSION;var o=t.split("?");if(o.length>1){var s,a=g(o[1].split("&"));try{for(a.s();!(s=a.n()).done;){var c=s.value.split("=")[0];i[c]&&delete i[c]}}catch(e){a.e(e)}finally{a.f()}}var u=t.indexOf("?")>-1?"&":"?";return t+u+function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return L(e,(function(e,r){t=encodeURIComponent(e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t})),i.join(r)}(i)}(e,r.urlQueryArgs||{},{ip:this.get_config("ip")}),z(t)&&this.get_config("img")){var a=x.createElement("img");a.src=e,x.body.appendChild(a)}else if(s)try{P.navigator.sendBeacon(e,fn(t,n(n({},r),{},{sendBeacon:!0})))}catch(d){this.get_config("debug")&&console.error(d)}else if(kn)try{hn({url:e,data:t,headers:this.get_config("xhr_headers"),options:r,captureMetrics:this._captureMetrics,callback:i,retriesPerformedSoFar:0,retryQueue:this._retryQueue,onXHRError:this.get_config("on_xhr_error")})}catch(d){console.error(d)}else{var c,u=x.createElement("script");u.type="text/javascript",u.async=!0,u.defer=!0,u.src=e;var l=x.getElementsByTagName("script")[0];null===(c=l.parentNode)||void 0===c||c.insertBefore(u,l)}}}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];B(e,(function(e){e&&(t=e[0],U(t)?o.push(e):"function"==typeof e?e.call(n):U(e)&&"alias"===t?r.push(e):U(e)&&-1!==t.indexOf("capture")&&"function"==typeof n[t]?o.push(e):i.push(e))}));var s=function(e,t){B(e,(function(e){if(U(e[0])){var n=t;L(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};s(r,this),s(i,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bn;if(this.__loaded&&!nt(this,!1)){this._captureMetrics.incr("capture"),"$snapshot"===e&&this._captureMetrics.incr("snapshot");var r=(n=n||bn).transport;if(r&&(n.transport=r),Q(e)||"string"!=typeof e)console.error("No event name provided to posthog.capture");else if(!function(e){return!!/(google web preview|baiduspider|yandexbot|bingbot|googlebot|yahoo! slurp|ahrefsbot|facebookexternalhit|facebookcatalog|applebot|semrushbot|duckduckbot|twitterbot|rogerbot|linkedinbot|mj12bot|sitebulb|bot.htm|bot.php|hubspot|crawler)/i.test(e)}(C)){this.persistence.update_search_keyword(x.referrer),this.get_config("store_google")&&this.persistence.update_campaign_params(),this.get_config("save_referrer")&&this.persistence.update_referrer_info(x.referrer);var i={event:e,properties:this._calculate_event_properties(e,t||{})};"$identify"===e&&n.$set&&(i.$set=n.$set),(i=te(i,n._noTruncate?null:this.get_config("properties_string_max_length"))).timestamp=n.timestamp||new Date,this.get_config("debug")&&j("PostHog.js send",i);var o=JSON.stringify(i),s=this.get_config("api_host")+(n.endpoint||"/e/"),a=n!==bn;return!this.get_config("request_batching")||a&&!n._batchKey||n.send_instantly?this.__compress_and_send_json_request(s,o,n):this._requestQueue.enqueue(s,i,n),this._invokeCaptureHooks(e,i),i}}}},{key:"_addCaptureHook",value:function(e){this.__captureHooks.push(e)}},{key:"_invokeCaptureHooks",value:function(e,t){this.config._onCapture(e,t),L(this.__captureHooks,(function(t){return t(e)}))}},{key:"_calculate_event_properties",value:function(e,t){var r,i=this.persistence.remove_event_timer(e),o=n({},t);if(o.token=this.get_config("token"),"$snapshot"===e){var s=this.persistence.properties();return o.distinct_id=s.distinct_id,o}var a=ue.properties();if(this.sessionManager){var c=this.sessionManager.checkAndGetSessionAndWindowId(),u=c.sessionId,l=c.windowId;o.$session_id=u,o.$window_id=l}if(null!==(r=this.webPerformance)&&void 0!==r&&r.isEnabled&&("$pageview"===e&&this.pageViewIdManager.onPageview(),o=H(o,{$pageview_id:this.pageViewIdManager.getPageViewId()})),"$performance_event"===e){var d=this.persistence.properties();return o.distinct_id=d.distinct_id,o.$current_url=a.$current_url,o}if(void 0!==i){var p=(new Date).getTime()-i;o.$duration=parseFloat((p/1e3).toFixed(3))}o=H({},a,this.persistence.properties(),o);var f=this.get_config("property_blacklist");U(f)?L(f,(function(e){delete o[e]})):console.error("Invalid value for property_blacklist config: "+f);var h=this.get_config("sanitize_properties");return h&&(o=h(o,e)),o}},{key:"register",value:function(e,t){this.persistence.register(e,t)}},{key:"register_once",value:function(e,t,n){this.persistence.register_once(e,t,n)}},{key:"unregister",value:function(e){this.persistence.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(a({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(n){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"identify",value:function(e,t,n){if(e){this._captureMetrics.incr("identify");var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property($e)&&(this.unregister($e),this.register({distinct_id:e}));var o="anonymous"===this.persistence.get_user_state();e!==r&&o?(this.persistence.set_user_state("identified"),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t&&this.people.set(t),n&&this.people.set_once(n)),e!==r&&this.reloadFeatureFlags()}else console.error("Unique user id has not been set in posthog.identify")}},{key:"group",value:function(e,t,r){if(e&&t){this._captureMetrics.incr("group");var i=this.getGroups();this.register({$groups:n(n({},i),{},a({},e,t))}),r&&this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:r}),i[e]!==t&&this.reloadFeatureFlags()}else console.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.reloadFeatureFlags()}},{key:"reset",value:function(e){var t=this.get_property("$device_id");this.persistence.clear(),this.persistence.set_user_state("anonymous"),this.sessionManager.resetSessionId();var n=this.get_config("get_device_id")(oe());this.register_once({distinct_id:n,$device_id:e?n:t},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"alias",value:function(e,t){return e===this.get_property(Re)?(D("Attempting to create alias for existing People user - aborting."),-2):(Q(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single($e,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(console.error("alias matches current distinct_id - skipping api call."),this.identify(e),-1))}},{key:"set_config",value:function(e){var t=n({},this.config);z(e)&&(H(this.config,e),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Ee.is_supported()&&"true"===Ee.get("ph_debug")&&(this.config.debug=!0),this.get_config("debug")&&(S.DEBUG=!0),this.sessionRecording&&void 0!==e.disable_session_recording&&t.disable_session_recording!==e.disable_session_recording&&(e.disable_session_recording?this.sessionRecording.stopRecording():this.sessionRecording.startRecordingIfEnabled()))}},{key:"startSessionRecording",value:function(){this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started())}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_config",value:function(e){var t;return null===(t=this.config)||void 0===t?void 0:t[e]}},{key:"get_property",value:function(e){return this.persistence.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.get_config("name"))&&void 0!==e?e:wn;return t!==wn&&(t=wn+"."+t),t}},{key:"_gdpr_init",value:function(){"localStorage"===this.get_config("opt_out_capturing_persistence_type")&&Ee.is_supported()&&(!this.has_opted_in_capturing()&&this.has_opted_in_capturing({persistence_type:"cookie"})&&this.opt_in_capturing({enable_persistence:!1}),!this.has_opted_out_capturing()&&this.has_opted_out_capturing({persistence_type:"cookie"})&&this.opt_out_capturing({clear_persistence:!1}),this.clear_opt_in_out_capturing({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_capturing()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_capturing()||!this.get_config("opt_out_capturing_by_default")&&!Ie.get("ph_optout")||(Ie.remove("ph_optout"),this.opt_out_capturing({clear_persistence:this.get_config("opt_out_persistence_by_default")}))}},{key:"_gdpr_update_persistence",value:function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t)}},{key:"_gdpr_call_func",value:function(e,t){return t=H({capture:this.capture.bind(this),persistence_type:this.get_config("opt_out_capturing_persistence_type"),cookie_prefix:this.get_config("opt_out_capturing_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),secure_cookie:this.get_config("secure_cookie")},t||{}),Ee.is_supported()||"localStorage"!==t.persistence_type||(t.persistence_type="cookie"),e(this.get_config("token"),{capture:t.capture,captureEventName:t.capture_event_name,captureProperties:t.capture_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieExpiration:t.cookie_expiration,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie})}},{key:"opt_in_capturing",value:function(e){e=H({enable_persistence:!0},e||{}),this._gdpr_call_func(Qe,e),this._gdpr_update_persistence(e)}},{key:"opt_out_capturing",value:function(e){var t=H({clear_persistence:!0},e||{});this._gdpr_call_func(Ge,t),this._gdpr_update_persistence(t)}},{key:"has_opted_in_capturing",value:function(e){return this._gdpr_call_func(Je,e)}},{key:"has_opted_out_capturing",value:function(e){return this._gdpr_call_func(Ze,e)}},{key:"clear_opt_in_out_capturing",value:function(e){var t=H({enable_persistence:!0},null!=e?e:{});this._gdpr_call_func(Xe,t),this._gdpr_update_persistence(t)}},{key:"debug",value:function(e){!1===e?(P.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(P.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}},{key:"decodeLZ64",value:function(e){return k.decompressFromBase64(e||null)}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Y(e.prototype[t[n]])}(On,["identify"]);var En={},Pn=(dn=ln.INIT_MODULE,(pn=new On).init=function(e,t,n){if(n)return pn[n]||(pn[n]=En[n]=In(e||"",t||{},n,(function(e){pn[n]=En[n]=e,e._loaded()}))),pn[n];var r=pn;return En[wn]?r=En[wn]:e&&(r=In(e,t||{},wn,(function(e){En[wn]=e,e._loaded()})),En[wn]=r),pn=r,dn===ln.INIT_SNIPPET&&(P[wn]=pn),L(En,(function(e,t){t!==wn&&(pn[t]=e)})),r},pn.init(),function(){function e(){e.done||(e.done=!0,Sn=!1,L(En,(function(e){e._dom_loaded()})))}x.addEventListener&&("complete"===x.readyState?e():x.addEventListener("DOMContentLoaded",e,!1)),ce(P,"load",e,!0)}(),pn);const An={stage:"v1",posthog:{token:"phc_tnQZyAK9BM0WkS5fdAZAxA1bNnyKUlWSACWzmxDfVrA",url:"https://posthog.worldshopping.global",debug:!1,cookieDisabledDomains:["online.euglena.jp"]},release:{dynamoDbTable:"v1PosthogScript"}},xn=["require.js","prototype.js"];function Cn(e){!function(e){const t=document.getElementsByTagName("script");for(const n of t){const t=n.getAttribute("src");Tn(t)&&e.capture("script_conflict_detect",{src:t})}}(e),function(e){const t=new MutationObserver((t=>{t.forEach((t=>{"childList"===t.type&&t.addedNodes.forEach((t=>{if("script"===t.nodeName.toLowerCase()){const n=t.getAttribute("src");Tn(n)&&e.capture("script_conflict_detect",{src:n})}}))}))})),n={childList:!0,attributes:!0,subtree:!0},r=document.querySelector("body"),i=document.querySelector("head");r&&t.observe(r,n),i&&t.observe(i,n)}(e)}function Tn(e){return!!(e&&xn.find((t=>e.includes(t))))}let Rn;e.capture=function(e,t){Rn.capture(e,t)},e.checkConflictScripts=function(){Rn?Cn(Rn):console.warn("ZigzagPosthogScript not initialized")},e.init=function(e,t){Rn=Pn.init(An.posthog.token,{api_host:An.posthog.url,debug:An.posthog.debug,autocapture:!1,capture_pageview:!1,persistence:An.posthog.cookieDisabledDomains.includes(window.location.hostname)?"localStorage":"localStorage+cookie",loaded:void 0,advanced_disable_decide:!0,...null!=t?t:{}},"zigzag"),Rn.register({shop_key:e})},e.initPreConsent=function(e,t){Rn=Pn.init(An.posthog.token,{api_host:An.posthog.url,debug:An.posthog.debug,autocapture:!1,capture_pageview:!1,persistence:"memory",loaded:function(e){e.identify("00000000000000-00000000000000-00000000-000000-00000000000000")},advanced_disable_decide:!0,...null!=t?t:{}},"zigzag"),Rn.register({shop_key:e})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
;
if (typeof ZigzagPosthogScript !== 'undefined') {
  try {
    ZigzagPosthogScript.initPreConsent('store_wacoal_jp');
    ZigzagPosthogScript.checkConflictScripts();
  } catch (error) {
    console.warn('WorldShopping: error when initialize posthog-script ' + (error.message || ''));
  }
}

  const zigzagLoadedEndedAt = new Date().getTime();
  ZigzagPosthogScript.capture('checkout_script_init', {
    first_visit: false,
    trigger: 'timeout',
    duration: (zigzagLoadedEndedAt - window.zigzagLoadingStartedAt) / 1000
  });
  executeScript();
}, deferMilliseconds);

}
}());
