@billgangcom/theme-lib 1.123.0 → 1.123.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./builder-BNQD7fm1.cjs"),m=require("./ticket-C5g3kw8c.cjs"),n=require("react"),v=require("./charge-DcKd_es2.cjs"),_=require("./ui-components-jkqz3-Kc.cjs"),e=require("@phosphor-icons/react"),Q=({children:r,shopDomain:u,shopId:d,shopPassword:h,shopLogo:g})=>{const{setShopDomain:x,setShopId:P,setShopPassword:y,setShopTerms:p,setShopPrivacyPolicy:a,setShopRefundPolicy:f,setShopLogo:A}=i.useStorefrontStore();return n.useLayoutEffect(()=>{const s=async()=>{const{data:l}=await v.fetchTerms();p(l)},S=async()=>{const{data:l}=await v.fetchPrivacyPolicy();a(l)},T=async()=>{const{data:l}=await v.fetchRefundPolicy();f(l)};x(u),P(d),h&&y(h),g&&A(g),s(),S(),T()},[u,d,h]),t.jsx(t.Fragment,{children:r})},X="_wrapper_1xuz3_18",D={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 $=n.lazy(()=>Promise.resolve().then(()=>require("./builder-BNQD7fm1.cjs")).then(r=>r.index).then(r=>({default:r.BuilderPage}))),K=n.lazy(()=>Promise.resolve().then(()=>require("./index-BnMpELp_.cjs")).then(r=>({default:r.ErrorPage}))),Y=n.lazy(()=>Promise.resolve().then(()=>require("./index-BYdRgPyI.cjs")).then(r=>({default:r.ActivePage}))),Z=n.lazy(()=>Promise.resolve().then(()=>require("./validation-Be-6h5-8.cjs")).then(r=>({default:r.ValidationPage}))),ee=n.lazy(()=>Promise.resolve().then(()=>require("./index-DoklSmf4.cjs")).then(r=>({default:r.WrapperPage}))),te=n.lazy(()=>Promise.resolve().then(()=>require("./index-Dyg2ZZW6.cjs")).then(r=>({default:r.RouterErrorPage}))),c=n.lazy(()=>Promise.resolve().then(()=>require("./index-BtqOzf1F.cjs")).then(r=>({default:r.DynamicErrorPage}))),re=n.lazy(()=>Promise.resolve().then(()=>require("./checkout-BQwNBpVW.cjs")).then(r=>({default:r.Checkout}))),ne=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.index$1).then(r=>({default:r.ChargePage}))),oe=n.lazy(()=>Promise.resolve().then(()=>require("./ticket-C5g3kw8c.cjs")).then(r=>r.index).then(r=>({default:r.TicketItem}))),se=n.lazy(()=>Promise.resolve().then(()=>require("./subscription-5ytxlwXp.cjs")).then(r=>r.index).then(r=>({default:r.Subscription}))),ce=n.lazy(()=>Promise.resolve().then(()=>require("./top-up-CrbYB293.cjs")).then(r=>({default:r.TopUpBalance}))),ie=n.lazy(()=>Promise.resolve().then(()=>require("./order-B0gf5VEi.cjs")).then(r=>r.index).then(r=>({default:r.OrderPage}))),ae=n.lazy(()=>Promise.resolve().then(()=>require("./index-DozNvPOR.cjs")).then(r=>({default:r.TermsPage}))),le=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.index).then(r=>({default:r.CustomerDashboard}))),U=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.recapcha).then(r=>({default:r.ReCaptchaProvider}))),ue=()=>null,o=({children:r})=>t.jsx(n.Suspense,{fallback:t.jsx(ue,{}),children:r}),B=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderAnnouncement}))),L=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderFooter}))),R=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderHeader}))),de=r=>{var q;const{blocks:u,settings:d,header:h,footer:g,announcement:x,routes:P=[],shopLogo:y,apiURLs:p,isAntistock:a=!1}=r,[f,A]=n.useState(null),{general:s,setIsAntistock:S}=i.useGeneralStore(),{setApiUrls:T}=i.useApiStore(),l=((q=s==null?void 0:s.info)==null?void 0:q.customerAccountSettings)??"OPTIONAL",z=l==="DISABLED",{setBlocks:H,setSourceBlocks:F,setHeader:O,setFooter:M,setAnnouncement:G,setSettings:W}=i.useBlocksStore(),{themeSettings:C}=i.useThemeSettingsStore(),{settings:w,setSettings:V}=i.useSettingsStore(),j=i.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"":window.location.hostname,N=localStorage.getItem("shopPassword"),b=localStorage.getItem("shopId")||"";return n.useEffect(()=>{S(a)},[a,S]),n.useEffect(()=>{!b&&(s!=null&&s.info.id)&&localStorage.setItem("shopId",s==null?void 0:s.info.id)},[s]),n.useEffect(()=>{!j&&!a&&localStorage.setItem("fakeDomain","drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io"),!j&&a&&localStorage.setItem("fakeDomain","eva8.astck.io")},[j]),n.useEffect(()=>{if(C&&w){const I=m.generateDynamicStyles(C,w);m.loadCustomFonts(),m.setupDynamicFonts(C),m.injectStylesToDOM(I)}},[C,JSON.stringify(w),window.location.hostname]),n.useEffect(()=>{const k=new d().blockSettings;V(k)},[]),n.useEffect(()=>{J()},[]),n.useLayoutEffect(()=>{const I={};Object.keys(u).map(E=>{I[E]=u[E]}),F(I),H(I),O(h),M(g),G(x),W(d),p&&T(p);const k=i.createBrowserRouter([{element:t.jsx(Q,{shopDomain:j,shopId:b,shopPassword:N||void 0,shopLogo:y,children:t.jsx(U,{children:t.jsx(ee,{children:t.jsx(i.Outlet,{})})})}),errorElement:t.jsx(o,{children:t.jsx(te,{})}),children:[{path:"/admin/builder/*",element:t.jsx(o,{children:t.jsx(Y,{children:t.jsx($,{blocks:u,settings:d,header:h,footer:g,announcement:x})})}),errorElement:t.jsx(o,{children:t.jsx(K,{})})},...P,{path:"/checkout",element:t.jsx(o,{children:t.jsx(re,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:t.jsx(o,{children:t.jsx(ce,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:t.jsx(o,{children:t.jsx(ne,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:t.jsx(o,{children:t.jsx(ie,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:t.jsx(o,{children:t.jsx(se,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Subscriptions",!0)},...z?[]:[{path:a?"/account":"/customer-dash",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(B,{}),t.jsx(R,{}),t.jsx("div",{style:{flex:"1 1 auto"},children:t.jsx(le,{})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title=a?"Account":"Customer Dashboard",!0)}],{path:"/validation",element:t.jsx(o,{children:t.jsx(Z,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(R,{}),t.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:t.jsx(U,{children:t.jsx(oe,{})})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Ticket",!0)},{path:"/terms",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(B,{}),t.jsx(R,{}),t.jsx("div",{style:{flex:1,width:"100%"},children:t.jsx(ae,{})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Terms of Service",!0)},{path:"*",element:t.jsx(m.DynamicRouteWrapper,{}),errorElement:t.jsx(o,{children:t.jsx(c,{})})}]}]);A(k)},[s,l]),t.jsx(n.Suspense,{fallback:null,children:f&&t.jsx(i.RouterProvider,{router:f})})};exports.App=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./builder-BNQD7fm1.cjs"),m=require("./ticket-C5g3kw8c.cjs"),n=require("react"),v=require("./charge-DcKd_es2.cjs"),_=require("./ui-components-jkqz3-Kc.cjs"),e=require("@phosphor-icons/react"),Q=({children:r,shopDomain:u,shopId:d,shopPassword:h,shopLogo:g})=>{const{setShopDomain:x,setShopId:j,setShopPassword:P,setShopTerms:p,setShopPrivacyPolicy:l,setShopRefundPolicy:f,setShopLogo:y}=i.useStorefrontStore();return n.useLayoutEffect(()=>{const s=async()=>{const{data:a}=await v.fetchTerms();p(a)},S=async()=>{const{data:a}=await v.fetchPrivacyPolicy();l(a)},A=async()=>{const{data:a}=await v.fetchRefundPolicy();f(a)};x(u),j(d),h&&P(h),g&&y(g),s(),S(),A()},[u,d,h]),t.jsx(t.Fragment,{children:r})},X="_wrapper_1xuz3_18",D={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 $=n.lazy(()=>Promise.resolve().then(()=>require("./builder-BNQD7fm1.cjs")).then(r=>r.index).then(r=>({default:r.BuilderPage}))),K=n.lazy(()=>Promise.resolve().then(()=>require("./index-BnMpELp_.cjs")).then(r=>({default:r.ErrorPage}))),Y=n.lazy(()=>Promise.resolve().then(()=>require("./index-BYdRgPyI.cjs")).then(r=>({default:r.ActivePage}))),Z=n.lazy(()=>Promise.resolve().then(()=>require("./validation-Be-6h5-8.cjs")).then(r=>({default:r.ValidationPage}))),ee=n.lazy(()=>Promise.resolve().then(()=>require("./index-DoklSmf4.cjs")).then(r=>({default:r.WrapperPage}))),te=n.lazy(()=>Promise.resolve().then(()=>require("./index-Dyg2ZZW6.cjs")).then(r=>({default:r.RouterErrorPage}))),c=n.lazy(()=>Promise.resolve().then(()=>require("./index-BtqOzf1F.cjs")).then(r=>({default:r.DynamicErrorPage}))),re=n.lazy(()=>Promise.resolve().then(()=>require("./checkout-BQwNBpVW.cjs")).then(r=>({default:r.Checkout}))),ne=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.index$1).then(r=>({default:r.ChargePage}))),oe=n.lazy(()=>Promise.resolve().then(()=>require("./ticket-C5g3kw8c.cjs")).then(r=>r.index).then(r=>({default:r.TicketItem}))),se=n.lazy(()=>Promise.resolve().then(()=>require("./subscription-5ytxlwXp.cjs")).then(r=>r.index).then(r=>({default:r.Subscription}))),ce=n.lazy(()=>Promise.resolve().then(()=>require("./top-up-CrbYB293.cjs")).then(r=>({default:r.TopUpBalance}))),ie=n.lazy(()=>Promise.resolve().then(()=>require("./order-B0gf5VEi.cjs")).then(r=>r.index).then(r=>({default:r.OrderPage}))),ae=n.lazy(()=>Promise.resolve().then(()=>require("./index-DozNvPOR.cjs")).then(r=>({default:r.TermsPage}))),le=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.index).then(r=>({default:r.CustomerDashboard}))),U=n.lazy(()=>Promise.resolve().then(()=>require("./charge-DcKd_es2.cjs")).then(r=>r.recapcha).then(r=>({default:r.ReCaptchaProvider}))),ue=()=>null,o=({children:r})=>t.jsx(n.Suspense,{fallback:t.jsx(ue,{}),children:r}),B=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderAnnouncement}))),L=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderFooter}))),R=n.lazy(()=>Promise.resolve().then(()=>require("./builder-components-B8gWw88v.cjs")).then(r=>r.index).then(r=>({default:r.RenderHeader}))),de=r=>{var q;const{blocks:u,settings:d,header:h,footer:g,announcement:x,routes:j=[],shopLogo:P,apiURLs:p,isAntistock:l=!1}=r,[f,y]=n.useState(null),{general:s,setIsAntistock:S}=i.useGeneralStore(),{setApiUrls:A}=i.useApiStore(),a=((q=s==null?void 0:s.info)==null?void 0:q.customerAccountSettings)??"OPTIONAL",z=a==="DISABLED",{setBlocks:H,setSourceBlocks:F,setHeader:O,setFooter:M,setAnnouncement:G,setSettings:W}=i.useBlocksStore(),{themeSettings:C}=i.useThemeSettingsStore(),{settings:T,setSettings:V}=i.useSettingsStore(),w=i.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"":window.location.hostname,N=localStorage.getItem("shopPassword"),b=localStorage.getItem("shopId")||"";return n.useEffect(()=>{S(l)},[l,S]),n.useEffect(()=>{!b&&(s!=null&&s.info.id)&&localStorage.setItem("shopId",s==null?void 0:s.info.id)},[s]),n.useEffect(()=>{!w&&!l&&localStorage.setItem("fakeDomain","drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io")},[w]),n.useEffect(()=>{if(C&&T){const I=m.generateDynamicStyles(C,T);m.loadCustomFonts(),m.setupDynamicFonts(C),m.injectStylesToDOM(I)}},[C,JSON.stringify(T),window.location.hostname]),n.useEffect(()=>{const k=new d().blockSettings;V(k)},[]),n.useEffect(()=>{J()},[]),n.useLayoutEffect(()=>{const I={};Object.keys(u).map(E=>{I[E]=u[E]}),F(I),H(I),O(h),M(g),G(x),W(d),p&&A(p);const k=i.createBrowserRouter([{element:t.jsx(Q,{shopDomain:w,shopId:b,shopPassword:N||void 0,shopLogo:P,children:t.jsx(U,{children:t.jsx(ee,{children:t.jsx(i.Outlet,{})})})}),errorElement:t.jsx(o,{children:t.jsx(te,{})}),children:[{path:"/admin/builder/*",element:t.jsx(o,{children:t.jsx(Y,{children:t.jsx($,{blocks:u,settings:d,header:h,footer:g,announcement:x})})}),errorElement:t.jsx(o,{children:t.jsx(K,{})})},...j,{path:"/checkout",element:t.jsx(o,{children:t.jsx(re,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Checkout",!0)},{path:"/top-up",element:t.jsx(o,{children:t.jsx(ce,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Top Up Balance",!0)},{path:"/charges/:id",element:t.jsx(o,{children:t.jsx(ne,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Charges",!0)},{path:"/orders/:id/:accessToken?",element:t.jsx(o,{children:t.jsx(ie,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Orders",!0)},{path:"/subscriptions/:id/:accessToken?",element:t.jsx(o,{children:t.jsx(se,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Subscriptions",!0)},...z?[]:[{path:l?"/account":"/customer-dash",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(B,{}),t.jsx(R,{}),t.jsx("div",{style:{flex:"1 1 auto"},children:t.jsx(le,{})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title=l?"Account":"Customer Dashboard",!0)}],{path:"/validation",element:t.jsx(o,{children:t.jsx(Z,{})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Validation",!0)},{path:"/ticket/:id/:accessToken",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(R,{}),t.jsx("div",{style:{flex:1,width:"100%",height:"100%"},children:t.jsx(U,{children:t.jsx(oe,{})})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Ticket",!0)},{path:"/terms",element:t.jsx(o,{children:t.jsxs("div",{className:D.wrapper,children:[t.jsx(B,{}),t.jsx(R,{}),t.jsx("div",{style:{flex:1,width:"100%"},children:t.jsx(ae,{})}),t.jsx(L,{})]})}),errorElement:t.jsx(o,{children:t.jsx(c,{})}),loader:()=>(document.title="Terms of Service",!0)},{path:"*",element:t.jsx(m.DynamicRouteWrapper,{}),errorElement:t.jsx(o,{children:t.jsx(c,{})})}]}]);y(k)},[s,a]),t.jsx(n.Suspense,{fallback:null,children:f&&t.jsx(i.RouterProvider,{router:f})})};exports.App=de;
@@ -14,25 +14,25 @@ const oo = ({
14
14
  }) => {
15
15
  const {
16
16
  setShopDomain: m,
17
- setShopId: C,
18
- setShopPassword: y,
17
+ setShopId: S,
18
+ setShopPassword: C,
19
19
  setShopTerms: I,
20
- setShopPrivacyPolicy: a,
20
+ setShopPrivacyPolicy: i,
21
21
  setShopRefundPolicy: p,
22
- setShopLogo: A
22
+ setShopLogo: y
23
23
  } = V();
24
24
  return o.useLayoutEffect(() => {
25
25
  const r = async () => {
26
- const { data: i } = await ae();
27
- I(i);
26
+ const { data: a } = await ae();
27
+ I(a);
28
28
  }, g = async () => {
29
- const { data: i } = await ie();
30
- a(i);
31
- }, w = async () => {
32
- const { data: i } = await se();
33
- p(i);
29
+ const { data: a } = await ie();
30
+ i(a);
31
+ }, A = async () => {
32
+ const { data: a } = await se();
33
+ p(a);
34
34
  };
35
- m(s), C(l), d && y(d), u && A(u), r(), g(), w();
35
+ m(s), S(l), d && C(d), u && y(u), r(), g(), A();
36
36
  }, [s, l, d]), /* @__PURE__ */ e(j, { children: t });
