/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 1952:
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {


// EXTERNAL MODULE: ./node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js
var runtime_dom_esm_bundler = __webpack_require__(3751);
// EXTERNAL MODULE: ./node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js
var runtime_core_esm_bundler = __webpack_require__(641);
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=template&id=779f6888

function render(_ctx, _cache, $props, $setup, $data, $options) {
  const _component_Spinner = (0,runtime_core_esm_bundler/* resolveComponent */.g2)("Spinner");
  const _component_router_view = (0,runtime_core_esm_bundler/* resolveComponent */.g2)("router-view");
  return (0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)(runtime_core_esm_bundler/* Fragment */.FK, null, [(0,runtime_core_esm_bundler/* createVNode */.bF)(_component_Spinner), (0,runtime_core_esm_bundler/* createVNode */.bF)(_component_router_view)], 64);
}
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Spinner.vue?vue&type=template&id=2e3dd064

const _hoisted_1 = {
  key: 0,
  class: "nano_loading nano_active"
};
const _hoisted_2 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", null, [/*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", {
  class: "bt-spinner"
})], -1);
const _hoisted_3 = [_hoisted_2];
function Spinnervue_type_template_id_2e3dd064_render(_ctx, _cache, $props, $setup, $data, $options) {
  return _ctx.showSpinner === true ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("div", _hoisted_1, _hoisted_3)) : (0,runtime_core_esm_bundler/* createCommentVNode */.Q3)("", true);
}
;// ./src/components/Spinner.vue?vue&type=template&id=2e3dd064

// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm-bundler.js + 4 modules
var vuex_esm_bundler = __webpack_require__(3543);
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Spinner.vue?vue&type=script&lang=js

/* harmony default export */ var Spinnervue_type_script_lang_js = ({
  computed: (0,vuex_esm_bundler/* mapState */.aH)(["showSpinner"])
});
;// ./src/components/Spinner.vue?vue&type=script&lang=js
 
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/components/Spinner.vue?vue&type=style&index=0&id=2e3dd064&lang=css
// extracted by mini-css-extract-plugin

;// ./src/components/Spinner.vue?vue&type=style&index=0&id=2e3dd064&lang=css

// EXTERNAL MODULE: ./node_modules/vue-loader/dist/exportHelper.js
var exportHelper = __webpack_require__(6262);
;// ./src/components/Spinner.vue




;


const __exports__ = /*#__PURE__*/(0,exportHelper/* default */.A)(Spinnervue_type_script_lang_js, [['render',Spinnervue_type_template_id_2e3dd064_render]])

/* harmony default export */ var Spinner = (__exports__);
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=script&lang=js


/* harmony default export */ var Appvue_type_script_lang_js = ({
  computed: (0,vuex_esm_bundler/* mapState */.aH)(["showSpinner"]),
  components: {
    Spinner: Spinner
  },
  methods: {
    ...(0,vuex_esm_bundler/* mapMutations */.PY)(["setErrors"])
  }
});
;// ./src/App.vue?vue&type=script&lang=js
 
;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/App.vue?vue&type=style&index=0&id=779f6888&lang=css
// extracted by mini-css-extract-plugin

;// ./src/App.vue?vue&type=style&index=0&id=779f6888&lang=css

;// ./src/App.vue




;


const App_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(Appvue_type_script_lang_js, [['render',render]])

/* harmony default export */ var App = (App_exports_);
// EXTERNAL MODULE: ./node_modules/vue-router/dist/vue-router.esm-bundler.js
var vue_router_esm_bundler = __webpack_require__(6166);
// EXTERNAL MODULE: ./node_modules/@vue/shared/dist/shared.esm-bundler.js
var shared_esm_bundler = __webpack_require__(33);
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/views/ConnectToWooCommerce.vue?vue&type=template&id=48be1038

