PageSourceSearch

https://app.listingview.io/_next/static/chunks/9674-a8e71d1628ebe207.js

js listingview.io collected 2026-09-24 14:24:15 UTC 112,314 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9674],{47268:function(e,t,n){var r=n(57437),a=n(2265),l=n(99376),i=n(68575),o=n(74231),s=n(54438),d=n(26576),c=n(96745),u=n(37930),h=n(7261);t.Z=e=>{let{open:t,handleClose:n,showContinueWithoutConnecting:v=!1,onContinueWithoutConnecting:x}=e,[m,p]=(0,a.useState)(null),[f,b]=(0,a.useState)(null);(0,l.useRouter)();let g=(0,i.I0)();return(0,a.useEffect)(()=>{let e=()=>{let e=localStorage.getItem("userInfo"),t=localStorage.getItem("loggedInUser");e&&p(JSON.parse(e)),t&&b(JSON.parse(t))};e();let t=()=>{e()};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}},[]),(0,a.useEffect)(()=>{var e,t;((null==m?void 0:null===(e=m.data)||void 0===e?void 0:e.shopConnected)||(null==m?void 0:null===(t=m.data)||void 0===t?void 0:t.etsyShopConnected)||(null==f?void 0:f.shopConnected)||(null==f?void 0:f.etsyShopConnected))&&g((0,o.w7)({shopConnected:!0}))},[m,f,g]),(0,r.jsx)(u.Z,{open:t,onClose:n,size:"sm",noPadding:!0,hideClose:!0,children:(0,r.jsx)("div",{className:"p-10",children:(0,r.jsx)(d.i,{bare:!0,ShopIcon:"/assets/connectYourShopPlaceholderImages/EtsyIcon.svg",ShopName:"Etsy",showContinueWithoutConnecting:v,onContinueWithoutConnecting:()=>{(null==m?void 0:m.data)&&g((0,s._z)()),x&&x(),n&&n()},onConnectClick:async e=>{let{setConnecting:t}=e;(null==m?void 0:m.data)&&g((0,s._z)()),t(!0);try{await (0,c.Z)()||(h.Am.error("Failed to get Etsy authorization URL."),t(!1))}catch(e){t(!1)}}})})})}},77874:function(e,t,n){n.d(t,{Z:function(){return eR}});var r=n(57437),a=n(2265),l=n(33145),i=n(49089),o=n(99376),s=n(46387),d=n(9871),c=n(74231),u=n(68575),h=n(47268);n(12927);var v=n(43792),x=n(69317),m=n(64413),p=n(80804),f=n(62720),b=n(2961),g=n(1340),y=n(73618),j=n(33954),w=n(94283),C=n(82023),k=n(66949),N=n(12805),S=n(42449),E=n(9334),A=n(89345),L=n(98728),z=n(47692),Z=n(97226),M=n(85929),R=n(98617),I=n(46506),_=n(54438),T=n(9384),F=n(85388),P=n(26847),H=n(73524),D=n(58666),V=n(30166),G=n(37930);n(86260);var O=n(7261),U=n(4385),W=n(13213),B=n(28906),q=n(5423),J=n(97626),Y=n(36362),K=n(95846),Q=n(36841),$=n(18673),X=n(15127);let ee="lv-sidebar-section",et={RESEARCH:"research",MANAGEMENT:"management"},en=et.RESEARCH,er={dashboard:et.RESEARCH,"shop-analyzer":et.RESEARCH,"listing-explorer":et.RESEARCH,"keyword-finder":et.RESEARCH,"tag-analyzer":et.RESEARCH,"trend-radar":et.RESEARCH,"tag-extractor":et.RESEARCH,calculator:et.RESEARCH,"listing-optimizer":et.MANAGEMENT,"listing-creation":et.MANAGEMENT,"tag-generator":et.MANAGEMENT,"asset-library":et.MANAGEMENT,"design-canvas":et.MANAGEMENT,orders:et.MANAGEMENT,backups:et.MANAGEMENT,admin:et.MANAGEMENT},ea={[et.RESEARCH]:["dashboard","shop-analyzer","listing-explorer","keyword-finder","tag-analyzer","trend-radar","divider","tag-extractor","tag-generator","calculator"],[et.MANAGEMENT]:["listing-optimizer","listing-creation","asset-library","design-canvas","orders","backups","admin","divider","tag-extractor","tag-generator","calculator"]};function el(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=ea[ed(e)]||[],r=[];for(let e of n)if("divider"===e){if(0===r.length||"divider"===r[r.length-1].type)continue;r.push({type:"divider"})}else t[e]&&r.push(t[e]);return r.length&&"divider"===r[r.length-1].type&&r.pop(),r}function ei(e,t){return!!(t&&(null==e?void 0:e.hideInEmbed))}function eo(e,t){if(!e.startsWith(t))return!1;let n=e.slice(t.length);return""===n||n.startsWith("/")}let es=["/dashboard/listing-optimizer","/embed/listing-optimizer"];function ed(e){return e===et.RESEARCH||e===et.MANAGEMENT?e:en}var ec=n(86720);let eu={[et.RESEARCH]:{label:"Research",Icon:x.Z},[et.MANAGEMENT]:{label:"Manage",Icon:m.Z}};function eh(e){let{activeSection:t,onSectionChange:n,isExpanded:a}=e,l=t===et.MANAGEMENT?et.RESEARCH:et.MANAGEMENT,i=e=>{let{label:t,Icon:n}=eu[e];return{value:e,label:a?t:void 0,icon:()=>(0,r.jsx)(n,{size:14}),tooltip:a?void 0:t,ariaLabel:t}},o=a?[i(et.RESEARCH),i(et.MANAGEMENT)]:[i(t)],s=a?n:()=>n(l);return(0,r.jsx)("div",{className:"px-1.5 pb-2 pt-1","data-tour":"sidebar-sections",children:(0,r.jsx)(ec.Z,{options:o,value:t,onChange:s,size:"default",orientation:"horizontal",fullWidth:!0,labelFontSize:12,activeColor:"var(--lv-text-primary)",ariaLabel:"Sidebar section"})})}var ev=n(88906),ex=n(99897),em=n(67782),ep=n(76865),ef=n(40875),eb=n(87789),eg=n(96745),ey=n(61510);function ej(e){var t,n,l,i;let{collapsed:o=!1,loading:s=!1,connectedShops:c=[],selectedShop:u=null,shopInfo:h=null,isShopConnected:x,etsyTokenStatus:p,activeShopId:f,onSelectShop:b,onConnectShop:g}=e,[y,j]=(0,a.useState)(null),w="w-11",C=()=>j(null),k=e=>{let{iconUrl:t,needsReconnect:n=!1}=e;return(0,r.jsxs)("span",{className:"relative",children:[(0,r.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-lg border border-lv-border overflow-hidden",children:t?(0,r.jsx)("img",{src:t,alt:"Shop",className:"h-full w-full object-cover"}):(0,r.jsx)(m.Z,{size:18,className:"text-lv-text-secondary"})}),n?(0,r.jsx)("span",{className:"absolute -bottom-1 -right-1 flex items-center justify-center w-3.5 h-3.5 rounded-full border-2 border-lv-card",style:{backgroundColor:"var(--lv-warning)"},children:(0,r.jsx)(ep.Z,{size:8,color:"var(--lv-text-inverse)","aria-hidden":"true"})}):(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 bg-green-400 rounded-full border-2 border-lv-card"})]})};if(s)return(0,r.jsx)("div",{className:"flex items-center h-11 justify-center ".concat(w),children:(0,r.jsx)(d.D8,{size:20})});if(!1===x)return(0,r.jsxs)("button",{type:"button",className:"flex items-center w-full h-11 rounded-xl cursor-pointer text-lv-text-primary hover:bg-lv-elevated border border-transparent hover:border-lv-border",onClick:g,"data-tour":"connect-shop","aria-label":"Connect your shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(w," flex items-center justify-center"),children:(0,r.jsx)(eb.ZG,{size:18})}),!o&&(0,r.jsx)("span",{className:"whitespace-nowrap text-xs text-lv-text-primary",children:"Connect your shop"})]});if(!0===x&&!p)return(0,r.jsxs)("button",{type:"button",className:"flex items-center w-full h-11 rounded-xl cursor-pointer text-orange-500 hover:bg-lv-elevated border border-transparent hover:border-lv-border",onClick:g,"data-tour":"connect-shop","aria-label":"Reconnect shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(w," flex items-center justify-center"),children:(0,r.jsx)(m.Z,{size:18})}),!o&&(0,r.jsx)("span",{className:"whitespace-nowrap text-xs",children:"Reconnect Shop"})]});let N=(null==u?void 0:u.shopName)||(null==h?void 0:null===(t=h.data)||void 0===t?void 0:t.name)||"";if(h&&!1!==x&&c.length>0){let e=!!(null==u?void 0:u.needsReconnect),t=function(e){let t=Array.isArray(e)?e[0]:null;return t&&"object"==typeof t&&t.description?t.description:ey.t}(null==u?void 0:u.missingScopes);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(v.Z,{title:e?t:N,placement:"top",maxWidth:220,children:(0,r.jsxs)("button",{type:"button",className:"flex items-center w-full h-11 rounded-xl cursor-pointer hover:bg-lv-elevated border border-transparent hover:border-lv-border",onClick:e=>
1{j(e.currentTarget),(0,X.Z)("user_card_opened",{collapsed:o,surface:"shop"})},"data-shop-dropdown-button":!0,"aria-haspopup":"menu","aria-expanded":!!y,"aria-label":"Switch shop. Current shop: ".concat(N||"none").concat(e?" (reconnect required)":""),children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(w," flex items-center justify-center"),children:(0,r.jsx)(k,{iconUrl:null==u?void 0:u.iconUrl,needsReconnect:e})}),!o&&(0,r.jsxs)("span",{className:"flex items-center min-w-0 flex-1 pr-2",children:[(0,r.jsx)("span",{className:"text-xs text-lv-text-primary truncate block max-w-[130px]",children:N}),(0,r.jsx)(ef.Z,{className:"ml-auto flex-shrink-0 text-lv-text-tertiary transition-transform duration-200 ".concat(y?"rotate-180":""),size:14})]})]})}),(0,r.jsx)(W.Z,{anchorEl:y,open:!!y,onClose:C,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},maxHeight:300,minWidth:null!==(n=null==y?void 0:y.offsetWidth)&&void 0!==n?n:180,items:[...e?[{label:"Reconnect Etsy",description:"Missing permission to read your orders",icon:(0,r.jsx)(ep.Z,{size:14,color:"var(--lv-warning)","aria-hidden":"true"}),onClick:()=>{C(),(0,eg.Z)()}},{divider:!0}]:[],...c.map(e=>{let t=e.shopId===f;return{label:e.shopName,active:(null==u?void 0:u.shopId)===e.shopId,icon:e.iconUrl?(0,r.jsx)("img",{src:e.iconUrl,alt:e.shopName,className:"w-4 h-4 object-cover rounded"}):(0,r.jsx)(m.Z,{size:14,className:"text-lv-text-primary"}),badge:e.needsReconnect?"Reconnect":t?"Default":void 0,onClick:()=>b(e)}}),{divider:!0},{label:"Add Shop",icon:(0,r.jsx)(m.Z,{size:14,className:"text-lv-text-primary"}),onClick:()=>{C(),g()}}]})]})}return h&&!1!==x?(0,r.jsxs)("div",{className:"flex items-center w-full h-11 rounded-xl",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(w," flex items-center justify-center"),children:(0,r.jsx)(k,{iconUrl:null==h?void 0:null===(l=h.data)||void 0===l?void 0:l.logoSrc})}),!o&&(0,r.jsx)("span",{className:"text-xs text-lv-text-primary truncate",children:null==h?void 0:null===(i=h.data)||void 0===i?void 0:i.name})]}):(0,r.jsxs)("button",{type:"button",className:"flex items-center w-full h-11 rounded-xl cursor-pointer hover:bg-lv-elevated border border-transparent hover:border-lv-border",onClick:g,"data-tour":"connect-shop","aria-label":"Connect your shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(w," flex items-center justify-center"),children:(0,r.jsx)(eb.ZG,{size:18})}),!o&&(0,r.jsx)("span",{className:"whitespace-nowrap text-xs text-lv-text-primary",children:"Connect your shop"})]})}var ew=n(66952);function eC(e){let{collapsed:t=!1,userInfo:n,shopSwitcherProps:l={},showShopSwitcher:i=!0,accountActions:o={},themeControl:s={}}=e,d=!n||0===Object.keys(n).length,[c,u]=(0,a.useState)(null),h="w-11",v=null==n?void 0:n.name,x=null==n?void 0:n.email,m=function(e,t){if(e&&e.trim()){var n;let t=e.trim().split(/\s+/);return(((null===(n=t[0])||void 0===n?void 0:n[0])||"")+(t.length>1?t[t.length-1][0]:"")).toUpperCase()||e.trim()[0].toUpperCase()}return t?t[0].toUpperCase():"?"}(v,x),p=(0,ew.w)(null==n?void 0:n.planTier),{onSettings:f,onSupport:b,onLogout:g}=o,{theme:y,resolvedTheme:j,setTheme:w}=s,C="dark"===j?Z.Z:M.Z,k=[f&&{label:"Settings",icon:(0,r.jsx)(L.Z,{size:14}),onClick:f},b&&{label:"Support",icon:(0,r.jsx)(A.Z,{size:14}),onClick:b},(f||b)&&w&&{divider:!0},w&&{label:"Theme",icon:(0,r.jsx)(C,{size:14}),children:[{label:"Light",icon:(0,r.jsx)(M.Z,{size:14}),active:"light"===y,keepOpen:!0,onClick:()=>w("light")},{label:"Dark",icon:(0,r.jsx)(Z.Z,{size:14}),active:"dark"===y,keepOpen:!0,onClick:()=>w("dark")},{label:"System",icon:(0,r.jsx)(ex.Z,{size:14}),active:"system"===y,keepOpen:!0,onClick:()=>w("system")}]},g&&{divider:!0},g&&{label:"Log out",icon:(0,r.jsx)(z.Z,{size:14}),danger:!0,onClick:g}].filter(Boolean),N=k.length>0;return(0,r.jsxs)("div",{role:"region","aria-label":"Account","data-tour":"user-card",className:"px-1.5 pt-2 mt-1 border-t border-lv-border",children:[d?(0,r.jsxs)("div",{className:"flex items-center h-11","aria-hidden":"true",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(h," flex items-center justify-center"),children:(0,r.jsx)("span",{className:"w-8 h-8 rounded-full bg-lv-elevated animate-pulse"})}),!t&&(0,r.jsxs)("div",{className:"min-w-0 flex-1 pr-2 space-y-1",children:[(0,r.jsx)("span",{className:"block h-3 w-24 rounded bg-lv-elevated animate-pulse"}),(0,r.jsx)("span",{className:"block h-2.5 w-32 rounded bg-lv-elevated animate-pulse"})]})]}):(0,r.jsxs)("button",{type:"button",onClick:N?e=>
1{u(e.currentTarget),(0,X.Z)("user_card_opened",{collapsed:t,surface:"account"})}:void 0,disabled:!N,"aria-haspopup":N?"menu":void 0,"aria-expanded":N?!!c:void 0,"aria-label":N?"Account menu for ".concat(v||x||"your account"):"Account: ".concat(v||x||"signed in"),"data-user-card-button":!0,className:"flex items-center w-full h-11 rounded-xl border border-transparent ".concat(N?"cursor-pointer hover:bg-lv-elevated hover:border-lv-border":"cursor-default"," ").concat(c?"bg-lv-elevated border-lv-border":""),children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(h," flex items-center justify-center"),children:(0,r.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-lv-brand-light text-lv-brand text-xs font-semibold uppercase",children:m})}),!t&&(0,r.jsxs)("span",{className:"min-w-0 flex-1 pr-1 text-left",children:[(0,r.jsx)("span",{className:"flex items-center gap-1.5",children:(0,r.jsx)("span",{className:"text-xs font-medium text-lv-text-primary truncate",children:v||"Account"})}),x&&(0,r.jsx)("span",{className:"text-xs text-lv-text-tertiary truncate block",children:x})]}),!t&&N&&(0,r.jsx)(em.Z,{size:14,className:"ml-auto mr-2 flex-shrink-0 text-lv-text-tertiary"})]}),N&&(0,r.jsx)(W.Z,{anchorEl:c,open:!!c,onClose:()=>u(null),anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},minWidth:c?Math.max(c.offsetWidth,200):200,header:(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-xs font-medium text-lv-text-primary truncate",children:v||"Account"}),x&&(0,r.jsx)("div",{className:"text-xs text-lv-text-tertiary truncate",children:x}),p&&(0,r.jsx)("div",{className:"mt-1",children:(0,r.jsx)("span",{className:"inline-flex text-[10px] font-medium rounded border border-lv-border px-1.5 py-0 leading-4 text-lv-text-tertiary",children:p})})]}),items:k}),i&&(0,r.jsx)(ej,{collapsed:t,...l})]})}var ek=n(82156);let eN=(0,V.default)(()=>Promise.all([n.e(6691),n.e(6428),n.e(3355)]).then(n.bind(n,83355)),{loadableGenerated:{webpack:()=>[83355]},ssr:!1});function eS(e){let{open:t,onClose:n}=e,a=(0,ek.Z)("(max-width:600px)");return(0,r.jsx)(G.Z,{open:t,onClose:n,title:"Profit calculator",size:a?"fullscreen":"lg",fullWidth:!0,noPadding:!0,scroll:a?"paper":"body",PaperProps:{className:"lvc-modal-host"},children:t?(0,r.jsx)(eN,{layout:"auto"}):null})}var eE=n(34753),eA=n(57692);let eL=(0,V.default)(()=>Promise.all([n.e(3588),n.e(5064),n.e(2713),n.e(7571),n.e(9542)]).then(n.bind(n,49542)),{loadableGenerated:{webpack:()=>[49542]},ssr:!1}),ez=(0,V.default)(()=>Promise.all([n.e(3588),n.e(1953),n.e(5064),n.e(2713),n.e(7571),n.e(2147),n.e(3286),n.e(6967),n.e(8491),n.e(4398),n.e(4168),n.e(2583)]).then(n.bind(n,12583)),{loadableGenerated:{webpack:()=>[12583]},ssr:!1}),eZ=(0,V.default)(()=>Promise.all([n.e(4890),n.e(3461),n.e(3501)]).then(n.bind(n,32487)),{loadableGenerated:{webpack:()=>[32487]},ssr:!1}),eM=e=>{let{children:t}=e;return(0,r.jsx)("span",{className:"mx-[2px] inline-flex shrink-0 items-center rounded-lv-xs bg-lv-promo-lime px-[7px] py-[3px] -skew-x-12",children:(0,r.jsx)("span",{className:"inline-block skew-x-12 text-lv-btn font-bold uppercase leading-none text-lv-promo-lime-ink",children:t})})};function eR(e){var t,n,V,G,ea,ec,eu;let{isPinned:ex,togglePin:em,smallScreen:ep,onHandleOpenRef:ef}=e,eb=(0,o.usePathname)(),eg=(0,u.I0)(),ey=(0,u.v9)(e=>e.user.myInfo),ew=function(){let[e,t]=(0,a.useState)(()=>Y.jf?(0,eE.getCachedQueueCounts)():{awaitingApproval:0,held:0,submissionFailed:0,relayFailed:0,total:0});return(0,a.useEffect)(()=>{if(!Y.jf)return;let e=()=>t((0,eE.getCachedQueueCounts)());return e(),window.addEventListener(eE.EVENT_NAME,e),()=>window.removeEventListener(eE.EVENT_NAME,e)},[]),e}(),ek=function(){let e=(0,K.y)(c.Vs),t=(0,u.v9)(c.B3);return e&&t}(),eN=function(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!Y._n)return;let e=!1;return(0,F.LD)().then(n=>{e||t((null==n?void 0:n.ai_design_canvas_enabled)===!0)}).catch(()=>{e||t(!1)}),()=>{e=!0}},[]),Y._n&&e}(),eR=(0,u.v9)(e=>{var t;return null===(t=e.user.myInfo)||void 0===t?void 0:t.etsyShopConnected}),eI=(0,u.v9)(e=>{var t;return null===(t=e.user.myInfo)||void 0===t?void 0:t.etsyRefreshTokenStatus}),e_=(0,u.v9)(e=>{var t;return null===(t=e.user)||void 0===t?void 0:t.isExtensionInstalled}),eT=(0,P.W6)(),{currentView:eF,setCurrentView:eP,setCurrentParam
1s:eH}=(0,H.b)(),eD=(0,u.v9)(e=>e.user.currentTab),{theme:eV,resolvedTheme:eG,setTheme:eO}=(0,D.Fg)(),[eU,eW]=(0,a.useState)(!0),[eB,eq]=(0,a.useState)(!0),[eJ,eY]=(0,a.useState)(!0),[eK,eQ]=(0,a.useState)(!1),[e$,eX]=(0,a.useState)(!1),[e0,e1]=(0,a.useState)(null),[e2,e5]=(0,a.useState)(!0),e3=(0,o.useRouter)(),[e7,e4]=a.useState(!1),e6=()=>e4(!0),[e8,e9]=(0,a.useState)(!1),te=(0,a.useRef)(null),tt=(0,a.useRef)(null),tn=ex||e8,tr=Y.Nx&&!eT,ta=(0,K.y)("trendRadarEnabled"),tl=(0,K.y)("listingCreationEnabled"),ti=(0,Q.Z)(),to=(0,J.a)(),[ts,td]=(0,a.useState)(en),[tc,tu]=(0,a.useState)(!1),th=tr?"w-[232px]":"w-64",tv=tr?"w-14":"w-20",tx=tr?"w-[56px]":"w-[80px]",tm=tr?ti?"h-11":"h-8":"h-9",tp=tr?"w-11":"w-[56px]",tf=tr?"px-1.5":"px-3",tb=tr?"-ml-1":"",tg=tr?14:18,ty=(0,a.useCallback)(()=>{!ex&&(tr&&ti||(clearTimeout(tt.current),te.current=setTimeout(()=>{e9(!0)},150)))},[ex,tr,ti]),tj=(0,a.useCallback)(()=>{clearTimeout(te.current),tt.current=setTimeout(()=>{e9(!1)},200)},[]);(0,a.useEffect)(()=>()=>{clearTimeout(te.current),clearTimeout(tt.current)},[]);let tw=(0,r.jsx)("svg",{width:tg,height:tg,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M6 9L8 11L12 7M19 19L14.7 14.7M17 9C17 13.4183 13.4183 17 9 17C4.58172 17 1 13.4183 1 9C1 4.58172 4.58172 1 9 1C13.4183 1 17 4.58172 17 9Z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});a.useEffect(()=>{ef&&(ef.current=e6)},[ef]);let[tC,tk]=(0,a.useState)(!1),[tN,tS]=(0,a.useState)([]),[tE,tA]=(0,a.useState)(null),[tL,tz]=(0,a.useState)(null);a.useRef(null);let tZ=a.useRef(null),tM=(0,a.useRef)(!1),[tR,tI]=a.useState(!1),[t_,tT]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!1;return(0,F.lh)().then(t=>{e||tT(t)}),()=>{e=!0}},[]),(0,a.useEffect)(()=>{if(!tE)return;let e=()=>{document.querySelectorAll('[role="menu"]').forEach(e=>{let t=e.closest(".MuiPaper-root");if(t){let e=t.style.top;if(e&&e.includes("px")&&!t.dataset.adjusted){let n=parseFloat(e);!isNaN(n)&&n>0&&(t.style.top="".concat(n-7,"px"),t.dataset.adjusted="true")}}})},t=setTimeout(e,0),n=setTimeout(e,50),r=setTimeout(e,100);return()=>{clearTimeout(t),clearTimeout(n),clearTimeout(r),document.querySelectorAll('[role="menu"]').forEach(e=>{let t=e.closest(".MuiPaper-root");t&&delete t.dataset.adjusted})}},[tE]),(0,a.useEffect)(()=>{(async()=>{try{let e=await (0,T.Db)();if((null==e?void 0:e.statusCode)===200&&(null==e?void 0:e.data)&&(tS(e.data),e.data.length>0)){let t=null==ey?void 0:ey.etsyShopId,n=null;if(t){let r=e.data.find(e=>e.shopId===t);r?(tz(r),n=r):(tz(t=>t||e.data[e.data.length-1]),n=e.data[e.data.length-1])}else tz(t=>t||e.data[e.data.length-1]),n=e.data[e.data.length-1];(null==n?void 0:n.currencyCode)&&!tM.current&&eg((0,c.Ls)(n.currencyCode))}}catch(e){console.error("Error fetching connected shops:",e)}})()},[null==ey?void 0:ey.etsyShopId]),(0,a.useEffect)(()=>{let e=()=>{tZ.current&&tI(tZ.current.scrollWidth>tZ.current.clientWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[null==tL?void 0:tL.shopName,null==e0?void 0:null===(t=e0.data)||void 0===t?void 0:t.name]),(0,a.useEffect)(()=>{(async()=>{e5(!0);try{var e,t,n,r,a;let l=await eg((0,_.me)());if(null==l?void 0:null===(n=l.payload)||void 0===n?void 0:null===(t=n.userData)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.etsyShopConnected){let e=await (0,T.KN)();if(200===e.statusCode){localStorage.setItem("shopInfo",JSON.stringify(e)),e1(e);let t=(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.currencyCode)||(null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.currency_code);t&&(eg((0,c.Ls)(t)),tM.current=!0)}}}catch(e){console.error("Error initializing shop info:",e)}finally{e5(!1)}})();let e=e=>{"shopInfo"===e.key&&e1(JSON.parse(e.newValue))};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[eg]);let tF=async()=>{await tq({type:"path",path:"/dashboard/manage-subscription",label:"Upgrade"})&&(e3.push("/dashboard/manage-subscription"),eg((0,c.Lw)("settings")))},tP=e=>{eg((0,c.Lw)(e))},tH=()=>{tA(null)},tD=async e=>{if(tH(),null==e?void 0:e.shopId){try{var t;let n=await U.default.post("/api/auth/switch-shop",{shopId:e.shopId});if(!(null==n?void 0:null===(t=n.data)||void 0===t?void 0:t.success)){O.Am.error("Failed to switch shop. Please try again.");return}}catch(e){O.Am.error("Failed to switch shop. Please try again.");return}
1tz(e),eg((0,c.V1)(e.shopId)),(0,X.Z)("shop_switched",{shopCount:tN.length}),eg((0,_.me)()),window.dispatchEvent(new CustomEvent("shopChanged",{detail:{shop:e}}))}};(0,a.useEffect)(()=>{let e=function(e){let{isEmbed:t=!1,currentView:n=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e?"/dashboard"===e||"/embed"===e?t&&"listing"===n?"listing-explorer":t&&"shop"===n?"shop-analyzer":"dashboard":"/dashboard/shop-analyzer"===e||"/embed/shop-analyzer"===e?"shop-analyzer":"/dashboard/listing-explorer"===e||"/embed/listing-explorer"===e?"listing-explorer":"/dashboard/keyword-finder"===e||"/embed/keyword-finder"===e?"keyword-finder":"/dashboard/tag-analyzer"===e||"/embed/tag-analyzer"===e?"tag-analyzer":"/dashboard/trend-radar"===e||"/embed/trend-radar"===e?"trend-radar":es.some(t=>eo(e,t))?"listing-optimizer":"/dashboard/listing-creation"===e?"listing-creation":"/dashboard/asset-library"===e?"asset-library":eo(e,"/dashboard/design-canvas")?"design-canvas":e.startsWith("/dashboard/orders")?"orders":e.startsWith("/dashboard/backups")?"backups":"/dashboard/admin"===e?"admin":"/dashboard/settings"===e?"settings":null:null}(eb,{isEmbed:eT,currentView:eF});e&&eg((0,c.Lw)(e))},[eb,eg,eT,eF]),(0,a.useEffect)(()=>{tr&&td(function(){let{currentTab:e,savedSection:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return er[e]||null||ed(t)}({currentTab:eD,savedSection:$.ZP.get(ee)}))},[eD,tr]);let tV=(0,a.useCallback)(e=>{e!==ts&&((0,X.Z)("sidebar_section_changed",{from:ts,to:e}),td(e),$.ZP.set(ee,e))},[ts]),tG=tr&&!eT&&(null==ey?void 0:ey.sidebarV2IntroSeen)===!1,tO=(0,a.useMemo)(()=>[{element:'[data-tour="sidebar-sections"]',title:"Your tools are grouped now",description:"Switch between Research and Management to find the right tool faster.",side:"right",align:"start"},{element:'[data-tour="user-card"]',title:"Switch shops here now",description:"Your profile and shop switcher live in this card at the bottom.",side:"right",align:"end"}],[]);(0,a.useEffect)(()=>{tG&&(0,X.Z)("tour.started",{tour:"sidebar_v2_intro"})},[tG]);let tU=(0,a.useMemo)(()=>{let e=function(){let{role:e,isEmbed:t=!1,iconSize:n=18}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t||"ADMIN"!==e?null:{name:"admin",section:et.MANAGEMENT,label:"Admin",icon:(0,r.jsx)(ev.Z,{size:n}),path:"/dashboard/admin",hideInEmbed:!0}}({role:null==ey?void 0:ey.role,isEmbed:eT,iconSize:tg});return[{name:"dashboard",section:et.RESEARCH,label:"Database",icon:(0,r.jsx)(x.Z,{size:tg}),path:"/dashboard",embedPath:"/embed"},{name:"shop-analyzer",section:et.RESEARCH,label:"Shops",icon:(0,r.jsx)(m.Z,{size:tg}),path:"/dashboard/shop-analyzer",embedPath:"/embed/shop-analyzer"},{name:"listing-explorer",section:et.RESEARCH,label:"Listings",icon:(0,r.jsx)(p.Z,{size:tg}),path:"/dashboard/listing-explorer",embedPath:"/embed/listing-explorer"},{name:"keyword-finder",section:et.RESEARCH,label:"Search Term Analyzer",icon:tw,path:"/dashboard/keyword-finder",embedPath:"/embed/keyword-finder"},{name:"tag-analyzer",section:et.RESEARCH,label:"Tag Analyzer",icon:(0,r.jsx)(f.Z,{size:tg}),path:"/dashboard/tag-analyzer",embedPath:"/embed/tag-analyzer"},...ta&&(0,eA.Ww)(null==ey?void 0:ey.planTier)?[{name:"trend-radar",section:et.RESEARCH,label:"Trend Radar",icon:(0,r.jsx)(b.Z,{size:tg}),path:"/dashboard/trend-radar",embedPath:"/embed/trend-radar",badge:"NEW",badgeVariant:"new"}]:[],{name:"tag-extractor",section:et.RESEARCH,label:"Tag Extractor",icon:(0,r.jsx)(g.Z,{size:tg}),action:"tag-extractor",isModal:!0},...tr?[{name:"calculator",section:et.RESEARCH,label:"Calculator",icon:(0,r.jsx)(y.Z,{size:tg}),action:"calculator",isModal:!0}]:[],{name:"tag-generator",section:et.MANAGEMENT,label:"Tag Generator",icon:(0,r.jsx)(j.Z,{size:tg}),action:"tag-generator",isModal:!0},{type:"divider"},{name:"listing-optimizer",section:et.MANAGEMENT,label:"Listing Optimizer",icon:(0,r.jsx)(w.Z,{size:tg}),path:"/dashboard/listing-optimizer",embedPath:"/embed/listing-optimizer"},...tl?[{name:"listing-creation",section:et.MANAGEMENT,label:"Create",icon:(0,r.jsx)(C.Z,{size:tg}),path:"/dashboard/listing-creation",badge:"NEW",badgeVariant:"new",hideInEmbed:!0}]:[],{name:"asset-library",section:et.MANAGEMENT,label:"Asset Library",icon:(0,r.jsx)(k.Z,{size:tg}),path:"/dashboard/asset-library",embedPath:"/embed/asset-library"},...eN?[{name:"design-canvas",section:et.MANAGEMENT,label:"Design Canvas",icon:(0,r.jsx)(N.Z,{size:tg}),path:"/dashboard/design-canvas",badge:"NEW",badgeVariant:"new"}]:[],{name:"orders",section:et.MANAGEMENT,label:"Orders",icon:(0,r.jsx)(S.Z,{size:tg}),path:"/dashboard/orders",...ew.total>0?{badge:String(ew.total),badgeClassName:"bg-lv-selected text-white border-lv-selected"}:{}},...ek?[{name:"backups",section:et.MANAGEMENT,label:"Backups",icon:(0,r.jsx)(E.Z,{size:tg}),path:"/dashboard/backups"}]:[],...e?[e]:[]]},[ew.total,tr,eN,ta,tl,tg,ek,null==ey?void 0:ey.planTier,null==ey?void 0:ey.role,eT]),tW=(0,a.useMemo)(()=>{let e={};for(let t of tU)t.name&&(e[t.name]=t);return e},[tU]),tB=(0,a.useMemo)(()=>[{name:"learn-more",label:"Learn More",icon:(0,r.jsx)("svg",{width:tg,height:tg,viewBox:"0 0 17 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M16.0416 4.54604V8.90878M4.40764 6.36385V8.90878C4.40764 9.48732 4.86729 10.0422 5.68546 10.4512C6.50363 10.8603 7.61331 11.0902 8.77039 11.0902C9.92746 11.0902 11.0371 10.8603 11.8553 10.4512C12.6735 10.0422 13.1331 9.48732 13.1331 8.90878V6.36385M15.6199 5.21645C15.7501 5.15902 15.8605 5.06467 15.9376 4.94509C16.0147 4.8255 16.055 4.68593 16.0535 4.54367C16.052 4.4014 16.0089 4.26269 15.9293 4.14473C15.8498 4.02676 15.7374 3.93471 15.6061 3.87999L9.3739 1.0413C9.18444 0.954879 8.97863 0.910156 8.77039 0.910156C8.56215 0.910156 8.35633 0.954879 8.16687 1.0413L1.93542 3.87708C1.80597 3.93378 1.69584 4.02697 1.61851 4.14526C1.54118 4.26355 1.5 4.40181 1.5 4.54313C1.5 4.68445 1.54118 4.82271 1.61851 4.941C1.69584 5.05929 1.80597 5.15248 1.93542 5.20917L8.16687 8.05078C8.35633 8.1372 8.56215 8.18192 8.77039 8.18192C8.97863 8.18192 9.18444 8.1372 9.3739 8.05078L15.6199 5.21645Z",stroke:"currentColor",strokeWidth:"1.45425",strokeLinecap:"round",strokeLinejoin:"round"})}),action:"learn-more",isModal:!0},{name:"support",label:"Support",icon:(0,r.jsx)(A.Z,{size:tg}),action:"support",isModal:!0,hideInEmbed:!0},{name:"settings",label:"Settings",icon:(0,r.jsx)(L.Z,{size:tg}),path:"/dashboard/settings",hideInEmbed:!0},{name:"logout",label:"Logout",icon:(0,r.jsx)(z.Z,{size:tg}),action:"logout",isModal:!0,hideInEmbed:!0},{name:"extension",label:(null==t_?void 0:t_.shortLabel)||"Chrome extension",icon:(null==t_?void 0:t_.icon)?(()=>{let e=t_.icon;return(0,r.jsx)(e,{size:16})})():(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M8.2207 4.95C6.67431 4.95 5.4207 6.2036 5.4207 7.75C5.4207 9.2964 6.67431 10.55 8.2207 10.55C9.7671 10.55 11.0207 9.2964 11.0207 7.75C11.0207 6.2036 9.7671 4.95 8.2207 4.95ZM8.2207 4.95H14.6397M2.5857 3.592L5.7987 9.15M7.4367 14.708L10.6427 9.15M15.2207 7.75C1
15.2207 11.616 12.0867 14.75 8.2207 14.75C4.35471 14.75 1.2207 11.616 1.2207 7.75C1.2207 3.88401 4.35471 0.75 8.2207 0.75C12.0867 0.75 15.2207 3.88401 15.2207 7.75Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})}),action:"extension",hideWhen:"extensionInstalled",hideInEmbed:!0}],[t_,tg]),tq=(0,a.useCallback)(async e=>{let t=window.__LV_UNSAVED_CHANGES_GUARD__;if(!(null==t?void 0:t.confirmNavigation))return!0;try{return await t.confirmNavigation(e)}catch(e){return console.error("Navigation guard failed:",e),!1}},[]),tJ=(0,a.useCallback)(async e=>{if("logout"===e.action){if(await tq({type:"logout",label:e.label})){try{await U.default.post("/api/auth/logout")}catch(e){console.error("Logout error:",e)}localStorage.clear(),(0,F.ml)({type:"AUTH_STATE_CHANGED",payload:{isAuthenticated:!1,user:null}}),window.location.href="/auth/login"}}else if("tag-extractor"===e.action)eQ(!0);else if("tag-generator"===e.action)tk(!0);else if("learn-more"===e.action)window.open("https://listingview.io/documents/","_blank");else if("support"===e.action)window.open("https://listingview.io/resources/support","_blank");else if("extension"===e.action)(0,F.hr)();else if("calculator"===e.action)tu(!0),(0,X.Z)("calculator_opened",{source:"sidebar"});else if(e.path){let t=eT&&e.embedPath?e.embedPath:e.path;if(!await tq({type:"path",path:t,label:e.label}))return;"design-canvas"===e.name&&$.ZP.set("dcNavSource","sidenav"),eT&&"/embed"===t&&"/embed"===eb?(eP("search"),eH({})):e3.push(t),tP(e.name)}},[e3,eg,eT,eb,tq,eP,eH]),[tY,tK]=(0,a.useState)(()=>"true"===localStorage.getItem("churnkeyOpen"));(0,a.useEffect)(()=>{let e=e=>{"churnkeyOpen"===e.key&&tK("true"===e.newValue)};window.addEventListener("storage",e);let t=setInterval(()=>{let e="true"===localStorage.getItem("churnkeyOpen");tK(t=>t!==e?e:t)},300);return()=>{window.removeEventListener("storage",e),clearInterval(t)}},[]);let tQ=(e,t)=>{if("divider"===e.type)return(0,r.jsx)("div",{className:"px-5 my-2",children:(0,r.jsx)("div",{className:"h-px bg-lv-border"})},"divider-".concat(t));let n=!e.isModal&&eD===e.name;return"extensionInstalled"===e.hideWhen&&e_||ei(e,eT)?null:(0,r.jsx)("div",{className:"".concat(tf," my-[2px]"),children:(0,r.jsx)(v.Z,{placement:"right",title:tn?"":e.label||e.name.replace(/-/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),children:(0,r.jsxs)("div",{role:"button",tabIndex:0,"data-tour":e.name,"aria-current":n?"page":void 0,className:"flex items-center ".concat(tm," rounded-xl cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-lv-focus ").concat(n?"text-lv-brand bg-lv-brand-light border border-lv-brand-border font-medium shadow-[0px_2px_4px_0px_rgba(0,156,255,0.10)]":"text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary border border-transparent hover:border-lv-border"),onClick:()=>tJ(e),onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.preventDefault(),tJ(e))},children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:e.icon}),(0,r.jsxs)("span",{className:"flex items-center gap-1.5 whitespace-nowrap overflow-hidden transition-opacity duration-150 ".concat(tb," ").concat(tn?"opacity-100":"opacity-0 w-0"),children:[(0,r.jsx)("span",{className:"text-xs",children:e.label}),e.badge&&("new"===e.badgeVariant?(0,r.jsx)(eM,{children:e.badge}):(0,r.jsx)("span",{className:"text-[10px] font-medium rounded border px-1.5 py-0 leading-4 ".concat(e.badgeClassName||""),children:e.badge}))]})]})})},e.name)},t$=(0,a.useCallback)(()=>{eO("light"===eV?"dark":"dark"===eV?"system":"light")},[eV,eO]),tX="system"===eV?"System":"dark"===eV?"Dark":"Light",t0="dark"===eG?Z.Z:M.Z,t1=(0,a.useCallback)(()=>tJ({name:"settings",label:"Settings",path:"/dashboard/settings",hideInEmbed:!0}),[tJ]),t2=(0,a.useCallback)(()=>tJ({action:"support"}),[tJ]),t5=(0,a.useCallback)(()=>tJ({action:"logout",label:"Log out"}),[tJ]),t3=(0,a.useMemo)(()=>({onSettings:t1,onSupport:t2,onLogout:t5}),[t1,t2,t5]),t7=(0,a.useMemo)(()=>({theme:eV,resolvedTheme:eG,setTheme:eO}),[eV,eG,eO]),t4=(0,a.useMemo)(()=>tr?tB.filter(e=>
1!["settings","support","logout"].includes(e.name)):tB,[tr,tB]);return(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("div",{className:"lg:hidden flex items-center justify-between px-6 py-4 w-full bg-lv-card",children:[(0,r.jsxs)("div",{className:"flex items-center flex-shrink-0",children:[(0,r.jsx)(l.default,{src:"/assets/logo.svg",alt:"Logo",width:30,height:30,className:"flex-shrink-0 dark:invert"}),(0,r.jsx)(s.Z,{className:"ml-2 text-2xl font-bold text-lv-text-primary whitespace-nowrap",children:"ListingView"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 flex-shrink-0",children:[(0,r.jsx)(B.Z,{}),(0,r.jsx)(v.Z,{title:"Theme: ".concat(tX),placement:"bottom",children:(0,r.jsx)("button",{type:"button",onClick:t$,"aria-label":"Theme: ".concat(tX,". Click to cycle theme."),className:"inline-flex items-center justify-center rounded-full motion-safe:transition-colors hover:bg-[color:var(--lv-bg-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-lv-focus",style:{width:32,height:32},children:(0,r.jsx)(t0,{size:18,"aria-hidden":"true"})})}),(0,r.jsx)("button",{onClick:()=>{eX(!e$)},className:"text-lv-text-primary","aria-label":e$?"Close menu":"Open menu",children:e$?(0,r.jsx)(i.aHS,{size:24}):(0,r.jsx)(i.Fm7,{size:24})})]})]}),e7?(0,r.jsx)(h.Z,{open:e7,handleClose:()=>e4(!1)}):null,eK?(0,r.jsx)(eL,{open:eK,onClose:async()=>{eQ(!1),eg((0,c.LK)({}))}}):null,tC?(0,r.jsx)(ez,{open:tC,onClose:async()=>{tk(!1),eg((0,c.P0)({}))}}):null,tr?(0,r.jsx)(eS,{open:tc,onClose:()=>tu(!1)}):null,tG?(0,r.jsx)(eZ,{tourKey:"sidebarV2IntroSeen",steps:tO,onComplete:()=>(0,X.Z)("tour.completed",{tour:"sidebar_v2_intro"})}):null,(0,r.jsx)("div",{className:"hidden lg:relative lg:flex lg:flex-col ".concat(tv," ").concat(tY?"opacity-75":""),children:(0,r.jsxs)("div",{onMouseEnter:ty,onMouseLeave:tj,style:{transition:"width 150ms ease, box-shadow 150ms ease"},className:"\n            ".concat(ex?"relative z-50":"absolute top-0 left-0 z-[1200]","\n            bg-lv-card border-r border-lv-border h-screen overflow-y-auto overflow-x-hidden\n            ").concat(tn?th:tv,"\n            ").concat(!ex&&e8?"shadow-[2px_0_8px_var(--lv-shadow-sm)]":"shadow-none","\n          "),children:[(0,r.jsxs)("div",{className:"flex items-center py-5 bg-lv-card relative",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tx," flex items-center justify-center"),children:(0,r.jsx)(l.default,{src:"/assets/logo.svg",alt:"Logo",width:28,height:28,className:"dark:invert"})}),(0,r.jsx)("span",{className:"whitespace-nowrap text-xl font-bold text-lv-text-primary overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:"ListingView"}),tn&&(0,r.jsx)("button",{onClick:em,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 rounded-full transition-colors duration-150 z-10 ".concat(ti?"min-w-[44px] min-h-[44px] flex items-center justify-center ":"").concat(ex?"bg-lv-elevated border border-lv-border text-lv-text-primary":"bg-transparent border border-transparent text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary hover:border-lv-border"),"aria-label":ex?"Unpin sidebar":"Pin sidebar open",children:ex?(0,r.jsx)(I.Z,{size:13,className:"text-lv-text-primary rotate-45"}):(0,r.jsx)(I.Z,{size:13})})]}),(0,r.jsx)("nav",{className:"flex-grow pt-2 bg-lv-card h-[calc(100%-82px)]",children:(0,r.jsxs)("div",{className:"flex flex-col justify-between h-full",children:[(0,r.jsxs)("div",{children:[tr&&ti&&!tn&&(0,r.jsx)("div",{className:"px-1.5 pt-1 pb-1",children:(0,r.jsx)("button",{onClick:em,"aria-label":"Expand sidebar",className:"flex items-center justify-center w-full h-11 rounded-xl text-lv-text-primary hover:bg-lv-elevated border border-transparent hover:border-lv-border",children:(0,r.jsx)(i.Fm7,{size:18})})}),tr&&(0,r.jsx)(eh,{activeSection:ts,onSectionChange:tV,isExpanded:tn}),(tr?el(ts,tW):tU).map(tQ)]}),(0,r.jsxs)("div",{children:[t4.map(tQ),!eT&&!tr&&(0,r.jsx)("div",{className:"".concat(tf," my-[2px]"),children:(0,r.jsx)(v.Z,{placement:"right",title:tn?"":"Theme: ".concat(tX),children:(0,r.jsxs)("div",{className:"flex items-center h-9 rounded-xl cursor-pointer text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary border border-transparent hover:border-lv-border",onClick:t$,children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsx)(t0,{size:tg})}),(0,r.jsxs)("span",{className:"flex items-center gap-1.5 whitespace-nowrap overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:[(0,r.jsx)("span",{className:"text-xs",children:tX}),(0,r.jsx)("span",{className:"text-[10px] font-medium rounded border border-lv-border px-1.5 py-0 leading-4 text-lv-text-tertiary",children:"system"===eV?"dark"===eG?"Dark":"Light":""})]})]})})}),(null==ey?void 0:ey.planTier)==="FREE"&&!eT&&(0,r.jsx)("div",{className:"".concat(tf," my-[2px]"),children:(0,r.jsxs)("div",{className:"flex items-center h-9 rounded-xl cursor-pointer bg-gradient-to-r from-amber-50 to-orange-50 border border-amber-200/60 text-amber-700 hover:from-amber-100 hover:to-orange-100 hover:border-amber-300/60 transition-all duration-150",onClick:tF,children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsx)(R.Z,{fill:"#d97706",stroke:"#d97706",strokeWidth:"1px",size:tg})}),(0,r.jsxs)("span",{className:"flex items-center gap-1.5 whitespace-nowrap text-xs font-semibold overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:["Upgrade",to.active&&(0,r.jsx)(q.Z,{})]})]})}),!tr&&!eT&&(0,r.jsx)("div",{className:"px-3 mt-1",children:e2?(0,r.jsx)("div",{className:"flex items-center h-9 justify-center w-[56px]",children:(0,r.jsx)(d.D8,{size:20})}):!1===eR?(0,r.jsxs)("div",{className:"flex items-center h-10 rounded-xl cursor-pointer text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary",onClick:e6,"data-tour":"connect-shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsx)("svg",{width:"16",height:"18",viewBox:"0 0 17 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M11.9719 17.2531H7.37217C5.94539 17.2531 5.57628 16.884 5.57628 15.6408V9.8282H9.27554C10.6486 9.82719 11.0724 10.1973 11.547 11.544L11.9182 12.629C12.1301 13.2628 12.9738 13.2882 12.9738 12.5499C12.8683 10.4346 12.8683 7.95018 12.9211 5.83689C12.9738 5.09764 12.1271 5.12401 11.9172 5.75779L11.548 6.84283
1C11.0714 8.21586 10.7013 8.63973 9.27554 8.63973H5.57628V1.76952C5.57628 1.39939 5.73346 1.24019 6.13096 1.24019H11.6545C13.2669 1.24019 13.9524 1.6884 14.4553 3.08982L15.0638 4.80864C15.301 5.49515 16.1194 5.39071 16.1194 4.72954L16.0667 0.474577C16.0677 0.131827 15.8567 0 15.5657 0H0.607418C0.131827 0 0 0.263654 0 0.529336C0 0.792989 0.131827 1.03129 0.581052 1.08402C2.4317 1.21686 2.74808 1.58699 2.74808 2.67V15.9358C2.74808 16.9398 2.4317 17.2825 0.686514 17.4164C0.264668 17.4681 0.131827 17.7054 0.131827 17.971C0.131827 18.2367 0.263654 18.5004 0.712879 18.5004H15.8294C16.1194 18.5004 16.3313 18.3686 16.3313 18.0258L16.3841 13.7708C16.3841 13.1097 15.5657 13.0306 15.3538 13.6917L14.7991 15.4095C14.3488 16.8373 13.5822 17.2602 11.9719 17.2602",fill:"currentColor"})})}),(0,r.jsx)("span",{className:"whitespace-nowrap text-xs overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:"Connect your shop"})]}):!0!==eR||eI?e0&&!1!==eR?tN.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center h-10 rounded-xl cursor-pointer hover:bg-lv-elevated",onClick:e=>{tA(e.currentTarget)},"data-shop-dropdown-button":!0,children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsxs)("span",{className:"relative",children:[(0,r.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-lg border border-lv-border overflow-hidden",children:(null==tL?void 0:tL.iconUrl)?(0,r.jsx)("img",{src:tL.iconUrl,alt:"Shop",className:"h-full w-full object-cover"}):(0,r.jsx)(m.Z,{size:18,className:"text-lv-text-secondary"})}),(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 bg-green-400 rounded-full border-2 border-lv-card"})]})}),(0,r.jsxs)("span",{className:"flex items-center min-w-0 overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:[(0,r.jsx)(v.Z,{title:tR&&((null==tL?void 0:tL.shopName)||(null==e0?void 0:null===(n=e0.data)||void 0===n?void 0:n.name))||"",placement:"top",maxWidth:200,children:(0,r.jsx)("span",{ref:tZ,className:"text-xs text-lv-text-primary truncate block max-w-[130px]",children:(null==tL?void 0:tL.shopName)||(null==e0?void 0:null===(V=e0.data)||void 0===V?void 0:V.name)})}),(0,r.jsx)(i.RiI,{className:"ml-auto mr-1 flex-shrink-0 text-lv-text-tertiary transition-transform duration-200 ".concat(tE?"rotate-180":""),size:10})]})]}),(0,r.jsx)(W.Z,{anchorEl:tE,open:!!tE,onClose:tH,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"left"},maxHeight:300,minWidth:null!==(eu=null==tE?void 0:tE.offsetWidth)&&void 0!==eu?eu:180,items:[...tN.map(e=>{let t=e.shopId===(null==ey?void 0:ey.etsyShopId);return{label:e.shopName,active:(null==tL?void 0:tL.shopId)===e.shopId,icon:e.iconUrl?(0,r.jsx)("img",{src:e.iconUrl,alt:e.shopName,className:"w-4 h-4 object-cover rounded"}):(0,r.jsx)(m.Z,{size:10,className:"text-lv-text-primary"}),badge:t?"Default":void 0,onClick:()=>tD(e)}}),{divider:!0},{label:"Add Shop",icon:(0,r.jsx)("svg",{fill:"none",height:"20",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsxs)("g",{stroke:"var(--lv-text-primary)",strokeLinecap:"round",strokeWidth:"1.5",children:[(0,r.jsx)("path",{d:"m2 12c0 5.5228 4.47715 10 10 10 5.5228 0 10-4.4772 10-10 0-5.52285-4.4772-10-10-10"}),(0,r.jsxs)("g",{strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"m4.64856 5.07876c.13834-.14665.28092-.28926.42754-.42765m2.87123-1.92172c.18151-.08159.3658-.15811.55267-.22939m-6 6c.07195-.18873.14925-.37482.23172-.55808"}),(0,r.jsx)("path",{d:"m12 8v8m4-4h-8"})]})]})}),onClick:()=>{tH(),e6()}}]})]}):(0,r.jsxs)("div",{className:"flex items-center h-10 rounded-xl",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsxs)("span",{className:"relative",children:[(0,r.jsx)("span",{className:"flex items-center justify-center w-8 h-8 rounded-lg border border-lv-border overflow-hidden",children:(null==e0?void 0:null===(G=e0.data)||void 0===G?void 0:G.logoSrc)?(0,r.jsx)("img",{src:null==e0?void 0:null===(ea=e0.data)||void 0===ea?void 0:ea.logoSrc,alt:"Shop",className:"h-full w-full object-cover"}):(0,r.jsx)(m.Z,{size:18,className:"text-lv-text-secondary"})}),(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 bg-green-400 rounded-full border-2 border-lv-card"})]})}),(0,r.jsx)("span",{className:"text-xs text-lv-text-primary truncate overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:null==e0?void 0:null===(ec=e0.data)||void 0===ec?void 0:ec.name})]}):(0,r.jsxs)("div",{className:"flex items-center h-10 rounded-xl cursor-pointer hover:bg-lv-elevated",onClick:e6,"data-tour":"connect-shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsx)("img",{width:18,height:18,src:"https://encrypted-tbn0.gstatic.
1com/images?q=tbn:ANd9GcQ6Rk437s6sdInx9cBDwQm2fczdS4nF13SVrQ&s"})}),(0,r.jsx)("span",{className:"whitespace-nowrap text-xs text-lv-text-primary overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:"Connect your shop"})]}):(0,r.jsxs)("div",{className:"flex items-center h-10 rounded-xl cursor-pointer text-orange-500 hover:bg-lv-elevated",onClick:e6,"data-tour":"connect-shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 ".concat(tp," flex items-center justify-center"),children:(0,r.jsx)("svg",{width:"16",height:"18",viewBox:"0 0 17 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M11.9719 17.2531H7.37217C5.94539 17.2531 5.57628 16.884 5.57628 15.6408V9.8282H9.27554C10.6486 9.82719 11.0724 10.1973 11.547 11.544L11.9182 12.629C12.1301 13.2628 12.9738 13.2882 12.9738 12.5499C12.8683 10.4346 12.8683 7.95018 12.9211 5.83689C12.9738 5.09764 12.1271 5.12401 11.9172 5.75779L11.548 6.84283C11.0714 8.21586 10.7013 8.63973 9.27554 8.63973H5.57628V1.76952C5.57628 1.39939 5.73346 1.24019 6.13096 1.24019H11.6545C13.2669 1.24019 13.9524 1.6884 14.4553 3.08982L15.0638 4.80864C15.301 5.49515 16.1194 5.39071 16.1194 4.72954L16.0667 0.474577C16.0677 0.131827 15.8567 0 15.5657 0H0.607418C0.131827 0 0 0.263654 0 0.529336C0 0.792989 0.131827 1.03129 0.581052 1.08402C2.4317 1.21686 2.74808 1.58699 2.74808 2.67V15.9358C2.74808 16.9398 2.4317 17.2825 0.686514 17.4164C0.264668 17.4681 0.131827 17.7054 0.131827 17.971C0.131827 18.2367 0.263654 18.5004 0.712879 18.5004H15.8294C16.1194 18.5004 16.3313 18.3686 16.3313 18.0258L16.3841 13.7708C16.3841 13.1097 15.5657 13.0306 15.3538 13.6917L14.7991 15.4095C14.3488 16.8373 13.5822 17.2602 11.9719 17.2602",fill:"currentColor"})})}),(0,r.jsx)("span",{className:"whitespace-nowrap text-xs overflow-hidden transition-opacity duration-150 ".concat(tn?"opacity-100":"opacity-0 w-0"),children:"Reconnect Shop"})]})}),tr&&!eT&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:tf,children:(0,r.jsx)(ej,{collapsed:!tn,loading:e2,connectedShops:tN,selectedShop:tL,shopInfo:e0,isShopConnected:eR,etsyTokenStatus:eI,activeShopId:null==ey?void 0:ey.etsyShopId,onSelectShop:tD,onConnectShop:e6})}),(0,r.jsx)(eC,{collapsed:!tn,userInfo:ey,accountActions:t3,themeControl:t7,showShopSwitcher:!1})]})]})]})})]})}),e$&&(0,r.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 z-40 lg:hidden",onClick:()=>eX(!1)}),(0,r.jsxs)("div",{className:"fixed top-0 left-0 z-50 h-[100dvh] w-64 max-w-[82vw] bg-lv-card border-r border-lv-border transform transition-transform duration-300 lg:hidden ".concat(e$?"translate-x-0":"-translate-x-full"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.default,{src:"/assets/logo.svg",alt:"Logo",width:28,height:28,className:"dark:invert"}),(0,r.jsx)("span",{className:"text-xl font-bold text-lv-text-primary",children:"ListingView"})]}),(0,r.jsx)("button",{onClick:()=>eX(!1),className:"text-lv-text-secondary","aria-label":"Close menu",children:(0,r.jsx)(i.aHS,{size:18})})]}),(0,r.jsxs)("nav",{className:"flex flex-col justify-between h-[calc(100%-65px)] pt-2 overflow-y-auto",children:[(0,r.jsxs)("div",{children:[tr&&(0,r.jsx)(eh,{activeSection:ts,onSectionChange:tV,isExpanded:!0}),(tr?el(ts,tW):tU).map((e,t)=>{if("divider"===e.type)return(0,r.jsx)("div",{className:"px-5 my-2",children:(0,r.jsx)("div",{className:"h-px bg-lv-border"})},"divider-".concat(t));let n=!e.isModal&&eD===e.name;return"extensionInstalled"===e.hideWhen&&e_||ei(e,eT)?null:(0,r.jsx)("div",{className:"px-3 my-[2px]",children:(0,r.jsxs)("div",{"data-tour":e.name,className:"flex items-center h-11 rounded-xl cursor-pointer ".concat(n?"text-lv-text-primary bg-lv-elevated border border-lv-border font-medium":"text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary border border-transparent hover:border-lv-border"),onClick:()=>{tJ(e),eX(!1)},children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-11 flex items-center justify-center",children:e.icon}),(0,r.jsx)("span",{className:"text-xs",children:e.label}),e.badge&&("new"===e.badgeVariant?(0,r.jsx)("span",{className:"ml-1.5 inline-flex",children:(0,r.jsx)(eM,{children:e.badge})}):(0,r.jsx)("span",{className:"ml-1.5 text-[10px] font-medium rounded border px-1.5 leading-4 ".concat(e.badgeClassName||""),children:e.badge}))]})},e.name)})]}),(0,r.jsxs)("div",{className:"pb-4",children:[t4.map(e=>{let t=eD===e.name;return"extensionInstalled"===e.hideWhen&&e_||ei(e,eT)?null:(0,r.jsx)("div",{className:"px-3 my-[2px]",children:(0,r.jsxs)("div",{"data-tour":e.name,className:"flex items-center h-11 rounded-xl cursor-pointer ".concat(t?"text-lv-text-primary bg-lv-elevated border border-lv-border font-medium":"text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary border border-transparent hover:border-lv-border"),onClick:()=>{tJ(e),eX(!1)},children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-11 flex items-center justify-center",children:e.icon}),(0,r.jsx)("span",{className:"text-xs",children:e.label})]})},e.name)}),(null==ey?void 0:ey.planTier)==="FREE"&&!eT&&(0,r.jsx)("div",{className:"px-3 my-[2px]",children:(0,r.jsxs)("div",{className:"flex items-center h-9 rounded-xl cursor-pointer bg-gradient-to-r from-amber-50 to-orange-50 border border-amber-200/60 text-amber-700 hover:from-amber-100 hover:to-orange-100 hover:border-amber-300/60 transition-all duration-150",onClick:()=>{tF(),eX(!1)},children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-11 flex items-center justify-center",children:(0,r.jsx)(R.Z,{fill:"#d97706",stroke:"#d97706",strokeWidth:"1px",size:18})}),(0,r.jsx)("span",{className:"text-xs font-semibold",children:"Upgrade"}),to.active&&(0,r.jsx)(q.Z,{className:"ml-1.5"})]})}),tr&&!eT&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"px-3 my-[2px]",children:(0,r.jsx)(ej,{collapsed:!1,loading:e2,connectedShops:tN,selectedShop:tL,shopInfo:e0,isShopConnected:eR,etsyTokenStatus:eI,activeShopId:null==ey?void 0:ey.etsyShopId,onSelectShop:e=>{tD(e),eX(!1)},onConnectShop:()=>{e6(),eX(!1)}})}),(0,r.jsx)(eC,{collapsed:!1,userInfo:ey,accountActions:{onSettings:()=>{t1(),eX(!1)},onSupport:()=>{t2(),eX(!1)},onLogout:t5},themeControl:t7,showShopSwitcher:!1})]}),!tr&&!1===eR&&(0,r.jsx)("div",{className:"px-3 my-[2px]",children:(0,r.jsxs)("div",{className:"flex items-center h-9 rounded-xl cursor-pointer text-lv-text-primary hover:bg-lv-elevated hover:text-lv-text-primary",onClick:()=>{e6(),eX(!1)},"data-tour":"connect-shop",children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-11 flex items-center justify-center",children:(0,r.jsx)("svg",{width:"18",height:"10",viewBox:"0 0 50 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M43.5769 24.3352C45.6385 24.3352 47.3289 23.6487 48.4393 22.3548C49.5771 21.0071 49.9462 19.6584 49.9462 16.9093V7.84776C49.9462 7.10648 49.9462 6.28713 49.9989 5.70608C50.0253 5.20209 49.576 5.09764 49.1785 5.25685C48.0428 5.70608 47.0642 5.94336 45.7439 6.2344C45.4265 6.31349 45.2947 6.52543 45.2947 6.76373C45.2947 7.00204 45.4559 7.2667 45.9569 7.24034C47.1454 7.18761 47.4617 7.42591 47.4617 8.29495V14.1369C47.2762 15.7219 45.9569 17.0696 44.2918 17.0696C42.7849 17.0696 41.9128 16.0656 41.9128 14.0041V7.84674C41.9128 7.10648 41.9392 6.28713 41.9656 5.70608C41.9919 5.20209 41.5701 5.09764 41.1452 5.25685C40.0348 5.67971 39.11 5.94336 37.8678 6.2344C37.524 
16.31349 37.3912 6.52543 37.3912 6.76373C37.3912 7.00204 37.5504 7.2667 38.0523 7.24034C39.1343 7.18761 39.4254 7.42591 39.4254 8.29495V14.4543C39.4254 17.3342 41.0894 18.6282 43.5728 18.6282C45.1071 18.6282 46.7194 17.7561 47.4597 16.1437V18.2864C47.4587 19.9758 47.1149 21.0599 46.4284 21.8792C45.7155 22.7259 44.7907 23.2015 43.6012 23.2015C42.1998 23.2005 41.4342 22.6975 41.4342 21.9583C41.4342 21.721 41.5133 21.4553 41.5133 21.0862C41.5133 20.3997 41.0367 19.7913 40.2975 19.7913C39.3726 19.7913 38.9244 20.5042 38.9244 21.3255C38.9244 22.7523 40.483 24.3373 43.5739 24.3373M31.7399 18.7336C34.778 18.7336 36.654 16.884 36.654 14.6379C36.654 10.173 29.7047 11.3077 29.7047 8.42779C29.7047 7.31741 30.4976 6.39259 31.9508 6.39259C33.2974 6.39259 34.3287 7.00102 34.8824 8.26859L35.1471 8.87702C35.4117 9.48342 36.151 9.35261 36.0719 8.74418L35.8082 6.57816C35.7555 6.20803 35.65 6.04883 35.3316 5.91801C34.3277 5.46879 33.2427 5.25685 32.0816 5.25685C29.228 5.25685 27.562 7.0284 27.562 9.2218C27.562 13.7668 34.5113 12.5783 34.5113 15.4319C34.5113 16.5666 33.5864 17.5715 31.8159 17.5715C30.2827 17.5725 29.3568 16.9387 28.6713 15.5099L28.2759 14.6906C28.0355 14.1866 27.2963 14.3205 27.4028 14.9816L27.7719 17.3596C27.8246 17.7054 27.9574 17.8098 28.2495 17.9427C29.3842 18.471 30.31 18.7346 31.7358 18.7346M22.7797 18.76C24.603 18.76 25.8452 17.8088 26.3197 16.1437C26.5073 15.5637 25.8989 15.2199 25.5288 15.802C25.0258 16.6731 24.2866 17.0432 23.4398 17.0432C22.3578 17.0432 21.8021 16.2492 21.8021 14.7971V6.7901L25.2905 6.81646C25.686 6.81646 25.8452 6.44633 25.8452 6.12995C25.8452 5.78619 25.6596 5.49515 25.2367 5.49515L21.8021 5.52152V3.51268C21.8021 3.16892 21.5902 3.00971 21.3255 3.00971C21.2267 3.00961 21.1294 3.03356 21.042 3.07949C20.9545 3.12543 20.8796 3.19197 20.8236 3.27336C19.8724 4.72954 19.2366 5.23049 17.7581 5.78517C17.4407 5.91599 17.2551 6.10156 17.2551 6.33986C17.2551 6.60351 17.387 6.78807 17.7845 6.78807H19.3167V15.0861C19.3167 17.4924 20.7181 18.76 22.7777 18.76M11.9719 17.2531H7.37217C5.94539 17.2531 5.57628 16.884 5.57628 15.6408V9.8282H9.27554C10.6486 9.82719 11.0724 10.1973 11.547 11.544L11.9182 12.629C12.1301 13.2628 12.9738 13.2882 12.9738 12.5499C12.8683 10.4346 12.8683 7.95018 12.9211 5.83689C12.9738 5.09764 12.1271 5.12401 11.9172 5.75779L11.548 6.84283C11.0714 8.21586 10.7013 8.63973 9.27554 8.63973H5.57628V1.76952C5.57628 1.39939 5.73346 1.24019 6.13096 1.24019H11.6545C13.2669 1.24019 13.9524 1.6884 14.4553 3.08982L15.0638 4.80864C15.301 5.49515 16.1194 5.39071 16.1194 4.72954L16.0667 0.474577C16.0677 0.131827 15.8567 0 15.5657 0H0.607418C0.131827 0 0 0.263654 0 0.529336C0 0.792989 0.131827 1.03129 0.581052 1.08402C2.4317 1.21686 2.74808 1.58699 2.74808 2.67V15.9358C2.74808 16.9398 2.4317 17.2825 0.686514 17.4164C0.264668 17.4681 0.131827 17.7054 0.131827 17.971C0.131827 18.2367 0.263654 18.5004 0.712879 18.5004H15.8294C16.1194 18.5004 16.3313 18.3686 16.3313 18.0258L16.3841 13.7708C16.3841 13.1097 15.5657 13.0306 15.3538 13.6917L14.7991 15.4095C14.3488 16.8373 13.5822 17.2602 11.9719 17.2602",fill:"currentColor"})})}),(0,r.jsx)("span",{className:"text-xs",children:"Connect your shop"})]})})]})]})]})]})}},9384:function(e,t,n){n.d(t,{Db:function(){return i},KN:function(){return l},bG:function(){return a}});var r=n(4385);async function a(e){try{return(await r.default.get("".concat("https://backend.listingview.io","/api/auth/me"),{headers:{Authorization:"Bearer ".concat(e)}})).data}catch(e){var t,n;throw Error((null==e?void 0:null===(n=e.response)||void 0===n?void 0:null===(t=n.data)||void 0===t?void 0:t.message)||"Sign-up request failed.")}}async function l(){try{return(await r.default.get("".concat("https://backend.listingview.io","/api/integration/etsy/my-shop-details"))).data}catch(n){var e,t;throw Error((null==n?void 0:null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||"Failed to fetch shop details.")}}async function i(){try{return(await r.default.get("".concat("https://backend.listingview.io","/api/integration/etsy/get-connected-shops"))).data}catch(n){var e,t;throw console.error("Error fetching connected shops:",n),Error((null==n?void 0:null===(t=n.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||"Failed to fetch connected shops.")}}},86260:function(e,t,n){var r=n(57437),a=n(67116),l=n(21988),i=n(70208),o=n(59469),s=n(54301),d=n(61201),c=n(22095),u=n(46387);n(9871);var h=n(65621),v=n(2265),x=n(18848),m=n(51880);function p(e){let{text:t="Loading..."}=e,{ref:n}=(0,m.b)({text:t,speed:.1,tick:1,step:1,scramble:4});return(0,r.jsx)("span",{ref:n,style:{fontSize:"0.9rem",color:"#555"}})}function f(e){let{src:t,alt:n}=e;return function(e){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>
1{if(!e){n(!1);return}let t=new Image;if(t.src=e,t.complete){n(!0);return}let r=()=>n(!0),a=()=>n(!0);return t.addEventListener("load",r),t.addEventListener("error",a),()=>{t.removeEventListener("load",r),t.removeEventListener("error",a)}},[e]),t}(t)&&t?(0,r.jsx)(a.Z,{alt:n,src:t,sx:{width:36,height:36,borderRadius:"8px"}}):(0,r.jsx)(l.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:"8px"}})}t.Z=e=>{let{searchedShopData:t,loading:n,handleSearch:a,setWatchListLoading:m,handleGetPopularData:b,handleGetRecentHistory:g,searchScreen:y,dashboardSearch:j,tab:w,handleCloseSearchModal:C}=e,[k]=(0,v.useState)({key:"name",direction:"asc"}),N=v.useMemo(()=>k.key?[...t||[]].sort((e,t)=>{let n=e[k.key],r=t[k.key];return n===r?0:"asc"===k.direction?n>r?1:-1:n<r?1:-1}):t,[t,k]),S=e=>null==e||"-"===e?"-":e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(1),"K"):e;if(console.log("searchedShopData",t),n)return(0,r.jsx)(i.Z,{children:(0,r.jsx)(o.Z,{className:"max-h-96 overflow-y-auto",children:Array.from({length:7}).map((e,t)=>(0,r.jsx)(s.Z,{children:(0,r.jsx)(d.Z,{colSpan:7,sx:{py:0},children:(0,r.jsxs)("div",{className:"flex items-center space-x-2 px-4 py-2",children:[(0,r.jsx)(l.Z,{variant:"rounded",width:36,height:36,sx:{borderRadius:"8px",bgcolor:"var(--lv-border-default)"}}),(0,r.jsx)(p,{text:"Fetching shop…"})]})})},t))})});let E=Array.isArray(N)&&N.length>0;return(0,r.jsx)(c.Z,{className:"mt-2 max-h-96 overflow-y-auto",children:(0,r.jsx)(i.Z,{sx:{"& .MuiTableRow-root":{borderBottom:"none"},"& .MuiTableCell-root":{borderBottom:"none"}},children:(0,r.jsx)(o.Z,{children:E?t.map((e,t)=>{var n,l,i,o;let c=(null==e?void 0:e.status)==="incomplete";return(0,r.jsx)(s.Z,{sx:{borderBottom:"none"},children:(0,r.jsx)(d.Z,{colSpan:7,sx:{py:0},children:(0,r.jsxs)("div",{onClick:()=>{c||(null==a||a(e.name),null==C||C())},className:"hover:bg-[#F8FAFD] rounded-lg px-4 py-2 flex items-center justify-between ".concat(c?"cursor-default":"cursor-pointer"),children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2 w-[250px]",children:[(0,r.jsx)(f,{src:null==e?void 0:null===(n=e.otherInfo)||void 0===n?void 0:n.image,alt:"Shop Img"}),c?(0,r.jsx)(p,{text:"Loading shop…"}):(0,r.jsx)(u.Z,{className:"text-semibold",dangerouslySetInnerHTML:{__html:x.Z.sanitize((null==e?void 0:e.name)||"")}})]}),!y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"w-[120px] text-sm",children:c?(0,r.jsx)(p,{text:"Loading…"}):(0,r.jsxs)(u.Z,{className:"text-sm",children:[S(null==e?void 0:null===(l=e.otherInfo)||void 0===l?void 0:l.activeListings)," ","Listings"]})}),(0,r.jsx)("div",{className:"w-[120px] text-sm",children:c?(0,r.jsx)(p,{text:"Loading…"}):(0,r.jsxs)(u.Z,{className:"text-sm",children:[S(null==e?void 0:null===(i=e.otherInfo)||void 0===i?void 0:i.revenue)," Revenue"]})}),(0,r.jsx)("div",{className:"w=[180px] text-sm",children:c?(0,r.jsx)(p,{text:"Loading…"}):(0,r.jsx)(u.Z,{className:"text-sm",children:(null==e?void 0:null===(o=e.otherInfo)||void 0===o?void 0:o.joinDate)?new Date(1e3*e.otherInfo.joinDate).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"N/A"})})]}),!j&&(0,r.jsx)("div",{className:"text-[#808080] w-[180px] flex justify-end",children:c?(0,r.jsx)(p,{text:"Loading…"}):0===w||2===w?null:(0,r.jsxs)(u.Z,{className:"text-sm flex",children:[(0,r.jsx)(h.Z,{size:16,className:"mt-1 mr-2"}),null==e?void 0:e.searchedAgo]})})]})})},t)}):(0,r.jsx)(s.Z,{children:(0,r.jsx)(d.Z,{colSpan:7,children:(0,r.jsx)(u.Z,{className:"mt-4 text-center",children:"No Shop Searched"})})})})})})}},18673:function(e,t,n){function r(e){try{return window.localStorage.getItem(e)}catch(e){return null}}function a(e,t){try{window.localStorage.setItem(e,t)}catch(e){}}n.d(t,{$o:function(){return r},qQ:function(){return a}}),t.ZP={get:r,set:a,remove:function(e){try{window.localStorage.removeItem(e)}catch(e){}}}},12927:function(e,t,n){var r=n(57437);n(2265),t.Z=()=>(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 10 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M4.53256 0.787718C4.5509 0.754408 4.57785 0.726631 4.61058 0.707285C4.64332 0.68794 4.68065 0.677734 4.71867 0.677734C4.756
17 0.677734 4.79402 0.68794 4.82676 0.707285C4.8595 0.726631 4.88644 0.754408 4.90478 0.787718L6.15909 3.16888C6.18901 3.22401 6.23075 3.27184 6.28134 3.30893C6.33193 3.34602 6.3901 3.37145 6.45168 3.38339C6.51326 3.39533 6.57672 3.39349 6.63751 3.378C6.69829 3.36251 6.75489 3.33376 6.80325 3.2938L8.62056 1.73695C8.65544 1.70858 8.69843 1.692 8.74334 1.68962C8.78824 1.68723 8.83275 1.69916 8.87044 1.72367C8.90814 1.74819 8.93708 1.78404 8.95311 1.82605C8.96914 1.86807 8.97142 1.91408 8.95963 1.95748L7.75545 6.31104C7.73087 6.40012 7.67792 6.47877 7.60462 6.53505C7.53131 6.59133 7.44166 6.62218 7.34925 6.62291H2.08852C1.99603 6.62227 1.90628 6.59146 1.83289 6.53518C1.75951 6.47889 1.70649 6.40019 1.68189 6.31104L0.478137 1.9579C0.466346 1.91451 0.468628 1.86849 0.484655 1.82648C0.500682 1.78446 0.529627 1.74861 0.567324 1.7241C0.605021 1.69958 0.649525 1.68766 0.694429 1.69004C0.739334 1.69243 0.782323 1.709 0.817209 1.73738L2.6341 3.29422C2.68245 3.33418 2.73905 3.36294 2.79983 3.37843C2.86062 3.39392 2.92408 3.39576 2.98566 3.38382C3.04724 3.37187 3.10541 3.34645 3.156 3.30936C3.20659 3.27227 3.24834 3.22444 3.27825 3.1693L4.53256 0.787718Z",fill:"var(--lv-premium-gold)"}),(0,r.jsx)("path",{d:"M1.74435 8.32295H7.69299Z",fill:"var(--lv-premium-gold)"}),(0,r.jsx)("path",{d:"M1.74435 8.32295H7.69299M4.53256 0.787718C4.5509 0.754408 4.57785 0.726631 4.61058 0.707285C4.64332 0.68794 4.68065 0.677734 4.71867 0.677734C4.7567 0.677734 4.79402 0.68794 4.82676 0.707285C4.8595 0.726631 4.88644 0.754408 4.90478 0.787718L6.15909 3.16888C6.18901 3.22401 6.23075 3.27184 6.28134 3.30893C6.33193 3.34602 6.3901 3.37145 6.45168 3.38339C6.51326 3.39533 6.57672 3.39349 6.63751 3.378C6.69829 3.36251 6.75489 3.33376 6.80325 3.2938L8.62056 1.73695C8.65544 1.70858 8.69843 1.692 8.74334 1.68962C8.78824 1.68723 8.83275 1.69916 8.87044 1.72367C8.90814 1.74819 8.93708 1.78404 8.95311 1.82605C8.96914 1.86807 8.97142 1.91408 8.95963 1.95748L7.75545 6.31104C7.73087 6.40012 7.67792 6.47877 7.60462 6.53505C7.53131 6.59133 7.44166 6.62218 7.34925 6.62291H2.08852C1.99603 6.62227 1.90628 6.59146 1.83289 6.53518C1.75951 6.47889 1.70649 6.40019 1.68189 6.31104L0.478137 1.9579C0.466346 1.91451 0.468628 1.86849 0.484655 1.82648C0.500682 1.78446 0.529627 1.74861 0.567324 1.7241C0.605021 1.69958 0.649525 1.68766 0.694429 1.69004C0.739334 1.69243 0.782323 1.709 0.817209 1.73738L2.6341 3.29422C2.68245 3.33418 2.73905 3.36294 2.79983 3.37843C2.86062 3.39392 2.92408 3.39576 2.98566 3.38382C3.04724 3.37187 3.10541 3.34645 3.156 3.30936C3.20659 3.27227 3.24834 3.22444 3.27825 3.1693L4.53256 0.787718Z",stroke:"var(--lv-premium-gold)","stroke-width":"0.849806","stroke-linecap":"round","stroke-linejoin":"round"})]})},26650:function(e,t,n){n.d(t,{default:function(){return s}});var r=n(57437),a=n(7882),l=n.n(a),i=n(32001),o=JSON.parse('{"v":"5.12.1","fr":29.9700012207031,"ip":0,"op":90.0000036657751,"w":1080,"h":1080,"nm":"LV-logo","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 1 Outlines 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[538.834,540,0],"ix":2,"l":2},"a":{"a":0,"k":[169.524,189.863,0],"ix":1,"l":2},"s":{"a":0,"k":[160,160,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[3.875,0],[0,0],[-1.926,-5.709],[0,0],[-3.779,0],[0,0],[0.343,0],[-1.209,3.582],[0,0],[6.024,0],[0,0],[1.125,-3.714],[0,0],[0,0]],"o":[[0,0],[-6.025,0],[0,0],[1.208,3.582],[0,0],[-0.33,0.036],[3.778,0],[0,0],[1.926,-5.711],[0,0],[-3.881,0],[0,0],[0,0],[-1.129,-3.708]],"v":[[-55.999,-189.614],[-139.779,-189.614],[-148.124,-177.99],[-26.132,183.621],[-17.786,189.613],[88.339,189.559],[88.339,189.559],[96.682,183.565],[148.123,31.146],[139.779,19.521],[62.542,19.521],[54.112,25.777],[35.175,88.331],[-47.574,-183.372]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":15,"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":89.0000036250443,"s":[-360]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.450980392157,0.439215686275,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[150.299,189.863],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[8.516,-9.135],[0,-12.715],[-8.394,-9.012],[-11.974,0],[-8.394,9.135],[0,12.838],[8.516,9.135],[11.85,0]],"o":[[-8.394,9.135],[0,12.838],[8.516,9.135],[11.85,0],[8.516,-9.012],[0,-12.715],[-8.394,-9.135],[-11.974,0]],"v":[[-30.641,-32.775],[-43.232,0],[
1-30.641,32.775],[0.094,46.478],[30.458,32.775],[43.232,0],[30.458,-32.775],[0.094,-46.478]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":0,"k":10,"ix":2},"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":0,"s":[0]},{"t":89.0000036250443,"s":[-360]}],"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false},{"ty":"st","c":{"a":0,"k":[0.450980392157,0.439215686275,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":4,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[295.44,79.401],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[94,94],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":3,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90.0000036657751,"st":0,"ct":1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Layer 1 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[538.834,540,0],"ix":2,"l":2},"a":{"a":0,"k":[169.524,189.863,0],"ix":1,"l":2},"s":{"a":0,"k":[160,160,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[3.875,0],[0,0],[-1.926,-5.709],[0,0],[-3.779,0],[0,0],[0.343,0],[-1.209,3.582],[0,0],[6.024,0],[0,0],[1.125,-3.714],[0,0],[0,0]],"o":[[0,0],[-6.025,0],[0,0],[1.208,3.582],[0,0],[-0.33,0.036],[3.778,0],[0,0],[1.926,-5.711],[0,0],[-3.881,0],[0,0],[0,0],[-1.129,-3.708]],"v":[[-55.999,-189.614],[-139.779,-189.614],[-148.124,-177.99],[-26.132,183.621],[-17.786,189.613],[88.339,189.559],[88.339,189.559],[96.682,183.565],[148.123,31.146],[139.779,19.521],[62.542,19.521],[54.112,25.777],[35.175,88.331],[-47.574,-183.372]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.955686621572,0.962766639859,0.96651838714,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[150.299,189.863],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[8.516,-9.135],[0,-12.715],[-8.394,-9.012],[-11.974,0],[-8.394,9.135],[0,12.838],[8.516,9.135],[11.85,0]],"o":[[-8.394,9.135],[0,12.838],[8.516,9.135],[11.85,0],[8.516,-9.012],[0,-12.715],[-8.394,-9.135],[-11.974,0]],"v":[[-30.641,-32.775],[-43.232,0],[-30.641,32.775],[0.094,46.478],[30.458,32.775],[43.232,0],[30.458,-32.775],[0.094,-46.478]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.955686621572,0.962766639859,0.96651838714,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[295.566,79.024],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"bm":0,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":90.0000036657751,"st":0,"ct":1,"bm":0}],"markers":[],"props":{}}');function s(e){let{overlay:t=!1}=e;return t?(0,r.jsx)("div",{className:"absolute inset-0 z-[1400] flex justify-center items-center",style:{backgroundColor:"rgba(0, 0, 0, 0.4)"},"aria-live":"polite","aria-busy":"true",children:(0,r.jsx)(i.Z,{size:48,accent:"var(--lv-selected)",ariaLabel:"Loading"})}):(0,r.jsx)("div",{className:"flex  justify-center items-center w-full h-screen",children:(0,r.jsx)(l(),{animationData:o,loop:!0,style:{width:200,height:200}})})}},36943:function(e,t,n){n.d(t,{s:function(){return h}});var r=n(45008),a=n(57437),l=n(2265),i=n(40718),o=n.n(i),s=n(3146),d=n(63226);function c(){let e=(0,r._)(["\n  0%   { transform: scaleY(0.4);  filter: brightness(1.4); }\n  55%  { transform: scaleY(1.18); filter: brightness(1.3); }\n  100% { transform: scaleY(1);    filter: brightness(1); }\n"]);return c=function(){return e},e}let u=(0,s.F4)(c());function h(e){let{progress:t,accent:n="var(--lv-text-primary)",track:r="var(--lv-bg-hover)",ink:i="var(--lv-text-primary)",thickness:o=4,radius:s=0,blockWidth:c=2,gap:h=3,showPercent:v=!0,ariaLabel:x="Loading",className:m}=e,p=(0,d.J)(),[f,b]=function(e,t){let n=(0,l.useRef)(null),[r,a]=(0,l.useState)(50);return(0,l.useEffect)(()=>
1{if(!n.current)return;let r=n=>{let r=e+t;a(Math.max(1,Math.floor((n+t)/r)))};r(n.current.getBoundingClientRect().width);let l=new ResizeObserver(e=>{let[t]=e;return r(t.contentRect.width)});return l.observe(n.current),()=>l.disconnect()},[e,t]),[n,r]}(c,h),g=Math.max(0,Math.min(1,t)),y=Math.round(g*b),j=Math.min(s,o/2);return(0,a.jsxs)("div",{className:m,role:"progressbar","aria-valuenow":Math.round(100*g),"aria-valuemin":0,"aria-valuemax":100,"aria-label":x,style:{display:"flex",alignItems:"center",gap:14,width:"100%"},children:[(0,a.jsx)("div",{ref:f,style:{flex:1,display:"flex",alignItems:"center",gap:h,height:2.2*o,overflow:"hidden"},children:Array.from({length:b}).map((e,t)=>{let l=t<y;return(0,a.jsx)("div",{style:{width:c,flexShrink:0,height:l?"100%":"40%",background:l?n:r,borderRadius:j,transformOrigin:"center",animation:!p&&l&&t===y-1?"".concat(u," .35s cubic-bezier(.2,.8,.3,1.4)"):"none",transition:l?"none":"height .2s ease, background .15s linear"}},"".concat(t,"-").concat(l?"on":"off"))})}),v&&(0,a.jsxs)("div",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:13,color:i,fontVariantNumeric:"tabular-nums",minWidth:40,textAlign:"right"},children:[(100*g).toFixed(1),"%"]})]})}h.propTypes={progress:o().number.isRequired,accent:o().string,track:o().string,ink:o().string,thickness:o().number,radius:o().number,blockWidth:o().number,gap:o().number,showPercent:o().bool,ariaLabel:o().string,className:o().string},t.Z=h},90377:function(e,t,n){n.d(t,{Z:function(){return o}});var r=n(57437),a=n(77543);let l={primary:{bg:a.GX.primary,text:"#FFFFFF"},error:{bg:a.GX.error,text:"#FFFFFF"},warning:{bg:a.GX.warning,text:"#FFFFFF"}},i={sm:{size:16,fontSize:9,dotSize:8},md:{size:20,fontSize:11,dotSize:10}};function o(e){let{count:t=0,max:n=99,color:a="error",size:o="sm",showZero:s=!1,dot:d=!1,className:c=""}=e;if(!d&&0===t&&!s)return null;let u=l[a]||l.error,h=i[o]||i.sm;if(d)return(0,r.jsx)("span",{className:"inline-block rounded-full ".concat(c),style:{width:h.dotSize,height:h.dotSize,backgroundColor:u.bg},"aria-label":"Notification"});let v=t>n?"".concat(n,"+"):String(t),x=v.length>2;return(0,r.jsx)("span",{className:"inline-flex items-center justify-center rounded-full font-semibold font-Inter ".concat(c),style:{minWidth:h.size,height:h.size,padding:x?"0 5px":0,fontSize:h.fontSize,backgroundColor:u.bg,color:u.text,lineHeight:1},"aria-label":"".concat(t," notifications"),children:v})}},86720:function(e,t,n){n.d(t,{Z:function(){return d}});var r=n(57437),a=n(2265),l=n(2069),i=n(46387),o=n(43792);let s=a.useLayoutEffect;function d(e){let{options:t,value:n,onChange:d,activeColor:c="var(--lv-text-primary)",size:u="default",orientation:h="horizontal",fullWidth:v=!1,labelFontSize:x=14,ariaLabel:m,ariaDescribedBy:p,disabled:f=!1}=e,b="compact"===u,g="large"===u,y="vertical"===h,j=(0,a.useRef)(null),w=(0,a.useRef)([]),C=t.findIndex(e=>e.value===n),k=C>=0?C:0,[N,S]=(0,a.useState)({left:0,top:0,width:0,height:0,visible:!1}),[E,A]=(0,a.useState)(!1),[L,z]=(0,a.useState)(!1),[Z,M]=(0,a.useState)(!1),R=(0,a.useRef)(null),I=(0,a.useCallback)(()=>{let e=w.current[C];if(C<0||!e){S(e=>e.visible?{...e,visible:!1}:e);return}S({left:e.offsetLeft,top:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight,visible:!0})},[C]);s(()=>{I()},[I,n,t.length,u,h,v,y]),(0,a.useEffect)(()=>{let e=j.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(()=>{M(!0),I(),R.current&&clearTimeout(R.current),R.current=setTimeout(()=>M(!1),120)});return t.observe(e),()=>{t.disconnect(),R.current&&clearTimeout(R.current)}},[I]),(0,a.useEffect)(()=>{A(!0)},[]),(0,a.useEffect)(()=>{var e;if(!window.matchMedia)return;let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=()=>z(t.matches);return n(),null===(e=t.addEventListener)||void 0===e||e.call(t,"change",n),()=>{var e;return null===(e=t.removeEventListener)||void 0===e?void 0:e.call(t,"change",n)}},[]);let _=e=>{var n;let r=t[e];r&&(d(r.value),null===(n=w.current[e])||void 0===n||n.focus())}
1,T=(e,n)=>{let r=t.length;switch(e.key){case"ArrowRight":case"ArrowDown":e.preventDefault(),_((n+1)%r);break;case"ArrowLeft":case"ArrowUp":e.preventDefault(),_((n-1+r)%r);break;case"Home":e.preventDefault(),_(0);break;case"End":e.preventDefault(),_(r-1);break;case"Enter":case" ":e.preventDefault(),d(t[n].value)}};return(0,r.jsxs)(l.Z,{ref:j,role:"radiogroup","aria-label":m,"aria-describedby":p,"aria-disabled":f||void 0,sx:{position:"relative",display:v?"flex":"inline-flex",flexDirection:y?"column":"row",width:v?"100%":y?"auto":"fit-content",bgcolor:"var(--lv-bg-elevated)",borderRadius:b?"11px":"13px",p:"3px",gap:"2px",alignItems:"stretch"},children:[(0,r.jsx)(l.Z,{"aria-hidden":!0,sx:{position:"absolute",top:0,left:0,width:N.width,height:N.height,transform:"translate(".concat(N.left,"px, ").concat(N.top,"px)"),borderRadius:b?"8px":"10px",bgcolor:"var(--lv-bg-segment-active)",border:".5px solid var(--lv-border-default)",boxShadow:"0 1px 4px -2px var(--lv-shadow-md)",opacity:N.visible?1:0,pointerEvents:"none",zIndex:0,willChange:"transform, width, height",transition:!E||L||Z?"none":"transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), width 0.25s cubic-bezier(0.4, 0, 0.2, 1), height 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s ease"}}),t.map((e,t)=>{let a=e.value===n,s="function"==typeof e.icon,u=void 0!==e.label&&null!==e.label&&""!==e.label,h=s&&!u,m=e.ariaLabel||e.tooltip||("string"==typeof e.label?e.label:void 0),p=u?(0,r.jsx)(i.Z,{component:"span",fontSize:x,fontWeight:a?500:400,color:a?c:"var(--lv-text-primary)",sx:{lineHeight:1.6,whiteSpace:"nowrap",transition:L?"none":"color 0.15s ease"},children:e.label}):null,j=(0,r.jsxs)(l.Z,{ref:e=>w.current[t]=e,role:"radio","aria-checked":a,"aria-label":m,tabIndex:f?-1:t===k?0:-1,onClick:f?void 0:()=>d(e.value),onKeyDown:f?void 0:e=>T(e,t),sx:{px:v?.25:h?b?.75:1:1.5,py:v?.5:h?b?.75:1:g?1:.25,width:y?"100%":void 0,flex:v?"1 1 0":void 0,minWidth:v?0:h?g?44:32:void 0,minHeight:g?44:v?30:h?32:void 0,display:"flex",alignItems:"center",justifyContent:"center",gap:s&&u?"6px":0,borderRadius:b?"8px":"10px",border:".5px solid transparent",cursor:"pointer",bgcolor:"transparent",position:"relative",zIndex:1,transition:L?"none":"color 0.15s ease",userSelect:"none","&:focus-visible":{outline:"2px solid var(--lv-focus-ring)",outlineOffset:"1px"}},children:[s?e.icon(a):null,p]},e.value);return e.tooltip?(0,r.jsx)(o.Z,{title:e.tooltip,placement:"top",disableInteractive:!0,children:j},e.value):j})]})}},13213:function(e,t,n){var r=n(57437),a=n(2265),l=n(38398),i=n(30401),o=n(10407);let s=e=>{var t;let{item:n,onClose:l,depth:s=0}=e,[c,u]=(0,a.useState)(null),h=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(!1),m=(0,a.useRef)(!1),p=n.children&&n.children.length>0,f=(0,a.useCallback)(()=>{v.current&&(window.clearTimeout(v.current),v.current=null)},[]),b=(0,a.useCallback)(()=>{f(),v.current=window.setTimeout(()=>{x.current||m.current||u(null),v.current=null},250)},[f]);(0,a.useEffect)(()=>()=>f(),[f]);let g=(0,a.useCallback)(e=>{if(!n.disabled){if(p){f(),u(h.current);return}n.onClick&&n.onClick(e),!0!==n.keepOpen&&l&&l()}},[n,p,l,f]),y=(0,a.useCallback)(()=>{p&&!n.disabled&&(x.current=!0,f(),u(h.current))},[p,n.disabled,f]),j=(0,a.useCallback)(()=>{p&&(x.current=!1,b())},[p,b]);if(n.divider)return(0,r.jsx)("div",{className:"my-1.5 border-t border-lv-border"});if(n.header)return(0,r.jsx)("div",{className:"px-2.5 pt-2 pb-1 text-[10px] font-semibold uppercase tracking-wider text-lv-text-tertiary select-none",children:n.header});if(n.render)return n.render({onClose:l});let w="boolean"==typeof n.checked||"menuitemradio"===n.role||"menuitemcheckbox"===n.role,C=null!==(t=n.role)&&void 0!==t?t:w?"menuitemcheckbox":"menuitem",k=!!n.checked,N=w?k:n.active,S=n.danger,E=n.disabled,A=!!n.description,L=k&&E;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{ref:h,role:C,"aria-checked":w?k:void 0,tabIndex:E&&!L?-1:0,"aria-disabled":E||void 0,"aria-haspopup":p?"menu":void 0,"aria-expanded":p?!!c:void 0,"data-lv-active":N?"true":void 0,onClick:g,onMouseEnter:y,onMouseLeave:j,onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),g(e))},className:["w-full px-2.5 py-[6px] rounded-md flex gap-2 text-xs font-medium motion-safe:transition-colors outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-lv-focus",A?"items-start":"items-center",L?"cursor-default bg-lv-selected-light text-lv-selected font-semibold":"",!L&&E?"opacity-40 cursor-not-allowed":"",L||E?"":"cursor-pointer",L||E||!S?"":"text-red-500 hover:bg-red-50 focus-visible:bg-red-50",L||E||S||!N?"":"bg-lv-selected-light text-lv-selected font-semibold",L||E||S||N?"":"text-lv-text-primary hover:bg-lv-hover focus-visible:bg-lv-hover"].filter(Boolean).join(" "),children:[n.icon&&(0,r.jsx)("span",{className:"flex-shrink-0 w-4 h-4 flex items-center justify-center mt-0.5",children:n.icon}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 text-left",children:[(0,r.jsx)("div",{className:"truncate",children:n.label}),A&&(0,r.jsx)("div",{className:["mt-0.5 text-[11px] font-normal leading-4 text-lv-text-tertiary",2===n.descriptionLines?"line-clamp-2 whitespace-normal":"truncate"].join(" "),children:n.description})]}),n.shortcut&&(0,r.jsx)("span",{className:"ml-auto pt-0.5 text-[10px] text-lv-text-tertiary font-normal",children:n.shortcut}),n.badge&&(0,r.jsx)("span",{className:"tint"===n.badgeVariant?"ml-auto mt-0.5 text-[10px] bg-lv-selected-light text-lv-selected rounded-full px-1.5 py-[1px] leading-none font-medium":"ml-auto mt-0.5 text-[10px] bg-lv-selected text-white rounded-full px-1.5 py-[1px] leading-none font-medium",children:n.badge}),L&&(0,r.jsx)(i.Z,{size:13,"aria-hidden":"true",className:"ml-auto mt-0.5 flex-shrink-0"}),p&&(0,r.jsx)(o.Z,{size:12,className:"ml-auto mt-0.5 text-lv-text-tertiary flex-shrink-0"})]}),p&&(0,r.jsx)(d,{anchorEl:c,open:!!c,onClose:()=>{f(),u(null)},onCloseAll:l,items:n.children,anchorOrigin:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"left"},depth:s+1,...n.submenuProps||{},rootProps:{sx:{pointerEvents:"none"}},paperProps:{sx:{pointerEvents:"auto"},onMouseEnter:()=>{m.current=!0,f()},onMouseLeave:()=>{m.current=!1,b()}}})]})},d=e=>{let{anchorEl:t,anchorPosition:n,open:i,onClose:o,onCloseAll:d,items:c=[],anchorOrigin:u={vertical:"bottom",horizontal:"left"},transformOrigin:h={vertical:"top",horizontal:"left"},minWidth:v=180,maxWidth:x=280,maxHeight:m=320,depth:p=0,header:f,footer:b,className:g="",paperProps:y={},rootProps:j={}}=e,w=(0,a.useRef)(null),C=(0,a.useCallback)(()=>{d?d():o&&o()},[o,d]);(0,a.useEffect)(()=>{if(!i)return;let e=window.setTimeout(()=>{let e=w.current;if(!e)return;let t=e.querySelector('[data-lv-active="true"]');if(t&&e.scrollHeight>e.clientHeight){let n=t.offsetTop-e.clientHeight/2+t.clientHeight/2;e.scrollTop=Math.max(0,n)}},0);return()=>window.clearTimeout(e)},[i]);let{sx:k,...N}=j;return(0,r.jsx)(l.ZP,{open:i&&(!!t||!!n),anchorEl:n?void 0:t,anchorPosition:n||void 0,onClose:o,anchorOrigin:u,transformOrigin:h,disablePortal:!1,container:"undefined"!=typeof document?document.body:void 0,style:{zIndex:1300+p},disableScrollLock:!0,sx:k,...N,slotProps:{paper:{elevation:0,...y,sx:{borderRadius:"16px",border:"0.72px solid var(--lv-border-default)",background:"var(--lv-bg-card)",boxShadow:"0 2px 6px 0 var(--lv-shadow-md) !important",backgroundImage:"none !important",filter:"none !important",minWidth:v,maxWidth:x,overflow:"hidden",maxHeight:m,...y.sx||{}}}},children:(0,r.jsxs)("div",{role:"menu",className:["flex flex-col",g].filter(Boolean).join(" "),style:{maxHeight:m},children:[f&&(0,r.jsxs)("div",{className:"flex-shrink-0 pt-2 px-1.5",children:[(0,r.jsx)("div",{className:"px-2.5 pb-1.5",children:f}),(0,r.jsx)("div",{className:"border-t border-lv-border"})]}),(0,r.jsx)("div",{ref:w,className:["flex-1 min-h-0 flex flex-col gap-0.5 px-1.5",f?"pt-1.5":"pt-2",b?"pb-1.5":"pb-2","overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"].join(" "),children:c.map((e,t)=>{var n,a;return(0,r.jsx)(s,{item:e,onClose:C,depth:p},null!==(a=null!==(n=e.key)&&void 0!==n?n:e.label)&&void 0!==a?a:"item-".concat(t))})}),b&&(0,r.jsxs)("div",{className:"flex-shrink-0 pb-2 px-1.5",children:[(0,r.jsx)("div",{className:"border-t border-lv-border"}),(0,r.jsx)("div",{className:"px-2.5 pt-1.5",children:b})]})]})})};t.Z=d},28906:function(e,t,n){n.d(t,{Z:function(){return B}});var r=n(57437),a=n(2265),l=n(68575),i=n(99376),o=n(94766),s=n(82156),d=n(92253),c=n(13213),u=n(90377),h=n(93611),v=n(69364);function x(){let{id:e,count:t,label:n,priority:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,l.I0)();(0,a.useEffect)(()=>
1{if(e)return i((0,v.Bc)({id:e,count:null!=t?t:0,label:null!=n?n:"",priority:null!=r?r:100})),()=>{i((0,v.pn)(e))}},[e,i]),(0,a.useEffect)(()=>{e&&i((0,v.MC)({id:e,count:null!=t?t:0}))},[e,t,i])}function m(e){return"lv:onboarded:".concat(e)}let p="lv:notifications-bell:open",f="lv:notifications-bell:opened";var b=n(99894),g=n(378),y=n(64022),j=n(36976),w=n(68552),C=n(59963);function k(e){let{onClose:t,onResumeSync:n,resumeDisabled:o=!1,filter:s,hideHeaderTabs:d=!1}=e,c=(0,l.I0)(),u=(0,i.useRouter)(),[h,v]=(0,a.useState)("all"),x=null!=s?s:h,m=(0,l.v9)(g.zs),p=(0,l.v9)(g.dZ),f=(0,l.v9)(g.Sb),b=(0,l.v9)(g.SE),y=(0,l.v9)(g.G1),k=(0,l.v9)(g.Bs),E=(0,l.v9)(g.Ts),A=(0,l.v9)(g.S0),L=(0,l.v9)(g.mw),z="unread"===x?p:m,Z=b&&0===m.length,M=L===g.sq.POLLING||L===g.sq.OFFLINE,R=(0,a.useCallback)(e=>{(null==e?void 0:e.read_at)==null&&c((0,g.aK)({ids:[e.id]}));let n=(0,C.Qw)(null==e?void 0:e.deep_link);null==t||t(),n&&u.push(n)},[c,u,t]),I=(0,a.useCallback)(e=>{(null==e?void 0:e.read_at)==null&&c((0,g.aK)({ids:[e.id]})),null==t||t(),null==n||n()},[c,t,n]),_=(0,a.useCallback)(()=>{0!==f&&c((0,g.op)())},[c,f]),T=(0,a.useCallback)(()=>{!y&&k&&c((0,g.nZ)({cursor:E}))},[c,y,k,E]),F=(0,a.useCallback)(()=>{null==t||t(),u.push("/dashboard/notifications")},[u,t]),P=(0,a.useCallback)(()=>{c((0,g.nZ)())},[c]),H=(0,a.useMemo)(()=>[{key:"all",label:"All"},{key:"unread",label:f>0?"Unread (".concat(f,")"):"Unread"}],[f]);return(0,r.jsxs)("div",{className:"flex flex-col min-h-full",children:[!d||f>0?(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 pt-2 pb-1 min-h-[28px]",children:[d?(0,r.jsx)("span",{}):(0,r.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-[color:var(--lv-text-secondary)]",children:"Recent"}),f>0?(0,r.jsx)("button",{type:"button",onClick:_,className:"text-[11px] font-medium text-[color:var(--lv-brand)] hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)] rounded px-1 py-0.5",children:"Mark all read"}):null]}):null,d?null:(0,r.jsx)("div",{className:"px-3 pb-1.5",children:(0,r.jsx)(w.Z,{tabs:H,value:x,onChange:v,idPrefix:"bell-notifs",size:"sm"})}),(0,r.jsx)("div",{className:"px-1",role:d?void 0:"tabpanel",id:d?void 0:"bell-notifs-panel","aria-labelledby":d?void 0:"bell-notifs-tab-".concat(x),children:Z?(0,r.jsx)(S,{}):A?(0,r.jsxs)("div",{className:"px-3 py-4 text-center",children:[(0,r.jsx)("p",{className:"m-0 text-[12px] text-[color:var(--lv-text-secondary)]",children:A}),(0,r.jsx)("button",{type:"button",onClick:P,className:"mt-1 text-[12px] font-medium text-[color:var(--lv-brand)] hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)] rounded px-1",children:"Retry"})]}):0===z.length?(0,r.jsx)(N,{tab:x,onShowAll:()=>v("all")}):(0,r.jsx)("ul",{className:"m-0 p-0 list-none flex flex-col",children:z.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(j.Z,{notification:e,variant:"compact",onActivate:R,onResumeSync:n?I:void 0,resumeDisabled:o})},e.id))})}),"all"===x&&k?(0,r.jsx)("button",{type:"button",onClick:T,disabled:y,className:"mx-3 my-1 text-[12px] font-medium text-[color:var(--lv-brand)] hover:underline disabled:opacity-60 focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)] rounded py-1",children:y?"Loading…":"Load more"}):null,M?(0,r.jsx)("p",{className:"m-0 px-3 pb-1 text-[10px] text-[color:var(--lv-text-secondary)]",children:"Live updates paused — may be delayed by up to 30 seconds."}):null,(0,r.jsx)("div",{className:"mt-auto sticky bottom-0 z-10 flex items-center justify-end px-3 py-1.5 border-t border-[color:var(--lv-border-default)] bg-[color:var(--lv-bg-card)]",children:(0,r.jsx)("button",{type:"button",onClick:F,className:"text-[12px] font-medium text-[color:var(--lv-brand)] hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)] rounded px-1",children:"View all →"})})]})}function N(e){let{tab:t,onShowAll:n}=e;return(0,r.jsxs)("div",{className:"px-3 py-6 text-center flex flex-col items-center gap-1.5",children:[(0,r.jsx)(y.Z,{size:22,"aria-hidden":"true",className:"text-[color:var(--lv-text-secondary)]"}),(0,r.jsx)("span",{className:"text-[13px] font-medium text-[color:var(--lv-text-primary)]",children:"unread"===t?"No unread notifications":"All caught up"}),(0,r.jsx)("span",{className:"text-[11px] text-[color:var(--lv-text-secondary)]",children:"unread"===t?"You're all read up.":"We'll let you know 
1when something needs attention."}),"unread"===t?(0,r.jsx)("button",{type:"button",onClick:n,className:"mt-1 text-[12px] font-medium text-[color:var(--lv-brand)] hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)] rounded px-1",children:"Show all"}):null]})}function S(){return(0,r.jsx)("div",{className:"px-2.5 py-1 flex flex-col gap-2","aria-hidden":"true",children:[0,1,2].map(e=>(0,r.jsxs)("div",{className:"flex items-start gap-2.5 py-1",children:[(0,r.jsx)("span",{className:"mt-0.5 h-4 w-4 rounded-full bg-[color:var(--lv-bg-hover)]"}),(0,r.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"h-3 w-3/4 rounded bg-[color:var(--lv-bg-hover)]"}),(0,r.jsx)("span",{className:"h-2.5 w-1/2 rounded bg-[color:var(--lv-bg-hover)]"})]})]},e))})}var E=n(84689),A=n(69637),L=n(31201),z=n(40718),Z=n.n(z),M=n(36943);let R={normal:"var(--lv-brand)",warning:"var(--lv-warning, #f5a623)",exceeded:"var(--lv-error, #e05252)"};function I(e){let{label:t,used:n,limit:a,valueText:l}=e,i=a>0?Math.min(n/a,1):0,o=i>=1?"exceeded":i>=.8?"warning":"normal",s=null!=l?l:"".concat(n," / ").concat(a);return(0,r.jsxs)("div",{className:"mb-1.5 last:mb-0","data-usage-level":o,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-0.5",children:[(0,r.jsx)("span",{className:"text-[12px] text-[color:var(--lv-text-secondary)]",children:t}),(0,r.jsx)("span",{className:"text-[12px] font-medium tabular-nums text-[color:var(--lv-text-primary)]",children:s})]}),(0,r.jsx)(M.Z,{progress:i,accent:R[o],thickness:3,showPercent:!1,ariaLabel:"".concat(t,": ").concat(n," of ").concat(a," used")})]})}I.propTypes={label:Z().string.isRequired,used:Z().number.isRequired,limit:Z().number.isRequired,valueText:Z().string};var _=n(92006);function T(){let e=(0,l.v9)(_.PJ),t=(0,l.v9)(_.Nf),n=(0,l.v9)(_.o9);return e?(0,r.jsxs)("div",{className:"px-3 pt-2 pb-1.5 border-b border-[color:var(--lv-border-default)]","data-testid":"mockup-usage-strip",children:[(0,r.jsx)(I,{label:"Mockups used today",used:t.used,limit:t.limit}),n&&n.limit>0?(0,r.jsx)(I,{label:"PSD mockups",used:n.used,limit:n.limit}):null,(0,r.jsx)("div",{className:"mt-1 text-[11px] text-[color:var(--lv-text-tertiary)]",children:"Resets daily"})]}):null}var F=n(30166),P=n(54636);let H=(0,F.default)(()=>n.e(5136).then(n.bind(n,95136)),{loadableGenerated:{webpack:()=>[95136]},ssr:!1}),D=e=>Number(null!=e?e:0).toLocaleString("en-US");function V(){let e=(0,l.v9)(P._J),t=(0,l.v9)(P.h1),[n,i]=(0,a.useState)(!1);if(!e)return null;let o=!!t&&(t.totalAvailable<=0||!(t.purchasedRemaining>0)&&!(t.dailyAllowance<=0)&&t.dailyUsed/t.dailyAllowance>=.8),s=t.totalAvailable<=0;return(0,r.jsxs)("div",{className:"px-3 pt-2 pb-1.5 border-b border-[color:var(--lv-border-default)]","data-testid":"ai-token-usage-strip",children:[(0,r.jsx)(I,{label:"AI tokens today",used:t.dailyUsed,limit:t.dailyAllowance,valueText:"".concat(D(t.dailyUsed)," / ").concat(D(t.dailyAllowance))}),t.purchasedRemaining>0?(0,r.jsxs)("div",{className:"mt-1 text-[11px] text-[color:var(--lv-text-secondary)]",children:["+ ",D(t.purchasedRemaining)," purchased"]}):null,(0,r.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2",children:[(0,r.jsx)("span",{className:"text-[11px] text-[color:var(--lv-text-tertiary)]",children:"Resets daily"}),o?(0,r.jsx)("button",{type:"button",onClick:()=>i(!0),className:"text-[11px] font-medium text-[color:var(--lv-brand)] underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)] rounded-sm","data-testid":"ai-token-get-more",children:s?"Out of tokens — get more":"Running low — get more"}):null]}),n?(0,r.jsx)(H,{open:n,onClose:()=>i(!1)}):null]})}var G=n(88842),O=n(15127);let U="lv:pending-queue:open-count";function W(){try{var e;return parseInt(null!==(e=window.sessionStorage.getItem(U))&&void 0!==e?e:"0",10)||0}catch(e){return 0}}function B(){let e=(0,l.I0)();(0,i.useRouter)();let[t,n]=(0,a.useState)(null),y=!!t,j=(0,s.Z)("(max-width:1023px)"),w=(0,a.useRef)(null),[C,k]=(0,a.useState)(!1),N=(0,l.v9)(b.e_),S=(0,l.v9)(b.L
1d),E=(0,l.v9)(b.Jt),A=(0,l.v9)(b.b4),z=(0,l.v9)(b.eo),Z=(0,l.v9)(b.fc),M=(0,l.v9)(v.ty),R=(0,l.v9)(g.Sb),I=(0,l.v9)(g.Wg),T=(0,l.v9)(g.uP),F=(0,l.v9)(L.M7),H=(0,l.v9)(L.j$),D=(0,l.v9)(_.PJ),V=(0,l.v9)(P._J),B=D||V,K=(0,l.v9)(e=>{var t,n,r;return null!==(r=null===(n=e.jobActivity)||void 0===n?void 0:null===(t=n.active)||void 0===t?void 0:t.length)&&void 0!==r?r:0}),Q=(0,l.v9)(e=>{var t,n,r;return null!==(r=null===(n=e.jobActivity)||void 0===n?void 0:null===(t=n.scheduled)||void 0===t?void 0:t.length)&&void 0!==r?r:0}),$=(0,l.v9)(e=>{var t,n,r;return null!==(r=null===(n=e.jobActivity)||void 0===n?void 0:null===(t=n.recent)||void 0===t?void 0:t.length)&&void 0!==r?r:0}),X=(0,l.v9)(e=>{var t,n;return null===(n=e.notifications)||void 0===n?void 0:null===(t=n.items)||void 0===t?void 0:t[0]}),[ee,et]=(0,a.useState)(""),en=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{let e=en.current,t=null==X?void 0:X.id;if(void 0!==e&&t&&t!==e&&(null==X?void 0:X.read_at)==null){var n;et("New notification: ".concat(null!==(n=X.title)&&void 0!==n?n:""))}en.current=t},[X]);let[er]=function(e){let[t,n]=(0,a.useState)(()=>(function(e){try{return"true"===window.localStorage.getItem(m(e))}catch(e){return!1}})(e));return(0,a.useEffect)(()=>{let t=t=>{t.key===m(e)&&n("true"===t.newValue)};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[e]),[t,(0,a.useCallback)(()=>{try{window.localStorage.setItem(m(e),"true")}catch(e){}n(!0)},[e])]}("pendingQueueOnboarded"),[ea,el]=(0,a.useState)(()=>W());x({id:"pendingUpdates",count:z||0===N?0:1,label:z?null:"Pending updates",priority:10}),x({id:"persistent-center",count:I?R:0,label:"Notifications",priority:50}),x({id:"active-jobs",count:0,label:"Active jobs",priority:10}),x({id:"mockup-usage",count:0,label:"Mockup usage",priority:20});let ei=(0,a.useCallback)(()=>n(null),[]);(0,a.useEffect)(()=>{let e=()=>{w.current&&null!==w.current.offsetParent&&n(w.current)};return window.addEventListener(p,e),()=>window.removeEventListener(p,e)},[]);let eo=(0,a.useRef)({lastFetchedAt:null,available:!0});eo.current={lastFetchedAt:H,available:F},(0,a.useEffect)(()=>{let t=()=>{let{lastFetchedAt:t,available:n}=eo.current;n&&(null==t||Date.now()-t>G.Mm)&&e((0,L.vv)())};return window.addEventListener(f,t),()=>window.removeEventListener(f,t)},[e]),(0,a.useEffect)(()=>{let t=()=>{e((0,_.OC)()),e((0,P.h$)())};return window.addEventListener(f,t),()=>window.removeEventListener(f,t)},[e]);let es=(0,a.useMemo)(()=>(function(e){let{total:t,isSyncing:n,syncJob:r}=e;if(n){var a,l;return"Syncing pending updates. ".concat(null!==(a=null==r?void 0:r.succeeded)&&void 0!==a?a:0," of ").concat(null!==(l=null==r?void 0:r.total)&&void 0!==l?l:"—"," listings.")}return 0===t?"Notifications, all read.":1===t?"Notifications, 1 unread.":"Notifications, ".concat(t," unread.")})({total:M,isSyncing:A,syncJob:E}),[M,A,E]),ed=(0,a.useCallback)(()=>k(!0),[]),ec=(0,a.useCallback)(()=>{A||e((0,b.E)())},[e,A]),eu=(0,a.useMemo)(()=>{let e=!z;if(!I&&!e&&!F&&!B)return[];let t=K+Q;return[{key:"bell-tabbed-body",render:()=>(0,r.jsx)(q,{pendingTotal:S,showUpdatesTab:e,notificationsAvailable:I,unreadCount:R,showJobsTab:F,jobActiveCount:t,onClose:ei,onReconnect:ed,onResumeSync:ec,resumeDisabled:A})}]},[z,I,F,B,R,K,Q,S,A,ec,ed,ei]);return(!z||I||F||B)&&(Z||T||0!==M||A||B)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"sr-only",role:"status","aria-live":"polite","aria-atomic":"true",children:ee}),(0,r.jsxs)("button",{ref:w,type:"button",onClick:e=>{n(e.currentTarget),window.dispatchEvent(new CustomEvent(f)),K+Q>0&&(0,O.L)("job_activity.bell_opened_with_active",{activeCount:K,scheduledCount:Q,recentCount:$}),el(ea+1),function(){try{let e=W()+1;window.sessionStorage.setItem(U,String(e))}catch(e){}}()},"aria-label":es,"aria-haspopup":"menu","aria-expanded":y,className:"relative inline-flex items-center justify-center rounded-full transition-colors hover:bg-[color:var(--lv-bg-hover)] focus:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--lv-brand)]",style:{width:24,height:24},"data-testid":"notifications-bell",children:[(0,r.jsx)("span",{className:"absolute inset-0 max-md:-inset-2.5","aria-hidden":"true"}),(0,r.jsx)(o.Z,{size:18,"aria-hidden":"true"}),M>
10?(0,r.jsx)("span",{className:"absolute",style:{top:-4,right:-6,transform:"translate(0, 0)"},children:(0,r.jsx)(u.Z,{count:M,color:"error",size:"sm"})}):null,!er&&ea<3?(0,r.jsx)("span",{"aria-hidden":"true",className:"lv-bell-onboarding-pulse absolute",style:{bottom:-2,right:-2,width:7,height:7,borderRadius:"50%",backgroundColor:"var(--lv-brand)",border:"1.5px solid var(--lv-bg-card)"}}):null]}),j?(0,r.jsx)(d.ZP,{anchor:"bottom",open:y,onClose:ei,PaperProps:{sx:{borderTopLeftRadius:16,borderTopRightRadius:16,maxHeight:"85vh",backgroundColor:"var(--lv-bg-card)",paddingBottom:"env(safe-area-inset-bottom)"}},children:(0,r.jsxs)("div",{role:"dialog","aria-label":"Notifications",children:[(0,r.jsx)("div",{className:"flex justify-center pt-2 pb-1","aria-hidden":"true",children:(0,r.jsx)("span",{className:"h-1 w-9 rounded-full bg-[color:var(--lv-border-default)]"})}),(0,r.jsx)("div",{className:"px-4 pb-2 border-b border-[color:var(--lv-border-default)]",children:(0,r.jsx)(Y,{})}),(0,r.jsx)("div",{className:"overflow-y-auto",style:{maxHeight:"calc(85vh - 64px)"},children:(0,r.jsx)(J,{items:eu})})]})}):(0,r.jsx)(c.Z,{anchorEl:t,open:y,onClose:ei,items:eu,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},minWidth:420,maxWidth:420,maxHeight:600,header:(0,r.jsx)(Y,{})}),(0,r.jsx)(h.Z,{open:C,onClose:()=>k(!1),title:"Reconnect your Etsy account",body:(0,r.jsx)("p",{className:"m-0 text-[13px] text-[color:var(--lv-text-primary)]",children:"Your Etsy connection expired mid-sync, so the remaining listings are paused. Reconnect to finish syncing — your progress so far is saved."})})]}):null}function q(e){var t;let n,{pendingTotal:l,showUpdatesTab:i,notificationsAvailable:o,unreadCount:s,showJobsTab:d,jobActiveCount:c,onClose:u,onReconnect:h,onResumeSync:v,resumeDisabled:x}=e,m=[];o&&(m.push({key:"all",label:"All"}),m.push({key:"unread",label:s>0?"Unread (".concat(s,")"):"Unread"})),i&&m.push({key:"updates",label:l>0?"Updates (".concat(l,")"):"Updates"}),d&&m.push({key:"jobs",label:c>0?"Job Activity (".concat(c,")"):"Job Activity"});let[p,f]=(0,a.useState)("all"),b=m.some(e=>e.key===p)?p:null===(t=m[0])||void 0===t?void 0:t.key,g=m.length>1;return n="jobs"===b?(0,r.jsx)(A.Z,{onClose:u}):"updates"===b?(0,r.jsx)(E.Z,{onClose:u,onReconnect:h}):b?(0,r.jsx)(k,{filter:"unread"===b?"unread":"all",hideHeaderTabs:!0,onClose:u,onResumeSync:v,resumeDisabled:x}):null,(0,r.jsxs)("div",{children:[(0,r.jsx)(V,{}),(0,r.jsx)(T,{}),g?(0,r.jsx)("div",{className:"px-3 pt-2 pb-1.5 border-b border-[color:var(--lv-border-default)]",children:(0,r.jsx)(w.Z,{tabs:m,value:b,onChange:f,idPrefix:"bell-sections",size:"sm"})}):null,null!=n?(0,r.jsx)("div",{role:g?"tabpanel":void 0,id:g?"bell-sections-panel":void 0,"aria-labelledby":g?"bell-sections-tab-".concat(b):void 0,className:"overflow-y-auto",style:{height:"min(60vh, 440px)"},children:n}):null]})}function J(e){let{items:t}=e;return(0,r.jsx)("div",{className:"py-1",children:t.map(e=>{var t;return e.divider?(0,r.jsx)("div",{className:"my-1 border-t border-[color:var(--lv-border-default)]"},e.key):(0,r.jsx)("div",{children:null===(t=e.render)||void 0===t?void 0:t.call(e)},e.key)})})}function Y(){return(0,r.jsx)("span",{className:"text-[13px] font-semibold text-[color:var(--lv-text-primary)]",children:"Notifications"})}},61510:function(e,t,n){n.d(t,{Z:function(){return h},t:function(){return u}});var r=n(57437),a=n(2069),l=n(46387),i=n(95576),o=n(76865),s=n(96362),d=n(32489),c=n(66848);let u="Reconnect your Etsy shop to sync orders — the app is missing permission to read your orders.";function h(e){let{visible:t,onReconnect:n,onDismiss:h,description:v}=e;return t?(0,r.jsxs)(a.Z,{role:"alert","data-testid":"reconnect-orders-banner",sx:{mb:2,p:2,borderRadius:"12px",backgroundColor:"var(--lv-warning-bg)",border:"1px solid var(--lv-warning)",display:"flex",gap:1.5,alignItems:"flex-start"},children:[(0,r.jsx)(o.Z,{size:20,color:"var(--lv-warning)",style:{flexShrink:0,marginTop:2},"aria-hidden":"true"}),(0,r.jsxs)(a.Z,{sx:{flex:1,minWidth:0},children:[(0,r.jsx)(l.Z,{component:"h3",sx:{fontSize:"14px",fontWeight:600,color:"var(--lv-text-primary)",mb:.5},children:"Reconnect your Etsy shop to sync orders"}),(0,r.jsx)(l.Z,{sx:{fontSize:"13px",color:"var(--lv-text-secondary)",mb:1.5,lineHeight:1.5},children:v||u}),(0,r.jsx)(c.f,{text:"Reconnect Etsy",color:"purple",onClick:()=>null==n?void 0:n(),icon:(0,r.jsx)(s.Z,{size:14}),iconPosition:"before",padding:"px-4 py-2",fontSize:"text-xs",borderRadius:"roun
1ded-lg",width:"auto",className:"whitespace-nowrap"})]}),(0,r.jsx)(i.Z,{size:"small",onClick:()=>null==h?void 0:h(),"aria-label":"Dismiss",sx:{flexShrink:0,color:"var(--lv-text-secondary)",mt:-.5,mr:-.5},children:(0,r.jsx)(d.Z,{size:16})})]}):null}},5423:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(57437),a=n(62720),l=n(38572);function i(e){let{className:t=""}=e;return(0,r.jsxs)("span",{style:{backgroundColor:l.C.dark},className:"inline-flex shrink-0 items-center gap-1 rounded px-1.5 py-0.5 text-[11px] font-bold uppercase tracking-wide text-white "+t,children:[(0,r.jsx)(a.Z,{size:11,className:"shrink-0"}),"Limited offer"]})}},38572:function(e,t,n){function r(e){let t="/checkout?plan=PLUS_YEARLY";return e?"".concat(t,"&coupon=").concat(encodeURIComponent(e)):t}n.d(t,{C:function(){return a},n:function(){return r}});let a={bannerBg:"#FF005B",accent:"#D1FE17",dark:"#131416"}},97626:function(e,t,n){n.d(t,{a:function(){return m}});var r=n(2265),a=n(68575),l=n(4385);let i="".concat("https://backend.listingview.io","/api/sale/current");async function o(){var e,t,n;let r=await l.default.get(i),a=null!==(n=null!==(t=null==r?void 0:null===(e=r.data)||void 0===e?void 0:e.data)&&void 0!==t?t:null==r?void 0:r.data)&&void 0!==n?n:null;return a&&"object"==typeof a?a:null}var s=n(57692);let d=null,c=null,u=0,h=new Set;async function v(){if("undefined"==typeof document||!document.hidden){try{d=await o()}catch(e){d=null}h.forEach(e=>e(d))}}function x(){document.hidden||v()}function m(){var e,t,n,l,i,o,m,p,f,b;let g=(0,a.v9)(e=>{var t,n;return null===(n=e.user)||void 0===n?void 0:null===(t=n.myInfo)||void 0===t?void 0:t.planTier}),y=(0,s.XB)(g),[j,w]=(0,r.useState)(d);(0,r.useEffect)(()=>{if(y)return;let e=e=>w(e);return h.add(e),1===(u+=1)?c||(v(),c=setInterval(v,3e5),"undefined"!=typeof document&&document.addEventListener("visibilitychange",x)):w(d),()=>{h.delete(e),0==(u-=1)&&(c&&(clearInterval(c),c=null),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",x))}},[y]);let C=y?null:j,k=!!(null==C?void 0:C.active);return{active:k,code:null!==(e=null==C?void 0:C.code)&&void 0!==e?e:null,endsAt:k&&null!==(t=null==C?void 0:C.endsAt)&&void 0!==t?t:null,headline:null!==(n=null==C?void 0:C.headline)&&void 0!==n?n:null,monthlyEq:null!==(l=null==C?void 0:C.monthlyEq)&&void 0!==l?l:null,yearlyPrice:null!==(i=null==C?void 0:C.yearlyPrice)&&void 0!==i?i:null,normalMonthly:null!==(o=null==C?void 0:C.normalMonthly)&&void 0!==o?o:null,normalYearly:null!==(m=null==C?void 0:C.normalYearly)&&void 0!==m?m:null,renewalPrice:null!==(p=null==C?void 0:C.renewalPrice)&&void 0!==p?p:null,badgeLabel:null!==(f=null==C?void 0:C.badgeLabel)&&void 0!==f?f:null,disclaimer:null!==(b=null==C?void 0:C.disclaimer)&&void 0!==b?b:null}}},58666:function(e,t,n){n.d(t,{Fg:function(){return u},Mr:function(){return c}});var r=n(57437),a=n(2265);let l="lv-theme",i=["light","dark","system"],o=(0,a.createContext)({theme:"system",resolvedTheme:"light",setTheme:()=>{}});function s(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function d(e){let t=document.documentElement;"dark"===e?(t.classList.add("dark"),t.classList.remove("light")):(t.classList.remove("dark"),t.classList.add("light"))}function c(e){let{children:t}=e,[n,c]=(0,a.useState)(()=>{var e;return null!==(e=function(){try{let e=localStorage.getItem(l);return i.includes(e)?e:null}catch(e){return null}}())&&void 0!==e?e:"system"}),[u,h]=(0,a.useState)(()=>"system"===n?s():n),v=(0,a.useCallback)(e=>{if(i.includes(e)){c(e);try{localStorage.setItem(l,e)}catch(e){}}},[]);(0,a.useEffect)(()=>{let e="system"===n?s():n;h(e),d(e)},[n]),(0,a.useEffect)(()=>{if("system"!==n)return;let e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{let t=e.matches?"dark":"light";h(t),d(t)};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[n]);let x=(0,a.useMemo)(()=>({theme:n,resolvedTheme:u,setTheme:v}),[n,u,v]);return(0,r.jsx)(o.Provider,{value:x,children:t})}function u(){let e=(0,a.useContext)(o);if(!e)throw Error("useTheme must be used within <LVThemeProvider>");return e}},36841:function(e,t,n){n.d(t,{w:function(){return a}});var r=n(2265);function a(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>
1{if(!window.matchMedia)return;let e=window.matchMedia("(hover: none), (pointer: coarse)"),n=()=>t(e.matches);return(n(),e.addEventListener)?(e.addEventListener("change",n),()=>e.removeEventListener("change",n)):(e.addListener(n),()=>e.removeListener(n))},[]),e}t.Z=a},43173:function(e,t,n){n.d(t,{$_:function(){return m},EU:function(){return C},J$:function(){return j},NV:function(){return p},R8:function(){return b},Ry:function(){return v},US:function(){return w},Y3:function(){return s},Y_:function(){return k},lV:function(){return g},tk:function(){return x},xA:function(){return h},xS:function(){return y}});var r=n(36362);let a="lv_mock_pod_orders_v1",l="mock-";function i(){try{let e=window.localStorage.getItem(a);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch(e){return[]}}function o(e){try{window.localStorage.setItem(a,JSON.stringify(e)),Promise.resolve().then(()=>{try{let{notifyMockChanged:e}=n(34753);e()}catch(e){}})}catch(e){}}function s(e){return"string"==typeof e&&e.startsWith(l)}function d(){return new Date().toISOString()}let c=new Set(["delivered","rejected","cancelled_pre_submit","cancelled_in_production"]);function u(e,t){let{fromState:n,toState:r,reason:a,actor:l}=t,i={id:e.__events.length+1,eventType:r,actor:l||"seller_user_mock",actorUserId:null,payload:{fromState:null!=n?n:null,...a?{reason:a}:{}},createdAt:d()};return e.__events.push(i),i}function h(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!r.gp)return null;let{shippingAddress:t={},variant:n={},quantity:a=1,personalization:s="",initialStatus:c="awaiting_approval"}=e,h="".concat(l).concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,8)),v=d(),x=Number(n.priceCents)||2500,m=x*Math.max(1,Number(a)||1),p=[t.first_name,t.last_name].filter(Boolean).join(" ")||"Test Buyer",f=s.trim().length>0,b="held"===c?f?["personalization"]:["incomplete_design"]:[],g=n.listingTitle||n.label||n.name||"Test POD Listing",y=n.label||(n.variations||[]).map(e=>"".concat(e.name,": ").concat(e.value)).join(", ")||null,j={__mock:!0,id:h,orderId:h,externalId:h.slice(l.length,l.length+10),externalUrl:null,podVariantLabel:y,lvStatus:c,fulfillmentStatus:"pending",productType:"pod",holdReasons:b,daysInQueue:0,trackingCode:null,carrier:null,etsyRelayLastError:null,printifyOrderId:null,providerOrderId:null,podProvider:n.provider||"printify",hasPersonalization:f,productImage:n.productImage||null,date:v,paymentStatus:"Paid",itemsInOrder:1,quantity:a,isDigital:!1,itemPrice:x/100,discountAmt:0,shippingCost:4.99,taxCost:0,vatCost:0,giftWrapPrice:0,subtotal:x/100,grandTotal:m/100+4.99,revenue:m/100,transactionFee:1.5,processingFee:.5,offsiteAdsFee:0,totalFees:2,profit:m/100-2-4.99,refundAmount:0,buyerCity:t.city||"—",buyerState:t.region||"—",buyerCountry:t.country||"US",lastSyncTime:v,listingTitle:g,listingId:n.listingId||null,transactionId:null,listingType:"physical",listingState:"active",listingPrice:x/100,total:m/100+4.99,customer:{name:p,address:{line1:t.address1,line2:t.address2,city:t.city,state:t.region,zip:t.zip,country:t.country}},shippingAddress:t,items:[{transactionId:null,listingId:n.listingId||null,listingTitle:g,listingPrice:x/100,listingType:"physical",listingState:"active",productImage:n.productImage||null,quantity:a,price:x/100,isDigital:!1,variations:n.variations||[],title:g,variant:y||"—",qty:a,unitPrice:x/100}],subOrders:[],statusHistory:[],__events:[],createdAt:v,updatedAt:v};u(j,{fromState:null,toState:c,reason:"mock_created",actor:"mock_factory"}),"relay_failed"===c&&(j.etsyRelayLastError="Etsy returned 400: tracking carrier not recognized. (Mock test data)",j.trackingCode="MOCK-9410-1234-5678-9000",j.carrier="USPS");let w=i();return w.unshift(j),o(w),j}function v(){return r.gp?i():[]}function x(e){return s(e)&&i().find(t=>t.id===e)||null}function m(e){var t;let n=x(e);return null!==(t=null==n?void 0:n.__events)&&void 0!==t?t:[]}function p(){return v().reduce((e,t)=>(e[t.lvStatus]=(e[t.lvStatus]||0)+1,e),{})}function f(e,t){if(!s(e))return null;let n=i(),r=n.findIndex(t=>t.id===e);if(-1===r)return null;let a=t({...n[r],__events:[...n[r].__events||[]]});return a&&(a.updatedAt=d(),n[r]=a,o(n)),a}function b(e){return f(e,e=>
1{if(c.has(e.lvStatus))throw Error('Cannot approve order in terminal state "'.concat(e.lvStatus,'".'));return u(e,{fromState:e.lvStatus,toState:"approved",reason:"manual_approve"}),e.lvStatus="approved",u(e,{fromState:"approved",toState:"submitted",reason:"auto_submit",actor:"system"}),e.lvStatus="submitted",e.printifyOrderId="pf-mock-".concat(Math.floor(1e6*Math.random())),e.providerOrderId=e.printifyOrderId,e.fulfillmentStatus="processing",e})}function g(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return f(e,e=>{if(c.has(e.lvStatus))throw Error('Cannot reject order in terminal state "'.concat(e.lvStatus,'".'));return u(e,{fromState:e.lvStatus,toState:"rejected",reason:t||"manual_reject"}),e.lvStatus="rejected",e.fulfillmentStatus="failed",e})}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"personalization";return f(e,e=>{if("awaiting_approval"!==e.lvStatus)throw Error('Cannot hold order in state "'.concat(e.lvStatus,'".'));return e.holdReasons=[t],u(e,{fromState:"awaiting_approval",toState:"held",reason:t}),e.lvStatus="held",e})}function j(e){return f(e,e=>{if("held"!==e.lvStatus)throw Error('Cannot release hold from state "'.concat(e.lvStatus,'".'));return u(e,{fromState:"held",toState:"awaiting_approval",reason:"manual_release"}),e.lvStatus="awaiting_approval",e.holdReasons=[],e})}function w(e){return f(e,e=>{if(!["submitted","in_production"].includes(e.lvStatus))throw Error('Cannot cancel POD from state "'.concat(e.lvStatus,'".'));let t="in_production"===e.lvStatus?"cancelled_in_production":"cancelled_pre_submit";return u(e,{fromState:e.lvStatus,toState:t,reason:"manual_cancel_pod"}),e.lvStatus=t,e.fulfillmentStatus="failed",e})}function C(e){return f(e,e=>{if("relay_failed"!==e.lvStatus)throw Error('Cannot retry relay from state "'.concat(e.lvStatus,'".'));return e.etsyRelayLastError=null,u(e,{fromState:"relay_failed",toState:"shipped",reason:"manual_retry_relay_success",actor:"system"}),e.lvStatus="shipped",e.fulfillmentStatus="fulfilled",e})}function k(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],n=[];for(let r of e){if(!s(r)){n.push({orderId:r,reason:"not_owned"});continue}try{b(r)?t.push(r):n.push({orderId:r,reason:"not_found"})}catch(e){n.push({orderId:r,reason:"invalid_state"})}}return{approved:t.length,rejected:n}}},34753:function(e,t,n){n.r(t),n.d(t,{EVENT_NAME:function(){return l},getCachedQueueCounts:function(){return c},notifyMockChanged:function(){return d},setBeQueueCounts:function(){return s}});var r=n(36362),a=n(43173);let l="pod-queue-counts-changed",i={awaitingApproval:0,held:0,submissionFailed:0,relayFailed:0};function o(){window.dispatchEvent(new CustomEvent(l))}function s(){var e,t,n,r,a,l,s;let d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};d&&"object"==typeof d&&["awaiting_approval","awaitingApproval","held","submission_failed","submissionFailed","relay_failed","relayFailed"].some(e=>e in d)&&(i={awaitingApproval:null!==(t=null!==(e=d.awaiting_approval)&&void 0!==e?e:d.awaitingApproval)&&void 0!==t?t:0,held:null!==(n=d.held)&&void 0!==n?n:0,submissionFailed:null!==(a=null!==(r=d.submission_failed)&&void 0!==r?r:d.submissionFailed)&&void 0!==a?a:0,relayFailed:null!==(s=null!==(l=d.relay_failed)&&void 0!==l?l:d.relayFailed)&&void 0!==s?s:0},o())}function d(){o()}function c(){var e,t,n,l;let o=r.gp?(0,a.NV)():{},s=i.awaitingApproval+(null!==(e=o.awaiting_approval)&&void 0!==e?e:0),d=i.held+(null!==(t=o.held)&&void 0!==t?t:0),c=i.submissionFailed+(null!==(n=o.submission_failed)&&void 0!==n?n:0);return{awaitingApproval:s,held:d,submissionFailed:c,relayFailed:i.relayFailed+(null!==(l=o.relay_failed)&&void 0!==l?l:0),total:s+d+c}}},66952:function(e,t,n){n.d(t,{w:function(){return r}});function r(e){if(!e)return null;let t={FREE:"Free",LIFETIME:"Lifetime",PLUS:"Plus",PREMIUM:"Premium"};return t[e]?t[e]:e.toLowerCase().split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}}}]);

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.