@billgangcom/theme-lib 1.120.4 → 1.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{builder-B7zcAFlP.js → builder-CULKvuzI.js} +5 -5
- package/dist/{builder-D-_y0UZo.cjs → builder-GUSC-VqG.cjs} +2 -2
- package/dist/{builder-components-DTblcA5b.js → builder-components-Bh7Wzulo.js} +4 -4
- package/dist/{builder-components-BINsMpjv.cjs → builder-components-DD74FeFy.cjs} +1 -1
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +239 -217
- package/dist/{charge-DFWqP484.cjs → charge--UEFO_yq.cjs} +39 -39
- package/dist/{charge-D_2QP2MU.js → charge-D2D0KO0N.js} +5662 -5570
- package/dist/{checkout-BFUUel8K.cjs → checkout-BPim1kWl.cjs} +1 -1
- package/dist/{checkout-CW4kk1A2.js → checkout-DmVjQ7qL.js} +5 -5
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-CQMyE7Wb.js → index-BGcK4oXQ.js} +5 -5
- package/dist/{index-BiNYeUmn.js → index-BSv52ixn.js} +1 -1
- package/dist/index-Co6SbqR4.cjs +1 -0
- package/dist/{index-CMzqaOZI.js → index-CqJBTbYk.js} +5 -5
- package/dist/{index-DOsbUE9W.js → index-CspqOvt6.js} +5 -5
- package/dist/{index-DScxpPuH.cjs → index-CyjdClPE.cjs} +1 -1
- package/dist/{index-DI14JIuH.cjs → index-D3tHDwlB.cjs} +1 -1
- package/dist/{index-CyrZrBYf.cjs → index-DJeUikc5.cjs} +1 -1
- package/dist/{index-Dcc_1V35.cjs → index-DVRVUkVq.cjs} +1 -1
- package/dist/{index-BUpWXhdd.js → index-DhlWg3_R.js} +5 -5
- package/dist/index-DmmQUpBX.js +45 -0
- package/dist/{index-XUyDh3Pa.cjs → index-kAYyWOg3.cjs} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/order-5WoovJR7.js +294 -0
- package/dist/order-BF9gce6B.cjs +1 -0
- package/dist/src/components/lazy-pages.d.ts +2 -1
- package/dist/src/pages/terms/index.d.ts +2 -0
- package/dist/src/storefront/models/checkout.d.ts +5 -0
- package/dist/src/storefront/models/order.d.ts +3 -0
- package/dist/style.css +1 -1
- package/dist/{subscription-BbMSdNBC.js → subscription-CgYzqQq4.js} +5 -5
- package/dist/{subscription-BqANqkMh.cjs → subscription-DTxohDSL.cjs} +1 -1
- package/dist/{ticket-ClWCwOa2.js → ticket-BjAWQBHH.js} +5 -5
- package/dist/{ticket-DZLQHt1e.cjs → ticket-DwzKY7OF.cjs} +1 -1
- package/dist/{top-up-YIsioJgU.js → top-up-C-TbJas2.js} +5 -5
- package/dist/{top-up-CRprLre3.cjs → top-up-jTGvS5Wv.cjs} +1 -1
- package/dist/ui-components-B0NcrAD7.cjs +1 -0
- package/dist/{ui-components-B9RxvEbc.js → ui-components-BKXG7k9L.js} +6 -5
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-BRWhHglL.js → validation-BDVKIwl1.js} +5 -5
- package/dist/{validation-CbLHhgF-.cjs → validation-BS6RZGb8.cjs} +1 -1
- package/package.json +1 -1
- package/dist/order-Ctzxqbbs.cjs +0 -1
- package/dist/order-x-Rke14d.js +0 -277
- package/dist/ui-components-CAVkeo8V.cjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("./charge--UEFO_yq.cjs"),u=require("./builder-GUSC-VqG.cjs"),l=require("react"),_=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");require("./ticket-DwzKY7OF.cjs");const b="_checkoutContainer_thje1_1",S="_loaderContainer_thje1_20",s={checkoutContainer:b,loaderContainer:S},D=()=>{const{isAntistock:r}=u.useGeneralStore(),{cart:t,products:c,pending:d,getTotalAndDiscount:C,getPossibleGateways:h,submitCart:p,setGateway:m,applyCoupon:g,setDiscordSocialConnectId:j,setCustomFields:k,applyCouponPending:y,coupon:i,removeCoupon:q,getDiscordSettings:v,setPaymentMethod:x,reset:f}=n.useCart(),a=l.useMemo(()=>C(),[i,t]),o=u.useNavigate();return l.useEffect(()=>{if(t.parts.length===0){if(r){o("/");return}try{o(-1)}catch{o("/")}}},[t.parts]),d?e.jsx("div",{className:s.checkoutContainer,children:e.jsx("div",{className:s.loaderContainer,children:e.jsx(_.Loader,{})})}):e.jsxs("div",{className:s.checkoutContainer,children:[e.jsx(n.CheckoutItems,{cart:t,products:c,applyCoupon:g,applyCouponPending:y,coupon:i,removeCoupon:q,totalAndDiscount:a}),e.jsx(n.CheckoutOperational,{cart:t,getPossibleGateways:h,setGateway:m,getDiscordSettings:v,products:c,submitCart:p,totalAndDiscount:a,setCustomFieldsToCart:k,setDiscordSocialConnectId:j,setPaymentMethod:x,reset:f,isAntistock:r})]})};exports.Checkout=D;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as e, jsxs as j } from "react/jsx-runtime";
|
|
2
|
-
import { u as D, C as N, a as x } from "./charge-
|
|
3
|
-
import { K as A, p as G } from "./builder-
|
|
2
|
+
import { u as D, C as N, a as x } from "./charge-D2D0KO0N.js";
|
|
3
|
+
import { K as A, p as G } from "./builder-CULKvuzI.js";
|
|
4
4
|
import c from "react";
|
|
5
|
-
import { e as P } from "./ui-components-
|
|
6
|
-
import "./builder-components-
|
|
5
|
+
import { e as P } from "./ui-components-BKXG7k9L.js";
|
|
6
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
7
7
|
import "react-dom";
|
|
8
|
-
import "./ticket-
|
|
8
|
+
import "./ticket-BjAWQBHH.js";
|
|
9
9
|
const S = "_checkoutContainer_thje1_1", b = "_loaderContainer_thje1_20", s = {
|
|
10
10
|
checkoutContainer: S,
|
|
11
11
|
loaderContainer: b
|
package/dist/exports.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const o=require("./builder-GUSC-VqG.cjs"),a=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");const t=require("./charge--UEFO_yq.cjs"),e=require("./ticket-DwzKY7OF.cjs"),r=require("./checkout-BPim1kWl.cjs");require("react-dom");exports.AntistockRoutes=o.AntistockRoutes;exports.Routes=o.Routes;exports.formatPrice=o.formatPrice;exports.ImagesLoader=a.ImagesLoader;exports.MarkdownText=t.MarkdownText;exports.ReCaptchaProvider=t.ReCaptchaProvider;exports.parseDraftJsText=t.parseDraftJsText;exports.useCart=t.useCart;exports.useGeneralInfo=t.useGeneralInfo;exports.useMarkdownIt=t.useMarkdownIt;exports.useReCaptcha=t.useReCaptcha;exports.ColorVariables=e.ColorVariables;exports.aspectRatioOptions=e.aspectRatioOptions;exports.hotReload=e.hotReload;exports.iconNames=e.iconNames;exports.removeNotification=e.removeNotification;exports.showNotification=e.showNotification;exports.splitTextIntoSpans=e.splitTextIntoSpans;exports.useAdaptiveStyles=e.useAdaptiveStyles;exports.useBalance=e.useBalance;exports.useBuilderPages=e.useBuilderPages;exports.useCreateTicket=e.useCreateTicket;exports.Checkout=r.Checkout;
|
package/dist/exports.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { Y as i, Z as p, _ as u } from "./builder-
|
|
4
|
-
import { k as c } from "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
6
|
-
import { M as f, G as d, J as l, u as x, I as C, K as h, H as k } from "./charge-
|
|
7
|
-
import { C as I, c as T, h as v, i as w, r as M, d as N, s as P, u as b, e as g, b as A, a as B } from "./ticket-
|
|
8
|
-
import { Checkout as J } from "./checkout-
|
|
3
|
+
import { Y as i, Z as p, _ as u } from "./builder-CULKvuzI.js";
|
|
4
|
+
import { k as c } from "./ui-components-BKXG7k9L.js";
|
|
5
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
6
|
+
import { M as f, G as d, J as l, u as x, I as C, K as h, H as k } from "./charge-D2D0KO0N.js";
|
|
7
|
+
import { C as I, c as T, h as v, i as w, r as M, d as N, s as P, u as b, e as g, b as A, a as B } from "./ticket-BjAWQBHH.js";
|
|
8
|
+
import { Checkout as J } from "./checkout-DmVjQ7qL.js";
|
|
9
9
|
import "react-dom";
|
|
10
10
|
export {
|
|
11
11
|
i as AntistockRoutes,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as o, jsxs as N, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import r from "react";
|
|
3
|
-
import { Z as z, a1 as U } from "./charge-
|
|
4
|
-
import { N as f, O as T, ac as F, p as G, a7 as R, e as H, Q as V, m as q, a as B, u as K, K as M, b as Q, am as X, ah as Y } from "./builder-
|
|
5
|
-
import { g as Z } from "./ticket-
|
|
6
|
-
import { e as $, N as ee, x as te } from "./ui-components-
|
|
7
|
-
import "./builder-components-
|
|
3
|
+
import { Z as z, a1 as U } from "./charge-D2D0KO0N.js";
|
|
4
|
+
import { N as f, O as T, ac as F, p as G, a7 as R, e as H, Q as V, m as q, a as B, u as K, K as M, b as Q, am as X, ah as Y } from "./builder-CULKvuzI.js";
|
|
5
|
+
import { g as Z } from "./ticket-BjAWQBHH.js";
|
|
6
|
+
import { e as $, N as ee, x as te } from "./ui-components-BKXG7k9L.js";
|
|
7
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
8
8
|
import "react-dom";
|
|
9
9
|
const se = "_notifications_1ntnm_1", ae = "_wrapper_1ntnm_12", P = {
|
|
10
10
|
notifications: se,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, Fragment as m } from "react/jsx-runtime";
|
|
2
|
-
import { ac as d, o as l, m as b, i as u, q as t, z as s } from "./builder-
|
|
2
|
+
import { ac as d, o as l, m as b, i as u, q as t, z as s } from "./builder-CULKvuzI.js";
|
|
3
3
|
import k from "react";
|
|
4
4
|
const B = (i) => {
|
|
5
5
|
const { children: c } = i, { pathname: r } = d(), { setActiveBlock: e } = l(), { setActiveBlock: a } = b(), { setActiveBlock: o } = u();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("./builder-GUSC-VqG.cjs"),n=require("./charge--UEFO_yq.cjs"),l="_wrapper_x27n6_1",m="_content_x27n6_10",x="_title_x27n6_18",d="_text_x27n6_24",p="_empty_x27n6_42",r={wrapper:l,content:m,title:x,text:d,empty:p},_=()=>{const{shopTerms:t}=c.useStorefrontStore(),{isAntistock:o}=c.useGeneralStore(),a=!!(t!=null&&t.termsOfService&&t.termsOfService.length>0);return e.jsx("div",{className:r.wrapper,children:e.jsxs("div",{className:r.content,children:[e.jsx("h1",{className:r.title,children:"Terms of Service"}),a?o?e.jsx("div",{className:r.text,children:e.jsx(n.MarkdownText,{text:t.termsOfService})}):e.jsx(n.Markdown,{remarkPlugins:[n.remarkGfm],rehypePlugins:[n.rehypeRaw],className:r.text,components:{a:({node:i,...s})=>e.jsx("a",{...s,target:"_blank",rel:"noopener noreferrer",id:"md"}),p:({node:i,...s})=>e.jsx("p",{...s,id:"md"})},children:t==null?void 0:t.termsOfService}):e.jsx("p",{className:r.empty,children:"No terms of service."})]})})};exports.TermsPage=_;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
-
import { g as i } from "./ui-components-
|
|
2
|
+
import { g as i } from "./ui-components-BKXG7k9L.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { p as s, an as a } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
4
|
+
import { p as s, an as a } from "./builder-CULKvuzI.js";
|
|
5
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
import "./charge-
|
|
8
|
-
import "./ticket-
|
|
7
|
+
import "./charge-D2D0KO0N.js";
|
|
8
|
+
import "./ticket-BjAWQBHH.js";
|
|
9
9
|
const c = "_wrapper_ej209_1", p = "_content_ej209_12", m = "_title_ej209_22", r = {
|
|
10
10
|
wrapper: c,
|
|
11
11
|
content: p,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as n, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { B as m, a as w, C as _ } from "./ui-components-
|
|
2
|
+
import { B as m, a as w, C as _ } from "./ui-components-BKXG7k9L.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-
|
|
5
|
-
import "./builder-components-
|
|
4
|
+
import { j as I, r as b, s as j, b as v, J as P, k as T, u as k } from "./builder-CULKvuzI.js";
|
|
5
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
import "./charge-
|
|
8
|
-
import "./ticket-
|
|
7
|
+
import "./charge-D2D0KO0N.js";
|
|
8
|
+
import "./ticket-BjAWQBHH.js";
|
|
9
9
|
const C = "_wrapper_1yd2j_1", A = "_error_1yd2j_11", N = "_title_1yd2j_21", B = "_buttons_1yd2j_29", i = {
|
|
10
10
|
wrapper: C,
|
|
11
11
|
error: A,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),e=require("./builder-GUSC-VqG.cjs"),o=require("react"),l=r=>{const{children:i}=r,{pathname:a}=e.useLocation(),{setActiveBlock:t}=e.useNavbarStore(),{setActiveBlock:s}=e.useThemeSettingsStore(),{setActiveBlock:n}=e.usePreviewStore();return o.useEffect(()=>{switch(n({id:null,neededScroll:!1}),a){case"/admin/builder":t(e.navbarBlocks[0]);break;case"/admin/builder/add":t(e.navbarBlocks[1]);break;case"/admin/builder/theme":t(e.navbarBlocks[2]);break;case"/admin/builder/settings":t(e.navbarBlocks[3]);break;case"/admin/builder/theme/colors":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[0]);break;case"/admin/builder/theme/fonts":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[1]);break;case"/admin/builder/theme/borders":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[2]);break;case"/admin/builder/theme/buttons":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[3]);break;case"/admin/builder/theme/inputs":t(e.navbarBlocks[2]),s(e.themeSettingsBlocks[4]);break}},[a]),c.jsx(c.Fragment,{children:i})};exports.ActivePage=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),l=require("./ui-components-B0NcrAD7.cjs");require("react");const s=require("./builder-GUSC-VqG.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");require("./charge--UEFO_yq.cjs");require("./ticket-DwzKY7OF.cjs");const j="_wrapper_1yd2j_1",w="_error_1yd2j_11",_="_title_1yd2j_21",b="_buttons_1yd2j_29",i={wrapper:j,error:w,title:_,buttons:b},S=async e=>{const o=localStorage.getItem("shopId")||void 0,r=localStorage.getItem("draftId"),d=`${s.useApiStore.getState().apiUrls.api}/v2/builder/shops/${o}/drafts/${r}/reset`;return await s.request({url:d,withToken:!0,method:"post",body:e})},x=()=>{const{error:e,setError:o}=s.useErrorStore(),{pages:r}=s.usePagesStore(),{setIsOpen:c}=s.useModalStore(),{title:d,description:m,setOnConfirm:u,setTitle:g,setDescription:p}=s.useConfirmationModalStore(),{setBlocks:h}=s.useLayersStore();async function y(){await S({resetSettings:(e==null?void 0:e.failedSettings)??!1,resetThemeSettings:(e==null?void 0:e.failedThemeSettings)??!1,resetPageIds:(e==null?void 0:e.failedPageIds)??[]}),o(null),h({}),window.location.reload()}async function f(){const a=[];r&&Object.keys(r).map(n=>r[n].id).filter(n=>n!==void 0).map(n=>a.push(n)),await S({resetSettings:!0,resetThemeSettings:!0,resetPageIds:a}),o(null)}return t.jsxs("div",{className:i.wrapper,children:[t.jsxs("div",{className:i.error,children:[t.jsxs("div",{children:[t.jsx("div",{className:i.title,children:"Oops! Something went wrong"}),t.jsx("span",{className:i.message,children:(e==null?void 0:e.message)||""})]}),t.jsxs("div",{className:i.buttons,children:[t.jsx(l.ButtonSettings,{type:"Primary",onClick:y,children:"Reset Settings"}),t.jsx(l.ButtonSettings,{type:"Secondary",onClick:a=>{a.stopPropagation(),g("Reset All Settings"),p("Are you sure you want to reset all settings? This is irreversible."),u(async()=>{await f()})},children:"Reset All Settings"})]})]}),d&&m&&t.jsx(l.BuilderModal,{close:()=>{c(!1),setTimeout(()=>{g(null),p(null),u(null),c(!0)},300)},children:t.jsx(l.ConfirmationModal,{})})]})};exports.ErrorPage=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime");require("./builder-GUSC-VqG.cjs");const r=require("react"),t=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");require("./charge--UEFO_yq.cjs");require("./ticket-DwzKY7OF.cjs");const i=()=>(r.useEffect(()=>{setTimeout(()=>{window.location.reload()},500)},[]),e.jsx("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:e.jsx(t.Loader,{})}));exports.RouterErrorPage=i;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("./ui-components-B0NcrAD7.cjs");require("react");const n=require("./builder-GUSC-VqG.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");require("./charge--UEFO_yq.cjs");require("./ticket-DwzKY7OF.cjs");const s="_wrapper_ej209_1",c="_content_ej209_12",a="_title_ej209_22",r={wrapper:s,content:c,title:a},l=()=>{const o=n.useNavigate(),t=n.useRouteError();return console.error("ROUTE ERROR: ",t),alert(t),e.jsx("div",{className:r.wrapper,children:e.jsxs("div",{className:r.content,children:[e.jsx("h1",{className:r.title,children:"Something Went Wrong"}),e.jsx(i.Button,{type:"Primary",onClick:()=>{o("/")},children:"Go Home"})]})})};exports.DynamicErrorPage=l;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import "./builder-
|
|
2
|
+
import "./builder-CULKvuzI.js";
|
|
3
3
|
import e from "react";
|
|
4
|
-
import { e as r } from "./ui-components-
|
|
5
|
-
import "./builder-components-
|
|
4
|
+
import { e as r } from "./ui-components-BKXG7k9L.js";
|
|
5
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
6
6
|
import "react-dom";
|
|
7
|
-
import "./charge-
|
|
8
|
-
import "./ticket-
|
|
7
|
+
import "./charge-D2D0KO0N.js";
|
|
8
|
+
import "./ticket-BjAWQBHH.js";
|
|
9
9
|
const f = () => (e.useEffect(() => {
|
|
10
10
|
setTimeout(() => {
|
|
11
11
|
window.location.reload();
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { N as i, K as m } from "./builder-CULKvuzI.js";
|
|
3
|
+
import { a2 as l, a3 as p, a4 as d, M as _ } from "./charge-D2D0KO0N.js";
|
|
4
|
+
const x = "_wrapper_x27n6_1", f = "_content_x27n6_10", v = "_title_x27n6_18", h = "_text_x27n6_24", N = "_empty_x27n6_42", r = {
|
|
5
|
+
wrapper: x,
|
|
6
|
+
content: f,
|
|
7
|
+
title: v,
|
|
8
|
+
text: h,
|
|
9
|
+
empty: N
|
|
10
|
+
}, k = () => {
|
|
11
|
+
const { shopTerms: e } = i(), { isAntistock: s } = m(), a = !!(e != null && e.termsOfService && e.termsOfService.length > 0);
|
|
12
|
+
return /* @__PURE__ */ t("div", { className: r.wrapper, children: /* @__PURE__ */ c("div", { className: r.content, children: [
|
|
13
|
+
/* @__PURE__ */ t("h1", { className: r.title, children: "Terms of Service" }),
|
|
14
|
+
a ? s ? /* @__PURE__ */ t("div", { className: r.text, children: /* @__PURE__ */ t(_, { text: e.termsOfService }) }) : /* @__PURE__ */ t(
|
|
15
|
+
l,
|
|
16
|
+
{
|
|
17
|
+
remarkPlugins: [d],
|
|
18
|
+
rehypePlugins: [p],
|
|
19
|
+
className: r.text,
|
|
20
|
+
components: {
|
|
21
|
+
a: ({ node: o, ...n }) => /* @__PURE__ */ t(
|
|
22
|
+
"a",
|
|
23
|
+
{
|
|
24
|
+
...n,
|
|
25
|
+
target: "_blank",
|
|
26
|
+
rel: "noopener noreferrer",
|
|
27
|
+
id: "md"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
p: ({ node: o, ...n }) => /* @__PURE__ */ t(
|
|
31
|
+
"p",
|
|
32
|
+
{
|
|
33
|
+
...n,
|
|
34
|
+
id: "md"
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
},
|
|
38
|
+
children: e == null ? void 0 : e.termsOfService
|
|
39
|
+
}
|
|
40
|
+
) : /* @__PURE__ */ t("p", { className: r.empty, children: "No terms of service." })
|
|
41
|
+
] }) });
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
k as TermsPage
|
|
45
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),i=require("react"),P=require("./charge--UEFO_yq.cjs"),t=require("./builder-GUSC-VqG.cjs"),J=require("./ticket-DwzKY7OF.cjs"),g=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");const _="_notifications_1ntnm_1",F="_wrapper_1ntnm_12",j={notifications:_,wrapper:F},z=()=>(i.useEffect(()=>{document.title="Temporarily Unavailable"},[]),s.jsx("div",{style:{display:"flex",flexDirection:"column",width:"100vw",height:"100vh",overflowY:"scroll",overflowX:"hidden",background:"var(--surface-primary)",color:"var(--text-primary)"},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:"1",justifyContent:"center",alignItems:"center",gap:"24px"},children:[s.jsx("h2",{style:{color:"var(--text-primary)",fontSize:"var(--font-heading-h2-size)"},children:"Temporarily Unavailable"}),s.jsx("span",{style:{color:"var(--text-secondary)",fontSize:"var(--font-heading-h3-size)",width:"85%",textAlign:"center"},children:"We're making some quick updates to improve your shopping experience. During this time, browsing and checkout are temporarily unavailable."})]})}));function R(){const c=new URLSearchParams(document.location.search),n=c.get("customerAccessToken"),{setToken:d}=t.useStorefrontStore.getState(),{setDashInfo:u}=t.useCustomerDashboardStore.getState();n&&(c.delete("customerAccessToken"),localStorage.setItem("token",n),d(n),u(null))}const U=({children:c})=>{const n=t.useLocation(),{token:d,setToken:u}=t.useStorefrontStore(),{dashInfo:S,setDashInfo:y}=t.useCustomerDashboardStore(),{shopPassword:f}=t.useStorefrontStore(),v=t.useNavigate(),[l,b]=t.useSearchParams(),{notifications:x}=t.useNotificationStore(),[T,h]=i.useState(!0),{setCustomerEmail:I}=t.useCartStore(),{setThemeSettings:w,themeSettings:N}=t.useThemeSettingsStore(),{settings:C,setSettings:k}=t.useSettingsStore(),{setHeader:D,setFooter:q,setAnnouncement:A}=t.useLayersStore(),{general:o,setGeneral:E,isAntistock:p}=t.useGeneralStore(),{pageContext:L,setPageContext:O}=t.usePagesStore();t.useTrackingAnalytics((o==null?void 0:o.info.id)||localStorage.getItem("shopId")||null,"production",p);const W=async()=>{const e=await J.getDynamicPage(encodeURIComponent("/products"),o==null?void 0:o.info.passwordProtected);if(e){const{data:a}=e;O({...L,listings:a.listings})}};return i.useEffect(()=>{R()},[]),i.useEffect(()=>{const e=localStorage.getItem("token");if(e&&(!d||!S))try{const a=t.jwtDecode(e);y(a),u(e),I(a.email)}catch(a){console.error("Failed to decode token:",a),localStorage.removeItem("token"),u(""),y(null)}},[d,S]),i.useEffect(()=>{const e=l.get("r");e&&(localStorage.setItem("referralCode",e),l.delete("r"),b(l),v({pathname:n.pathname,search:l.toString()},{replace:!0}))},[l,n]),i.useEffect(()=>{!n.pathname.startsWith("/products")&&!n.pathname.startsWith("/admin/builder")&&o&&(o.info.passwordProtected&&f||o.isPasswordValid)&&W()},[o,f]),i.useLayoutEffect(()=>{const e=async()=>{if(h(!0),!o){const r=await P.fetchGeneral(f);if(!r.isPasswordValid&&!n.pathname.includes("/admin/builder")){v("/validation",{state:{from:n.pathname}});return}if(!r.info.passwordProtected){localStorage.removeItem("shopPassword");const{setShopPassword:m}=t.useStorefrontStore.getState();m("")}E(r)}},a=async()=>{h(!0);const{settings:r,theme:m}=(await P.fetchThemeAndSettings()).data;r?(r.settings&&k(r.settings),r.header&&D(JSON.parse(JSON.stringify(r.header))),r.footer&&q(JSON.parse(JSON.stringify(r.footer))),r.announcement&&A(JSON.parse(JSON.stringify(r.announcement)))):k(C),w(m||N),h(!1)};n.pathname.startsWith("/validation")||e(),a()},[]),p&&(o!=null&&o.info.onHold)?s.jsx(z,{}):n.pathname.startsWith("/admin/builder")?s.jsx(s.Fragment,{children:c}):s.jsx(s.Fragment,{children:T?s.jsx("div",{className:j.wrapper,children:s.jsx(g.Loader,{})}):s.jsxs(s.Fragment,{children:[c,x.length>0&&s.jsx("div",{className:j.notifications,children:x.map(e=>s.jsx(g.NotificationBuilder,{type:e.status,message:e.message,timer:e.timer||10,id:e.id,element:p?g.NotificationAntistock:e.component,label:e.label},e.id))})]})})};exports.WrapperPage=U;
|
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./builder.cjs.js"),c=require("./builder-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./builder.cjs.js"),c=require("./builder-GUSC-VqG.cjs"),u=require("react/jsx-runtime"),d=require("react"),e=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");const r=require("./charge--UEFO_yq.cjs");require("react-dom");const t=require("./ticket-DwzKY7OF.cjs");function I(o){d.useEffect(()=>{Object.entries(o).forEach(([s,i])=>{e.registerIcon(s,i)})},[o])}function f(o){Object.entries(o).forEach(([s,i])=>{e.registerIcon(s,i)})}function l(o){return o.endsWith("Icon")?o.slice(0,-4):o}function g(o,s=20,i=!0){return o.map(n=>({value:i?l(n):n,addon:u.jsx(e.Icon,{name:n,width:s,height:s,showPlaceholder:!0})}))}exports.App=a.App;exports.AntistockRoutes=c.AntistockRoutes;exports.Routes=c.Routes;exports.formatPrice=c.formatPrice;exports.Icon=e.Icon;exports.addIconSuffix=e.addIconSuffix;exports.getRegisteredIcon=e.getRegisteredIcon;exports.getRegisteredIcons=e.getRegisteredIcons;exports.isIconRegistered=e.isIconRegistered;exports.loadIcon=e.loadIcon;exports.registerIcon=e.registerIcon;exports.stripIconSuffix=e.stripIconSuffix;exports.useDynamicIconRegistration=e.useDynamicIconRegistration;exports.MarkdownText=r.MarkdownText;exports.ReCaptchaProvider=r.ReCaptchaProvider;exports.parseDraftJsText=r.parseDraftJsText;exports.useCart=r.useCart;exports.useGeneralInfo=r.useGeneralInfo;exports.useMarkdownIt=r.useMarkdownIt;exports.useReCaptcha=r.useReCaptcha;exports.ColorVariables=t.ColorVariables;exports.aspectRatioOptions=t.aspectRatioOptions;exports.hotReload=t.hotReload;exports.iconNames=t.iconNames;exports.removeNotification=t.removeNotification;exports.showNotification=t.showNotification;exports.splitTextIntoSpans=t.splitTextIntoSpans;exports.useAdaptiveStyles=t.useAdaptiveStyles;exports.useBalance=t.useBalance;exports.useBuilderPages=t.useBuilderPages;exports.useCreateTicket=t.useCreateTicket;exports.createIconLeftAddons=g;exports.registerIcons=f;exports.useIconRegistration=I;
|
package/dist/index.es.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { App as R } from "./builder.es.js";
|
|
2
|
-
import { Y as v, Z as w, _ as b } from "./builder-
|
|
2
|
+
import { Y as v, Z as w, _ as b } from "./builder-CULKvuzI.js";
|
|
3
3
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
4
|
import { useEffect as i } from "react";
|
|
5
|
-
import { r as o, I as n } from "./ui-components-
|
|
6
|
-
import { v as A, o as P, q as S, p as T, s as j, t as E, n as M } from "./ui-components-
|
|
7
|
-
import "./builder-components-
|
|
8
|
-
import { M as y, G as B, J as D, u as G, I as J, K as q, H } from "./charge-
|
|
5
|
+
import { r as o, I as n } from "./ui-components-BKXG7k9L.js";
|
|
6
|
+
import { v as A, o as P, q as S, p as T, s as j, t as E, n as M } from "./ui-components-BKXG7k9L.js";
|
|
7
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
8
|
+
import { M as y, G as B, J as D, u as G, I as J, K as q, H } from "./charge-D2D0KO0N.js";
|
|
9
9
|
import "react-dom";
|
|
10
|
-
import { C as L, c as V, h as W, i as Y, r as Z, d as _, s as F, u as Q, e as U, b as X, a as $ } from "./ticket-
|
|
10
|
+
import { C as L, c as V, h as W, i as Y, r as Z, d as _, s as F, u as Q, e as U, b as X, a as $ } from "./ticket-BjAWQBHH.js";
|
|
11
11
|
function m(e) {
|
|
12
12
|
i(() => {
|
|
13
13
|
Object.entries(e).forEach(([s, t]) => {
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { jsx as s, Fragment as G, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import r, { useState as Q, useMemo as O } from "react";
|
|
3
|
+
import { X as Y, a8 as Z, p as ee, K as te } from "./builder-CULKvuzI.js";
|
|
4
|
+
import { f as se, N as ae, P as oe, O as ne, g as ie, b as ce, c as h, d as re, e as le, h as ue, i as de, j as me, V as he, k as fe, L as ge, T as pe, l as U, m as _e, n as ye, R as Ne, o as ke } from "./charge-D2D0KO0N.js";
|
|
5
|
+
import { e as Se, g as ve, I as we } from "./ui-components-BKXG7k9L.js";
|
|
6
|
+
import "./builder-components-Bh7Wzulo.js";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "./ticket-BjAWQBHH.js";
|
|
9
|
+
const Pe = async (t = 1) => await se({ PageNumber: t }), tt = () => {
|
|
10
|
+
const [t, c] = r.useState(null), [u, e] = Q(null), [_, g] = r.useState(0), { page: m } = Y(), [p, y] = r.useState(!0);
|
|
11
|
+
async function A() {
|
|
12
|
+
y(!0);
|
|
13
|
+
const { list: k, totalCount: l } = await Pe(m);
|
|
14
|
+
c(k), g(l), e(null), y(!1);
|
|
15
|
+
}
|
|
16
|
+
async function N() {
|
|
17
|
+
const k = (t == null ? void 0 : t.map((i) => i.gatewayName)) || [], l = await ie(k);
|
|
18
|
+
e(l);
|
|
19
|
+
}
|
|
20
|
+
return r.useEffect(() => {
|
|
21
|
+
!u && t && N();
|
|
22
|
+
}, [t, u]), r.useEffect(() => {
|
|
23
|
+
A();
|
|
24
|
+
}, [m]), /* @__PURE__ */ s(G, { children: t != null && t.length && t.length === 0 ? /* @__PURE__ */ s(
|
|
25
|
+
ae,
|
|
26
|
+
{
|
|
27
|
+
title: "No Orders",
|
|
28
|
+
description: "When you purchase products from our website, you'll see a history of orders here."
|
|
29
|
+
}
|
|
30
|
+
) : /* @__PURE__ */ d(G, { children: [
|
|
31
|
+
/* @__PURE__ */ s(oe, { title: "Orders" }),
|
|
32
|
+
/* @__PURE__ */ s(
|
|
33
|
+
ne,
|
|
34
|
+
{
|
|
35
|
+
orders: t,
|
|
36
|
+
gatewaysDetail: u,
|
|
37
|
+
totalCount: _,
|
|
38
|
+
isLoading: p
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
] }) });
|
|
42
|
+
}, be = "_orderPage_gc87l_1", Oe = "_leftSection_gc87l_15", Ae = "_content_gc87l_35", De = "_main_gc87l_42", Ce = "_mainAntistock_gc87l_56", Re = "_orderMainDataAntistock_gc87l_69", Me = "_timelineBlockAntistock_gc87l_81", Te = "_footerAntistock_gc87l_92", Ie = "_statusBlock_gc87l_104", Ve = "_timelineBlock_gc87l_81", Ee = "_footer_gc87l_92", Be = "_rightSection_gc87l_121", Le = "_header_gc87l_142", $e = "_productList_gc87l_150", Fe = "_mobileFooter_gc87l_157", xe = "_loaderContainer_gc87l_166", We = "_orderMainData_gc87l_69", qe = "_prices_gc87l_181", je = "_headerTitle_gc87l_185", Ge = "_headerDescription_gc87l_189", n = {
|
|
43
|
+
orderPage: be,
|
|
44
|
+
leftSection: Oe,
|
|
45
|
+
content: Ae,
|
|
46
|
+
main: De,
|
|
47
|
+
mainAntistock: Ce,
|
|
48
|
+
orderMainDataAntistock: Re,
|
|
49
|
+
timelineBlockAntistock: Me,
|
|
50
|
+
footerAntistock: Te,
|
|
51
|
+
statusBlock: Ie,
|
|
52
|
+
timelineBlock: Ve,
|
|
53
|
+
footer: Ee,
|
|
54
|
+
rightSection: Be,
|
|
55
|
+
header: Le,
|
|
56
|
+
productList: $e,
|
|
57
|
+
mobileFooter: Fe,
|
|
58
|
+
loaderContainer: xe,
|
|
59
|
+
orderMainData: We,
|
|
60
|
+
prices: qe,
|
|
61
|
+
headerTitle: je,
|
|
62
|
+
headerDescription: Ge
|
|
63
|
+
}, Ue = (t) => {
|
|
64
|
+
if (!t) return null;
|
|
65
|
+
const c = t.split(":");
|
|
66
|
+
if (c.length !== 3) return null;
|
|
67
|
+
const [u, e, _] = c, g = Number(u), m = Number(e), p = Number(_);
|
|
68
|
+
return Number.isNaN(g) || Number.isNaN(m) || Number.isNaN(p) ? null : ((g * 60 + m) * 60 + p) * 1e3;
|
|
69
|
+
}, ze = () => {
|
|
70
|
+
var M, T, I, V, E, B, L, $, F;
|
|
71
|
+
const { id: t, accessToken: c } = Z(), u = ee(), [e, _] = r.useState(), [g, m] = r.useState(!1), [p, y] = r.useState(!1), [A, N] = r.useState(!1), k = ce(), { isAntistock: l, general: i } = te(), z = ((M = e == null ? void 0 : e.rawPrice) == null ? void 0 : M.currency) || "USD", H = new Intl.NumberFormat("en-US", {
|
|
72
|
+
style: "currency",
|
|
73
|
+
currency: z
|
|
74
|
+
}), C = r.useMemo(() => {
|
|
75
|
+
var f;
|
|
76
|
+
const a = Ue(
|
|
77
|
+
(e == null ? void 0 : e.estimatedProcessingTime) ?? null
|
|
78
|
+
), S = (f = e == null ? void 0 : e.timeline) == null ? void 0 : f[h.Processing], D = (e == null ? void 0 : e.status) === h.Processing && S && a ? {
|
|
79
|
+
processingStartTime: new Date(S),
|
|
80
|
+
expectedProcessingMs: a,
|
|
81
|
+
processingExpiresAt: e != null && e.processingExpiresAt ? new Date(e.processingExpiresAt) : void 0
|
|
82
|
+
} : null;
|
|
83
|
+
return (e == null ? void 0 : e.partOrders.map((o) => {
|
|
84
|
+
var v, x, W;
|
|
85
|
+
return {
|
|
86
|
+
id: Number((v = o.productWithVariant) == null ? void 0 : v.id) || 0,
|
|
87
|
+
partOrderId: Number(o == null ? void 0 : o.id) || 0,
|
|
88
|
+
image: o.productWithVariant.image,
|
|
89
|
+
name: (() => {
|
|
90
|
+
var q, j;
|
|
91
|
+
const w = ((q = o.productWithVariant) == null ? void 0 : q.name) || "", P = ((j = o.productWithVariant) == null ? void 0 : j.variantName) || "";
|
|
92
|
+
return !w && !P ? "" : !P || w === P ? w : w ? `${w} (${P})` : P;
|
|
93
|
+
})(),
|
|
94
|
+
description: "",
|
|
95
|
+
price: {
|
|
96
|
+
quantity: o.quantity,
|
|
97
|
+
amount: ((x = o.productWithVariant) == null ? void 0 : x.price.amount) || 0,
|
|
98
|
+
currency: (W = o.productWithVariant) == null ? void 0 : W.price.currency
|
|
99
|
+
},
|
|
100
|
+
deliveryCategories: "deliveryCategories" in o ? o.deliveryCategories : void 0,
|
|
101
|
+
customerNote: o.customerNote,
|
|
102
|
+
chargeType: o.chargeType || "ONE_TIME",
|
|
103
|
+
replacementRequests: "replacementRequests" in o ? o.replacementRequests : void 0,
|
|
104
|
+
allowedReplacementReasons: "allowedReplacementReasons" in o ? o.allowedReplacementReasons : void 0,
|
|
105
|
+
processingInfo: D
|
|
106
|
+
};
|
|
107
|
+
})) || [];
|
|
108
|
+
}, [e]);
|
|
109
|
+
r.useEffect(() => {
|
|
110
|
+
e && (e.status === h.FullDeliveryFailure || e.status === h.PartiallyDelivered) && e.refundedPrice && e.refundedPrice.amount > 0 && y(!0);
|
|
111
|
+
}, [e == null ? void 0 : e.status]);
|
|
112
|
+
const b = r.useCallback(
|
|
113
|
+
async (a, S, D = !1) => {
|
|
114
|
+
var o, v;
|
|
115
|
+
D || m(!0);
|
|
116
|
+
const { data: f } = await (S ? re(`${a}/${S}`) : le(a));
|
|
117
|
+
m(!1), f.status !== h.Completed && ((o = f.charge) == null ? void 0 : o.status) === ue.NotPaid && u(`/charges/${(v = f.charge) == null ? void 0 : v.id}`, {
|
|
118
|
+
replace: !0
|
|
119
|
+
}), _(f);
|
|
120
|
+
},
|
|
121
|
+
[u]
|
|
122
|
+
);
|
|
123
|
+
r.useLayoutEffect(() => {
|
|
124
|
+
if (t && !c) {
|
|
125
|
+
const a = JSON.parse(localStorage.getItem("orders") || "{}");
|
|
126
|
+
a[t] && u(`/orders/${t}/${a[t].fullAccessToken}`);
|
|
127
|
+
}
|
|
128
|
+
}, [t, c, u]), r.useEffect(() => {
|
|
129
|
+
t && b(t, c, !0);
|
|
130
|
+
const a = setInterval(() => {
|
|
131
|
+
t && b(t, c, !0);
|
|
132
|
+
}, 5e3);
|
|
133
|
+
return () => {
|
|
134
|
+
clearInterval(a);
|
|
135
|
+
};
|
|
136
|
+
}, [t, c, b]);
|
|
137
|
+
const J = O(() => !!(e != null && e.isApplicableForReplacement && (e.status === h.Completed || e.status === h.PartiallyDelivered || e.status === h.FullDeliveryFailure)), [e]), R = O(() => {
|
|
138
|
+
var a;
|
|
139
|
+
return !!((a = i == null ? void 0 : i.info) != null && a.isVouchesEnabled && c);
|
|
140
|
+
}, [(T = i == null ? void 0 : i.info) == null ? void 0 : T.isVouchesEnabled, c]), K = O(() => {
|
|
141
|
+
var a;
|
|
142
|
+
return !!(!((a = i == null ? void 0 : i.info) != null && a.isVouchesEnabled) && (e != null && e.review) && "accessToken" in e.review && !l);
|
|
143
|
+
}, [(I = i == null ? void 0 : i.info) == null ? void 0 : I.isVouchesEnabled, e == null ? void 0 : e.review, l]), X = O(() => {
|
|
144
|
+
var a;
|
|
145
|
+
return ((a = i == null ? void 0 : i.info) == null ? void 0 : a.domain) || window.location.hostname;
|
|
146
|
+
}, [(V = i == null ? void 0 : i.info) == null ? void 0 : V.domain]);
|
|
147
|
+
return g ? /* @__PURE__ */ s("div", { className: n.loaderContainer, children: /* @__PURE__ */ s(Se, {}) }) : (console.log("ORDER PAGE"), console.log(e), /* @__PURE__ */ d("div", { className: n.orderPage, children: [
|
|
148
|
+
/* @__PURE__ */ s("div", { className: n.leftSection, children: /* @__PURE__ */ d("div", { className: n.content, children: [
|
|
149
|
+
/* @__PURE__ */ s(de, {}),
|
|
150
|
+
e && /* @__PURE__ */ d("div", { className: `${n.main} ${l ? n.mainAntistock : ""}`, children: [
|
|
151
|
+
/* @__PURE__ */ s(
|
|
152
|
+
me,
|
|
153
|
+
{
|
|
154
|
+
className: n.statusBlock,
|
|
155
|
+
orderStatus: e.status
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ d(
|
|
159
|
+
"div",
|
|
160
|
+
{
|
|
161
|
+
className: `${n.orderMainData} ${l ? n.orderMainDataAntistock : ""}`,
|
|
162
|
+
children: [
|
|
163
|
+
R && /* @__PURE__ */ s(
|
|
164
|
+
he,
|
|
165
|
+
{
|
|
166
|
+
onAddMessage: () => N(!0),
|
|
167
|
+
isVouchLeft: e.isVouchLeft
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
/* @__PURE__ */ s(
|
|
171
|
+
fe,
|
|
172
|
+
{
|
|
173
|
+
lastUpdate: e.createdAt,
|
|
174
|
+
paymentType: (E = e.charge) == null ? void 0 : E.gateway,
|
|
175
|
+
email: e.customer ? e.customer.email : ((B = e.charge) == null ? void 0 : B.customerForCharge.email) || "",
|
|
176
|
+
orderId: e.id
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
K && e.review && /* @__PURE__ */ s(
|
|
180
|
+
ge,
|
|
181
|
+
{
|
|
182
|
+
orderId: e.id,
|
|
183
|
+
review: e.review
|
|
184
|
+
}
|
|
185
|
+
)
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
),
|
|
189
|
+
e.charge && e.charge.timeline && /* @__PURE__ */ s(
|
|
190
|
+
pe,
|
|
191
|
+
{
|
|
192
|
+
className: `${n.timelineBlock} ${l ? n.timelineBlockAntistock : ""}`,
|
|
193
|
+
timeline: e.charge.timeline
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ s(
|
|
197
|
+
U,
|
|
198
|
+
{
|
|
199
|
+
className: `${n.footer} ${l ? n.footerAntistock : ""}`
|
|
200
|
+
}
|
|
201
|
+
)
|
|
202
|
+
] })
|
|
203
|
+
] }) }),
|
|
204
|
+
/* @__PURE__ */ s(
|
|
205
|
+
"div",
|
|
206
|
+
{
|
|
207
|
+
className: n.rightSection,
|
|
208
|
+
style: l ? { borderLeft: "1px solid var(--border-secondary)" } : void 0,
|
|
209
|
+
children: /* @__PURE__ */ d("div", { className: n.content, children: [
|
|
210
|
+
((L = e == null ? void 0 : e.charge) == null ? void 0 : L.name) && /* @__PURE__ */ d("header", { className: n.header, children: [
|
|
211
|
+
/* @__PURE__ */ d("div", { children: [
|
|
212
|
+
/* @__PURE__ */ s("h1", { className: n.headerTitle, children: e.charge.name }),
|
|
213
|
+
e.charge.description && /* @__PURE__ */ s("p", { className: n.headerDescription, children: e.charge.description })
|
|
214
|
+
] }),
|
|
215
|
+
l ? null : /* @__PURE__ */ d(
|
|
216
|
+
ve,
|
|
217
|
+
{
|
|
218
|
+
type: "Secondary",
|
|
219
|
+
onClick: () => k((e == null ? void 0 : e.id) || ""),
|
|
220
|
+
style: {
|
|
221
|
+
whiteSpace: "nowrap",
|
|
222
|
+
display: "flex",
|
|
223
|
+
alignItems: "center",
|
|
224
|
+
gap: "4px"
|
|
225
|
+
},
|
|
226
|
+
children: [
|
|
227
|
+
/* @__PURE__ */ s(we, { name: "Copy" }),
|
|
228
|
+
/* @__PURE__ */ s("span", { children: "Copy ID" })
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
)
|
|
232
|
+
] }),
|
|
233
|
+
/* @__PURE__ */ d("div", { children: [
|
|
234
|
+
/* @__PURE__ */ s("div", { className: n.productList, children: C.map((a) => /* @__PURE__ */ s(
|
|
235
|
+
_e,
|
|
236
|
+
{
|
|
237
|
+
product: a,
|
|
238
|
+
isOrder: !0,
|
|
239
|
+
isApplicableForReplacement: J,
|
|
240
|
+
orderId: t,
|
|
241
|
+
accessToken: c,
|
|
242
|
+
allowedReplacementReasons: e == null ? void 0 : e.allowedReplacementReasons
|
|
243
|
+
},
|
|
244
|
+
a.id
|
|
245
|
+
)) }),
|
|
246
|
+
l ? null : /* @__PURE__ */ s(
|
|
247
|
+
ye,
|
|
248
|
+
{
|
|
249
|
+
formatter: H,
|
|
250
|
+
coupon: null,
|
|
251
|
+
total: (($ = e == null ? void 0 : e.endPrice) == null ? void 0 : $.amount) || 0,
|
|
252
|
+
discount: 0,
|
|
253
|
+
totalWithDiscount: ((F = e == null ? void 0 : e.endPrice) == null ? void 0 : F.amount) || 0,
|
|
254
|
+
className: n.prices,
|
|
255
|
+
isShowSubtotal: !1
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ s(U, { className: n.mobileFooter })
|
|
259
|
+
] })
|
|
260
|
+
] })
|
|
261
|
+
}
|
|
262
|
+
),
|
|
263
|
+
(e == null ? void 0 : e.refundedPrice) && /* @__PURE__ */ s(
|
|
264
|
+
Ne,
|
|
265
|
+
{
|
|
266
|
+
isOpen: p,
|
|
267
|
+
onClose: () => y(!1),
|
|
268
|
+
refundedAmount: e.refundedPrice.amount,
|
|
269
|
+
currency: e.refundedPrice.currency
|
|
270
|
+
}
|
|
271
|
+
),
|
|
272
|
+
R && /* @__PURE__ */ s(
|
|
273
|
+
ke,
|
|
274
|
+
{
|
|
275
|
+
isOpen: A,
|
|
276
|
+
onClose: () => N(!1),
|
|
277
|
+
products: C,
|
|
278
|
+
orderId: t,
|
|
279
|
+
accessToken: c,
|
|
280
|
+
shopDomain: X,
|
|
281
|
+
onSuccess: () => {
|
|
282
|
+
N(!1), t && b(t, c, !0);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
)
|
|
286
|
+
] }));
|
|
287
|
+
}, st = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
288
|
+
__proto__: null,
|
|
289
|
+
OrderPage: ze
|
|
290
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
291
|
+
export {
|
|
292
|
+
tt as O,
|
|
293
|
+
st as i
|
|
294
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),r=require("react"),j=require("./builder-GUSC-VqG.cjs"),o=require("./charge--UEFO_yq.cjs"),b=require("./ui-components-B0NcrAD7.cjs");require("./builder-components-DD74FeFy.cjs");require("react-dom");require("./ticket-DwzKY7OF.cjs");const K=async(s=1)=>await o.fetchOrders({PageNumber:s}),Q=()=>{const[s,l]=r.useState(null),[d,e]=r.useState(null),[p,g]=r.useState(0),{page:m}=j.usePaginationPagesStore(),[f,_]=r.useState(!0);async function O(){_(!0);const{list:S,totalCount:u}=await K(m);l(S),g(u),e(null),_(!1)}async function y(){const S=(s==null?void 0:s.map(i=>i.gatewayName))||[],u=await o.getGatewaysDetail(S);e(u)}return r.useEffect(()=>{!d&&s&&y()},[s,d]),r.useEffect(()=>{O()},[m]),t.jsx(t.Fragment,{children:s!=null&&s.length&&s.length===0?t.jsx(o.NoItemsBlock,{title:"No Orders",description:"When you purchase products from our website, you'll see a history of orders here."}):t.jsxs(t.Fragment,{children:[t.jsx(o.PageTitle,{title:"Orders"}),t.jsx(o.OrdersTable,{orders:s,gatewaysDetail:d,totalCount:p,isLoading:f})]})})},X="_orderPage_gc87l_1",Y="_leftSection_gc87l_15",Z="_content_gc87l_35",ee="_main_gc87l_42",te="_mainAntistock_gc87l_56",se="_orderMainDataAntistock_gc87l_69",oe="_timelineBlockAntistock_gc87l_81",ne="_footerAntistock_gc87l_92",ae="_statusBlock_gc87l_104",ce="_timelineBlock_gc87l_81",ie="_footer_gc87l_92",re="_rightSection_gc87l_121",le="_header_gc87l_142",ue="_productList_gc87l_150",de="_mobileFooter_gc87l_157",me="_loaderContainer_gc87l_166",he="_orderMainData_gc87l_69",ge="_prices_gc87l_181",fe="_headerTitle_gc87l_185",pe="_headerDescription_gc87l_189",c={orderPage:X,leftSection:Y,content:Z,main:ee,mainAntistock:te,orderMainDataAntistock:se,timelineBlockAntistock:oe,footerAntistock:ne,statusBlock:ae,timelineBlock:ce,footer:ie,rightSection:re,header:le,productList:ue,mobileFooter:de,loaderContainer:me,orderMainData:he,prices:ge,headerTitle:fe,headerDescription:pe},_e=s=>{if(!s)return null;const l=s.split(":");if(l.length!==3)return null;const[d,e,p]=l,g=Number(d),m=Number(e),f=Number(p);return Number.isNaN(g)||Number.isNaN(m)||Number.isNaN(f)?null:((g*60+m)*60+f)*1e3},ye=()=>{var D,R,M,T,E,I,V,B,F;const{id:s,accessToken:l}=j.useParams(),d=j.useNavigate(),[e,p]=r.useState(),[g,m]=r.useState(!1),[f,_]=r.useState(!1),[O,y]=r.useState(!1),S=o.useCopy(),{isAntistock:u,general:i}=j.useGeneralStore(),G=((D=e==null?void 0:e.rawPrice)==null?void 0:D.currency)||"USD",U=new Intl.NumberFormat("en-US",{style:"currency",currency:G}),C=r.useMemo(()=>{var h;const n=_e((e==null?void 0:e.estimatedProcessingTime)??null),N=(h=e==null?void 0:e.timeline)==null?void 0:h[o.OrderStatus.Processing],P=(e==null?void 0:e.status)===o.OrderStatus.Processing&&N&&n?{processingStartTime:new Date(N),expectedProcessingMs:n,processingExpiresAt:e!=null&&e.processingExpiresAt?new Date(e.processingExpiresAt):void 0}:null;return(e==null?void 0:e.partOrders.map(a=>{var x,$,q;return{id:Number((x=a.productWithVariant)==null?void 0:x.id)||0,partOrderId:Number(a==null?void 0:a.id)||0,image:a.productWithVariant.image,name:(()=>{var L,W;const k=((L=a.productWithVariant)==null?void 0:L.name)||"",v=((W=a.productWithVariant)==null?void 0:W.variantName)||"";return!k&&!v?"":!v||k===v?k:k?`${k} (${v})`:v})(),description:"",price:{quantity:a.quantity,amount:(($=a.productWithVariant)==null?void 0:$.price.amount)||0,currency:(q=a.productWithVariant)==null?void 0:q.price.currency},deliveryCategories:"deliveryCategories"in a?a.deliveryCategories:void 0,customerNote:a.customerNote,chargeType:a.chargeType||"ONE_TIME",replacementRequests:"replacementRequests"in a?a.replacementRequests:void 0,allowedReplacementReasons:"allowedReplacementReasons"in a?a.allowedReplacementReasons:void 0,processingInfo:P}}))||[]},[e]);r.useEffect(()=>{e&&(e.status===o.OrderStatus.FullDeliveryFailure||e.status===o.OrderStatus.PartiallyDelivered)&&e.refundedPrice&&e.refundedPrice.amount>0&&_(!0)},[e==null?void 0:e.status]);const w=r.useCallback(async(n,N,P=!1)=>{var a,x;P||m(!0);const{data:h}=await(N?o.fetchAuthorizedOrder(`${n}/${N}`):o.fetchOrder(n));m(!1),h.status!==o.OrderStatus.Completed&&((a=h.charge)==null?void 0:a.status)===o.ChargeStatus.NotPaid&&d(`/charges/${(x=h.charge)==null?void 0:x.id}`,{replace:!0}),p(h)},[d]);r.useLayoutEffect(()=>{if(s&&!l){const n=JSON.parse(localStorage.getItem("orders")||"{}");n[s]&&d(`/orders/${s}/${n[s].fullAccessToken}`)}},[s,l,d]),r.useEffect(()=>{s&&w(s,l,!0);const n=setInterval(()=>{s&&w(s,l,!0)},5e3);return()=>{clearInterval(n)}},[s,l,w]);const z=r.useMemo(()=>!!(e!=null&&e.isApplicableForReplacement&&(e.status===o.OrderStatus.Completed||e.status===o.OrderStatus.PartiallyDelivered||e.status===o.OrderStatus.FullDeliveryFailure)),[e]),A=r.useMemo(()=>{var n;return!!((n=i==null?void 0:i.info)!=null&&n.isVouchesEnabled&&l)},[(R=i==null?void 0:i.info)==null?void 0:R.isVouchesEnabled,l]),H=r.useMemo(()=>{var n;return!!(!((n=i==null?void 0:i.info)!=null&&n.isVouchesEnabled)&&(e!=null&&e.review)&&"accessToken"in e.review&&!u)},[(M=i==null?void 0:i.info)==null?void 0:M.isVouchesEnabled,e==null?void 0:e.review,u]),J=r.useMemo(()=>{var n;return((n=i==null?void 0:i.info)==null?void 0:n.domain)||window.location.hostname},[(T=i==null?void 0:i.info)==null?void 0:T.domain]);return g?t.jsx("div",{className:c.loaderContainer,children:t.jsx(b.Loader,{})}):(console.log("ORDER PAGE"),console.log(e),t.jsxs("div",{className:c.orderPage,children:[t.jsx("div",{className:c.leftSection,children:t.jsxs("div",{className:c.content,children:[t.jsx(o.CheckoutHeader,{}),e&&t.jsxs("div",{className:`${c.main} ${u?c.mainAntistock:""}`,children:[t.jsx(o.OrderStatusBlock,{className:c.statusBlock,orderStatus:e.status}),t.jsxs("div",{className:`${c.orderMainData} ${u?c.orderMainDataAntistock:""}`,children:[A&&t.jsx(o.VouchCard,{onAddMessage:()=>y(!0),isVouchLeft:e.isVouchLeft}),t.jsx(o.CheckoutOrderMainData,{lastUpdate:e.createdAt,paymentType:(E=e.charge)==null?void 0:E.gateway,email:e.customer?e.customer.email:((I=e.charge)==null?void 0:I.customerForCharge.email)||"",orderId:e.id}),H&&e.review&&t.jsx(o.LeaveAReview,{orderId:e.id,review:e.review})]}),e.charge&&e.charge.timeline&&t.jsx(o.TrackPayment,{className:`${c.timelineBlock} ${u?c.timelineBlockAntistock:""}`,timeline:e.charge.timeline}),t.jsx(o.CheckoutFooter,{className:`${c.footer} ${u?c.footerAntistock:""}`})]})]})}),t.jsx("div",{className:c.rightSection,style:u?{borderLeft:"1px solid var(--border-secondary)"}:void 0,children:t.jsxs("div",{className:c.content,children:[((V=e==null?void 0:e.charge)==null?void 0:V.name)&&t.jsxs("header",{className:c.header,children:[t.jsxs("div",{children:[t.jsx("h1",{className:c.headerTitle,children:e.charge.name}),e.charge.description&&t.jsx("p",{className:c.headerDescription,children:e.charge.description})]}),u?null:t.jsxs(b.Button,{type:"Secondary",onClick:()=>S((e==null?void 0:e.id)||""),style:{whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:"4px"},children:[t.jsx(b.Icon,{name:"Copy"}),t.jsx("span",{children:"Copy ID"})]})]}),t.jsxs("div",{children:[t.jsx("div",{className:c.productList,children:C.map(n=>t.jsx(o.CheckoutProduct,{product:n,isOrder:!0,isApplicableForReplacement:z,orderId:s,accessToken:l,allowedReplacementReasons:e==null?void 0:e.allowedReplacementReasons},n.id))}),u?null:t.jsx(o.CheckoutPrices,{formatter:U,coupon:null,total:((B=e==null?void 0:e.endPrice)==null?void 0:B.amount)||0,discount:0,totalWithDiscount:((F=e==null?void 0:e.endPrice)==null?void 0:F.amount)||0,className:c.prices,isShowSubtotal:!1}),t.jsx(o.CheckoutFooter,{className:c.mobileFooter})]})]})}),(e==null?void 0:e.refundedPrice)&&t.jsx(o.RefundNotificationModal,{isOpen:f,onClose:()=>_(!1),refundedAmount:e.refundedPrice.amount,currency:e.refundedPrice.currency}),A&&t.jsx(o.VouchModal,{isOpen:O,onClose:()=>y(!1),products:C,orderId:s,accessToken:l,shopDomain:J,onSuccess:()=>{y(!1),s&&w(s,l,!0)}})]}))},Se=Object.freeze(Object.defineProperty({__proto__:null,OrderPage:ye},Symbol.toStringTag,{value:"Module"}));exports.Orders=Q;exports.index=Se;
|
|
@@ -13,10 +13,11 @@ declare const TicketItem: LazyComponent;
|
|
|
13
13
|
declare const Subscription: LazyComponent;
|
|
14
14
|
declare const TopUpBalance: LazyComponent;
|
|
15
15
|
declare const OrderPage: LazyComponent;
|
|
16
|
+
declare const TermsPage: LazyComponent;
|
|
16
17
|
declare const CustomerDashboard: LazyComponent;
|
|
17
18
|
declare const ReCaptchaProvider: LazyComponent;
|
|
18
19
|
declare const LoadingFallback: React.FC;
|
|
19
20
|
export declare const LazyWrapper: React.FC<{
|
|
20
21
|
children: React.ReactNode;
|
|
21
22
|
}>;
|
|
22
|
-
export { BuilderPage, ErrorPage, ActivePage, ValidationPage, WrapperPage, RouterErrorPage, DynamicErrorPage, Checkout, ChargePage, TicketItem, Subscription, TopUpBalance, OrderPage, CustomerDashboard, ReCaptchaProvider, LoadingFallback, };
|
|
23
|
+
export { BuilderPage, ErrorPage, ActivePage, ValidationPage, WrapperPage, RouterErrorPage, DynamicErrorPage, Checkout, ChargePage, TicketItem, Subscription, TopUpBalance, OrderPage, CustomerDashboard, ReCaptchaProvider, LoadingFallback, TermsPage, };
|