const ConnectToWooCommercevue_type_template_id_48be1038_hoisted_1 = {
  style: {
    "padding": "20px",
    "max-width": "700px",
    "margin": "16px 20px",
    "background-color": "#fff",
    "border-radius": "10px"
  }
};
const ConnectToWooCommercevue_type_template_id_48be1038_hoisted_2 = {
  key: 0,
  style: {
    "background-color": "#fef2f2",
    "border": "1px solid #fca5a5",
    "border-radius": "8px",
    "padding": "16px 20px",
    "margin": "0 0 20px",
    "display": "flex",
    "align-items": "flex-start",
    "gap": "10px"
  }
};
const ConnectToWooCommercevue_type_template_id_48be1038_hoisted_3 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("span", {
  style: {
    "font-size": "20px"
  }
}, "⚠️", -1);
const _hoisted_4 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", {
  style: {
    "font-size": "14px",
    "color": "#991b1b",
    "line-height": "1.5"
  }
}, [/*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("strong", null, "Connection error"), /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("br"), /*#__PURE__*/(0,runtime_core_esm_bundler/* createTextVNode */.eW)(" We were unable to verify your API keys. Please contact our support team at "), /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("a", {
  href: "mailto:support@ship-safely.com",
  style: {
    "color": "#337ab7",
    "font-weight": "600"
  }
}, "support@ship-safely.com"), /*#__PURE__*/(0,runtime_core_esm_bundler/* createTextVNode */.eW)(" for assistance. ")], -1);
const _hoisted_5 = [ConnectToWooCommercevue_type_template_id_48be1038_hoisted_3, _hoisted_4];
const _hoisted_6 = ["src"];
const _hoisted_7 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", {
  style: {
    "clear": "both",
    "float": "none"
  }
}, " ", -1);
const _hoisted_8 = {
  key: 1
};
const _hoisted_9 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createStaticVNode */.Fv)("<div style=\"background-color:#f0fdf4;border:1px solid #86efac;border-radius:12px;padding:10px;margin:20px 0 0;\"><div style=\"padding:20px;border-radius:10px;margin-bottom:20px;\"><h3 style=\"margin:0 0 8px 0;font-size:20px;\">✓ You&#39;re All Set!</h3><p style=\"margin:0;font-size:15px;\">Your Ship-Safely integration is fully configured and ready to go.</p></div></div><p> Thank you for installing Ship-Safely. Giving you a peace of mind by empowering your customers with access to buyer protection that covers items Damaged, Lost or Stolen throughout the shipping process. </p><p>Your store can now offer shipping insurance to customers. Use the button below to access your Ship-Safely portal where you can:</p><ul style=\"padding:18px;border-radius:8px;margin:15px 0;\"><li>View your transactions and invoices</li><li>Track your commission earnings</li><li>Manage your account settings</li><li>Access support and resources</li></ul>", 4);
const _hoisted_13 = {
  style: {
    "margin-top": "25px"
  }
};
const _hoisted_14 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("p", null, [/*#__PURE__*/(0,runtime_core_esm_bundler/* createTextVNode */.eW)(" Please contact us at "), /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("a", {
  href: "mailto:support@ship-safely.com",
  style: {
    "color": "#337ab7"
  }
}, "support@ship-safely.com"), /*#__PURE__*/(0,runtime_core_esm_bundler/* createTextVNode */.eW)(" if you have any questions. Learn more on our website "), /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("a", {
  href: "https://ship-safely.com"
}, "here"), /*#__PURE__*/(0,runtime_core_esm_bundler/* createTextVNode */.eW)(". ")], -1);
const _hoisted_15 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("br", null, null, -1);
const _hoisted_16 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("p", null, " Thank you for installing Ship-Safely, please go through the three easy steps below before you can start offering our insurance. ", -1);
const _hoisted_17 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("h3", {
  style: {
    "font-weight": "bold",
    "font-size": "1.2em"
  }
}, "Let's get you set-up.", -1);
const _hoisted_18 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("br", null, null, -1);
const _hoisted_19 = {
  style: {
    "display": "flex",
    "justify-content": "space-between",
    "flex-wrap": "wrap",
    "align-items": "flex-start",
    "margin": "40px 0 0"
  }
};
const _hoisted_20 = {
  key: 0,
  style: {
    "margin": "0",
    "font-size": "18px",
    "line-height": "1.2em",
    "padding": "0"
  }
};
const _hoisted_21 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("h3", {
  style: {
    "margin": "0 0 5px",
    "font-size": "18px",
    "line-height": "1.2em",
    "padding": "0"
  }
}, "First step.", -1);
const _hoisted_22 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("p", {
  style: {
    "font-size": "0.9em"
  }
}, "Let's connect your shop to our ecosystem so we can create policies.", -1);
const _hoisted_23 = {
  key: 2,
  style: {
    "display": "flex",
    "flex-direction": "row",
    "align-items": "center"
  }
};
const _hoisted_24 = {
  key: 0,
  style: {
    "margin": "0",
    "font-size": "18px",
    "line-height": "1.2em",
    "padding": "0"
  }
};
const _hoisted_25 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("h3", {
  style: {
    "margin": "0 0 5px",
    "font-size": "18px",
    "line-height": "1.2em",
    "padding": "0"
  }
}, "Second step.", -1);
const _hoisted_26 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("p", {
  style: {
    "font-size": "0.9em"
  }
}, "Get our insurance product configured in your shop.", -1);
const _hoisted_27 = {
  key: 2,
  style: {
    "display": "flex",
    "flex-direction": "row",
    "align-items": "center"
  }
};
const _hoisted_28 = {
  key: 0,
  style: {
    "margin": "0",
    "font-size": "18px",
    "line-height": "1.2em",
    "padding": "0"
  }
};
const _hoisted_29 = /*#__PURE__*/(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("h3", {
  style: {
    "margin": "0 0 5px",
    "font-size": "18px",
    "line-height": "1.2em",
    "padding": "0"
  }
}, "Last step.", -1);
const _hoisted_30 = {
  key: 0,
  style: {
    "font-size": "0.9em",
    "color": "#dc3545"
  }
};
const _hoisted_31 = {
  key: 1,
  style: {
    "font-size": "0.9em"
  }
};
const _hoisted_32 = {
  style: {
    "display": "flex",
    "flex-direction": "row",
    "align-items": "center"
  }
};
function ConnectToWooCommercevue_type_template_id_48be1038_render(_ctx, _cache, $props, $setup, $data, $options) {
  return (0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("div", ConnectToWooCommercevue_type_template_id_48be1038_hoisted_1, [_ctx.contactSupport ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("div", ConnectToWooCommercevue_type_template_id_48be1038_hoisted_2, _hoisted_5)) : (0,runtime_core_esm_bundler/* createCommentVNode */.Q3)("", true), (0,runtime_core_esm_bundler/* createElementVNode */.Lk)("img", {
    src: $data.logoUrl,
    style: {
      "width": "100%",
      "max-width": "320px",
      "display": "block",
      "margin": "0 0 20px"
    }
  }, null, 8, _hoisted_6), _hoisted_7, $options.isAllSetup ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("div", _hoisted_8, [_hoisted_9, (0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", _hoisted_13, [(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("a", {
    onClick: _cache[0] || (_cache[0] = (...args) => $options.gotoLogin && $options.gotoLogin(...args)),
    style: {
      "cursor": "pointer",
      "background-color": "#ffd812",
      "color": "#111111",
      "border": "none",
      "margin": "0",
      "display": "inline-block",
      "line-height": "22px",
      "font-weight": "600",
      "font-size": "16px",
      "text-align": "center",
      "text-decoration": "none",
      "padding": "12px 32px",
      "border-radius": "6px",
      "font-family": "sans-serif"
    }
  }, " Access Ship-Safely Portal → ")]), _hoisted_14, _hoisted_15])) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)(runtime_core_esm_bundler/* Fragment */.FK, {
    key: 2
  }, [_hoisted_16, _hoisted_17, _hoisted_18, (0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", _hoisted_19, [(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", {
    style: (0,shared_esm_bundler/* normalizeStyle */.Tr)([{
      "width": "100%",
      "border-radius": "15px",
      "padding": "20px",
      "margin": "0 0 4%"
    }, $data.hasAuth ? 'background: #f0fdf4; border: 1px solid #86efac;' : 'background: rgba(0,0,0,0.05);'])
  }, [$data.hasAuth ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("h3", _hoisted_20, "✅ Your shop is connected.")) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)(runtime_core_esm_bundler/* Fragment */.FK, {
    key: 1
  }, [_hoisted_21, _hoisted_22], 64)), !$data.hasAuth ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("div", _hoisted_23, [(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("a", {
    onClick: _cache[1] || (_cache[1] = (...args) => $options.onGetPermission && $options.onGetPermission(...args)),
    style: {
      "cursor": "pointer",
      "background-color": "#ffd812",
      "color": "#111111",
      "border-color": "#ffd812",
      "margin": "5px 30px 5px 0",
      "display": "inline-block",
      "line-height": "22px",
      "font-weight": "600",
      "font-size": "15px",
      "text-align": "center",
      "text-decoration": "none",
      "padding": "8px 28px",
      "border-radius": "4px",
      "border-style": "solid",
      "border-width": "2px",
      "font-family": "sans-serif"
    }
  }, " Give us permission → ")])) : (0,runtime_core_esm_bundler/* createCommentVNode */.Q3)("", true)], 4), (0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", {
    style: (0,shared_esm_bundler/* normalizeStyle */.Tr)([{
      "width": "100%",
      "border-radius": "15px",
      "padding": "20px",
      "margin": "0 0 4%"
    }, $data.hasInsuranceProduct ? 'background: #f0fdf4; border: 1px solid #86efac;' : 'background: rgba(0,0,0,0.05);'])
  }, [$data.hasInsuranceProduct ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("h3", _hoisted_24, "✅ Insurance product is configured. ")) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)(runtime_core_esm_bundler/* Fragment */.FK, {
    key: 1
  }, [_hoisted_25, _hoisted_26], 64)), !$data.hasInsuranceProduct ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("div", _hoisted_27, [(0,runtime_core_esm_bundler/* createElementVNode */.Lk)("a", {
    onClick: _cache[2] || (_cache[2] = (...args) => $options.onConnectToUs && $options.onConnectToUs(...args)),
    style: {
      "cursor": "pointer",
      "background-color": "#ffd812",
      "color": "#111111",
      "border-color": "#ffd812",
      "margin": "5px 30px 5px 0",
      "display": "inline-block",
      "line-height": "22px",
      "font-weight": "600",
      "font-size": "15px",
      "text-align": "center",
      "text-decoration": "none",
      "padding": "8px 28px",
      "border-radius": "4px",
      "border-style": "solid",
      "border-width": "2px",
      "font-family": "sans-serif"
    }
  }, " Set up products → ")])) : (0,runtime_core_esm_bundler/* createCommentVNode */.Q3)("", true)], 4), (0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", {
    style: (0,shared_esm_bundler/* normalizeStyle */.Tr)([{
      "width": "100%",
      "border-radius": "15px",
      "padding": "20px",
      "margin": "0 0 4%"
    }, $options.isValidAccount ? 'background: #f0fdf4; border: 1px solid #86efac;' : 'background: rgba(0,0,0,0.05);'])
  }, [$options.isValidAccount ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("h3", _hoisted_28, "✅ Your account is verified.")) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)(runtime_core_esm_bundler/* Fragment */.FK, {
    key: 1
  }, [_hoisted_29, _ctx.accountStatus && _ctx.accountStatus.hasAccount && _ctx.accountStatus.hasCreditCard === false ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("p", _hoisted_30, " You are missing a payment method in your Ship-Safely vendor account. ")) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("p", _hoisted_31, "Create an account with us so we can track policies (and give you commissions for each policy sold)."))], 64)), (0,runtime_core_esm_bundler/* createElementVNode */.Lk)("div", _hoisted_32, [$options.isValidAccount ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("a", {
    key: 0,
    onClick: _cache[3] || (_cache[3] = (...args) => $options.gotoLogin && $options.gotoLogin(...args)),
    style: {
      "cursor": "pointer",
      "background-color": "#ffd812",
      "color": "#111111",
      "border-color": "#ffd812",
      "margin": "15px 30px 5px 0",
      "display": "inline-block",
      "line-height": "22px",
      "font-weight": "600",
      "font-size": "15px",
      "text-align": "center",
      "text-decoration": "none",
      "padding": "8px 28px",
      "border-radius": "4px",
      "border-style": "solid",
      "border-width": "2px",
      "font-family": "sans-serif"
    }
  }, " Log in to Dashboard → ")) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)(runtime_core_esm_bundler/* Fragment */.FK, {
    key: 1
  }, [_ctx.accountStatus && !_ctx.accountStatus.hasAccount ? ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("a", {
    key: 0,
    onClick: _cache[4] || (_cache[4] = (...args) => $options.gotoDashBoard && $options.gotoDashBoard(...args)),
    style: {
      "cursor": "pointer",
      "background-color": "#ffd812",
      "color": "#111111",
      "border-color": "#ffd812",
      "margin": "5px 30px 5px 0",
      "display": "inline-block",
      "line-height": "22px",
      "font-weight": "600",
      "font-size": "15px",
      "text-align": "center",
      "text-decoration": "none",
      "padding": "8px 28px",
      "border-radius": "4px",
      "border-style": "solid",
      "border-width": "2px",
      "font-family": "sans-serif"
    }
  }, " Sort my Ship-Safely account → ")) : ((0,runtime_core_esm_bundler/* openBlock */.uX)(), (0,runtime_core_esm_bundler/* createElementBlock */.CE)("a", {
    key: 1,
    onClick: _cache[5] || (_cache[5] = (...args) => $options.gotoLogin && $options.gotoLogin(...args)),
    style: {
      "cursor": "pointer",
      "background-color": "#ffd812",
      "color": "#111111",
      "border-color": "#ffd812",
      "margin": "5px 30px 5px 0",
      "display": "inline-block",
      "line-height": "22px",
      "font-weight": "600",
      "font-size": "15px",
      "text-align": "center",
      "text-decoration": "none",
      "padding": "8px 28px",
      "border-radius": "4px",
      "border-style": "solid",
      "border-width": "2px",
      "font-family": "sans-serif"
    }
  }, " Login to my Ship-Safely account → "))], 64))])], 4)])], 64))]);
}
;// ./src/views/ConnectToWooCommerce.vue?vue&type=template&id=48be1038

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
var es_iterator_constructor = __webpack_require__(8111);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
var es_iterator_filter = __webpack_require__(2489);
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./src/views/ConnectToWooCommerce.vue?vue&type=script&lang=js