37
37
  }, no = "_wrapper_1xuz3_18", D = {
38
38
  wrapper: no
@@ -205,30 +205,30 @@ const co = o.lazy(
205
205
  header: d,
206
206
  footer: u,
207
207
  announcement: m,
208
- routes: C = [],
209
- shopLogo: y,
208
+ routes: S = [],
209
+ shopLogo: C,
210
210
  apiURLs: I,
211
- isAntistock: a = !1
212
- } = t, [p, A] = o.useState(null), { general: r, setIsAntistock: g } = N(), { setApiUrls: w } = q(), i = ((b = r == null ? void 0 : r.info) == null ? void 0 : b.customerAccountSettings) ?? "OPTIONAL", z = i === "DISABLED", {
211
+ isAntistock: i = !1
212
+ } = t, [p, y] = o.useState(null), { general: r, setIsAntistock: g } = N(), { setApiUrls: A } = q(), a = ((b = r == null ? void 0 : r.info) == null ? void 0 : b.customerAccountSettings) ?? "OPTIONAL", z = a === "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: T, setSettings: W } = J(), S = K ? localStorage.getItem("fakeDomain") || "" : window.location.hostname, _ = localStorage.getItem("shopPassword"), x = localStorage.getItem("shopId") || "";
219
+ } = Q(), { themeSettings: f } = X(), { settings: w, setSettings: W } = J(), T = K ? localStorage.getItem("fakeDomain") || "" : window.location.hostname, _ = localStorage.getItem("shopPassword"), x = localStorage.getItem("shopId") || "";
220
220
  return o.useEffect(() => {
221
- g(a);
222
- }, [a, g]), o.useEffect(() => {
221
+ g(i);
222
+ }, [i, g]), o.useEffect(() => {
223
223
  !x && (r != null && r.info.id) && localStorage.setItem("shopId", r == null ? void 0 : r.info.id);
224
224
  }, [r]), o.useEffect(() => {
225
- !S && !a && localStorage.setItem("fakeDomain", "drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io"), !S && a && localStorage.setItem("fakeDomain", "eva8.astck.io");
226
- }, [S]), o.useEffect(() => {
227
- if (f && T) {
228
- const h = ee(f, T);
225
+ !T && !i && localStorage.setItem("fakeDomain", "drafts-ca18cf24-6659-4015-b1ab-9ebe9fa64e74.bgng.io");
226
+ }, [T]), o.useEffect(() => {
227
+ if (f && w) {
228
+ const h = ee(f, w);
229
229
  te(), oe(f), ne(h);
230
230
  }
231
- }, [f, JSON.stringify(T), window.location.hostname]), o.useEffect(() => {
231
+ }, [f, JSON.stringify(w), window.location.hostname]), o.useEffect(() => {
232
232
  const k = new l().blockSettings;
233
233
  W(k);
234
234
  }, []), o.useEffect(() => {
@@ -237,16 +237,16 @@ const co = o.lazy(
237
237
  const h = {};
238
238
  Object.keys(s).map((E) => {
239
239
  h[E] = s[E];
240
- }), H(h), v(h), F(d), O(u), M(m), G(l), I && w(I);
240
+ }), H(h), v(h), F(d), O(u), M(m), G(l), I && A(I);
241
241
  const k = $([
242
242
  {
243
243
  element: /* @__PURE__ */ e(
244
244
  oo,
245
245
  {
246
- shopDomain: S,
246
+ shopDomain: T,
247
247
  shopId: x,
248
248
  shopPassword: _ || void 0,
249
- shopLogo: y,
249
+ shopLogo: C,
250
250
  children: /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(lo, { children: /* @__PURE__ */ e(Y, {}) }) })
251
251
  }
252
252
  ),
@@ -266,7 +266,7 @@ const co = o.lazy(
266
266
  ) }) }),
