PageSourceSearch

https://upez-frontend.vercel.app/_next/static/chunks/276-6cab065caebcb900.js

js upez-frontend.vercel.app collected 2026-10-03 07:59:21 UTC 31,880 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="c982de92-0793-478c-94b4-d73e10279242",e._sentryDebugIdIdentifier="sentry-dbid-c982de92-0793-478c-94b4-d73e10279242")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[276],{6124:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(37876),s=a(52387),r=a(40788),i=a(14232);function l(e){let[t,a]=(0,i.useState)(!1),[l]=(0,i.useState)(Math.random().toString(36).substring(7)),d=(0,i.useCallback)(()=>{a(e=>!e)},[]),o=(0,n.jsx)(s.$,{removeUnderline:e.removeUnderline,icon:e.icon,variant:e.variant,loading:e.loading,tone:e.tone,size:e.size,disabled:e.disabled,onClick:d,disclosure:e.disclosure,children:e.label});return(0,n.jsx)(r.A,{active:t,activator:o,onClose:e=>{3!==e&&d()},"data-sentry-element":"Popover","data-sentry-component":"AutoPopover","data-sentry-source-file":"AutoPopover.tsx",children:e?.children?.({toggleActive:d})})}},7124:(e,t,a)=>{a.d(t,{A:()=>d});var n=a(37876),s=a(52387),r=a(40788),i=a(95186),l=a(14232);function d(e){let[t,a]=(0,l.useState)(!1),d=(0,n.jsx)(s.$,{loading:e.loading,icon:e.icon,removeUnderline:!0,size:e.size,disclosure:e.disclosure||"down",variant:e.variant||"monochromePlain",onClick:()=>a(!0),children:e.options.find(t=>t.value===e.value)?.label||e.label||"Select"});return(0,n.jsx)(r.A,{activator:d,active:t,onClose:()=>a(!1),"data-sentry-element":"Popover","data-sentry-component":"PlainButtonSelect","data-sentry-source-file":"PlainButtonSelect.tsx",children:(0,n.jsx)(i.l,{actionRole:"menuitem",items:e.options.map(({value:t,label:n,disabled:s})=>({content:n,disabled:s,onAction:()=>{e.onChange(t),a(!1)}})),"data-sentry-element":"ActionList","data-sentry-source-file":"PlainButtonSelect.tsx"})})}},8070:(e,t,a)=>{a.d(t,{A:()=>i});var n=a(83783),s=a(89099),r=a(14232);let i=(...e)=>{let[t,a]=(0,n.y3)(...e),i=shopify.toast,l=(0,s.useRouter)().push;return(0,r.useEffect)(()=>{if(!t.error)return;let e=t.error.executionErrors[0]?.message?.includes("PLAN_LIMIT");i.show(t.error.executionErrors[0]?.message,{isError:!0,duration:1e4,...e?{action:"Upgrade",onAction:()=>l("/billing")}:{}})},[t.error]),[t,a]}},23734:(e,t,a)=>{a.d(t,{a:()=>s});var n,s=((n={}).free_gift_created="free_gift_created",n.free_shipping_updated="free_shipping_updated",n.free_shipping_skipped="free_shipping_skipped",n.buy_x_get_y_discount_created="buy_x_get_y_discount_created",n.order_volume_discount_created="order_volume_discount_created",n.bundle_builder_discount_created="bundle_builder_discount_created",n.product_volume_discount_created="product_volume_discount_created",n.in_cart_upsell_flow_created="in_cart_upsell_flow_created",n.popup_upsell_flow_created="popup_upsell_flow_created",n.cart_item_upsell_flow_created="cart_item_upsell_flow_created",n.bundle_builder_tutorial_watched="bundle_builder_tutorial_watched",n.product_volume_tutorial_watched="product_volume_tutorial_watched",n.order_volume_discount_updated="order_volume_discount_updated",n.bundle_builder_tab_clicked="bundle_builder_tab_clicked",n.bundle_builder_save_failed="bundle_builder_save_failed",n.bundle_builder_flow_published="bundle_builder_flow_published",n.bundle_builder_onboarding_completed_v2="bundle_builder_onboarding_completed_v2",n.onboarding_cart_theme_editor_opened="onboarding_cart_theme_editor_opened",n.onboarding_cart_check_triggered="onboarding_cart_check_triggered",n.onboarding_cart_verification_success="onboarding_cart_verification_success",n.onboarding_cart_verification_failed="onboarding_cart_verification_failed",n.onboarding_cart_skipped="onboarding_cart_skipped",n.onboarding_cart_continued="onboarding_cart_continued",n.onboarding_select_offer_engagement="onboarding-select-offer-engagement",n.flow_published="flow_published",n.winning_offer_engagement="winning-offer-engagement",n.winning_offer_classify="winning-offer-classify",n.winning_offer_prompt_create_failed="winning-offer-prompt-create-failed",n.winning_offer_prompt_discount_created="winning-offer-prompt-discount-created",
1n.billing_unsubscribe_modal_opened="billing_unsubscribe_modal_opened",n.billing_unsubscribe_confirm_clicked="billing_unsubscribe_confirm_clicked",n.billing_unsubscribe_completed="billing_unsubscribe_completed",n.billing_unsubscribe_failed="billing_unsubscribe_failed",n)},26334:(e,t,a)=>{a.d(t,{cn:()=>r});var n=a(69241),s=a(29573);function r(...e){return(0,s.QP)((0,n.$)(e))}},27768:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(88362),s=a(83783),r=a(24386),i=a(14232),l=a(89050),d=a(92566);function o(){let{shop:e}=(0,d.P)(),[{data:t,fetching:a},o]=(0,s.SM)(l.F.userTags,{pause:!e,filter:{shopId:{equals:e?.id}}}),{pushEvent:c}=(0,n.dp)(),u=(0,i.useCallback)(async(t,a)=>{e&&await l.F.trackEvent({tags:[t]}),o(),window.Intercom?.("trackEvent",t,a),r.Ay.capture(t,a),c({eventName:t,properties:a||{}},!0)},[e,o,c]);return{loadingUserTags:a,userUsageEvents:t?.[0]?.tags||[],isUserUsageEventsLoaded:!!e&&!a&&!!t,track:u}}},30099:(e,t,a)=>{a.d(t,{x:()=>n});function n(e){let t=e.slice(0,5),a=e.find(e=>e.role?.trim().toLowerCase()==="main");return a&&!t.some(e=>e.id===a.id)?[...t,a]:[...t]}},42250:(e,t,a)=>{a.d(t,{J:()=>n});function n(e){let t=e.bypassCart;if(void 0===t)return!1;let a=(Array.isArray(t)?t[0]:t)?.toLowerCase();return void 0===a||""===a||"0"!==a&&"false"!==a&&"no"!==a}},45755:(e,t,a)=>{a.d(t,{A:()=>l});var n=a(83783),s=a(14232),r=a(89050),i=a(75908);function l(){let[{data:e,fetching:t},a]=(0,n.SM)(r.F.shopifyTheme,{sort:{shopifyUpdatedAt:"Descending"}}),l=(0,s.useMemo)(()=>(e||[]).find(e=>"MAIN"===e.role),[e]),{isCartEnabled:d,isChecking:o,refresh:c}=(0,i.L)({mainTheme:l??void 0,refreshThemes:a,runOnMount:!0}),[{fetching:u},p]=(0,n.y3)(r.F.shopifyTheme.checkAndUpdateBundleBuilderTemplate,{}),f=(0,s.useCallback)(async()=>{let t=e?.toJSON?.()??e??[];if(!t.length)return!1;try{return(await Promise.all(t.map(e=>p({id:e.id})))).some(e=>e?.data&&e.data.isBundleBuilderEnabled)}catch{return!1}},[e,p]);return{themes:e,isCartEnabledLive:d??l?.isUPEZEnabled??!1,checkingUPEZ:o,checkUPEZCartStatus:c,mainTheme:l,loadingThemes:t,checkBundleBuilderTemplateStatus:f,checkingBundleBuilderTemplate:u}}},49485:(e,t,a)=>{a.d(t,{g:()=>i});var n=a(37876),s=a(80407),r=a(37319);let i=({type:e})=>e===r.UQ.POPUP?(0,n.jsx)(s.E,{tone:"success",children:"ADD-TO-CART POPUP"}):e===r.UQ.UPSELL?(0,n.jsx)(s.E,{tone:"success",children:"POPUP (LEGACY)"}):e===r.UQ.CROSS_SELL?(0,n.jsx)(s.E,{tone:"info",children:"BOTTOM OF CART"}):e===r.UQ.PDP_UPSELL?(0,n.jsx)(s.E,{tone:"enabled",children:"PRODUCT PAGE"}):(0,n.jsx)(s.E,{tone:"attention","data-sentry-element":"Badge","data-sentry-component":"FlowTypeBadge","data-sentry-source-file":"FlowTypeBadge.tsx",children:"UNDER A CART ITEM"})},50276:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Y});var n=a(37876),s=a(83783),r=a(89050),i=a(77367),l=a(82947),d=a(33698),o=a(52387),c=a(57163),u=a(17036),p=a(708),f=a(89099),h=a(31320),m=a(14232),x=a(81293),g=a(76747);let _=(e,t)=>t.reduce((e,t)=>e?.[t],e);var y=a(8070),b=a(70811),w=a(37319),v=a(91930),P=a(57683),j=a(54587),U=a.n(j),E=a(90925),C=a(27768),S=a(70879),A=a(23734);function L(){let e=(0,f.useRouter)(),t={hidden:{opacity:0,y:50},visible:{opacity:1,y:0,transition:{duration:1}}},{selectTemplate:a}=(0,E.Li)(),[i,l]=(0,m.useState)(null),{data:d,fetching:c}=(0,h.A)(),{track:u}=(0,C.A)(),[x,g]=(0,s.y3)(r.F.upezFlow.create),_=(0,m.useCallback)(e=>{switch(e){case w.F9.IN_CART_ITEM:return A.a.cart_item_upsell_flow_created;case w.F9.UPSELL:return A.a.popup_upsell_flow_created;case w.F9.CROSS_SELL:return A.a.in_cart_upsell_flow_created;default:return""}},[]),y=async(t,a)=>{if(!d)return;let n={};a?.data.settings&&Array.isArray(a.data.settings)&&(n=a?.data.settings.reduce((e,t)=>t.default?{...e,[t.id]:t.default}:e,{}));let s=await g({upezFlow:{name:`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`,templateId:a.id,templateSettings:n,type:(0,S.D)(t),conditions:{AND:{cart_total_price:{},cart_items:{},cart_discounts:{}}},shop:{_link:d.id}}}),r=_(t);r&&u(r),s?.data?.id&&e.push(`/flows/${s.data.id}`,void 0,{shallow:!0})};return(0,n.jsx)(P.P.div,{variants:{hidden:{opacity:0,y:50,filter:"blur(5px)"},visible:{opacity:1,y:0,filter:"blur(0)",transition:{staggerChildren:.2,duration:1}},exit:{x:"-100vw",transition:{ease:"easeInOut"}}},animate:"visible",initial:"hidden","data-sentry-element":"unknown","data-sentry-component":"InCartUpsellHero","data-sentry-source-file":"InCartUpsellHero.tsx",children:(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row gap-10 m-auto items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-5 items-start px-8 max-w-[500px] grow m-auto",children:[(0,n.jsx)(P.P.div,{variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"InCartUpsellHero.tsx",children:(0,n.jsxs)(v.E,{as:"h1",variant:"heading2xl","data-sentry-element":"Text","data-sentry-source-file":"InCartUpsellHero.tsx",children:["CREATE AN ",(0,n.jsx)("u",{children:"IN-CART"})," UPSELL WIDGET"]})}),(0,n.jsx)(P.P.div,{variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"InCartUpsellHero.tsx",children:(0,n.jsxs)(v.E,{as:"p",variant:"bodyLg",tone:"subdued","data-sentry-element":"Text","data-sentry-source-file":"InCartUpsellHero.tsx",children:["Make offers right in the cart without interrupting ","customers'"," checkout flow. You can choose between 2 places in the cart to upsell:"]})}),(0,n.jsxs)(P.P.ol,{className:"space-y-5 list-inside",variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"InCartUpsellHero.tsx",children:[(0,n.jsx)(p.Z,{"data-sentry-element":"Card","data-sentry-source-file":"InCartUpsellHero.tsx",children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(v.E,{as:"p",variant:"bodyLg",fontWeight:"bold","data-sentry-element":"Text","data-sentry-source-file":"InCartUpsellHero.tsx",children:"Under a cart item"}),(0,n.jsx)(v.E,{as:"p","data-sentry-element":"Text","data-sentry-source-file":"InCartUpsellHero.tsx",children:"Show your upsell under a specific product. Best used for a strong offer that is exclusive to certain products, especially with a Buy X, Get Y offer."}),(0,n.jsx)(o.$,{variant:"primary",size:"large",fullWidth:!0,onClick:()=>{a(w.F9.IN_CART_ITEM,{disableAutoClose:!0}).then(async e=>{"select"===e.action&&(l(w.F9.IN_CART_ITEM),await y(w.F9.IN_CART_ITEM,e.template),l(null),console.log("finish creating widget"),e.closeModal())})},"data-sentry-element":"Button","data-sentry-source-file":"InCartUpsellHero.tsx",children:"Create widget"})]})}),(0,n.jsx)(p.Z,{"data-sentry-element":"Card","data-sentry-source-file":"InCartUpsellHero.tsx",children:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)(v.E,{as:"p",variant:"bodyLg",fontWeight:"bold","data-sentry-element":"Text","data-sentry-source-file":"InCartUpsellHero.tsx",children:"Bottom of the cart"}),(0,n.jsx)(v.E,{as:"p","data-sentry-element":"Text","data-sentry-source-file":"InCartUpsellHero.tsx",children:"This upsell lives below all cart items. Perfect for suggesting add-ons or matching products."}),(0,n.jsx)(o.$,{variant:"primary",size:"large",fullWidth:!0,onClick:()=>{a(w.F9.CROSS_SELL,{disableAutoClose:!0}).then(async e=>{"select"===e.action&&(l(w.F9.CROSS_SELL),await y(w.F9.CROSS_SELL,e.template),l(null),console.log("finish creating widget"),e.closeModal())})},"data-sentry-element":"Button","data-sentry-source-file":"InCartUpsellHero.tsx",children:"Create widget"})]})})]})]}),(0,n.jsx)(P.P.div,{variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"InCartUpsellHero.tsx",children:(0,n.jsx)(U(),{src:"/images/in-cart-hero-image-2.png",alt:"In-Cart Upsell",width:618,className:"h-[100vh] aspect-[618/890] max-w-none",height:890,"data-sentry-element":"Image","data-sentry-source-file":"InCartUpsellHero.tsx"})})]})})}function I(){let e=(0,f.useRouter)(),t={hidden:{opacity:0,y:50},visible:{opacity:1,y:0,transition:{duration:1}}},{selectTemplate:a}=(0,E.Li)(),[i,l]=(0,m.useState)(null),{data:d,fetching:c}=(0,h.A)(),{track:u}=(0,C.A)(),[p,x]=(0,s.y3)(r.F.upezFlow.create),g=(0,m.useCallback)(e=>{switch(e){case w.F9.IN_CART_ITEM:return A.a.cart_item_upsell_flow_created;case w.F9.POPUP:return A.a.popup_upsell_flow_created;case w.F9.CROSS_SELL:return A.a.in_cart_upsell_flow_created;default:return""}},[]),_=async(t,a)=>{if(!d)return;let n={};a?.data.settings&&Array.isArray(a.data.settings)&&(n=a?.data.settings.reduce((e,t)=>
1t.default?{...e,[t.id]:t.default}:e,{}));let s=await x({upezFlow:{name:`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`,templateId:a.id,templateSettings:n,type:(0,S.D)(t),conditions:{AND:{cart_total_price:{},cart_items:{},cart_discounts:{}}},shop:{_link:d.id}}}),r=g(t);r&&u(r),s?.data?.id&&e.push(`/flows/${s.data.id}`)};return(0,n.jsx)(P.P.div,{variants:{hidden:{opacity:0,y:50,filter:"blur(5px)"},visible:{opacity:1,y:0,filter:"blur(0)",transition:{staggerChildren:.2,duration:1}},exit:{x:"-100vw",transition:{ease:"easeInOut"}}},animate:"visible",initial:"hidden","data-sentry-element":"unknown","data-sentry-component":"PopupUpsellHero","data-sentry-source-file":"PopupUpsellHero.tsx",children:(0,n.jsxs)("div",{className:"m-auto grid max-w-7xl grid-cols-1 items-center gap-10 px-8 pt-10 lg:grid-cols-3",children:[(0,n.jsxs)("div",{className:"flex flex-col items-start gap-5",children:[(0,n.jsx)(P.P.div,{variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"PopupUpsellHero.tsx",children:(0,n.jsxs)(v.E,{as:"h1",variant:"heading2xl","data-sentry-element":"Text","data-sentry-source-file":"PopupUpsellHero.tsx",children:[(0,n.jsx)("u",{children:"POPUP"})," UPSELL"]})}),(0,n.jsx)(P.P.div,{variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"PopupUpsellHero.tsx",children:(0,n.jsx)(v.E,{as:"p",variant:"bodyLg","data-sentry-element":"Text","data-sentry-source-file":"PopupUpsellHero.tsx",children:"Make offers in a popup after a product is added to the cart. Best use for promotional campaigns or product upgrades."})}),(0,n.jsx)(P.P.div,{variants:t,"data-sentry-element":"unknown","data-sentry-source-file":"PopupUpsellHero.tsx",children:(0,n.jsx)(o.$,{variant:"primary",size:"large",onClick:()=>{a(w.F9.POPUP).then(async e=>{"select"===e.action&&(l(w.F9.POPUP),await _(w.F9.POPUP,e.template),l(null))})},"data-sentry-element":"Button","data-sentry-source-file":"PopupUpsellHero.tsx",children:"Create an upsell widget"})})]}),(0,n.jsx)(P.P.div,{variants:t,className:"col-span-2","data-sentry-element":"unknown","data-sentry-source-file":"PopupUpsellHero.tsx",children:(0,n.jsx)(U(),{src:"/images/popup-hero-image.png",alt:"In-Cart Upsell",width:1200,height:960,"data-sentry-element":"Image","data-sentry-source-file":"PopupUpsellHero.tsx"})})]})})}function T(){let e=(0,f.useRouter)(),{data:t,fetching:a,customer:i}=(0,h.A)(),[l,d]=(0,s.y3)(r.F.upezFlow.create),c=(0,m.useCallback)(e=>{switch(e){case w.F9.IN_CART_ITEM:return A.a.cart_item_upsell_flow_created;case w.F9.UPSELL:return A.a.popup_upsell_flow_created;case w.F9.CROSS_SELL:return A.a.in_cart_upsell_flow_created;default:return""}},[]),{track:u}=(0,C.A)();async function p(a,n){if(!t)return;let s={};n?.data.settings&&Array.isArray(n.data.settings)&&(s=n?.data.settings.reduce((e,t)=>t.default?{...e,[t.id]:t.default}:e,{}));let r=await d({upezFlow:{name:`${new Date().toLocaleDateString()} ${new Date().toLocaleTimeString()}`,templateId:n.id,templateSettings:s,type:(0,S.D)(a),conditions:{AND:{cart_total_price:{},cart_items:{},cart_discounts:{}}},shop:{_link:t.id}}}),i=c(a);i&&u(i),r?.data?.id&&e.push(`/flows/${r.data.id}`)}let{selectTemplate:x}=(0,E.Li)(),g={hidden:{opacity:0,y:50},visible:{opacity:1,y:0,transition:{duration:1}}};return(0,n.jsx)(P.P.div,{variants:{hidden:{opacity:0,y:50,filter:"blur(5px)"},visible:{opacity:1,y:0,filter:"blur(0)",transition:{staggerChildren:.2,duration:1}},exit:{x:"-100vw",transition:{ease:"easeInOut"}}},animate:"visible",initial:"hidden","data-sentry-element":"unknown","data-sentry-component":"PopupUpsellHero","data-sentry-source-file":"PDPUpsellHero.tsx",children:(0,n.jsxs)("div",{className:"pt-10 grid grid-cols-1 lg:grid-cols-3 gap-10 px-8 max-w-7xl m-auto items-center",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-5 items-start",children:[(0,n.jsx)(P.P.div,{variants:g,"data-sentry-element":"unknown","data-sentry-source-file":"PDPUpsellHero.tsx",children:(0,n.jsxs)(v.E,{as:"h1",variant:"heading2xl","data-sentry-element":"Text","data-sentry-source-file":"PDPUpsellHero.tsx",children:[(0,n.jsx)("u",{children:"PRODUCT PAGE"})," UPSELL"]})}),(0,n.jsx)(P.P.div,{variants:g,"data-sentry-element":"unknown","data-sentry-source-file":"PDPUpsellHero.tsx",children:(0,n.jsx)(v.E,{as:"p",variant:"bodyLg","data-sentry-element":"Text","data-sentry-source-file":"PDPUpsellHero.tsx",children:"Make offers in a popup after a product is added to the cart. Best use for promotional campaigns or product upgrades."})}),(0,n.jsx)(P.P.div,{variants:g,"data-sentry-element":"unknown","data-sentry-source-file":"PDPUpsellHero.tsx",children:(0,n.jsx)(o.$,{variant:"primary",size:"large",onClick:()=>{x(w.F9.PRODUCT_PAGE).then(async e=>{"select"===e.action&&await p(w.F9.PRODUCT_PAGE,e.template)})},"data-sentry-element":"Button","data-sentry-source-file":"PDPUpsellHero.tsx",children:"Create an upsell widget"})})]}),(0,n.jsx)(P.P.div,{variants:g,className:"col-span-2","data-sentry-element":"unknown","data-sentry-source-file":"PDPUpsellHero.tsx",children:(0,n.jsx)(U(),{src:"/images/popup-hero-image.png",alt:"In-Cart Upsell",width:1200,height:960,"data-sentry-element":"Image","data-sentry-source-file":"PDPUpsellHero.tsx"})})]})})}var k=a(92566),N=a(33448),R=a(7124);function F(e){let{shop:t}=(0,k.P)(),[{data:a,fetching:i}]=(0,s.SM)(r.F.flowsGroup),[{fetching:l},d]=(0,s.y3)(r.F.flowsGroup.create),[{fetching:o},c]=(0,s.y3)(r.F.upezFlow.update);return t?.tags.includes("BETA")?i?(0,n.jsx)(N.y,{}):(0,n.jsx)(R.A,{label:e.groupId?`Group ${e.groupId}`:"Group",value:e.groupId||"",loading:l||o,onChange:async a=>{if("CREATE_GROUP"===a){let a=await d({flowsGroup:{shop:{_link:t.id}}});a.data?.id&&await c({id:e.flowId,group:{_link:a.data.id}})}else"REMOVE_FROM_GROUP"===a?await c({id:e.flowId,group:null}):await c({id:e.flowId,group:{_link:a}})},options:[...e.groupId?[{label:"Remove from group",value:"REMOVE_FROM_GROUP"}]:[],...(a||[]).map(e=>({label:`Group ${e.id}`,value:e.id})),{label:"Create a new group",value:"CREATE_GROUP"}],"data-sentry-element":"PlainButtonSelect","data-sentry-component":"FlowGroupSelect","data-sentry-source-file":"FlowGroupSelect.tsx"}):null}var D=a(49485),O=a(84233),H=a(26334),W=a(62570),M=a(67508),B=a(54051),$=a(91855),z=a(49428),G=a(32578);let Q={dragHandle:{title:"",flex:"0 0 40px",minWidth:"40px",className:"shrink-0"}
1,name:{title:"Name",flex:"2 1 180px",minWidth:"180px",className:"px-1"},placement:{title:"Placement",flex:"1 1 120px",minWidth:"120px",className:"px-1"},status:{title:"Status",flex:"1 1 100px",minWidth:"100px",className:"px-1"},itemsSold:{title:"Items sold",flex:"1 1 80px",minWidth:"80px",className:"px-1 text-right",analyticsOnly:!0},ordersSold:{title:"Orders sold",flex:"1 1 80px",minWidth:"80px",className:"px-1 text-right",analyticsOnly:!0},revenue:{title:"Revenue",flex:"1 1 100px",minWidth:"100px",className:"px-1 text-right",analyticsOnly:!0},bestSellers:{title:"Best sellers",flex:"1.6 1 160px",minWidth:"160px",className:"px-1 text-center",analyticsOnly:!0},actions:{title:"Actions",flex:"1.5 1 180px",minWidth:"180px",className:"px-1"}},Z=({data:e})=>{let t=(0,f.useRouter)(),{shop:a}=(0,k.P)(),[s,c]=(0,m.useState)([]),[u,p]=(0,y.A)(r.F.upezFlow.update),[h,_]=(0,y.A)(r.F.upezFlow.delete),[,b]=(0,y.A)(r.F.upezFlow.duplicate),w=(0,z.Z)(),v=shopify.toast;(0,m.useEffect)(()=>{e&&c(e)},[e]);let P=(0,m.useCallback)(async e=>{if(!e.destination||e.source.index===e.destination.index)return;let t=s.slice(),[a]=t.splice(e.source.index,1);t.splice(e.destination.index,0,a);let n=t.reduce((t,a,n)=>n===e.destination.index?[...t,{...a,sort_order:e.destination.index}]:n===e.source.index?[...t,{...a,sort_order:e.source.index}]:isNaN(a.sort_order)?[...t,{...a,sort_order:n}]:t,[]);c(t),await Promise.all(n.map(e=>p({id:e.id,upezFlow:{sort_order:e.sort_order}}))),v.show("Flows list updated!",{id:(1e4*Math.random()).toString()})},[s]);return(0,n.jsxs)("div",{className:"w-full overflow-x-auto","data-sentry-component":"List","data-sentry-source-file":"flows.tsx",children:[u.fetching&&(0,n.jsx)(i.R,{}),h.fetching&&(0,n.jsx)(i.R,{}),(0,n.jsx)("div",{className:"flex w-full border-b border-[#e5e7eb] bg-[var(--p-color-bg-surface-secondary)] py-2",children:Object.entries(Q).map(([e,t])=>(0,n.jsx)("div",{className:(0,H.cn)("Polaris-IndexTable__Table thead th text-sm font-medium text-gray-900",t.className,t.analyticsOnly&&!w&&"text-[var(--p-color-text-disabled)]"),style:{flex:t.flex,minWidth:t.minWidth},children:t.title},e))}),(0,n.jsx)(g.JY,{onDragEnd:P,"data-sentry-element":"DragDropContext","data-sentry-source-file":"flows.tsx",children:(0,n.jsx)(g.gL,{droppableId:"droppable","data-sentry-element":"Droppable","data-sentry-source-file":"flows.tsx",children:e=>(0,n.jsxs)("div",{ref:e.innerRef,...e.droppableProps,children:[s.map((e,s)=>{var r;let i=(0,$.lZ)(e.orders,`flow-${e.id}`),c=(0,B.zh)(i,`flow-${e.id}`),u=0===e.orders.length?"-":(0,M.ZV)(i.length),f=`${0===(r=(0,B.rT)(c))?"-":(0,M.Yz)(a?.moneyFormat||"{{amount}}")(r)}`,h=(()=>{if(0===e.orders.length)return"-";let t=c.reduce((e,t)=>e+(t.node.quantity||0),0);return(0,M.ZV)(t)})(),m=(0,B.hx)(c);return(0,n.jsx)(g.sx,{draggableId:e.id,index:s,children:(a,s)=>(0,n.jsx)("div",{className:"Polaris-ResourceItem__ListItem border-b border-[#e5e7eb] last:border-0",ref:a.innerRef,...a.draggableProps,style:s.isDragging?{background:"white",...a.draggableProps.style}:a.draggableProps.style,children:(0,n.jsxs)("div",{className:"flex w-full items-center border-b bg-white py-3 last:border-b-0 hover:bg-gray-50",children:[(0,n.jsx)("div",{style:{flex:Q.dragHandle.flex,minWidth:Q.dragHandle.minWidth},children:(0,n.jsx)("div",{...a.dragHandleProps,children:(0,n.jsx)(l.m,{content:"Drag to reorder list items",children:(0,n.jsx)(d.I,{source:x.S,tone:"base"})})})}),(0,n.jsx)("div",{style:{flex:Q.name.flex,minWidth:Q.name.minWidth},className:"px-1",children:(0,n.jsx)(o.$,{variant:"plain",textAlign:"left",onClick:()=>t.push(`/flows/${e.id}`,void 0,{shallow:!0}),children:e.name||new Date(e.updatedAt).toLocaleString()})}),(0,n.jsx)("div",{style:{flex:Q.placement.flex,minWidth:Q.placement.minWidth},className:"px-1",children:(0,n.jsx)(D.g,{type:e.type})}),(0,n.jsx)("div",{style:{flex:Q.status.flex,minWidth:Q.status.minWidth},className:"px-1",children:(0,n.jsx)(W.H,{status:e.status,onAction:()=>{p({id:e.id,upezFlow:{status:"ACTIVE"===e.status?"DRAFT":"ACTIVE"}})}})}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{flex:Q.itemsSold.flex,minWidth:Q.itemsSold.minWidth},className:"px-1 text-right",children:(0,n.jsx)(G.R9,{locked:!w,children:h})}),(0,n.jsx)("div",{style:{flex:Q.ordersSold.flex,minWidth:Q.ordersSold.minWidth},className:"px-1 text-right",children:(0,n.jsx)(G.R9,{locked:!w,children:u})}),(0,n.jsx)("div",{style:{flex:Q.revenue.flex,minWidth:Q.revenue.minWidth},className:"px-1 text-right",children:(0,n.jsx)(G.R9,{locked:!w,children:f})}),(0,n.jsx)("div",{style:{flex:Q.bestSellers.flex,minWidth:Q.bestSellers.minWidth},className:"px-1",children:(0,n.jsx)(G.R9,{locked:!w,children:m.length>0?(0,n.jsx)("div",{className:"flex justify-center gap-2",children:m.map((e,t)=>(0,n.jsx)("img",{src:e.image?.url,alt:e.title,className:"h-10 w-10 rounded object-cover"},t))}):(0,n.jsx)("span",{className:"flex justify-center text-gray-400",children:"-"})})})]}),(0,n.jsx)("div",{style:{flex:Q.actions.flex,minWidth:Q.actions.minWidth},className:"px-1",children:(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(F,{flowId:e.id,groupId:e.group?.id}),(0,n.jsx)(o.$,{variant:"plain",onClick:()=>b({flowId:e.id}),children:"Duplicate"}),(0,n.jsx)(o.$,{tone:"critical",variant:"plain",onClick:()=>_({id:e.id}),children:"Delete"})]})})]})})},e.id)}),e.placeholder]})})})]})};function Y(e){let t,a,l,d=(0,f.useRouter)(),[o,x]=(0,m.useState)(O.w[3]),g=(0,m.useCallback)(()=>{d.push("/create-flow",void 0,{shallow:!0})},[d]),{data:y,fetching:v,customer:P}=(0,h.A)(),[{data:j,fetching:U}]=(0,s.SM)(r.F.upezFlow,{select:{name:!0,id:!0,type:!0,status:!0,conditions:!0,group:{id:!0},templateSettings:!0,templateId:!0,updatedAt:!0,sort_order:!0},first:250,filter:{type:Array.isArray(e.type)?{in:e.type}:{equals:e.type}},sort:{sort_order:"Ascending",createdAt:"Descending"}}),[{data:E,fetching:C}]=(0,s.SM)(r.F.ordersAnalytics,{filter:{shopId:{equals:y?.id||""},createdAt:{greaterThanOrEqual:o.period.since.toISOString(),lessThanOrEqual:o.period.until.toISOString()}}}),S=(0,z.Z)(),A=(0,m.useMemo)(()=>(E?.flatMap(e=>e.orders)||[]).reduce((e,t)=>
1{for(let a of[...new Set(t.upezFlows)])e[a]=[...e[a]||[],t];return e},{}),[E]),k=(0,m.useMemo)(()=>j?.map(e=>({...e,orders:A[`flow-${e.id}`]||[]}))||[],[j,A]);if(v)return(0,n.jsx)(i.R,{});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{children:(0,n.jsxs)(c.Y,{fullWidth:!0,title:"Upsell Widgets",subtitle:"Create and manage upsell widgets for your store.",primaryAction:{content:"Create upsell widget",onAction:g},secondaryActions:(0,n.jsx)(O.A,{value:o,onChange:x}),"data-sentry-element":"Page","data-sentry-source-file":"flows.tsx",children:[(U||C)&&(0,n.jsx)(i.R,{}),P&&P?.subscription?.plan&&!(0,h.j)({feature:"upsell_flows",currentPlan:P.subscription.plan,count:j?.filter(e=>"ACTIVE"===e.status).length||0})&&(0,n.jsxs)(u.lZ,{tone:"critical",title:"You've reached the limit of upsell widgets",action:{content:"Upgrade",onAction:()=>d.push("/billing",void 0,{shallow:!0})},children:["Your current plan only allows you to publish ",P.subscription.plan.features.upsell_flows.value," ","upsell widgets. Please upgrade to higher plan to create more or unpublish some flows."]}),!S&&j&&j.length>0&&(0,n.jsx)("div",{className:"mb-3",children:(0,n.jsx)(G.b$,{})}),j&&j.length>0&&(0,n.jsxs)("div",{className:"m-auto",children:[(0,n.jsx)(p.Z,{padding:"0",children:(0,n.jsx)(Z,{data:(t=[...k],a=["sort_order"],l=e=>new Date(e.updatedAt).getTime(),t.sort((e,t)=>(_(e,a)??l(e))-(_(t,a)??l(t))),t)})}),(0,n.jsx)("div",{className:"pt-4",children:(0,n.jsx)(b.A,{})})]})]})}),!U&&j&&0===j.length&&[w.UQ.IN_CART_ITEM_UPSELL,w.UQ.CROSS_SELL].includes(e.type?.[0]||e.type||0)&&(0,n.jsx)(L,{}),!U&&j&&0===j.length&&(e.type===w.UQ.POPUP||e.type===w.UQ.UPSELL||Array.isArray(e.type)&&(e.type.includes(w.UQ.POPUP)||e.type.includes(w.UQ.UPSELL)))&&(0,n.jsx)(I,{}),!U&&j&&0===j.length&&e.type==w.UQ.PDP_UPSELL&&(0,n.jsx)(T,{})]})}},62570:(e,t,a)=>{a.d(t,{H:()=>o});var n=a(37876),s=a(80407),r=a(95186),i=a(82947),l=a(6124),d=a(83893);let o=({active:e,status:t,onAction:a})=>{let o="ACTIVE"===t?"success":"SCHEDULED"===t?"info":"new",c=(0,n.jsx)("div",{style:{"--p-border-width-1":"0"},children:(0,n.jsx)(l.A,{disclosure:"select",variant:"monochromePlain",disabled:e,label:(0,n.jsx)(s.E,{progress:"ACTIVE"===t?"complete":"incomplete",tone:o,children:t&&(0,d.A)(t||"Draft")}),children:()=>(0,n.jsx)(r.l,{actionRole:"menuitem",items:[{content:(0,n.jsxs)("span",{children:["Switch to"," ","ACTIVE"===t?(0,n.jsx)(s.E,{progress:"incomplete",tone:"new",children:"Draft"}):(0,n.jsx)(s.E,{progress:"complete",tone:"success",children:"Active"})]}),onAction:a}]})})});return e?(0,n.jsx)(i.m,{active:e,content:e?"You have unsaved changes. Please save your changes or discard them to update discount's status":"",children:c}):c}},70811:(e,t,a)=>{a.d(t,{A:()=>u});var n=a(37876),s=a(92566),r=a(45755),i=a(17036),l=a(52387),d=a(33622),o=a(47054),c=a(20992);function u(){let{mainTheme:e,isCartEnabledLive:t,checkUPEZCartStatus:a,checkingUPEZ:u}=(0,r.A)(),{showElement:p}=(0,c.i4)(),{shop:f}=(0,s.P)();return!e||t?null:(0,n.jsx)(i.lZ,{title:"Upnova is not enabled in your live theme yet!",tone:"warning","data-sentry-element":"Banner","data-sentry-component":"UnpublishedUPEZWarningBanner","data-sentry-source-file":"UnpublishedUPEZWarningBanner.tsx",children:(0,n.jsxs)("p",{children:["You can do so by going to your ",(0,n.jsx)("span",{className:"bg-gray-200 py-0.5 px-1 rounded-md",children:"Theme Customizer"})," ","->"," ",(0,n.jsx)("span",{className:"bg-gray-200 py-0.5 px-1 rounded-md",children:"App Embeds"})," ","->"," ",(0,n.jsx)("span",{className:"bg-gray-200 py-0.5 px-1 rounded-md",children:"upnova cart slider"})," ","->"," toggle it on.",(0,n.jsx)("br",{}),"You need to enable UpNova Cart in your live theme to enable all of the upselling features of upnova.",(0,n.jsx)("br",{}),(0,n.jsx)("br",{}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.$,{icon:d.S,onClick:()=>{p((0,n.jsx)("div",{className:"bg-gray-200",children:(0,n.jsx)("div",{className:"",dangerouslySetInnerHTML:{__html:'<div style="position: relative; padding-bottom: 62.93706293706294%; height: 0;"><iframe src="https://www.loom.com/embed/a284def6a6d74f669e6b0c0069ad62e3?sid=8bcde725-327c-4128-abc3-487dfc678474" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"></iframe></div>'}})}))},"data-sentry-element":"Button","data-sentry-source-file":"UnpublishedUPEZWarningBanner.tsx",children:"Watch tutorial"}),(0,n.jsx)(l.$,{variant:"primary",onClick:()=>{window.open(`https://admin.shopify.com/store/${f.myshopifyDomain?.split(".")[0]}/themes/${e.id}/editor`,"_blank")},"data-sentry-element":"Button","data-sentry-source-file":"UnpublishedUPEZWarningBanner.tsx",children:"Go to Live Theme & Enable upnova"}),(0,n.jsx)(l.$,{variant:"tertiary",loading:u,icon:o.S,onClick:()=>a(),"data-sentry-element":"Button","data-sentry-source-file":"UnpublishedUPEZWarningBanner.tsx",children:"Re-check status"})]})]})})}},70879:(e,t,a)=>{a.d(t,{B:()=>s,D:()=>r});var n=a(37319);function s(e){switch(e){case n.UQ.UPSELL:return n.F9.UPSELL;case n.UQ.CROSS_SELL:return n.F9.CROSS_SELL;case n.UQ.IN_CART_ITEM_UPSELL:return n.F9.IN_CART_ITEM;case n.UQ.PDP_UPSELL:return n.F9.PRODUCT_PAGE;case n.UQ.POPUP:return n.F9.POPUP;default:throw Error(`Upsell flow type ${e} is not supported`)}}function r(e){switch(e){case n.F9.UPSELL:return n.UQ.UPSELL;case n.F9.CROSS_SELL:return n.UQ.CROSS_SELL;case n.F9.IN_CART_ITEM:return n.UQ.IN_CART_ITEM_UPSELL;case n.F9.PRODUCT_PAGE:return n.UQ.PDP_UPSELL;case n.F9.POPUP:return n.UQ.POPUP;default:throw Error(`Builder template type ${e} is not supported`)}}},75908:(e,t,a)=>{a.d(t,{L:()=>o});var n=a(83783),s=a(89099),r=a(14232),i=a(89050),l=a(30099),d=a(42250);function o({mainTheme:e,refreshThemes:t,runOnMount:a=!0,themesForUpezScan:o}){let c=(0,s.useRouter)(),u=(0,r.useMemo)(()=>c.isReady&&(0,d.J)(c.query),[c.isReady,c.query]),[,p]=(0,n.y3)(i.F.shopifyTheme.checkIfUPEZIsEnabled),[,f]=(0,n.Zu)(i.F.syncThemes),[h,m]=(0,r.useState)(null),[x,g]=(0,r.useState)(!1),_=(0,r.useRef)(!1),y=(0,r.useCallback)(async()=>
1{if(u)return m(!0),!0;if(_.current||!e?.id)return null;_.current=!0,g(!0);try{await f({}),await Promise.resolve(t?.());let a=o&&o.length>0?[...o].sort((e,t)=>new Date(t.shopifyUpdatedAt??0).getTime()-new Date(e.shopifyUpdatedAt??0).getTime()):null,n=a&&a.length>0?(0,l.x)(a):[{id:e.id}],s=await Promise.all(n.map(async e=>{let t=await p({id:e.id});return{id:e.id,enabled:t?.data?.isUPEZEnabled??!1}}));await Promise.resolve(t?.());let r=s.find(t=>t.id===e.id)?.enabled??!1;return m(r),r}catch{return m(!1),!1}finally{_.current=!1,g(!1)}},[u,e?.id,f,t,p,o]);return(0,r.useEffect)(()=>{f({})},[f]),(0,r.useEffect)(()=>{if(c.isReady){if(u)return void m(!0);a&&e?.id&&y()}},[e?.id,a,u,c.isReady]),{isCartEnabled:!!u||h,isChecking:!u&&x,refresh:y}}},83893:(e,t,a)=>{a.d(t,{A:()=>n});function n(e){let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.