// @ is an alias to /src

/* harmony default export */ var ConnectToWooCommercevue_type_script_lang_js = ({
  components: {},
  computed: {
    ...(0,vuex_esm_bundler/* mapState */.aH)(["accountStatus", "contactSupport"]),
    isValidAccount() {
      if (this.$store.state.accountStatus === null) {
        return null;
      }
      let res = Object.keys(this.$store.state.accountStatus).filter(key => {
        return !this.$store.state.accountStatus[key];
      });
      return res.length <= 0;
    },
    isAllSetup() {
      return this.hasAuth && this.hasInsuranceProduct && this.isValidAccount;
    }
  },
  data() {
    return {
      authSuccess: null,
      showWarning: false,
      hasAuth: null,
      storeMode: null,
      hasInsuranceProduct: null,
      logoUrl: null,
      authUrl: null,
      loginUrl: null,
      APIToken: null
    };
  },
  methods: {
    ...(0,vuex_esm_bundler/* mapActions */.i0)(["checkConsumerKey", "checkProduct", "createProduct", "checkAccount"]),
    async testAuth() {
      this.hasAuth = await this.checkConsumerKey();
    },
    async testInsuranceProduct() {
      this.hasInsuranceProduct = await this.checkProduct();
    },
    async testAccound() {
      await this.checkAccount();
    },
    async onGetPermission() {
      window.location.href = this.authUrl;
    },
    async onConnectToUs() {
      await this.createProduct();
      await this.testInsuranceProduct();
    },
    isDevMode() {
      return this.storeMode === "dev";
    },
    gotoLogin() {
      window.open(`${this.loginUrl}/v3/login`, "_blank").focus();
    },
    gotoDashBoard() {
      window.open(`${this.loginUrl}/v3/register?platform=WooCommerce&context=${encodeURIComponent(window.location.hostname)}&token=${encodeURIComponent(this.APIToken)}`, "_blank").focus();
    }
  },
  async mounted() {
    await this.testAuth();
    await this.testInsuranceProduct();
    await this.testAccound();
    const current_url = window.location.href;
    const store_url = window.url.context;
    const host = window.location.hostname;
    const callback_url = window.url.callback;
    const token = window.credential.token;
    this.APIToken = token;
    this.loginUrl = callback_url;
    this.logoUrl = window.url.plugin + "/ship-safely/admin/dist/logo-full-c.svg";
    this.authUrl = `${store_url}/wc-auth/v1/authorize?app_name=${encodeURIComponent("Ship-Safely Shipping Protection")}&scope=read_write&user_id=${host}&return_url=${encodeURIComponent(`${current_url}`)}&callback_url=${encodeURIComponent(`${callback_url}/v3/auth?store=${store_url}&context=${host}&token=${token}`)}`;
  }
});
;// ./src/views/ConnectToWooCommerce.vue?vue&type=script&lang=js
 
