@billgangcom/theme-lib 1.123.6 → 1.124.1
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-CN6EcOo5.cjs +43 -0
- package/dist/{builder-DJQh1c1e.js → builder-Ddop-8xf.js} +1169 -1169
- package/dist/{builder-components-Bgg9F62l.cjs → builder-components-CSl62_15.cjs} +2 -2
- package/dist/{builder-components-CpOz_SUG.js → builder-components-Co8dAOpQ.js} +337 -332
- package/dist/builder.cjs.js +1 -1
- package/dist/builder.es.js +129 -126
- package/dist/{charge-DywF6LWF.cjs → charge-C1avZix7.cjs} +1 -1
- package/dist/{charge-z48cLi-k.js → charge-DKR9uXCa.js} +6 -6
- package/dist/{checkout-M3jKk4q6.js → checkout-CCi0lVqr.js} +5 -5
- package/dist/{checkout-DTwC9CX7.cjs → checkout-DMJ9Uz7K.cjs} +1 -1
- package/dist/exports.cjs.js +1 -1
- package/dist/exports.es.js +6 -6
- package/dist/{index-DHPgQ7DA.js → index-B2X6m84l.js} +5 -5
- package/dist/{index-BTjeATna.js → index-BlUHhZz9.js} +1 -1
- package/dist/{index-DO-nVcAG.cjs → index-C8V0h3ez.cjs} +1 -1
- package/dist/{index-DD71JxVQ.cjs → index-Cg9SH7GR.cjs} +1 -1
- package/dist/{index-CloS3B1y.js → index-CgO4TZoW.js} +5 -5
- package/dist/{index-CElp6y2B.js → index-D60dcgnT.js} +5 -5
- package/dist/{index-BSrpJXEj.cjs → index-DJWZ286h.cjs} +1 -1
- package/dist/{index-CYANU9EG.js → index-DJkbapPF.js} +5 -5
- package/dist/{index-Bidor65E.cjs → index-DdqsQwCA.cjs} +1 -1
- package/dist/{index-D9rOdRq1.cjs → index-Dotf7I4I.cjs} +1 -1
- package/dist/{index-9XqQn8Cq.cjs → index-_9ANbEVO.cjs} +1 -1
- package/dist/{index-CcM2U332.js → index-jN8q1wgB.js} +2 -2
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +6 -6
- package/dist/{order-2fi-ASUJ.cjs → order-DnPLP5zk.cjs} +1 -1
- package/dist/{order-P0fQ9MtH.js → order-Dos_LDKQ.js} +5 -5
- package/dist/src/builder/constants/block-icons.d.ts +96 -16
- package/dist/src/ui/ItemsSettings/popup.d.ts +9 -2
- package/dist/src/ui/Link/index.d.ts +2 -1
- package/dist/src/ui/Select/utils/index.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/{subscription-BXILybzC.cjs → subscription-B5WUsxPh.cjs} +1 -1
- package/dist/{subscription-S3Q0J-LT.js → subscription-DmySCcmA.js} +5 -5
- package/dist/{ticket-CF6WDvC5.js → ticket-B2EMN-4l.js} +5 -5
- package/dist/{ticket-D67XjuXI.cjs → ticket-CXF_4RQh.cjs} +1 -1
- package/dist/{top-up-DkwIdCFZ.js → top-up-CsP9Vx2_.js} +5 -5
- package/dist/{top-up-Cl5gOjYY.cjs → top-up-VidGg46i.cjs} +1 -1
- package/dist/{ui-components-CNP0TL7h.js → ui-components-C1gbeJtH.js} +782 -776
- package/dist/ui-components-Dd9qd1PE.cjs +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +1 -1
- package/dist/{validation-C8mTX1VQ.js → validation-BKjF1gno.js} +5 -5
- package/dist/{validation-CFXeO04y.cjs → validation-C6sHStJp.cjs} +1 -1
- package/package.json +1 -1
- package/dist/builder--8Ry7cQ4.cjs +0 -43
- package/dist/ui-components-DnpGt0Lr.cjs +0 -1
package/dist/builder.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./builder
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./builder-CN6EcOo5.cjs"),m=require("./ticket-CXF_4RQh.cjs"),o=require("react"),D=require("./charge-C1avZix7.cjs"),_=require("./ui-components-Dd9qd1PE.cjs"),e=require("@phosphor-icons/react"),Q=({children:r,shopDomain:d,shopId:h,shopPassword:g,shopLogo:I})=>{const{setShopDomain:x,setShopId:P,setShopPassword:y,setShopTerms:p,setShopPrivacyPolicy:l,setShopRefundPolicy:f,setShopLogo:A}=i.useStorefrontStore();return o.useLayoutEffect(()=>{const s=async()=>{const{data:u}=await D.fetchTerms();p(u)},C=async()=>{const{data:u}=await D.fetchPrivacyPolicy();l(u)},w=async()=>{const{data:u}=await D.fetchRefundPolicy();f(u)};x(d),P(h),g&&y(g),I&&A(I),s(),C(),w()},[d,h,g]),t.jsx(t.Fragment,{children:r})},X="_wrapper_1xuz3_18",L={wrapper:X};function J(){_.registerIcons({X:e.XIcon,Plus:e.PlusIcon,Minus:e.MinusIcon,Check:e.CheckIcon,Clock:e.ClockIcon,Info:e.InfoIcon,Copy:e.CopyIcon,Trash:e.TrashIcon,Sliders:e.SlidersIcon,Image:e.ImageIcon,List:e.ListIcon,Handbag:e.HandbagIcon,Bag:e.BagIcon,Eye:e.EyeIcon,Crown:e.CrownIcon,ArrowUp:e.ArrowUpIcon,ArrowDown:e.ArrowDownIcon,Confetti:e.ConfettiIcon,ArrowLeft:e.ArrowLeftIcon,ArrowRight:e.ArrowRightIcon,ArrowLineUpRight:e.ArrowLineUpRightIcon,ArrowUpRight:e.ArrowUpRightIcon,ArrowUUpLeft:e.ArrowUUpLeftIcon,ArrowUUpRight:e.ArrowUUpRightIcon,CaretRight:e.CaretRightIcon,CaretDown:e.CaretDownIcon,CaretUp:e.CaretUpIcon,CaretLeft:e.CaretLeftIcon,MagnifyingGlass:e.MagnifyingGlassIcon,MagnifyingGlassMinus:e.MagnifyingGlassMinusIcon,ArrowLineDown:e.ArrowLineDownIcon,Selection:e.SelectionIcon,CloudArrowUpIcon:e.CloudArrowUpIcon,ArrowsHorizontal:e.ArrowsHorizontalIcon,ArrowsVertical:e.ArrowsVerticalIcon,CheckCircle:e.CheckCircleIcon,XCircle:e.XCircleIcon,Star:e.StarIcon,Fire:e.FireIcon,Lightning:e.LightningIcon,AlignCenterHorizontal:e.AlignCenterHorizontalIcon,File:e.FileIcon,FileText:e.FileTextIcon,BookOpen:e.BookOpenIcon,DownloadSimple:e.DownloadSimpleIcon,DiscordLogo:e.DiscordLogoIcon,TelegramLogo:e.TelegramLogoIcon,SignOut:e.SignOutIcon,Wallet:e.WalletIcon,PaperPlaneRight:e.PaperPlaneRightIcon,ChatsTeardrop:e.ChatsTeardropIcon,DotsSixVertical:e.DotsSixVerticalIcon,Share:e.ShareIcon,Shield:e.ShieldIcon,ShieldCheck:e.ShieldCheckIcon,FileCloud:e.FileCloudIcon,Lock:e.LockIcon,Heart:e.HeartIcon,User:e.UserIcon,Calendar:e.CalendarIcon,Smiley:e.SmileyIcon,Globe:e.GlobeIcon,House:e.HouseIcon,HouseSimple:e.HouseSimpleIcon,CurrencyCircleDollar:e.CurrencyCircleDollarIcon,Medal:e.MedalIcon,CalendarCheck:e.CalendarCheckIcon,Question:e.QuestionIcon,Warning:e.WarningIcon,WarningDiamond:e.WarningDiamondIcon,TreeStructure:e.TreeStructureIcon,Palette:e.PaletteIcon,Gear:e.GearIcon,PaintBrushBroad:e.PaintBrushBroadIcon,TextAa:e.TextAaIcon,TextB:e.TextBIcon,TextH:e.TextHIcon,CornersOut:e.CornersOutIcon,ArrowSquareIn:e.ArrowSquareInIcon,Textbox:e.TextboxIcon,SquaresFour:e.SquaresFourIcon,SealQuestion:e.SealQuestionIcon,ChatCentered:e.ChatCenteredIcon,Ticket:e.TicketIcon,UserCircleGear:e.UserCircleGearIcon,Desktop:e.DesktopIcon,DeviceTabletCamera:e.DeviceTabletCameraIcon,DeviceMobileCamera:e.DeviceMobileCameraIcon,Cards:e.CardsIcon,PushPin:e.PushPinIcon,TextAlignLeft:e.TextAlignLeftIcon,TextAlignRight:e.TextAlignRightIcon,TextAlignCenter:e.TextAlignCenterIcon,AlignLeft:e.AlignLeftIcon,AlignRight:e.AlignRightIcon,AlignTop:e.AlignTopIcon,AlignBottom:e.AlignBottomIcon,TextItalic:e.TextItalicIcon,TextStrikethrough:e.TextStrikethroughIcon,TextUnderline:e.TextUnderlineIcon})}const $=o.lazy(()=>Promise.resolve().then(()=>require("./builder-CN6EcOo5.cjs")).then(r=>r.index).then(r=>({default:r.BuilderPage}))),K=o.lazy(()=>Promise.resolve().then(()=>require("./index-_9ANbEVO.cjs")).then(r=>({default:r.ErrorPage}))),Y=o.lazy(()=>Promise.resolve().then(()=>require("./index-C8V0h3ez.cjs")).then(r=>({default:r.ActivePage}))),Z=o.lazy(()=>Promise.resolve().then(()=>require("./validation-C6sHStJp.cjs")).then(r=>({default:r.ValidationPage}))),ee=o.lazy(()=>Promise.resolve().then(()=>require("./index-Dotf7I4I.cjs")).then(r=>({default:r.WrapperPage}))),te=o.lazy(()=>Promise.resolve().then(()=>require("./index-Cg9SH7GR.cjs")).then(r=>({default:r.RouterErrorPage}))),c=o.lazy(()=>Promise.resolve().then(()=>require("./index-DJWZ286h.cjs")).then(r=>({default:r.DynamicErrorPage}))),re=o.lazy(()=>Promise.resolve().then(()=>require("./checkout-DMJ9Uz7K.cjs")).then(r=>({default:r.Checkout}))),oe=o.lazy(()=>Promise.resolve().then(()=>require("./charge-C1avZix7.cjs")).then(r=>r.index$1).then(r=>({default:r.ChargePage}))),ne=o.lazy(()=>Promise.resolve().then(()=>require("./ticket-CXF_4RQh.cjs")).then(r=>r.index).then(r=>({default:r.TicketItem}))),se=o.lazy(()=>Promise.resolve().then(()=>require("./subscription-B5WUsxPh.cjs")).then(r=>r.index).then(r=>({default:r.Subscription}))),ce=o.lazy(()=>Promise.resolve().then(()=>require("./top-up-VidGg46i.cjs")).then(r=>({default:r.TopUpBalance}))),ie=o.lazy(()=>Promise.resolve().then(()=>require("./order-DnPLP5zk.cjs")).then(r=>r.index).then(r=>({default:r.OrderPage}))),ae=o.lazy(()=>Promise.resolve().then(()=>require("./index-DdqsQwCA.cjs")).then(r=>({default:r.TermsPage}))),le=o.lazy(()=>Promise.resolve().then(()=>require("./charge-C1avZix7.cjs")).then(r=>r.index).then(r=>({default:r.CustomerDashboard}))),U=o.lazy(()=>Promise.resolve().then(()=>require("./charge-C1avZix7.cjs")).then(r=>r.recapcha).then(r=>({default:r.ReCaptchaProvider}))),ue=()=>null,n=({children:r})=>t.jsx(o.Suspense,{fallback:t.jsx(ue,{}),children:r}),B=o.lazy(()=>Promise.resolve().then(()=>require("./builder-components-CSl62_15.cjs")).then(r=>r.index).then(r=>({default:r.RenderAnnouncement}))),R=o.lazy(()=>Promise.resolve().then(()=>require("./builder-components-CSl62_15.cjs")).then(r=>r.index).then(r=>({default:r.RenderFooter}))),b=o.lazy(()=>Promise.resolve().then(()=>require("./builder-components-CSl62_15.cjs")).then(r=>r.index).then(r=>({default:r.RenderHeader}))),de=r=>{var E;const{blocks:d,settings:h,header:g,footer:I,announcement:x,routes:P=[],shopLogo:y,apiURLs:p,isAntistock:l=!1}=r,[f,A]=o.useState(null),{general:s,setIsAntistock:C}=i.useGeneralStore(),{setApiUrls:w}=i.useApiStore(),u=((E=s==null?void 0:s.info)==null?void 0:E.customerAccountSettings)??"OPTIONAL",z=u==="DISABLED",{setBlocks:H,setSourceBlocks:F,setHeader:O,setFooter:M,setAnnouncement:G,setSettings:W}=i.useBlocksStore(),{themeSettings:S}=i.useThemeSettingsStore(),{settings:T,setSettings:V}=i.useSettingsStore(),k=i.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"":window.location.hostname,N=localStorage.getItem("shopPassword"),q=localStorage.getItem("shopId")||"";return o.useEffect(()=>{if(C(l),l){const a=document.documentElement;getComputedStyle(a).getPropertyValue("--brand-color").trim()==="#ff3f19"&&a.style.setProperty("--brand-color","#a13dff")}},[l,C]),o.useEffect(()=>{!q&&(s!=null&&s.info.id)&&localStorage.setItem("shopId",s==null?void 0:s.info.id)},[s]),o.useEffect(()=>{!k&&!l&&localStorage.setItem("fakeDomain","drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io")},[k]),o.useEffect(()=>{if(S&&T){const a=m.generateDynamicStyles(S,T);m.loadCustomFonts(),m.setupDynamicFonts(S),m.injectStylesToDOM(a)}},[S,JSON.stringify(T),window.location.hostname]),o.useEffect(()=>{const j=new h().blockSettings;V(j)},[]),o.useEffect(()=>{J()},[]),o.useLayoutEffect(()=>{const a={};Object.keys(d).map(v=>{a[v]=d[v]}),F(a),H(a),O(g),M(I),G(x),W(h),p&&w(p);const j=i.createBrowserRouter([{element:t.jsx(Q,{shopDomain:k,shopId:q,shopPassword:N||void 0,shopLogo:y,children:t.jsx(U,{children:t.jsx(ee,{children:t.jsx(i.Outlet,{})})})}),errorElement:t.jsx(n,{children:t.jsx(te,{})}),children:[{path:"/admin/builder/*",element:t.jsx(n,{children:t.jsx(Y,{children:t.jsx($,{blocks:d,settings:h,header:g,footer:I,announcement:x})})}),errorElement:t.jsx(n,{children:t.jsx(K,{})})},...P,{path:"/checkout",element:t.jsx(n,{children:t.jsx(re,{})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:t.jsx(n,{children:t.jsx(ce,{})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:t.jsx(n,{children:t.jsx(oe,{})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:t.jsx(n,{children:t.jsx(ie,{})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:t.jsx(n,{children:t.jsx(se,{})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Subscriptions",!0)},...z?[]:[{path:l?"/account":"/customer-dash",element:t.jsx(n,{children:t.jsxs("div",{className:L.wrapper,children:[t.jsx(B,{}),t.jsx(b,{}),t.jsx("div",{style:{flex:"1 1 auto"},children:t.jsx(le,{})}),t.jsx(R,{})]})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title=l?"Account":"Customer Dashboard",!0)}],{path:"/validation",element:t.jsx(n,{children:t.jsx(Z,{})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:t.jsx(n,{children:t.jsxs("div",{className:L.wrapper,children:[t.jsx(b,{}),t.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:t.jsx(U,{children:t.jsx(ne,{})})}),t.jsx(R,{})]})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Ticket",!0)},{path:"/terms",element:t.jsx(n,{children:t.jsxs("div",{className:L.wrapper,children:[t.jsx(B,{}),t.jsx(b,{}),t.jsx("div",{style:{flex:1,width:"100%"},children:t.jsx(ae,{})}),t.jsx(R,{})]})}),errorElement:t.jsx(n,{children:t.jsx(c,{})}),loader:()=>(document.title="Terms of Service",!0)},{path:"*",element:t.jsx(m.DynamicRouteWrapper,{}),errorElement:t.jsx(n,{children:t.jsx(c,{})})}]}]);A(j)},[s,u]),t.jsx(o.Suspense,{fallback:null,children:f&&t.jsx(i.RouterProvider,{router:f})})};exports.App=de;
|
package/dist/builder.es.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { N as
|
|
3
|
-
import { f as ee, l as te, j as oe, k as ne, D as re } from "./ticket-
|
|
1
|
+
import { jsx as e, Fragment as _, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { N as j, z as N, j as q, c as Q, m as X, a as J, M as $, aj as K, ak as Y, al as Z } from "./builder-Ddop-8xf.js";
|
|
3
|
+
import { f as ee, l as te, j as oe, k as ne, D as re } from "./ticket-B2EMN-4l.js";
|
|
4
4
|
import o, { Suspense as ce } from "react";
|
|
5
|
-
import { _ as ae, $ as ie, a0 as
|
|
6
|
-
import { w as
|
|
7
|
-
import { TextUnderlineIcon as de, TextStrikethroughIcon as
|
|
5
|
+
import { _ as ae, $ as ie, a0 as le } from "./charge-DKR9uXCa.js";
|
|
6
|
+
import { w as se } from "./ui-components-C1gbeJtH.js";
|
|
7
|
+
import { TextUnderlineIcon as de, TextStrikethroughIcon as ue, TextItalicIcon as he, AlignBottomIcon as me, AlignTopIcon as pe, AlignRightIcon as Ie, AlignLeftIcon as ge, TextAlignCenterIcon as fe, TextAlignRightIcon as Ce, TextAlignLeftIcon as Se, PushPinIcon as ye, CardsIcon as Ae, DeviceMobileCameraIcon as we, DeviceTabletCameraIcon as Te, DesktopIcon as Pe, UserCircleGearIcon as ke, TicketIcon as De, ChatCenteredIcon as Le, SealQuestionIcon as Re, SquaresFourIcon as xe, TextboxIcon as be, ArrowSquareInIcon as Ee, CornersOutIcon as Be, TextHIcon as Ue, TextBIcon as ze, TextAaIcon as ve, PaintBrushBroadIcon as He, GearIcon as Fe, PaletteIcon as Oe, TreeStructureIcon as Me, WarningDiamondIcon as Ge, WarningIcon as We, QuestionIcon as Ve, CalendarCheckIcon as _e, MedalIcon as je, CurrencyCircleDollarIcon as Ne, HouseSimpleIcon as qe, HouseIcon as Qe, GlobeIcon as Xe, SmileyIcon as Je, CalendarIcon as $e, UserIcon as Ke, HeartIcon as Ye, LockIcon as Ze, FileCloudIcon as et, ShieldCheckIcon as tt, ShieldIcon as ot, ShareIcon as nt, DotsSixVerticalIcon as rt, ChatsTeardropIcon as ct, PaperPlaneRightIcon as at, WalletIcon as it, SignOutIcon as lt, TelegramLogoIcon as st, DiscordLogoIcon as dt, DownloadSimpleIcon as ut, BookOpenIcon as ht, FileTextIcon as mt, FileIcon as pt, AlignCenterHorizontalIcon as It, LightningIcon as gt, FireIcon as ft, StarIcon as Ct, XCircleIcon as St, CheckCircleIcon as yt, ArrowsVerticalIcon as At, ArrowsHorizontalIcon as wt, CloudArrowUpIcon as Tt, SelectionIcon as Pt, ArrowLineDownIcon as kt, MagnifyingGlassMinusIcon as Dt, MagnifyingGlassIcon as Lt, CaretLeftIcon as Rt, CaretUpIcon as xt, CaretDownIcon as bt, CaretRightIcon as Et, ArrowUUpRightIcon as Bt, ArrowUUpLeftIcon as Ut, ArrowUpRightIcon as zt, ArrowLineUpRightIcon as vt, ArrowRightIcon as Ht, ArrowLeftIcon as Ft, ConfettiIcon as Ot, ArrowDownIcon as Mt, ArrowUpIcon as Gt, CrownIcon as Wt, EyeIcon as Vt, BagIcon as _t, HandbagIcon as jt, ListIcon as Nt, ImageIcon as qt, SlidersIcon as Qt, TrashIcon as Xt, CopyIcon as Jt, InfoIcon as $t, ClockIcon as Kt, CheckIcon as Yt, MinusIcon as Zt, PlusIcon as eo, XIcon as to } from "@phosphor-icons/react";
|
|
8
8
|
const oo = ({
|
|
9
9
|
children: t,
|
|
10
10
|
shopDomain: s,
|
|
11
|
-
shopId:
|
|
12
|
-
shopPassword:
|
|
13
|
-
shopLogo:
|
|
11
|
+
shopId: d,
|
|
12
|
+
shopPassword: u,
|
|
13
|
+
shopLogo: h
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
16
|
setShopDomain: m,
|
|
17
17
|
setShopId: S,
|
|
18
|
-
setShopPassword:
|
|
19
|
-
setShopTerms:
|
|
18
|
+
setShopPassword: y,
|
|
19
|
+
setShopTerms: p,
|
|
20
20
|
setShopPrivacyPolicy: i,
|
|
21
|
-
setShopRefundPolicy:
|
|
22
|
-
setShopLogo:
|
|
23
|
-
} =
|
|
21
|
+
setShopRefundPolicy: I,
|
|
22
|
+
setShopLogo: A
|
|
23
|
+
} = j();
|
|
24
24
|
return o.useLayoutEffect(() => {
|
|
25
25
|
const r = async () => {
|
|
26
|
-
const { data:
|
|
27
|
-
|
|
26
|
+
const { data: l } = await ae();
|
|
27
|
+
p(l);
|
|
28
28
|
}, g = async () => {
|
|
29
|
-
const { data:
|
|
30
|
-
i(
|
|
31
|
-
},
|
|
32
|
-
const { data:
|
|
33
|
-
|
|
29
|
+
const { data: l } = await ie();
|
|
30
|
+
i(l);
|
|
31
|
+
}, w = async () => {
|
|
32
|
+
const { data: l } = await le();
|
|
33
|
+
I(l);
|
|
34
34
|
};
|
|
35
|
-
m(s), S(
|
|
36
|
-
}, [s,
|
|
37
|
-
}, no = "_wrapper_1xuz3_18",
|
|
35
|
+
m(s), S(d), u && y(u), h && A(h), r(), g(), w();
|
|
36
|
+
}, [s, d, u]), /* @__PURE__ */ e(_, { children: t });
|
|
37
|
+
}, no = "_wrapper_1xuz3_18", L = {
|
|
38
38
|
wrapper: no
|
|
39
39
|
};
|
|
40
40
|
function ro() {
|
|
41
|
-
|
|
41
|
+
se({
|
|
42
42
|
// Основные UI иконки
|
|
43
43
|
X: to,
|
|
44
44
|
Plus: eo,
|
|
@@ -51,9 +51,9 @@ function ro() {
|
|
|
51
51
|
Sliders: Qt,
|
|
52
52
|
Image: qt,
|
|
53
53
|
List: Nt,
|
|
54
|
-
Handbag:
|
|
55
|
-
Bag:
|
|
56
|
-
Eye:
|
|
54
|
+
Handbag: jt,
|
|
55
|
+
Bag: _t,
|
|
56
|
+
Eye: Vt,
|
|
57
57
|
Crown: Wt,
|
|
58
58
|
ArrowUp: Gt,
|
|
59
59
|
ArrowDown: Mt,
|
|
@@ -70,28 +70,28 @@ function ro() {
|
|
|
70
70
|
CaretLeft: Rt,
|
|
71
71
|
MagnifyingGlass: Lt,
|
|
72
72
|
MagnifyingGlassMinus: Dt,
|
|
73
|
-
ArrowLineDown:
|
|
74
|
-
Selection:
|
|
73
|
+
ArrowLineDown: kt,
|
|
74
|
+
Selection: Pt,
|
|
75
75
|
CloudArrowUpIcon: Tt,
|
|
76
76
|
ArrowsHorizontal: wt,
|
|
77
77
|
ArrowsVertical: At,
|
|
78
78
|
// Статусы и действия
|
|
79
79
|
CheckCircle: yt,
|
|
80
|
-
XCircle:
|
|
81
|
-
Star:
|
|
80
|
+
XCircle: St,
|
|
81
|
+
Star: Ct,
|
|
82
82
|
Fire: ft,
|
|
83
83
|
Lightning: gt,
|
|
84
|
-
AlignCenterHorizontal:
|
|
84
|
+
AlignCenterHorizontal: It,
|
|
85
85
|
// Файлы и документы
|
|
86
|
-
File:
|
|
86
|
+
File: pt,
|
|
87
87
|
FileText: mt,
|
|
88
|
-
BookOpen:
|
|
89
|
-
DownloadSimple:
|
|
88
|
+
BookOpen: ht,
|
|
89
|
+
DownloadSimple: ut,
|
|
90
90
|
// Социальные сети
|
|
91
91
|
DiscordLogo: dt,
|
|
92
|
-
TelegramLogo:
|
|
92
|
+
TelegramLogo: st,
|
|
93
93
|
// Навигация и интерфейс
|
|
94
|
-
SignOut:
|
|
94
|
+
SignOut: lt,
|
|
95
95
|
Wallet: it,
|
|
96
96
|
PaperPlaneRight: at,
|
|
97
97
|
ChatsTeardrop: ct,
|
|
@@ -112,9 +112,9 @@ function ro() {
|
|
|
112
112
|
House: Qe,
|
|
113
113
|
HouseSimple: qe,
|
|
114
114
|
CurrencyCircleDollar: Ne,
|
|
115
|
-
Medal:
|
|
116
|
-
CalendarCheck:
|
|
117
|
-
Question:
|
|
115
|
+
Medal: je,
|
|
116
|
+
CalendarCheck: _e,
|
|
117
|
+
Question: Ve,
|
|
118
118
|
// Иконки для статусов
|
|
119
119
|
Warning: We,
|
|
120
120
|
WarningDiamond: Ge,
|
|
@@ -133,124 +133,127 @@ function ro() {
|
|
|
133
133
|
SealQuestion: Re,
|
|
134
134
|
ChatCentered: Le,
|
|
135
135
|
Ticket: De,
|
|
136
|
-
UserCircleGear:
|
|
137
|
-
Desktop:
|
|
136
|
+
UserCircleGear: ke,
|
|
137
|
+
Desktop: Pe,
|
|
138
138
|
DeviceTabletCamera: Te,
|
|
139
139
|
DeviceMobileCamera: we,
|
|
140
140
|
Cards: Ae,
|
|
141
141
|
PushPin: ye,
|
|
142
142
|
// Иконки для выравнивания текста и отступов
|
|
143
|
-
TextAlignLeft:
|
|
144
|
-
TextAlignRight:
|
|
143
|
+
TextAlignLeft: Se,
|
|
144
|
+
TextAlignRight: Ce,
|
|
145
145
|
TextAlignCenter: fe,
|
|
146
146
|
AlignLeft: ge,
|
|
147
|
-
AlignRight:
|
|
148
|
-
AlignTop:
|
|
147
|
+
AlignRight: Ie,
|
|
148
|
+
AlignTop: pe,
|
|
149
149
|
AlignBottom: me,
|
|
150
150
|
// Иконки для форматирования текста
|
|
151
|
-
TextItalic:
|
|
152
|
-
TextStrikethrough:
|
|
151
|
+
TextItalic: he,
|
|
152
|
+
TextStrikethrough: ue,
|
|
153
153
|
TextUnderline: de
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
const co = o.lazy(
|
|
157
|
-
() => import("./builder-
|
|
157
|
+
() => import("./builder-Ddop-8xf.js").then((t) => t.ao).then((t) => ({ default: t.BuilderPage }))
|
|
158
158
|
), ao = o.lazy(
|
|
159
|
-
() => import("./index-
|
|
159
|
+
() => import("./index-B2X6m84l.js").then((t) => ({ default: t.ErrorPage }))
|
|
160
160
|
), io = o.lazy(
|
|
161
|
-
() => import("./index-
|
|
162
|
-
), so = o.lazy(
|
|
163
|
-
() => import("./validation-C8mTX1VQ.js").then((t) => ({ default: t.ValidationPage }))
|
|
161
|
+
() => import("./index-BlUHhZz9.js").then((t) => ({ default: t.ActivePage }))
|
|
164
162
|
), lo = o.lazy(
|
|
165
|
-
() => import("./
|
|
166
|
-
),
|
|
167
|
-
() => import("./index-
|
|
168
|
-
), c = o.lazy(
|
|
169
|
-
() => import("./index-CloS3B1y.js").then((t) => ({ default: t.DynamicErrorPage }))
|
|
163
|
+
() => import("./validation-BKjF1gno.js").then((t) => ({ default: t.ValidationPage }))
|
|
164
|
+
), so = o.lazy(
|
|
165
|
+
() => import("./index-D60dcgnT.js").then((t) => ({ default: t.WrapperPage }))
|
|
170
166
|
), uo = o.lazy(
|
|
171
|
-
() => import("./
|
|
167
|
+
() => import("./index-DJkbapPF.js").then((t) => ({ default: t.RouterErrorPage }))
|
|
168
|
+
), c = o.lazy(
|
|
169
|
+
() => import("./index-CgO4TZoW.js").then((t) => ({ default: t.DynamicErrorPage }))
|
|
170
|
+
), ho = o.lazy(
|
|
171
|
+
() => import("./checkout-CCi0lVqr.js").then((t) => ({ default: t.Checkout }))
|
|
172
172
|
), mo = o.lazy(
|
|
173
|
-
() => import("./charge-
|
|
174
|
-
), Io = o.lazy(
|
|
175
|
-
() => import("./ticket-CF6WDvC5.js").then((t) => t.m).then((t) => ({ default: t.TicketItem }))
|
|
173
|
+
() => import("./charge-DKR9uXCa.js").then((t) => t.a8).then((t) => ({ default: t.ChargePage }))
|
|
176
174
|
), po = o.lazy(
|
|
177
|
-
() => import("./
|
|
175
|
+
() => import("./ticket-B2EMN-4l.js").then((t) => t.m).then((t) => ({ default: t.TicketItem }))
|
|
176
|
+
), Io = o.lazy(
|
|
177
|
+
() => import("./subscription-DmySCcmA.js").then((t) => t.i).then((t) => ({ default: t.Subscription }))
|
|
178
178
|
), go = o.lazy(
|
|
179
|
-
() => import("./top-up-
|
|
179
|
+
() => import("./top-up-CsP9Vx2_.js").then((t) => ({ default: t.TopUpBalance }))
|
|
180
180
|
), fo = o.lazy(
|
|
181
|
-
() => import("./order-
|
|
182
|
-
), So = o.lazy(
|
|
183
|
-
() => import("./index-CcM2U332.js").then((t) => ({ default: t.TermsPage }))
|
|
181
|
+
() => import("./order-Dos_LDKQ.js").then((t) => t.i).then((t) => ({ default: t.OrderPage }))
|
|
184
182
|
), Co = o.lazy(
|
|
185
|
-
() => import("./
|
|
183
|
+
() => import("./index-jN8q1wgB.js").then((t) => ({ default: t.TermsPage }))
|
|
184
|
+
), So = o.lazy(
|
|
185
|
+
() => import("./charge-DKR9uXCa.js").then((t) => t.a7).then((t) => ({ default: t.CustomerDashboard }))
|
|
186
186
|
), B = o.lazy(
|
|
187
|
-
() => import("./charge-
|
|
187
|
+
() => import("./charge-DKR9uXCa.js").then((t) => t.a6).then((t) => ({ default: t.ReCaptchaProvider }))
|
|
188
188
|
), yo = () => null, n = ({ children: t }) => /* @__PURE__ */ e(ce, { fallback: /* @__PURE__ */ e(yo, {}), children: t }), U = o.lazy(
|
|
189
|
-
() => import("./builder-components-
|
|
189
|
+
() => import("./builder-components-Co8dAOpQ.js").then((t) => t.i).then((t) => ({
|
|
190
190
|
default: t.RenderAnnouncement
|
|
191
191
|
}))
|
|
192
|
-
),
|
|
193
|
-
() => import("./builder-components-
|
|
192
|
+
), R = o.lazy(
|
|
193
|
+
() => import("./builder-components-Co8dAOpQ.js").then((t) => t.i).then((t) => ({
|
|
194
194
|
default: t.RenderFooter
|
|
195
195
|
}))
|
|
196
|
-
),
|
|
197
|
-
() => import("./builder-components-
|
|
196
|
+
), x = o.lazy(
|
|
197
|
+
() => import("./builder-components-Co8dAOpQ.js").then((t) => t.i).then((t) => ({
|
|
198
198
|
default: t.RenderHeader
|
|
199
199
|
}))
|
|
200
|
-
),
|
|
201
|
-
var
|
|
200
|
+
), xo = (t) => {
|
|
201
|
+
var E;
|
|
202
202
|
const {
|
|
203
203
|
blocks: s,
|
|
204
|
-
settings:
|
|
205
|
-
header:
|
|
206
|
-
footer:
|
|
204
|
+
settings: d,
|
|
205
|
+
header: u,
|
|
206
|
+
footer: h,
|
|
207
207
|
announcement: m,
|
|
208
208
|
routes: S = [],
|
|
209
|
-
shopLogo:
|
|
210
|
-
apiURLs:
|
|
209
|
+
shopLogo: y,
|
|
210
|
+
apiURLs: p,
|
|
211
211
|
isAntistock: i = !1
|
|
212
|
-
} = t, [
|
|
212
|
+
} = t, [I, A] = o.useState(null), { general: r, setIsAntistock: g } = N(), { setApiUrls: w } = q(), l = ((E = r == null ? void 0 : r.info) == null ? void 0 : E.customerAccountSettings) ?? "OPTIONAL", z = l === "DISABLED", {
|
|
213
213
|
setBlocks: v,
|
|
214
214
|
setSourceBlocks: H,
|
|
215
215
|
setHeader: F,
|
|
216
216
|
setFooter: O,
|
|
217
217
|
setAnnouncement: M,
|
|
218
218
|
setSettings: G
|
|
219
|
-
} = Q(), { themeSettings: f } = X(), { settings:
|
|
219
|
+
} = Q(), { themeSettings: f } = X(), { settings: T, setSettings: W } = J(), P = $ ? localStorage.getItem("fakeDomain") || "" : window.location.hostname, V = localStorage.getItem("shopPassword"), b = localStorage.getItem("shopId") || "";
|
|
220
220
|
return o.useEffect(() => {
|
|
221
|
-
g(i)
|
|
221
|
+
if (g(i), i) {
|
|
222
|
+
const a = document.documentElement;
|
|
223
|
+
getComputedStyle(a).getPropertyValue("--brand-color").trim() === "#ff3f19" && a.style.setProperty("--brand-color", "#a13dff");
|
|
224
|
+
}
|
|
222
225
|
}, [i, g]), o.useEffect(() => {
|
|
223
|
-
!
|
|
226
|
+
!b && (r != null && r.info.id) && localStorage.setItem("shopId", r == null ? void 0 : r.info.id);
|
|
224
227
|
}, [r]), o.useEffect(() => {
|
|
225
|
-
!
|
|
226
|
-
}, [
|
|
227
|
-
if (f &&
|
|
228
|
-
const
|
|
229
|
-
te(), oe(f), ne(
|
|
228
|
+
!P && !i && localStorage.setItem("fakeDomain", "drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io");
|
|
229
|
+
}, [P]), o.useEffect(() => {
|
|
230
|
+
if (f && T) {
|
|
231
|
+
const a = ee(f, T);
|
|
232
|
+
te(), oe(f), ne(a);
|
|
230
233
|
}
|
|
231
|
-
}, [f, JSON.stringify(
|
|
232
|
-
const
|
|
233
|
-
W(
|
|
234
|
+
}, [f, JSON.stringify(T), window.location.hostname]), o.useEffect(() => {
|
|
235
|
+
const C = new d().blockSettings;
|
|
236
|
+
W(C);
|
|
234
237
|
}, []), o.useEffect(() => {
|
|
235
238
|
ro();
|
|
236
239
|
}, []), o.useLayoutEffect(() => {
|
|
237
|
-
const
|
|
238
|
-
Object.keys(s).map((
|
|
239
|
-
|
|
240
|
-
}), H(
|
|
241
|
-
const
|
|
240
|
+
const a = {};
|
|
241
|
+
Object.keys(s).map((k) => {
|
|
242
|
+
a[k] = s[k];
|
|
243
|
+
}), H(a), v(a), F(u), O(h), M(m), G(d), p && w(p);
|
|
244
|
+
const C = K([
|
|
242
245
|
{
|
|
243
246
|
element: /* @__PURE__ */ e(
|
|
244
247
|
oo,
|
|
245
248
|
{
|
|
246
|
-
shopDomain:
|
|
247
|
-
shopId:
|
|
248
|
-
shopPassword:
|
|
249
|
-
shopLogo:
|
|
250
|
-
children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
249
|
+
shopDomain: P,
|
|
250
|
+
shopId: b,
|
|
251
|
+
shopPassword: V || void 0,
|
|
252
|
+
shopLogo: y,
|
|
253
|
+
children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(so, { children: /* @__PURE__ */ e(Y, {}) }) })
|
|
251
254
|
}
|
|
252
255
|
),
|
|
253
|
-
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(
|
|
256
|
+
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(uo, {}) }),
|
|
254
257
|
children: [
|
|
255
258
|
{
|
|
256
259
|
path: "/admin/builder/*",
|
|
@@ -258,9 +261,9 @@ const co = o.lazy(
|
|
|
258
261
|
co,
|
|
259
262
|
{
|
|
260
263
|
blocks: s,
|
|
261
|
-
settings:
|
|
262
|
-
header:
|
|
263
|
-
footer:
|
|
264
|
+
settings: d,
|
|
265
|
+
header: u,
|
|
266
|
+
footer: h,
|
|
264
267
|
announcement: m
|
|
265
268
|
}
|
|
266
269
|
) }) }),
|
|
@@ -269,7 +272,7 @@ const co = o.lazy(
|
|
|
269
272
|
...S,
|
|
270
273
|
{
|
|
271
274
|
path: "/checkout",
|
|
272
|
-
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(
|
|
275
|
+
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(ho, {}) }),
|
|
273
276
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
274
277
|
loader: () => (document.title = "Checkout", !0)
|
|
275
278
|
},
|
|
@@ -293,26 +296,26 @@ const co = o.lazy(
|
|
|
293
296
|
},
|
|
294
297
|
{
|
|
295
298
|
path: "/subscriptions/:id/:accessToken?",
|
|
296
|
-
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(
|
|
299
|
+
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(Io, {}) }),
|
|
297
300
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
298
301
|
loader: () => (document.title = "Subscriptions", !0)
|
|
299
302
|
},
|
|
300
303
|
...z ? [] : [
|
|
301
304
|
{
|
|
302
305
|
path: i ? "/account" : "/customer-dash",
|
|
303
|
-
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */
|
|
306
|
+
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ D("div", { className: L.wrapper, children: [
|
|
304
307
|
/* @__PURE__ */ e(U, {}),
|
|
305
|
-
/* @__PURE__ */ e(
|
|
308
|
+
/* @__PURE__ */ e(x, {}),
|
|
306
309
|
/* @__PURE__ */ e(
|
|
307
310
|
"div",
|
|
308
311
|
{
|
|
309
312
|
style: {
|
|
310
313
|
flex: "1 1 auto"
|
|
311
314
|
},
|
|
312
|
-
children: /* @__PURE__ */ e(
|
|
315
|
+
children: /* @__PURE__ */ e(So, {})
|
|
313
316
|
}
|
|
314
317
|
),
|
|
315
|
-
/* @__PURE__ */ e(
|
|
318
|
+
/* @__PURE__ */ e(R, {})
|
|
316
319
|
] }) }),
|
|
317
320
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
318
321
|
loader: () => (document.title = i ? "Account" : "Customer Dashboard", !0)
|
|
@@ -320,14 +323,14 @@ const co = o.lazy(
|
|
|
320
323
|
],
|
|
321
324
|
{
|
|
322
325
|
path: "/validation",
|
|
323
|
-
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(
|
|
326
|
+
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(lo, {}) }),
|
|
324
327
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
325
328
|
loader: () => (document.title = "Validation", !0)
|
|
326
329
|
},
|
|
327
330
|
{
|
|
328
331
|
path: "/ticket/:id/:accessToken",
|
|
329
|
-
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */ e(
|
|
332
|
+
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ D("div", { className: L.wrapper, children: [
|
|
333
|
+
/* @__PURE__ */ e(x, {}),
|
|
331
334
|
/* @__PURE__ */ e(
|
|
332
335
|
"div",
|
|
333
336
|
{
|
|
@@ -336,19 +339,19 @@ const co = o.lazy(
|
|
|
336
339
|
width: "100%",
|
|
337
340
|
height: "100%"
|
|
338
341
|
},
|
|
339
|
-
children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(
|
|
342
|
+
children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(po, {}) })
|
|
340
343
|
}
|
|
341
344
|
),
|
|
342
|
-
/* @__PURE__ */ e(
|
|
345
|
+
/* @__PURE__ */ e(R, {})
|
|
343
346
|
] }) }),
|
|
344
347
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
345
348
|
loader: () => (document.title = "Ticket", !0)
|
|
346
349
|
},
|
|
347
350
|
{
|
|
348
351
|
path: "/terms",
|
|
349
|
-
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */
|
|
352
|
+
element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ D("div", { className: L.wrapper, children: [
|
|
350
353
|
/* @__PURE__ */ e(U, {}),
|
|
351
|
-
/* @__PURE__ */ e(
|
|
354
|
+
/* @__PURE__ */ e(x, {}),
|
|
352
355
|
/* @__PURE__ */ e(
|
|
353
356
|
"div",
|
|
354
357
|
{
|
|
@@ -356,10 +359,10 @@ const co = o.lazy(
|
|
|
356
359
|
flex: 1,
|
|
357
360
|
width: "100%"
|
|
358
361
|
},
|
|
359
|
-
children: /* @__PURE__ */ e(
|
|
362
|
+
children: /* @__PURE__ */ e(Co, {})
|
|
360
363
|
}
|
|
361
364
|
),
|
|
362
|
-
/* @__PURE__ */ e(
|
|
365
|
+
/* @__PURE__ */ e(R, {})
|
|
363
366
|
] }) }),
|
|
364
367
|
errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
|
|
365
368
|
loader: () => (document.title = "Terms of Service", !0)
|
|
@@ -372,9 +375,9 @@ const co = o.lazy(
|
|
|
372
375
|
]
|
|
373
376
|
}
|
|
374
377
|
]);
|
|
375
|
-
|
|
376
|
-
}, [r,
|
|
378
|
+
A(C);
|
|
379
|
+
}, [r, l]), /* @__PURE__ */ e(o.Suspense, { fallback: null, children: I && /* @__PURE__ */ e(Z, { router: I }) });
|
|
377
380
|
};
|
|
378
381
|
export {
|
|
379
|
-
|
|
382
|
+
xo as App
|
|
380
383
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const g=require("./builder--8Ry7cQ4.cjs"),i=require("react/jsx-runtime"),L=require("react"),N=require("./ui-components-DnpGt0Lr.cjs"),nl=require("./builder-components-Bgg9F62l.cjs");require("react-dom");const rl=require("./ticket-D67XjuXI.cjs"),ul=require("./order-2fi-ASUJ.cjs"),t2=require("./subscription-BXILybzC.cjs");function n2(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const me=n2(L),r2=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,al=({children:e,className:t,as:n="span",...r})=>{const[u,a]=L.useState(!1);return L.useEffect(()=>{typeof window<"u"&&a(r2())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function u2(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await g.request({method:"get",url:r,withToken:!1})).data}const a2=async()=>{const e=g.useApiStore.getState().apiUrls,t=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await g.request({url:n,withToken:!0,method:"get"})},s2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},i2=async(e,t)=>{const r=`${g.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await g.request({url:r,method:"post",body:e,withToken:!1})},Nr=async e=>{const t=g.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},o2=()=>Nr("dash/info"),sl=()=>Nr("dash/dashboard/home"),c2=()=>Nr("rewards"),l2=()=>Nr("balance"),d2=()=>Nr("balance/top-up/settings"),f2=()=>Nr("referral-system"),Ks=e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return g.request({url:r,withToken:!1,method:"get"})},h2=()=>Ks("terms"),p2=()=>Ks("refund-policy"),m2=()=>Ks("privacy-policy"),Es=10,aa=async({url:e,PageNumber:t})=>{var o;const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${Es}`,a=await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},sa=async(e,t="get",n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await g.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},g2=e=>sa("","post",e),b2=({PageNumber:e})=>aa({url:"customers/orders",PageNumber:e}),_2=e=>sa(e),x2=e=>sa(e),C2=(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return g.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},E2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),g.request({url:r,method:"post",withToken:!1,body:u})},y2=(e,t,n)=>sa(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),T2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await g.request({url:r,method:"post",withToken:!1,body:e})},k2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},A2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await g.request({url:u,method:"get",withToken:!1})},S2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await g.request({url:a,method:"post",withToken:!1,body:n})},I2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await g.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},N2=({PageNumber:e})=>aa({url:"customers/subscriptions",PageNumber:e}),v2=async({id:e,accessToken:t})=>await A2(e,t),w2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await g.request({url:u,method:"post",withToken:!1,body:t})},D2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},L2=async(e,t,n,r,u,a)=>{const s=g.useApiStore.getState().apiUrls,o=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,c=`${s.slApi}/v1/public/${o}/tickets/${e}/${t}/answer`;return(await g.request({url:c,method:"post",body:{message:n,recaptcha:r,tsId:u,...a&&a.length>0&&{imageIds:a.map(h=>h.imageId)}},withToken:!1})).data},P2=({PageNumber:e})=>aa({url:"customers/tickets",PageNumber:e}),R2=({PageNumber:e})=>aa({url:"customers/balance/transactions",PageNumber:e}),M2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await g.request({url:a,method:"post",withToken:!1,body:e})},O2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await g.request({url:r,method:"get",withToken:!1})},j2=async e=>{const t=g.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await g.request({url:a,method:"get",withToken:!1})},ku=new Map,il=async e=>{const t=g.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(ku.has(o))return ku.get(o);const c=g.request({url:s,method:"get",withToken:!1}).catch(l=>{throw ku.delete(o),l});return ku.set(o,c),c},ol=async({email:e,recaptcha:t,tsId:n})=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await g.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},cl=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=g.useApiStore.getState().apiUrls,a=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await g.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return g.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},ys=async()=>{g.useStorefrontStore.getState().setToken(""),g.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},F2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:cl,logoutCustomer:ys,requestOtp:ol},Symbol.toStringTag,{value:"Module"})),B2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await g.request({url:r,method:"post",body:e,withToken:!1})},H2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await g.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},U2=async()=>{const{data:e}=await f2();return e},V2=async e=>{const{data:t}=await H2(e);return t},$2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},z2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await g.request({url:r,method:"get",withToken:!1})};async function q2(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return g.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const Z2=async(e,t,n,r)=>{const a=`${g.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await g.request({url:a,method:"post",withToken:!1,body:e})},ll=()=>g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,W2=async()=>{const e=g.useApiStore.getState().apiUrls,t=ll(),n=`${e.customersApi}/v2/${t}/api-key`;return g.request({url:n,method:"get",withToken:!0,typeToken:"customer"})},Y2=async()=>{const e=g.useApiStore.getState().apiUrls,t=ll(),n=`${e.customersApi}/v2/${t}/api-key/regenerate`;return g.request({url:n,method:"post",withToken:!0,typeToken:"customer"})},Ma="Balance",jn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},G2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Wi=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=g.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},X2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},K2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(b=>(b==null?void 0:b.id)===u.productId),s=a==null?void 0:a.variants.find(b=>b.id===u.productVariantId);if(!s)return;const{gateway:o}=g.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(b=>b.name===o&&b.overrodePrice)?(m=c.find(b=>b.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const b=X2(s,u.quantity),_=f*(1-b/100);r+=_}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},Q2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Yi=e=>new Set(e.gateways.map(t=>t.name)),Oa={availableGateways:[],requiresSignInGateways:[]},Gi=(e,t)=>{if(t.length===0)return Oa;const n=e[0];if(!n)return Oa;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Oa;const a=Yi(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Yi(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(Ma)?(a.delete(Ma),{availableGateways:[...a],requiresSignInGateways:[Ma]}):{availableGateways:[...a],requiresSignInGateways:[]}},Xi=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},J2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},du=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=g.useCartStore(),f=async _=>{var M;h(!0);const{cart:E}=g.useCartStore.getState(),{gateway:x,parts:k}=E,{notifications:y,setNotifications:D}=g.useNotificationStore.getState();x||(h(!1),D([...y,{message:"There should be a gateway for the coupon",status:"error",id:g.v4()}]));const S=k.map(H=>H.productId);let I=null;try{const{data:H}=await B2({gateway:x,couponName:_,productIds:S});I=H.data,D([...y,{message:"Coupon is applied",status:"success",id:g.v4()}]),s(U=>({...U,coupon:_}))}catch(H){const U=H;D([...y,{message:`Coupon is not applied: ${U.message}`,status:"error",id:g.v4()}]),s(P=>({...P,coupon:null})),c(null),h(!1)}if(h(!1),(M=I==null?void 0:I.restrictToProductIds)!=null&&M.length&&!S.every(H=>{var U;return(U=I==null?void 0:I.restrictToProductIds)==null?void 0:U.includes(H)}))throw new Error("Coupon can't be applied to such products");return c(I),I},b={reset(){s({...G2})},addProducts:_=>{const E=g.useCartStore.getState().products,x=_.filter(k=>!E.some(y=>y.id===k.id));o([...E,...x])},addProductToCart:_=>{const E=g.useCartStore.getState().cart;try{Wi(t,_)}catch(k){throw new Error(k)}const x=E.parts.find(k=>k.productId===_.productId&&k.productVariantId===_.productVariantId&&k.chargeType===_.chargeType);if(x)return b.updateQuantityOfProduct({...x,quantity:(x.quantity||1)+(_.quantity||1),chargeType:_.chargeType});if(E.parts.length&&Gi([...E.parts,_],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...E,parts:[...E.parts,_]}),E.coupon&&f(E.coupon)},removeProduct({productId:_,productVariantId:E}){s(x=>({...x,parts:x.parts.filter(k=>k.productId!==_||k.productVariantId!==E)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Gi(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return Q2(t,e.parts)},updateQuantityOfProduct(_){Wi(t,_),s(E=>({...E,parts:E.parts.map(x=>x.productId===_.productId&&x.productVariantId===_.productVariantId?{...x,quantity:_.quantity,chargeType:_.chargeType}:x)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:_}=g.useCartStore.getState(),{total:E,totalWithVolumeDiscounts:x}=K2(e.parts,t);let k;const y=x;return _&&_.discount?!_.isFixed&&_.discount===100?k=0:k=_.isFixed?Math.max(0,y-_.discount):y*(1-_.discount/100):x!==E&&(k=x),{total:E,totalWithVolumeDiscounts:x!==E?x:void 0,totalWithDiscount:k}},setGateway(_){s(x=>({...x,gateway:_}));const{isAntistock:E}=g.useGeneralStore.getState();e.coupon&&!E&&f(e.coupon)},setPaymentMethod(_){s(E=>({...E,paymentMethod:_}))},async submitCart(_){l(!0);const{cart:E}=g.useCartStore.getState(),{discordInfo:x}=g.useDiscordStore.getState();let k;if(E.parts&&a&&J2(E.parts[0],t))try{const{data:y}=await T2({gateway:E.gateway,coupon:E.coupon,partOrder:E.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:x!=null&&x.authorized?x.id:null,customerEmail:a,recaptcha:_,customFields:{...E.customFields},tsId:g.useGetTsId()});k=y.data}catch(y){console.error(y)}else try{const{data:y}=await g2({gateway:E.gateway,parts:[...E.parts],coupon:E.coupon,customerEmail:E.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:_,customFields:{...E.customFields},tsId:g.useGetTsId(),discordSocialConnectId:x!=null&&x.authorized?x.id:null,usePriorityReplacement:E.usePriorityReplacement===!0});k=y.data}catch(y){const D=y,{notifications:S,setNotifications:I}=g.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${D.message}`,status:"error",id:g.v4()}])}if(l(!1),k)return k;throw new Error("Failed to create order")},setDiscordSocialConnectId(_){s(E=>({...E,discordSocialConnectId:_}))},setCustomFields(_){s(E=>({...E,customFields:{..._}}))}};return L.useEffect(()=>{s(_=>({..._,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...b}},Zn=()=>{const{notifications:e,setNotifications:t}=g.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:g.v4()}])}};var Ts={exports:{}},Au={exports:{}},Re={};/** @license React v16.13.1
|
|
1
|
+
"use strict";const g=require("./builder-CN6EcOo5.cjs"),i=require("react/jsx-runtime"),L=require("react"),N=require("./ui-components-Dd9qd1PE.cjs"),nl=require("./builder-components-CSl62_15.cjs");require("react-dom");const rl=require("./ticket-CXF_4RQh.cjs"),ul=require("./order-DnPLP5zk.cjs"),t2=require("./subscription-B5WUsxPh.cjs");function n2(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const me=n2(L),r2=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,al=({children:e,className:t,as:n="span",...r})=>{const[u,a]=L.useState(!1);return L.useEffect(()=>{typeof window<"u"&&a(r2())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function u2(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await g.request({method:"get",url:r,withToken:!1})).data}const a2=async()=>{const e=g.useApiStore.getState().apiUrls,t=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await g.request({url:n,withToken:!0,method:"get"})},s2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},i2=async(e,t)=>{const r=`${g.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await g.request({url:r,method:"post",body:e,withToken:!1})},Nr=async e=>{const t=g.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},o2=()=>Nr("dash/info"),sl=()=>Nr("dash/dashboard/home"),c2=()=>Nr("rewards"),l2=()=>Nr("balance"),d2=()=>Nr("balance/top-up/settings"),f2=()=>Nr("referral-system"),Ks=e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return g.request({url:r,withToken:!1,method:"get"})},h2=()=>Ks("terms"),p2=()=>Ks("refund-policy"),m2=()=>Ks("privacy-policy"),Es=10,aa=async({url:e,PageNumber:t})=>{var o;const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${Es}`,a=await g.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},sa=async(e,t="get",n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await g.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},g2=e=>sa("","post",e),b2=({PageNumber:e})=>aa({url:"customers/orders",PageNumber:e}),_2=e=>sa(e),x2=e=>sa(e),C2=(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return g.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},E2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),g.request({url:r,method:"post",withToken:!1,body:u})},y2=(e,t,n)=>sa(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),T2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await g.request({url:r,method:"post",withToken:!1,body:e})},k2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},A2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await g.request({url:u,method:"get",withToken:!1})},S2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await g.request({url:a,method:"post",withToken:!1,body:n})},I2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await g.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},N2=({PageNumber:e})=>aa({url:"customers/subscriptions",PageNumber:e}),v2=async({id:e,accessToken:t})=>await A2(e,t),w2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await g.request({url:u,method:"post",withToken:!1,body:t})},D2=async(e,t)=>{const n=g.useApiStore.getState().apiUrls,r=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await g.request({url:u,method:"get",withToken:!1})},L2=async(e,t,n,r,u,a)=>{const s=g.useApiStore.getState().apiUrls,o=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,c=`${s.slApi}/v1/public/${o}/tickets/${e}/${t}/answer`;return(await g.request({url:c,method:"post",body:{message:n,recaptcha:r,tsId:u,...a&&a.length>0&&{imageIds:a.map(h=>h.imageId)}},withToken:!1})).data},P2=({PageNumber:e})=>aa({url:"customers/tickets",PageNumber:e}),R2=({PageNumber:e})=>aa({url:"customers/balance/transactions",PageNumber:e}),M2=async(e,t,n)=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await g.request({url:a,method:"post",withToken:!1,body:e})},O2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await g.request({url:r,method:"get",withToken:!1})},j2=async e=>{const t=g.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await g.request({url:a,method:"get",withToken:!1})},ku=new Map,il=async e=>{const t=g.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(ku.has(o))return ku.get(o);const c=g.request({url:s,method:"get",withToken:!1}).catch(l=>{throw ku.delete(o),l});return ku.set(o,c),c},ol=async({email:e,recaptcha:t,tsId:n})=>{const r=g.useApiStore.getState().apiUrls,u=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await g.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},cl=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=g.useApiStore.getState().apiUrls,a=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await g.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return g.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},ys=async()=>{g.useStorefrontStore.getState().setToken(""),g.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},F2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:cl,logoutCustomer:ys,requestOtp:ol},Symbol.toStringTag,{value:"Module"})),B2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await g.request({url:r,method:"post",body:e,withToken:!1})},H2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await g.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},U2=async()=>{const{data:e}=await f2();return e},V2=async e=>{const{data:t}=await H2(e);return t},$2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await g.request({url:r,method:"post",body:e,withToken:!1})},z2=async e=>{const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await g.request({url:r,method:"get",withToken:!1})};async function q2(e){const t=g.useApiStore.getState().apiUrls,n=g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return g.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const Z2=async(e,t,n,r)=>{const a=`${g.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await g.request({url:a,method:"post",withToken:!1,body:e})},ll=()=>g.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,W2=async()=>{const e=g.useApiStore.getState().apiUrls,t=ll(),n=`${e.customersApi}/v2/${t}/api-key`;return g.request({url:n,method:"get",withToken:!0,typeToken:"customer"})},Y2=async()=>{const e=g.useApiStore.getState().apiUrls,t=ll(),n=`${e.customersApi}/v2/${t}/api-key/regenerate`;return g.request({url:n,method:"post",withToken:!0,typeToken:"customer"})},Ma="Balance",jn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},G2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Wi=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=g.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},X2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},K2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(b=>(b==null?void 0:b.id)===u.productId),s=a==null?void 0:a.variants.find(b=>b.id===u.productVariantId);if(!s)return;const{gateway:o}=g.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(b=>b.name===o&&b.overrodePrice)?(m=c.find(b=>b.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const b=X2(s,u.quantity),_=f*(1-b/100);r+=_}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},Q2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Yi=e=>new Set(e.gateways.map(t=>t.name)),Oa={availableGateways:[],requiresSignInGateways:[]},Gi=(e,t)=>{if(t.length===0)return Oa;const n=e[0];if(!n)return Oa;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Oa;const a=Yi(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Yi(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(Ma)?(a.delete(Ma),{availableGateways:[...a],requiresSignInGateways:[Ma]}):{availableGateways:[...a],requiresSignInGateways:[]}},Xi=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},J2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},du=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=g.useCartStore(),f=async _=>{var M;h(!0);const{cart:E}=g.useCartStore.getState(),{gateway:x,parts:k}=E,{notifications:y,setNotifications:D}=g.useNotificationStore.getState();x||(h(!1),D([...y,{message:"There should be a gateway for the coupon",status:"error",id:g.v4()}]));const S=k.map(H=>H.productId);let I=null;try{const{data:H}=await B2({gateway:x,couponName:_,productIds:S});I=H.data,D([...y,{message:"Coupon is applied",status:"success",id:g.v4()}]),s(U=>({...U,coupon:_}))}catch(H){const U=H;D([...y,{message:`Coupon is not applied: ${U.message}`,status:"error",id:g.v4()}]),s(P=>({...P,coupon:null})),c(null),h(!1)}if(h(!1),(M=I==null?void 0:I.restrictToProductIds)!=null&&M.length&&!S.every(H=>{var U;return(U=I==null?void 0:I.restrictToProductIds)==null?void 0:U.includes(H)}))throw new Error("Coupon can't be applied to such products");return c(I),I},b={reset(){s({...G2})},addProducts:_=>{const E=g.useCartStore.getState().products,x=_.filter(k=>!E.some(y=>y.id===k.id));o([...E,...x])},addProductToCart:_=>{const E=g.useCartStore.getState().cart;try{Wi(t,_)}catch(k){throw new Error(k)}const x=E.parts.find(k=>k.productId===_.productId&&k.productVariantId===_.productVariantId&&k.chargeType===_.chargeType);if(x)return b.updateQuantityOfProduct({...x,quantity:(x.quantity||1)+(_.quantity||1),chargeType:_.chargeType});if(E.parts.length&&Gi([...E.parts,_],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...E,parts:[...E.parts,_]}),E.coupon&&f(E.coupon)},removeProduct({productId:_,productVariantId:E}){s(x=>({...x,parts:x.parts.filter(k=>k.productId!==_||k.productVariantId!==E)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return Gi(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return Q2(t,e.parts)},updateQuantityOfProduct(_){Wi(t,_),s(E=>({...E,parts:E.parts.map(x=>x.productId===_.productId&&x.productVariantId===_.productVariantId?{...x,quantity:_.quantity,chargeType:_.chargeType}:x)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:_}=g.useCartStore.getState(),{total:E,totalWithVolumeDiscounts:x}=K2(e.parts,t);let k;const y=x;return _&&_.discount?!_.isFixed&&_.discount===100?k=0:k=_.isFixed?Math.max(0,y-_.discount):y*(1-_.discount/100):x!==E&&(k=x),{total:E,totalWithVolumeDiscounts:x!==E?x:void 0,totalWithDiscount:k}},setGateway(_){s(x=>({...x,gateway:_}));const{isAntistock:E}=g.useGeneralStore.getState();e.coupon&&!E&&f(e.coupon)},setPaymentMethod(_){s(E=>({...E,paymentMethod:_}))},async submitCart(_){l(!0);const{cart:E}=g.useCartStore.getState(),{discordInfo:x}=g.useDiscordStore.getState();let k;if(E.parts&&a&&J2(E.parts[0],t))try{const{data:y}=await T2({gateway:E.gateway,coupon:E.coupon,partOrder:E.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:x!=null&&x.authorized?x.id:null,customerEmail:a,recaptcha:_,customFields:{...E.customFields},tsId:g.useGetTsId()});k=y.data}catch(y){console.error(y)}else try{const{data:y}=await g2({gateway:E.gateway,parts:[...E.parts],coupon:E.coupon,customerEmail:E.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:_,customFields:{...E.customFields},tsId:g.useGetTsId(),discordSocialConnectId:x!=null&&x.authorized?x.id:null,usePriorityReplacement:E.usePriorityReplacement===!0});k=y.data}catch(y){const D=y,{notifications:S,setNotifications:I}=g.useNotificationStore.getState();I([...S,{message:`Failed to create order: ${D.message}`,status:"error",id:g.v4()}])}if(l(!1),k)return k;throw new Error("Failed to create order")},setDiscordSocialConnectId(_){s(E=>({...E,discordSocialConnectId:_}))},setCustomFields(_){s(E=>({...E,customFields:{..._}}))}};return L.useEffect(()=>{s(_=>({..._,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...b}},Zn=()=>{const{notifications:e,setNotifications:t}=g.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:g.v4()}])}};var Ts={exports:{}},Au={exports:{}},Re={};/** @license React v16.13.1
|
|
2
2
|
* react-is.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|