267
267
  errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(ao, {}) })
268
268
  },
269
- ...C,
269
+ ...S,
270
270
  {
271
271
  path: "/checkout",
272
272
  element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(uo, {}) }),
@@ -299,7 +299,7 @@ const co = o.lazy(
299
299
  },
300
300
  ...z ? [] : [
301
301
  {
302
- path: a ? "/account" : "/customer-dash",
302
+ path: i ? "/account" : "/customer-dash",
303
303
  element: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ P("div", { className: D.wrapper, children: [
304
304
  /* @__PURE__ */ e(U, {}),
305
305
  /* @__PURE__ */ e(R, {}),
@@ -315,7 +315,7 @@ const co = o.lazy(
315
315
  /* @__PURE__ */ e(L, {})
316
316
  ] }) }),
317
317
  errorElement: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(c, {}) }),
318
- loader: () => (document.title = a ? "Account" : "Customer Dashboard", !0)
318
+ loader: () => (document.title = i ? "Account" : "Customer Dashboard", !0)
319
319
  }
320
320
  ],
321
321
  {
@@ -372,8 +372,8 @@ const co = o.lazy(
372
372
  ]
373
373
  }
374
374
  ]);
375
- A(k);
376
- }, [r, i]), /* @__PURE__ */ e(o.Suspense, { fallback: null, children: p && /* @__PURE__ */ e(Z, { router: p }) });
375
+ y(k);
376
+ }, [r, a]), /* @__PURE__ */ e(o.Suspense, { fallback: null, children: p && /* @__PURE__ */ e(Z, { router: p }) });
377
377
  };
378
378
  export {
379
379
  Ro as App
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@billgangcom/theme-lib",
3
- "version": "1.123.0",
3
+ "version": "1.123.1",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"