;// ./src/views/ConnectToWooCommerce.vue




;
const ConnectToWooCommerce_exports_ = /*#__PURE__*/(0,exportHelper/* default */.A)(ConnectToWooCommercevue_type_script_lang_js, [['render',ConnectToWooCommercevue_type_template_id_48be1038_render]])

/* harmony default export */ var ConnectToWooCommerce = (ConnectToWooCommerce_exports_);
;// ./src/router/index.js


const routes = [{
  path: "/",
  name: "authentication",
  component: ConnectToWooCommerce
}, {
  path: "/:pathMatch(.*)*",
  redirect: "/"
}];
const router = (0,vue_router_esm_bundler/* createRouter */.aE)({
  history: (0,vue_router_esm_bundler/* createWebHashHistory */.Bt)(),
  routes
});
/* harmony default export */ var src_router = (router);
// EXTERNAL MODULE: ./node_modules/axios/lib/axios.js + 48 modules
var axios = __webpack_require__(4335);
;// ./src/store/index.js


let API = axios/* default */.A.create({
  baseURL: window.url.API
});
API.defaults.headers.common["Content-Type"] = "application/json";
API.defaults.headers.common["Authorization"] = "Bearer " + window.credential.token;
API.defaults.headers.common["ngrok-skip-browser-warning"] = "true";
if (false) // removed by dead control flow
{}

/* ── 403 interceptor: delete stale keys, refresh token, retry once ── */
API.interceptors.response.use(response => response, async error => {
  const originalRequest = error.config;
  if (error.response && error.response.status === 403 && !originalRequest._retried) {
    originalRequest._retried = true;
    try {
      const res = await fetch(window.url.context + "/wp-json/shipsafely/v1/auth/refresh", {
        method: "POST",
        credentials: "same-origin",
        headers: {
          "X-WP-Nonce": window.credential.nonce,
          "Content-Type": "application/json"
        }
      });
      if (res.ok) {
        const data = await res.json();
        if (data.success && data.token) {
          API.defaults.headers.common["Authorization"] = "Bearer " + data.token;
          originalRequest.headers["Authorization"] = "Bearer " + data.token;
          return API.request(originalRequest);
        }
      }
    } catch (refreshError) {
      console.log("Token refresh failed", refreshError);
    }
  }
  return Promise.reject(error);
});
/* harmony default export */ var store = ((0,vuex_esm_bundler/* createStore */.y$)({
  state() {
    return {
      isShowSpinner: false,
      accountStatus: null,
      storeMode: "prod",
      testingUrl: null,
      contactSupport: false
    };
  },
  mutations: {
    showSpinner(state, {
      show = true
    }) {
      state.showSpinner = show;
    },
    setAccountStatus(state, {
      status
    }) {
      state.accountStatus = status;
    },
    setAppMode(state, {
      mode = "prod"
    }) {
      state.storeMode = mode;
    },
    setContactSupport(state, value) {
      state.contactSupport = value;
    },
    setTestingUrl(state, {
      url = null
    }) {
      if (url) {
        window.url.API = url + '/api';
        API.defaults.baseURL = window.url.API;
        window.url.callback = url;
        state.testingUrl = url;
      }
    }
  },
  actions: {
    async checkAccount({
      commit
    }) {
      try {
        commit("showSpinner", {
          show: true
        });
        commit("setAccountStatus", {
          status: null
        });
        let res = await API.post("/v3/diagnosis/account", {
          context: window.location.hostname
        });
        if (res && res.data) {
          commit("setAccountStatus", {
            status: res.data
          });
          if (res.data.hasAccount && res.data.hasCreditCard) {
            return true;
          }
        }
        return false;
      } catch (e) {
        console.log(e);
        if (e.response && e.response.status === 403) {
          commit("setContactSupport", true);
        }
      } finally {
        commit("showSpinner", {
          show: false
        });
      }
    },
    async checkConsumerKey({
      commit
    }) {
      try {
        commit("showSpinner", {
          show: true
        });
        let res = await API.post("/v3/diagnosis/key", {
          context: window.location.hostname
        });
        if (res && res.data && res.data.connected) {
          return true;
        }
        return false;
      } catch (e) {
        console.log(e);
        if (e.response && e.response.status === 403) {
          commit("setContactSupport", true);
        }
      } finally {
        commit("showSpinner", {
          show: false
        });
      }
    },
    async checkProduct({
      commit
    }) {
      try {
        commit("showSpinner", {
          show: true
        });
        let res = await API.post("/v3/diagnosis/product", {
          context: window.location.hostname
        });
        if (res && res.data && res.data.hasValidNanoInsurance === true) {
          return true;
        }
        return false;
      } catch (e) {
        console.log(e);
        if (e.response && e.response.status === 403) {
          commit("setContactSupport", true);
        }
      } finally {
        commit("showSpinner", {
          show: false
        });
      }
    },
    async createProduct({
      commit
    }) {
      try {
        commit("showSpinner", {
          show: true
        });
        let res = await API.post("/v3/insurance", {
          context: window.location.hostname,
          plginUrl: window.url.plugin
        });
        if (res && res.data && res.data.connected) {
          return true;
        }
        return false;
      } catch (e) {
        console.log(e);
      } finally {
        commit("showSpinner", {
          show: false
        });
      }
    }
  },
  modules: {}
}));
;// ./src/main.js




document.addEventListener("DOMContentLoaded", () => {
  if (!window.nanoInstance) {
    window.nanoInstance = (0,runtime_dom_esm_bundler/* createApp */.Ef)(App).use(store).use(src_router).mount("#app");
  }
});

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = __webpack_modules__;
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/chunk loaded */
/******/ 	!function() {
/******/ 		var deferred = [];
/******/ 		__webpack_require__.O = function(result, chunkIds, fn, priority) {
/******/ 			if(chunkIds) {
/******/ 				priority = priority || 0;
/******/ 				for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];
/******/ 				deferred[i] = [chunkIds, fn, priority];
/******/ 				return;
/******/ 			}
/******/ 			var notFulfilled = Infinity;
/******/ 			for (var i = 0; i < deferred.length; i++) {
/******/ 				var chunkIds = deferred[i][0];
/******/ 				var fn = deferred[i][1];
/******/ 				var priority = deferred[i][2];
/******/ 				var fulfilled = true;
/******/ 				for (var j = 0; j < chunkIds.length; j++) {
/******/ 					if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {
/******/ 						chunkIds.splice(j--, 1);
/******/ 					} else {
/******/ 						fulfilled = false;
/******/ 						if(priority < notFulfilled) notFulfilled = priority;
/******/ 					}
/******/ 				}
/******/ 				if(fulfilled) {
/******/ 					deferred.splice(i--, 1)
/******/ 					var r = fn();
/******/ 					if (r !== undefined) result = r;
/******/ 				}
/******/ 			}
/******/ 			return result;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/global */
/******/ 	!function() {
/******/ 		__webpack_require__.g = (function() {
/******/ 			if (typeof globalThis === 'object') return globalThis;
/******/ 			try {
/******/ 				return this || new Function('return this')();
/******/ 			} catch (e) {
/******/ 				if (typeof window === 'object') return window;
/******/ 			}
/******/ 		})();
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/jsonp chunk loading */
/******/ 	!function() {
/******/ 		// no baseURI
/******/ 		
/******/ 		// object to store loaded and loading chunks
/******/ 		// undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ 		// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ 		var installedChunks = {
/******/ 			524: 0
/******/ 		};
/******/ 		
/******/ 		// no chunk on demand loading
/******/ 		
/******/ 		// no prefetching
/******/ 		
/******/ 		// no preloaded
/******/ 		
/******/ 		// no HMR
/******/ 		
/******/ 		// no HMR manifest
/******/ 		
/******/ 		__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };
/******/ 		
/******/ 		// install a JSONP callback for chunk loading
/******/ 		var webpackJsonpCallback = function(parentChunkLoadingFunction, data) {
/******/ 			var chunkIds = data[0];
/******/ 			var moreModules = data[1];
/******/ 			var runtime = data[2];
/******/ 			// add "moreModules" to the modules object,
/******/ 			// then flag all "chunkIds" as loaded and fire callback
/******/ 			var moduleId, chunkId, i = 0;
/******/ 			if(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {
/******/ 				for(moduleId in moreModules) {
/******/ 					if(__webpack_require__.o(moreModules, moduleId)) {
/******/ 						__webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ 					}
/******/ 				}
/******/ 				if(runtime) var result = runtime(__webpack_require__);
/******/ 			}
/******/ 			if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ 			for(;i < chunkIds.length; i++) {
/******/ 				chunkId = chunkIds[i];
/******/ 				if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ 					installedChunks[chunkId][0]();
/******/ 				}
/******/ 				installedChunks[chunkId] = 0;
/******/ 			}
/******/ 			return __webpack_require__.O(result);
/******/ 		}
/******/ 		
/******/ 		var chunkLoadingGlobal = self["webpackChunkvue"] = self["webpackChunkvue"] || [];
/******/ 		chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ 		chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ 	}();
/******/ 	
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module depends on other loaded chunks and execution need to be delayed
/******/ 	var __webpack_exports__ = __webpack_require__.O(undefined, [504], function() { return __webpack_require__(1952); })
/******/ 	__webpack_exports__ = __webpack_require__.O(__webpack_exports__);
/******/ 	
/******/ })()
;