1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5c7a1801-6b9b-481e-b9fe-c752e3f7b177",e._sentryDebugIdIdentifier="sentry-dbid-5c7a1801-6b9b-481e-b9fe-c752e3f7b177")}catch(e){}}();var _sentryModuleMetadataGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_sentryModuleMetadataGlobal._sentryModuleMetadata=_sentryModuleMetadataGlobal._sentryModuleMetadata||{},_sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack]=Object.assign({},_sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack],{"_sentryBundlerPluginAppKey:grouped-app":!0}),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7279],{73337:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/swaps/[swapId]/edit",function(){return a(81938)}])},9900:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var l=a(85893),n=a(6570),s=a(67294),i=a(60466),r=a(85790);function o(e){let{isOpen:t,onClose:a,isLoading:o,onConfirm:d,dirty:c,onBeforeUnload:u,cancelLabel:v="No, keep editing",confirmLabel:m="Yes",exitingLabel:x="Leaving...",content:p="Any unsaved changes will be lost if you exit now.",...f}=e,[h,y]=(0,s.useState)(!1),g=(0,s.useCallback)(()=>u?u(c):!c,[c,u]),{pending:b,onConfirm:w,onCancel:j,isLoading:S}=(0,n.O)(g),N=(0,s.useCallback)(async()=>{y(!0);try{await (null==d?void 0:d()),await w()}catch(e){(0,r.S3)(e,"Failed to confirm navigation")}finally{y(!1)}},[d,w]),C=(0,s.useCallback)(()=>{j(),null==a||a()},[j,a]);return(0,l.jsx)(i.sm,{isOpen:b||!!t,onClose:C,onCancel:C,onConfirm:N,isLoading:o||S||h,closeable:!1,cancelLabel:v,confirmLabel:S?x:m,content:p,...f,"data-sentry-element":"ConfirmModal","data-sentry-component":"DirtyStateModal","data-sentry-source-file":"DirtyStateModal.tsx"})}},59022:function(e,t,a){"use strict";a.d(t,{Z:function(){return f}});var l=a(85893),n=a(67294),s=a(27060),i=a(74094),r=a(63688),o=a(45335);function d(e){let{columnCount:t=5,rowCount:a=10}=e;return(0,l.jsx)("div",{className:r.ax.container.content,"data-sentry-component":"TableLoader","data-sentry-source-file":"loader.tsx",children:(0,l.jsxs)("table",{className:r.ax.table.base,children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{className:r.ax.header.row,children:Array.from({length:t},(e,t)=>(0,l.jsx)("th",{className:r.ax.header.cell,children:(0,l.jsx)(o.Od,{width:100})},t))})}),(0,l.jsx)("tbody",{children:Array.from({length:a},(e,a)=>(0,l.jsx)("tr",{className:r.ax.body.row,children:Array.from({length:t},(e,t)=>(0,l.jsx)("td",{className:r.ax.body.cell,children:(0,l.jsx)(o.Od,{})},t))},a))})]})})}var c=a(99356),u=a(93967),v=a.n(u),m=a(67814),x=a(59417),p=a(38012);function f(e){let{className:t,loading:a,data:u,columns:f,onRowHover:h,initialSorting:y,selectedRowId:g,rowIdAccessor:b="id",pageSize:w=10,hidePagination:j,onSort:S,isFetching:N,children:C,totalRows:k=u.length,currentPage:T,onPageChange:P}=e,F=!!P,M=Math.ceil(k/w),[D,Z]=(0,n.useState)({pageIndex:0,pageSize:w}),[L,E]=(0,n.useState)(null!=y?y:[]);(0,n.useEffect)(()=>{S&&S(L)},[L,S]);let O={data:u,columns:f,getCoreRowModel:(0,s.sC)(),getSortedRowModel:(0,s.tj)(),getFilteredRowModel:(0,s.vL)(),getPaginationRowModel:(0,s.G_)(),onPaginationChange:Z,onSortingChange:E,state:{pagination:D,sorting:L}};F&&(O.manualPagination=!0,O.pageCount=M,O.getPaginationRowModel=void 0);let R=(0,i.b7)(O);(0,n.useEffect)(()=>{y&&E(y)},[y]);let U=F?{totalRows:k,pageIndex:(null!=T?T:1)-1,rowsPerPage:w,nextPage:()=>P((null!=T?T:1)+1),prevPage:()=>P((null!=T?T:1)-1),canGetNext:(null!=T?T:1)<M,canGetPrev:(null!=T?T:1)>1}:{pageIndex:R.getState().pagination.pageIndex,totalRows:R.getFilteredRowModel().rows.length,rowsPerPage:R.getState().pagination.pageSize,nextPage:()=>R.nextPage(),prevPage:()=>R.previousPage(),canGetNext:R.getCanNextPage(),canGetPrev:R.getCanPreviousPage()};return(0,l.jsxs)("div",{className:r.ax.container.wrapper,"data-sentry-component":"Table","data-sentry-source-file":"index.tsx",children:[a?(0,l.jsx)(d,{columnCount:f.length,rowCount:w}):(0,l.jsx)("div",{className:null!=t?t:r.ax.container.content,children:(0,l.jsxs)("table",{className:r.ax.table.base,children:[(0,l.jsx)("thead",{children:R.getHeaderGroups().map(e=>(0,l.jsx)("tr",{className:r.ax.header.row,children:e.headers.map(e=>{var t,a,n,s,o,d,c,u,f;
1return(0,l.jsx)("th",{className:v()(r.ax.header.cell,{"cursor-pointer":e.column.getCanSort()}),onClick:e.column.getToggleSortingHandler(),children:(0,l.jsxs)("div",{className:v()("flex items-center gap-2",null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.headerClassName),children:[e.isPlaceholder?null:(0,i.ie)(e.column.columnDef.header,e.getContext()),(null===(a=e.column.columnDef.meta)||void 0===a?void 0:a.headerTooltip)&&(0,l.jsx)(p.Z,{variant:null!==(c=null===(n=e.column.columnDef.meta.headerTooltip)||void 0===n?void 0:n.variant)&&void 0!==c?c:"table",target:e.column.columnDef.meta.headerTooltip.target,content:e.column.columnDef.meta.headerTooltip.content,placement:null===(s=e.column.columnDef.meta.headerTooltip)||void 0===s?void 0:s.placement,interactive:null===(o=e.column.columnDef.meta.headerTooltip)||void 0===o?void 0:o.interactive,arrow:null===(u=null===(d=e.column.columnDef.meta.headerTooltip)||void 0===d?void 0:d.arrow)||void 0===u||u}),e.column.getIsSorted()&&(0,l.jsx)("span",{className:"text-xs",children:null!==(f=({asc:(0,l.jsx)(m.G,{icon:x.gc2}),desc:(0,l.jsx)(m.G,{icon:x.onQ})})[e.column.getIsSorted()])&&void 0!==f?f:null})]})},e.id)})},e.id))}),(0,l.jsxs)("tbody",{children:[R.getRowModel().rows.map(e=>{let t=void 0!==g&&e.original[b]===g;return(0,l.jsx)("tr",{className:v()(r.ax.body.row,{[r.ax.body.rowHover]:h,[r.ax.body.rowSelected]:t}),onMouseEnter:()=>null==h?void 0:h(e.original),onTouchStart:()=>null==h?void 0:h(e.original),children:e.getVisibleCells().map(e=>{var t;return(0,l.jsx)("td",{className:v()(r.ax.body.cell,null===(t=e.column.columnDef.meta)||void 0===t?void 0:t.cellClassName),children:N?(0,l.jsx)(o.Od,{count:1}):(0,i.ie)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}),C]})]})}),!j&&(0,l.jsx)("div",{className:r.ax.container.pagination,children:(0,l.jsx)(c.Z,{...U})})]})}},99356:function(e,t,a){"use strict";a.d(t,{Z:function(){return c}});var l=a(85893),n=a(67814),s=a(59417),i=a(93967),r=a.n(i),o=a(63688);let d=e=>r()(o.zF.button.base,e?o.zF.button.enabled:o.zF.button.disabled);function c(e){let{className:t,pageIndex:a,totalRows:i,rowsPerPage:c,nextPage:u,prevPage:v,canGetPrev:m,canGetNext:x}=e,p=Math.min(a*c+c,i);return(0,l.jsx)("div",{className:r()(o.zF.container.wrapper,t),"data-sentry-component":"TablePagination","data-sentry-source-file":"pagination.tsx",children:(0,l.jsx)("nav",{className:o.zF.container.nav,children:(0,l.jsxs)("ul",{className:o.zF.container.list,children:[(0,l.jsx)("li",{children:(0,l.jsxs)("span",{"aria-hidden":!0,className:o.zF.info.base,children:[a*c+1,"-",p," of ",i]})}),(0,l.jsx)("li",{children:(0,l.jsx)("button",{className:d(m),onClick:v,disabled:!m,children:(0,l.jsx)("span",{"aria-hidden":!0,className:o.zF.button.icon,children:(0,l.jsx)(n.G,{icon:s.A35,"data-sentry-element":"FontAwesomeIcon","data-sentry-source-file":"pagination.tsx"})})})}),(0,l.jsx)("li",{children:(0,l.jsx)("button",{className:d(x),onClick:u,disabled:!x,children:(0,l.jsx)("span",{"aria-hidden":!0,className:o.zF.button.icon,children:(0,l.jsx)(n.G,{icon:s._tD,"data-sentry-element":"FontAwesomeIcon","data-sentry-source-file":"pagination.tsx"})})})})]})})})}},28629:function(e,t,a){"use strict";a.d(t,{Z:function(){return c}});var l=a(85893),n=a(81074),s=a(11163),i=a(93967),r=a.n(i);let o={panel:"px-4 py-4 rounded-sm bg-surface-l1 text-core-t1",disabled:"opacity-50 cursor-not-allowed pointer-events-none",trigger:"unset cursor-pointer whitespace-nowrap text-sm outline-none",triggerContent:"flex items-center gap-2",verticalExpandedList:"min-w-48",hideLabel:"justify-center",v:{base:"flex flex-row gap-6 w-full md:w-auto",primary:{base:"bg-interactive-nav-menu text-interactive-nav-menu px-3 py-2 rounded-sm hover:bg-core-bronze transition duration-300",selected:"bg-interactive-nav-menu-active text-interactive-nav-menu px-3 py-2 rounded-sm",list:"flex flex-col justify-around gap-2"},secondary:{base:"rounded-sm border border-transparent bg-interactive-nav-menu px-3 py-2 text-interactive-nav-menu transition-colors duration-200 hover:border-interactive-accent-brand hover:bg-core-bronze/8 hover:text-interactive-nav-menu",selected:"rounded-sm border border-transparent bg-interactive-nav-menu-active px-3 py-2 text-interactive-nav-menu",list:"flex flex-col justify-around ga
1p-2"}},h:{base:"flex flex-col font-medium gap-5",primary:{base:"text-core-t2 text-lg px-7 py-3 border-b-2 border-transparent",selected:"text-core-bronze text-lg relative z-[2] px-7 py-3 border-core-bronze border-b-2 transition duration-300",list:"relative flex w-full flex-row justify-start overflow-x-auto scrollbar-mobile after:pointer-events-none after:absolute after:bottom-0 after:left-0 after:h-[2px] after:w-full after:bg-surface-l2 after:content-['']"},secondary:{base:"rounded-sm border border-transparent bg-interactive-nav-menu px-3 py-2 text-interactive-nav-menu transition-colors duration-200 hover:border-interactive-accent-brand hover:bg-core-bronze/8 hover:text-interactive-nav-menu",selected:"rounded-sm border border-transparent bg-interactive-nav-menu-active px-3 py-2 text-interactive-nav-menu",list:"flex flex-row justify-around w-full gap-2 overflow-x-auto scrollbar-mobile"}}};var d=a(67294);function c(e){let{className:t="",routing:a="none",selectedIndex:i=0,onChange:c,tabs:u,orientation:v="h",variant:m="primary",disabled:x,panelDisabled:p,hideLabel:f}=e,h=(0,s.useRouter)(),y=(0,d.useCallback)(e=>{null==c||c(e);let t=u[e].label,l=u[e].name||("string"==typeof t?t.toLowerCase():void 0);if(l&&"none"!==a)switch(a){case"hash":return h.push("#/".concat(l),void 0,{shallow:!0});case"query":return h.push({pathname:h.pathname,query:{tab:l}});case"pathname":return h.push("/".concat(l))}},[c,h,a,u]);return(0,l.jsxs)(n.O.Group,{selectedIndex:i,onChange:y,vertical:"v"===v,as:"div",className:r()(o[v].base,f&&o.hideLabel),"data-sentry-element":"unknown","data-sentry-component":"Tabs","data-sentry-source-file":"Tabs.tsx",children:[(0,l.jsx)(n.O.List,{className:t,"data-sentry-element":"unknown","data-sentry-source-file":"Tabs.tsx",children:(0,l.jsx)("div",{className:r()(o[v][m].list,{[o.verticalExpandedList]:"v"===v&&!f}),children:u.map((e,t)=>(0,l.jsx)(n.O,{className:r()(o.trigger,"v"===v&&"w-full",x&&o.disabled),disabled:x,children:t=>{let{selected:a}=t;return(0,l.jsxs)("div",{className:r()(o.triggerContent,o[v][m][a?"selected":"base"]),children:[e.icon,!f&&e.label]})}},e.name?"".concat(e.name,"-tab"):"tab-".concat(t)))})}),u.some(e=>e.content)&&(0,l.jsx)(n.O.Panels,{className:r()("w-full",(p||x)&&o.disabled),children:u.map((e,t)=>(0,l.jsx)(n.O.Panel,{className:e.className||o.panel,children:e.content},e.name?"".concat(e.name,"-content"):"tab-panel-".concat(t)))})]})}},22892:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var l=a(85893);a(67294);var n=a(45335),s=a(93967),i=a.n(s),r=a(30089);function o(e){let{icon:t,value:a,label:s,className:o,isLoading:d=!1}=e;return(0,l.jsxs)("div",{className:i()(r.u.base,o),"data-sentry-component":"MetricCard","data-sentry-source-file":"MetricCard.tsx",children:[(0,l.jsx)("div",{className:r.u.icon,children:t}),(0,l.jsx)("div",{className:r.u.content,children:d?(0,l.jsxs)("div",{className:r.u.skeleton,children:[(0,l.jsx)(n.Od,{width:38,height:12}),(0,l.jsx)(n.Od,{width:84,height:12})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:r.u.value,children:a}),(0,l.jsx)("div",{className:r.u.label,children:s})]})})]})}},10095:function(e,t,a){"use strict";a.d(t,{Z:function(){return d}});var l=a(85893);a(67294);var n=function(){return(0,l.jsxs)("div",{className:"self-stretch p-3 md:p-5 bg-interactive-nav-menu rounded-sm flex flex-col lg:flex-row justify-start items-start lg:items-center gap-4 md:gap-8 animate-pulse","data-sentry-component":"TitleBarSkeleton","data-sentry-source-file":"TitleBarSkeleton.tsx",children:[(0,l.jsxs)("div",{className:"flex-1 flex justify-start items-center gap-3",children:[(0,l.jsx)("div",{className:"w-[68px] h-[68px] bg-surface-l2 rounded-full flex-shrink-0"}),(0,l.jsxs)("div",{className:"flex-1 md:max-w-64 inline-flex flex-col justify-start items-start gap-2",children:[(0,l.jsx)("div",{className:"h-6 md:h-7 lg:h-8 bg-surface-l2 rounded w-3/4"}),(0,l.jsx)("div",{className:"h-3 bg-surface-l2 rounded w-1/2"})]})]}),(0,l.jsx)("div",{className:"w-full lg:w-auto grid grid-cols-1 md:grid-cols-3 lg:flex justify-start lg:justify-end items-center gap-2 md:gap-2.5",children:Array.from({length:3},(e,t)=>(0,l.jsxs)("div",{className:"p-2 md:p-2.5 bg-slate-950/30 rounded-[10px] flex justify-center items-center gap-3 lg:gap-5",children:[(0,l.jsx)("div",{className:"w-5 h-5 bg-surface-l2 rounded"}),(0,l.jsxs)("div",{className:"inline-flex flex-col justify-start items-center lg:items-end gap-1",children:[(0,l.jsx)("div",{className:"h-4 md:h-5 bg-surface-l2 rounded w-16"}),(0,l.jsx)("div",{className:"h-3 bg-surface-l2 rounded w-12"})]})]},t))})]})},s=a(93967),i=a.n(s),r=a(64146),o=a(30089);function d(e){let{groupName:t,artistName:a,avatar:s,isLoading:d=!1,children:c,className:u}=e;return d?(0,l.jsx)(n,{}):(0,l.jsxs)("div",{className:i()(o.v.base,u),"data-sentry-component":"TitleBar","data-sentry-source-file":"TitleBar.tsx",children:[(0,l.jsxs)("div",{className:o.v.identity,children:[(0,l.jsx)(r.Z,{className:o.v.avatar,src:s,alt:"".concat(a||"User"," avatar"),width:64,height:64,"data-sentry-element":"BaseImage","data-sentry-source-file":"TitleBar.tsx"}),(0,l.jsxs)("div",{className:o.v.info,children:[(0,l.jsx)("div",{className:o.v.groupName,children:t}),(0,l.jsx)("div",{className:o.v.artistName,children:a})]})]}),(0,l.jsx)("div",{className:o.v.metrics,children:c})]})}},79224:function(e,t,a){"use strict";a.d(t,{Z:function(){return o}});var l=a(85893),n=a(93528),s=a(64946),i=a(61194),r=a(66201);function o(e){let{swap:t,...a}=e,{planState:o}=(0,r.E)();return(0,l.jsx)(n.Z,{...a,swap:t&&(0,i.cG)(o)?(0,s.Ol)(t):t,"data-sentry-element":"SwapPreview","data-sentry-component":"PlanAwareSwapPreview","data-sentry-source-file":"PlanAwareSwapPreview.tsx"})}},81938:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return e1},default:function(){return e2}});var l=a(85893),n=a(96897),s=a(43984),i=a(28629),r=a(10095),o=a(22892),d=a(9636),c=a(9900),u=a(85790),v=a(34288),m=a(59417),x=a(67814),p=a(17817),f=a(18446),h=a.n(f),y=a(9814),g=a(67294),b=a(62984),w=a(79224),j=a(93967),S=a.n(j);let N={container:"my-4 px-4 py-4",action:"unset flex flex-row items-center justify-between cursor-pointer w-full text-left dark",icon:{base:"cursor-pointer transition duration-300 text-core-t2",open:"rotate-180"}
1,panel:{base:"overflow-hidden transition-height duration-300",open:"max-h-[4000px] my-2",close:"max-h-0"}};var C=a(21162),k=a(23637);function T(e){let{title:t,header:a,children:n,initialOpen:s,hideButton:i,className:r,panelClass:o,style:d,onFocus:c}=e,[u,v]=(0,g.useState)(!!s);return(0,l.jsxs)("div",{className:null!=r?r:N.container,style:d,onFocus:c,"data-sentry-component":"CollapsiblePanel","data-sentry-source-file":"CollapsiblePanel.tsx",children:[!i&&(0,l.jsxs)("button",{type:"button",className:N.action,onClick:()=>v(!u),children:[null!=a?a:(0,l.jsx)(k.Z,{variant:"H3",children:t}),(0,l.jsx)(C.v4,{height:20,width:20,className:S()(N.icon.base,u&&N.icon.open)})]}),(0,l.jsx)("div",{className:S()(N.panel.base,u?N.panel.open:N.panel.close,o),children:n})]})}var P=a(56327);let F={root:"flex flex-col lg:flex-row gap-4 h-full w-full",editor:"text-core-t1 grow",panel:"bg-surface-l2 px-6 py-4 rounded-sm my-4",header:"flex flex-col gap-1 [&>p]:text-core-t2",preview:"sticky top-[65px] flex-0 h-fit flex"};function M(e){let{values:t,initialValues:a,setFieldValue:n,handleBlur:s,handleChange:i,isLoading:r,onFocus:o,authTokens:d,featureFmSettings:c}=e,{type:u}=t,v=u?(0,P.s2)({goal:P.B5[u]}).filter(e=>e!==P._Q.GOAL):[];return(0,l.jsx)("form",{className:F.editor,onBlur:s,"data-sentry-component":"SwapEditor","data-sentry-source-file":"SwapEditor.tsx",children:v.map((e,s)=>{let{Component:u,label:v,title:m,caption:x}=P.Od[e];return u&&(0,l.jsx)(T,{className:F.panel,header:(0,l.jsxs)("div",{className:F.header,children:[(0,l.jsx)(k.Z,{variant:"H3",children:null!=v?v:m}),x&&(0,l.jsx)(k.Z,{variant:"body",children:x})]}),onFocus:()=>null==o?void 0:o(e),initialOpen:0===s,children:(0,l.jsx)(u,{handleChange:i,isLoading:r,values:t,initialValues:a,setFieldValue:n,authTokens:d,featureFmSettings:c})},e)})})}var D=a(64946),Z=a(7813);function L(e){let{isLoading:t,preview:a,authTokens:n,featureFmSettings:s,saasEnabled:i=!0}=e,r=(0,b.u6)(),{values:o}=r,[d,c]=(0,g.useState)();return(0,l.jsx)(Z.Of,{authTokens:n,enabled:i,"data-sentry-element":"SaasCtaProvider","data-sentry-component":"EditSwap","data-sentry-source-file":"EditSwap.tsx",children:(0,l.jsxs)("div",{className:F.root,children:[(0,l.jsx)(M,{isLoading:t,...r,onFocus:c,authTokens:n,featureFmSettings:s,"data-sentry-element":"SwapEditor","data-sentry-source-file":"EditSwap.tsx"}),(0,l.jsx)(w.Z,{title:"Live Preview",className:F.preview,swap:(0,D.dc)(o),preview:a,step:d,showPlaceholderComments:!0,"data-sentry-element":"PlanAwareSwapPreview","data-sentry-source-file":"EditSwap.tsx"})]})})}var E=a(72063),O=a(59642),R=a(26972),U=a(26929),I=a(89485);a(44120),a(51562);var A=a(78099),G=a(81294),_=a(75791),B=a(45335);a(86783);var V=a(10329),z=a(46886),q=a(64579),H=a(64398),K=a(57172);let J={default:{outline:"none"},hover:{outline:"none"},pressed:{outline:"none"}};function W(e){let{data:t,selected:a,onLocationEnter:n,onLocationLeave:s,min:i=10}=e,r=(0,g.useRef)(null),[o,d]=(0,g.useState)({width:800,height:400});(0,g.useEffect)(()=>{if(!r.current)return;let e=new ResizeObserver(e=>{let{width:t}=e[0].contentRect;d({width:t,height:t/2})});return e.observe(r.current),()=>e.disconnect()},[]);let c=e=>{let t=o.width/800;return Math.min(Math.max(.08*Math.sqrt(e/i)*t,1*t),10*t)};return(0,l.jsx)("div",{ref:r,className:"relative","data-sentry-component":"GeoMap","data-sentry-source-file":"GeoMap.tsx",children:(0,l.jsxs)(K.ComposableMap,{className:"px-4",projection:"geoEquirectangular",projectionConfig:{scale:o.width/800*130,center:[0,30]},height:o.height,width:o.width,"data-sentry-element":"ComposableMap","data-sentry-source-file":"GeoMap.tsx",children:[(0,l.jsx)("defs",{"data-sentry-element":"defs","data-sentry-source-file":"GeoMap.tsx",children:(0,l.jsx)("pattern",{id:"dot-pattern",x:"0",y:"0",width:"4",height:"4",patternUnits:"userSpaceOnUse",patternTransform:"translate(0, 0)",className:"text-[#D0D5DD]","data-sentry-element":"pattern","data-sentry-source-file":"GeoMap.tsx",children:(0,l.jsx)("circle",{cx:"2",cy:"2",r:"1",fill:"currentColor","data-sentry-element":"circle","data-sentry-source-file":"GeoMap.tsx"})})}),(0,l.jsx)(K.Geographies,{geography:"https://cdn.jsdelivr.net/npm/world-atlas@2/land-50m.json","data-sentry-element":"Geographies","data-sentry-source-file":"GeoMap.tsx",children:e=>{let{geographies:t}=e;return t.map(e=>(0,l.jsx)(K.Geography,{geography:e,fill:"url(#dot-pattern)",stroke:"none",style:J},e.rsmKey))}}),t.filter(e=>e.count>=i&&e.latitude&&e.longitude).map(e=>(0,l.jsx)(K.Marker,{className:S()({"text-[#FD853A] animate-pulse transition":a===e.id,"text-[#5B61D9] transition":a!==e.id}
1),coordinates:[e.longitude,e.latitude],style:{hover:{cursor:n?"pointer":"default"}},onMouseEnter:()=>{null==n||n(null==e?void 0:e.id)},onMouseLeave:()=>{null==s||s(null==e?void 0:e.id)},children:(0,l.jsxs)("g",{fill:"currentColor",children:[(0,l.jsx)("circle",{r:c(e.count),fillOpacity:1}),(0,l.jsx)("circle",{r:2.5*c(e.count),fillOpacity:.2}),(0,l.jsx)("circle",{r:4*c(e.count),fillOpacity:.1})]})},e.label))]})})}var Q=a(59022),X=a(63688),Y=a(83985);let $=e=>{let{data:t,sortKey:a,header:l="City",mapKey:n,top:s=10}=e,[i,r]=(0,g.useState)([]),[o,d]=(0,g.useState)(!1),[c,v]=(0,g.useState)(),m=(0,g.useMemo)(()=>t.map((e,t)=>({...e,id:"".concat(t)})),[t]),x=(0,g.useMemo)(()=>a?[{id:a,desc:!0}]:[],[a]),p=(0,g.useMemo)(()=>m.length?Object.fromEntries(Object.keys(m[0]).map(e=>[e,0])):null,[m]),f=(0,g.useMemo)(()=>m.length<=s||!p?{}:m.slice(s).reduce((e,t)=>Object.fromEntries(Object.keys(e).filter(e=>!R.qN.includes(e)).map(a=>[a,+e[a]+ +t[a]])),p),[m,p,s]),h=(0,g.useMemo)(()=>o?m:m.slice(0,s),[m,o,s]),y=(0,g.useMemo)(()=>[{accessorFn:e=>{let{city:t,country:a}=e;return"".concat(t).concat(a?", ".concat(a):"")},header:l,cell:e=>e.getValue()},...(m.length?Object.keys(m[0]):[]).filter(e=>!R.qN.includes(e)).map(e=>({accessorKey:e,header:e,cell:e=>{var t;return(0,u.JP)(null!==(t=e.getValue())&&void 0!==t?t:0,R.ym)}}))],[m,l]);return(0,g.useEffect)(()=>{let e=!1;return async function(){let t=[],a=[];m.forEach(e=>{let{[n]:l,id:s,longitude:i,latitude:r,city:o,country:d}=e,c=o+(d?", ".concat(d):"");i&&r?t.push({id:s,count:+l||0,longitude:i,latitude:r,label:c}):c&&a.push({label:c,id:s,count:+l||0})});let l=[];if(a.length>0){let e=a.map(e=>e.label),t=await (0,Y.Pb)(e);l=a.map(e=>{let a=t.get(e.label);return{id:e.id,count:e.count,longitude:null==a?void 0:a.longitude,latitude:null==a?void 0:a.latitude,label:e.label}})}let s=[...t,...l];e||r(s)}(),()=>{e=!0}},[m,n]),{displayAll:o,setDisplayAll:d,selectedLoc:c,setSelectedLoc:v,initialSorting:x,otherData:f,tableData:h,tableColumns:y,geoData:i}};function ee(e){let{sortKey:t,isLoading:a,data:n,moreDataLabel:s="More",header:i="City",mapKey:r,top:o=10}=e,{displayAll:d,setDisplayAll:c,selectedLoc:v,setSelectedLoc:m,initialSorting:x,otherData:p,tableData:f,tableColumns:h,geoData:y}=$({data:n,sortKey:t,header:i,mapKey:r,top:o});return(null==n?void 0:n.length)||a?(0,l.jsxs)("div",{"data-sentry-component":"ActivityMap","data-sentry-source-file":"ActivityMap.tsx",children:[(0,l.jsx)(W,{data:y,selected:v,min:1,"data-sentry-element":"GeoMap","data-sentry-source-file":"ActivityMap.tsx"}),(0,l.jsxs)("div",{className:"border border-core-divider my-2 pt-6 rounded",children:[(0,l.jsx)(Q.Z,{loading:!!a,data:f,columns:h,onRowHover:e=>m(e.id),initialSorting:x,selectedRowId:v,hidePagination:!d,pageSize:d?o:R.IV,"data-sentry-element":"Table","data-sentry-source-file":"ActivityMap.tsx",children:!d&&(null==p?void 0:p.length)&&(0,l.jsxs)("tr",{className:S()(X.ax.body.row,"italic border-b-0"),children:[(0,l.jsx)("td",{className:X.ax.body.cell,children:"All others"}),Object.entries(p).map(e=>{let[t,a]=e;return(0,l.jsx)("td",{className:X.ax.body.cell,children:(0,u.JP)(a,R.ym)},t)})]})}),!d&&(0,l.jsx)("button",{className:"unset p-4 text-sm text-core-bronze",onClick:()=>c(!0),children:s})]})]}):(0,l.jsx)("div",{className:"px-4 py-6 text-core-t2",children:"No activity yet..."})}var et=a(79843),ea=a(45673),el=a(61085),en=a(45684);function es(){let{swapType:e,includeTopSources:t=!0,includeReferrers:a=!1,includeCities:l=!0,includeTopFans:n=!1,includeRevenue:s,includeComments:i=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=[];return i&&r.push("comments"),t&&r.push("topSources"),a&&r.push("referrers"),l&&r.push("cities"),n&&r.push("topFans"),("boolean"==typeof s?s:"paywall"===e)&&r.push("revenue"),r.join(",")}function ei(e){let{swapId:t,accessToken:a,start:l,end:n,swapType:s,ctaEnabled:i,includeKpis:r=!0,includeBase:o=!0,includeBreakdowns:d=!0,includeCta:c=!0,includePollCounts:u
1=!0,includeTopFans:v=!0,includePreSave:m=!0,refreshOnFocus:x=!0,refreshOnReconnect:p=!0}=e,f=!!t&&!!a,h=el.n9.useGetSwapStatsQuery(r&&f?{accessToken:a,swapId:t,startDate:l,endDate:n}:ea.skipToken,{refetchOnFocus:x,refetchOnReconnect:p}),y=(0,g.useMemo)(()=>es({swapType:s,includeTopSources:!1,includeReferrers:!1,includeCities:!1,includeTopFans:v,includeRevenue:"paywall"===s,includeComments:!0}),[s,v]),b=(0,en.IJ)(o&&f?{accessToken:a,swapId:t,start:l,end:n,metrics:y,topFansSort:"score"}:ea.skipToken,{refetchOnFocus:x,refetchOnReconnect:p}),w=(0,g.useMemo)(()=>es({swapType:s,includeTopSources:!0,includeReferrers:!1,includeCities:!0,includeTopFans:!1,includeRevenue:!1,includeComments:!1}),[s]),j=(0,en.IJ)(d&&f?{accessToken:a,swapId:t,start:l,end:n,metrics:w}:ea.skipToken,{refetchOnFocus:x,refetchOnReconnect:p}),S=el.n9.useGetSwapCtaStatsQuery(c&&i&&t?{swapId:t,startDate:l,endDate:n}:ea.skipToken,{refetchOnFocus:x,refetchOnReconnect:p}),N=(0,en.vu)(m&&"pre-save"===s&&f?{accessToken:a,swapId:t,startDate:l,endDate:n}:ea.skipToken,{refetchOnFocus:x,refetchOnReconnect:p}),C=(0,en.ly)(u&&"vote"===s&&t&&a?{id:t,accessToken:a}:ea.skipToken,{refetchOnFocus:x,refetchOnReconnect:p}),k=(0,g.useMemo)(()=>({kpis:!!(null==h?void 0:h.isLoading)||!!(null==h?void 0:h.isFetching),base:!!(null==b?void 0:b.isLoading)||!!(null==b?void 0:b.isFetching),breakdowns:{topSources:!!(null==j?void 0:j.isFetching),cities:!!(null==j?void 0:j.isFetching)},cta:!!(null==S?void 0:S.isLoading)||!!(null==S?void 0:S.isFetching),preSave:!!(null==N?void 0:N.isLoading)||!!(null==N?void 0:N.isFetching),pollCounts:!!(null==C?void 0:C.isLoading)||!!(null==C?void 0:C.isFetching)}),[null==h?void 0:h.isLoading,null==h?void 0:h.isFetching,null==b?void 0:b.isLoading,null==b?void 0:b.isFetching,null==j?void 0:j.isFetching,null==S?void 0:S.isLoading,null==S?void 0:S.isFetching,null==N?void 0:N.isLoading,null==N?void 0:N.isFetching,null==C?void 0:C.isLoading,null==C?void 0:C.isFetching]),T=(0,g.useMemo)(()=>({preSave:!!(null==N?void 0:N.error)}),[null==N?void 0:N.error]);return{stats:(0,g.useMemo)(()=>{var e,t,a,s,i,r,o,d,c,u,v,m,x,p,f,y;let g={},w=null==b?void 0:null===(e=b.data)||void 0===e?void 0:e.summary;w&&(g.analytics={...g.analytics||{},...w},g.topFans=w.topFans);let k=null==j?void 0:null===(t=j.data)||void 0===t?void 0:t.summary;if(null==k?void 0:k.breakdowns){let e=g.analytics||{};g.analytics={...e,breakdowns:{...(null==e?void 0:e.breakdowns)||{},...k.breakdowns||{}}}}let T=null==h?void 0:h.data;if(T){let e="object"==typeof(null==T?void 0:T.uniqueViewers)?T.uniqueViewers:{total:null!==(r=null==T?void 0:T.uniqueViewers)&&void 0!==r?r:0,deltaPct:0,series:[]},t="object"==typeof(null==T?void 0:T.uniqueSignups)?T.uniqueSignups:{total:null!==(o=null==T?void 0:T.uniqueSignups)&&void 0!==o?o:0,deltaPct:0,series:[]},h=g.analytics||{};g.analytics={...h,timeframe:h.timeframe||(l||n?{start:l,end:n,resolution:"auto"}:void 0),uniqueViewers:{...h.uniqueViewers||{},total:null!==(d=e.total)&&void 0!==d?d:0,deltaPct:null!==(c=e.deltaPct)&&void 0!==c?c:0,series:null!==(u=e.series)&&void 0!==u?u:[]},signups:{...h.signups||{},total:null!==(v=t.total)&&void 0!==v?v:0,deltaPct:null!==(m=t.deltaPct)&&void 0!==m?m:0,series:null!==(x=t.series)&&void 0!==x?x:[]},conversionRate:{...h.conversionRate||{},current:null!==(p=null==T?void 0:null===(a=T.conversionRate)||void 0===a?void 0:a.current)&&void 0!==p?p:0,deltaPct:null!==(f=null==T?void 0:null===(s=T.conversionRate)||void 0===s?void 0:s.deltaPct)&&void 0!==f?f:0,series:null!==(y=null==T?void 0:null===(i=T.conversionRate)||void 0===i?void 0:i.series)&&void 0!==y?y:[]}}}return(null==S?void 0:S.data)&&(g.cta={clicks:S.data.clicks,ctr:S.data.ctr,groupSignups:S.data.groupSignups}),(null==N?void 0:N.data)&&(g.preSave=N.data),(null==C?void 0:C.data)&&(g.pollCounts=C.data),g},[null==b?void 0:b.data,null==j?void 0:j.data,null==h?void 0:h.data,null==S?void 0:S.data,null==N?void 0:N.data,null==C?void 0:C.data,l,n]),loading:k,errors:T}}let er=e=>{let{swapType:t,accessToken:a,initialTimeframe:l="monthly",swapId:n,ctaEnabled:s}=e,{value:i}=(0,U.y)("hideSwapTopFans",!0),[r,o]=(0,g.useState)(l),d=(0,g.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"monthly";o(e)},[]),{start:c,end:u}=(0,g.useMemo)(()=>{let e=new Date;return{start:(0,et.k)(e,R.Dt[r].days).toISOString(),end:e.toISOString()}},[r]),{stats:v,loading:m,errors:x}
1=ei({swapId:n,accessToken:a,start:c,end:u,swapType:t,ctaEnabled:s,includeKpis:!0,includeBase:!0,includeBreakdowns:!0,includeCta:!0,includePollCounts:!0,includeTopFans:!i,includePreSave:!0});return{stats:v,timeframe:r,handleTimeframeChange:d,loading:m,errors:x}};var eo=a(64146);function ed(e){let{pollCounts:t,pollType:a="text",pollOptions:n,topN:s=4}=e,i=(0,g.useMemo)(()=>{var e;return null!==(e=null==n?void 0:n.reduce((e,t)=>({...e,[t.id]:t}),{}))&&void 0!==e?e:{}},[n]),r=(0,g.useMemo)(()=>Object.keys(i).map(e=>{var a,l;return[e,null!==(l=null==t?void 0:null===(a=t.counts)||void 0===a?void 0:a[e])&&void 0!==l?l:0]}).sort((e,t)=>+t[1]-+e[1]).slice(0,s),[i,null==t?void 0:t.counts,s]);return(0,l.jsxs)(I.Z,{title:"Poll Results","data-sentry-element":"SwapDashboardCard","data-sentry-component":"PollResults","data-sentry-source-file":"PollResults.tsx",children:[(0,l.jsxs)("h1",{className:"text-feature-swaps text-3xl -mt-2 font-bold mb-4",children:[(0,u.JP)(t.total,1e5)," vote",1===t.total?"":"s"]}),(0,l.jsx)("div",{className:"flex flex-col gap-4 my-4 w-full",children:r.map((e,n)=>{var s,r,o,d,c,v,m;let[x,p]=e;return(0,l.jsxs)("div",{className:"flex flex-row gap-4 w-full",children:["image"===a&&(0,l.jsx)(eo.Z,{className:"w-[60px] h-[60px] object-cover rounded",src:null!==(m=null!==(v=null==i?void 0:null===(r=i[x])||void 0===r?void 0:null===(s=r.thumbnailUrls)||void 0===s?void 0:s.default)&&void 0!==v?v:null==i?void 0:null===(d=i[x])||void 0===d?void 0:null===(o=d.mediaUrls)||void 0===o?void 0:o.default)&&void 0!==m?m:"",alt:"Thumbnail",width:100,height:100,loader:q.XI}),(0,l.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,l.jsxs)("div",{className:"flex flex-row items-center justify-between gap-2 w-full",children:[(0,l.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,l.jsxs)("span",{className:"bg-core-bronze-25 text-[#5B61D9] w-10 h-10 inline-flex items-center justify-center rounded-full",children:["#",n+1]}),(0,l.jsx)("span",{children:null==i?void 0:null===(c=i[x])||void 0===c?void 0:c.label})]}),(0,l.jsxs)("span",{className:"font-bold",children:[(0,u.JP)(+p)," votes"]})]}),!!(null==t?void 0:t.total)&&(0,l.jsx)(_.Z,{percentage:Math.round(+p/t.total*100),precision:0})]})]},x)})})]})}var ec=a(59854);let eu={root:"flex flex-col gap-2",grid:"grid gap-2 lg:grid-cols-[minmax(0,2fr)_minmax(280px,1fr)]",statColumn:"flex flex-col gap-2",chartCard:"flex h-full flex-col gap-5",chartBody:"grid flex-1 items-center gap-4 lg:grid-cols-[minmax(220px,1fr)_minmax(180px,220px)]",chartWrap:"relative mx-auto aspect-square w-full min-w-[220px] max-w-[clamp(220px,32vw,320px)]",chartSkeleton:"mx-auto aspect-square w-full min-w-[220px] max-w-[clamp(220px,32vw,320px)]",centerLabel:"pointer-events-none absolute inset-0 flex items-center justify-center text-center",centerContent:"flex w-[62%] max-w-[180px] min-w-0 flex-col items-center",totalValue:"text-[clamp(2rem,5vw,3rem)] font-bold leading-none text-core-t1",totalCaption:"mt-2 flex flex-wrap items-center justify-center gap-1 text-xs text-core-t2 sm:text-sm",totalCaptionText:"text-xs text-core-t2 sm:text-sm",legend:"flex flex-col gap-3",legendItem:"flex items-center justify-between gap-3",legendLabel:"flex items-center gap-2 text-sm text-core-t2",legendDot:"h-3 w-3 rounded-full",legendPercent:"text-sm text-core-t3",legendValue:"text-sm font-semibold text-core-t1",footer:"mt-auto flex flex-col gap-3 border-t border-core-divider pt-4",followList:"flex flex-col gap-3",followItem:"flex items-center justify-between gap-3",followLabel:"flex items-center gap-3 text-sm text-core-t2",followIcon:"h-6 w-6 rounded-full",followValue:"text-2xl font-bold leading-none text-core-t1",errorCard:"flex min-h-[280px] flex-col items-center justify-center gap-2 p-6 text-center",errorTitle:"text-base font-semibold text-core-t1",errorCaption:"max-w-[360px] text-sm leading-relaxed text-core-t2"};function ev(e){let{title:t,caption:a}=e;return(0,l.jsxs)(ec.Z,{className:eu.errorCard,"data-sentry-element":"Card","data-sentry-component":"PreSaveAnalyticsErrorState","data-sentry-source-file":"PreSaveAnalyticsErrorState.tsx",children:[(0,l.jsx)(k.Z,{variant:"H4",className:eu.errorTitle,"data-sentry-element":"Typography","data-sentry-source-file":"PreSaveAnalyticsErrorState.tsx",children:t}),(0,l.jsx)(k.Z,{variant:"body",className:eu.errorCaption,"data-sentry-element":"Typography","data-sentry-source-file":"PreSaveAnalyticsErrorState.tsx",children:a})]})}var em=a(11079),ex=a(91241),ep=a(43378),ef=a(66936),eh=a(3059);let ey=[{key:"future",label:"Future Saves",color:"#5B61D9"},{key:"oneTime",label:"One-time",color:"#C7C9F4"}],eg={visits:"Total Visits",uniqueUsers:"Unique Users",clicksToService:"Clicks to Service",errorTitle:"Unable to load pre-save analytics",errorCaption:"Try refreshing the page or switching the date range. If the problem continues, please try again in a moment."};var eb=a(60411),ew=a(17386);function ej(e){let{follow:t}=e;return 0===t.length?null:(0,l.jsx)("div",{className:eu.footer,"data-sentry-component":"PreSaveFollowList","data-sentry-source-file":"PreSaveFollowList.tsx",children:(0,l.jsx)("div",{className:eu.followList,children:t.map(e=>{var t;let a=ew.Tt[e.service],n=a?ew.ne[a]:void 0,s=null!==(t=ew.EI[e.service])&&void 0!==t?t:e.service;return(0,l.jsxs)("div",{className:eu.followItem,children:[(0,l.jsxs)("div",{className:eu.followLabel,children:[(0,l.jsx)(eb.Z,{src:null==n?void 0:n.icon,alt:s,width:24,height:24,className:eu.followIcon}),(0,l.jsxs)(k.Z,{as:"span",variant:"H4",children:[s," followers"]})]}),(0,l.jsx)(k.Z,{as:"span",variant:"H2",className:eu.followValue,children:(0,eh.u)(e.total)})]},e.service)})})})}function eS(e){var t,a,n,s,i;let{data:r,isLoading:o=!1}=e;if(o)return(0,l.jsxs)(ec.Z,{className:eu.chartCard,children:[(0,l.jsx)(B.Od,{width:180,height:24}),(0,l.jsxs)("div",{className:eu.chartBody,children:[(0,l.jsx)(B.Od,{className:eu.chartSkeleton}),(0,l.jsxs)("div",{className:eu.legend,children:[(0,l.jsx)(B.Od,{width:180,height:20}),(0,l.jsx)(B.Od,{width:180,height:20})]})]}),(0,l.jsxs)("div",{className:eu.footer,children:[(0,l.jsx)(B.Od,{width:120,height:24}),(0,l.jsx)(B.Od,{width:92,height:36})]})]});let d=null!==(t=null==r?void 0:r.preSaves.future)&&void 0!==t?t:0,c=null!==(a=null==r?void 0:r.preSaves.oneTime)&&void 0!==a?a:0,u=null!==(n=null==r?void 0:r.preSaves.total.total)&&void 0!==n?n:0,v=(null!==(s=null==r?void 0:r.preSaves.total.deltaPct)&&void 0!==s?s:0)/100,m=0!==v,x=null!==(i=null==r?void 0:r.follow)&&void 0!==i?i:[],p=ey.map(e=>({...e,value:"future"===e.key?d:c})),f=p.map(e=>({...e,pct:u>0?Math.round(e.value/u*100):0}
1)),h=f.some(e=>e.pct>0),y=u>0?p.filter(e=>e.value>0):p.map(e=>({...e,value:1}));return(0,l.jsxs)(ec.Z,{className:eu.chartCard,"data-sentry-element":"Card","data-sentry-component":"PreSaveBreakdownChart","data-sentry-source-file":"PreSaveBreakdownChart.tsx",children:[(0,l.jsxs)("div",{className:eu.chartBody,children:[(0,l.jsxs)("div",{className:eu.chartWrap,children:[(0,l.jsx)(em.h,{"data-sentry-element":"ResponsiveContainer","data-sentry-source-file":"PreSaveBreakdownChart.tsx",children:(0,l.jsx)(ex.u,{"data-sentry-element":"PieChart","data-sentry-source-file":"PreSaveBreakdownChart.tsx",children:(0,l.jsx)(ep.b,{data:y,dataKey:"value",nameKey:"label",innerRadius:"68%",outerRadius:"96%",stroke:"none","data-sentry-element":"Pie","data-sentry-source-file":"PreSaveBreakdownChart.tsx",children:y.map(e=>(0,l.jsx)(ef.b,{fill:e.color},e.key))})})}),(0,l.jsx)("div",{className:eu.centerLabel,children:(0,l.jsxs)("div",{className:eu.centerContent,children:[(0,l.jsx)(k.Z,{as:"span",variant:"H1",className:eu.totalValue,"data-sentry-element":"Typography","data-sentry-source-file":"PreSaveBreakdownChart.tsx",children:(0,eh.u)(u)}),(0,l.jsxs)("div",{className:eu.totalCaption,children:[(0,l.jsx)(k.Z,{as:"span",variant:"body",className:eu.totalCaptionText,"data-sentry-element":"Typography","data-sentry-source-file":"PreSaveBreakdownChart.tsx",children:"Total Pre-Saves"}),m?(0,l.jsx)(H.Z,{delta:v}):null]})]})})]}),(0,l.jsx)("div",{className:eu.legend,children:f.map(e=>(0,l.jsxs)("div",{className:eu.legendItem,children:[(0,l.jsxs)("div",{className:eu.legendLabel,children:[(0,l.jsx)("div",{className:eu.legendDot,style:{backgroundColor:e.color}}),(0,l.jsx)(k.Z,{as:"span",variant:"body",children:e.label}),h?(0,l.jsx)(k.Z,{as:"span",variant:"caption",className:eu.legendPercent,children:"".concat(e.pct,"%")}):null]}),(0,l.jsx)(k.Z,{as:"span",variant:"H5",className:eu.legendValue,children:(0,eh.u)(e.value)})]},e.key))})]}),(0,l.jsx)(ej,{follow:x,"data-sentry-element":"PreSaveFollowList","data-sentry-source-file":"PreSaveBreakdownChart.tsx"})]})}function eN(e){var t,a,n;let{data:s,timeframe:i,timeframeLabel:r,isLoading:o=!1}=e,d=(null==s?void 0:s.visits.deltaPct)&&0!==s.visits.deltaPct?s.visits.deltaPct:void 0,c=(null==s?void 0:s.uniqueUsers.deltaPct)&&0!==s.uniqueUsers.deltaPct?s.uniqueUsers.deltaPct:void 0,u=(null==s?void 0:s.clicksToService.deltaPct)&&0!==s.clicksToService.deltaPct?s.clicksToService.deltaPct:void 0;return(0,l.jsxs)("div",{className:eu.statColumn,"data-sentry-component":"PreSaveStatsColumn","data-sentry-source-file":"PreSaveStatsColumn.tsx",children:[(0,l.jsx)(E.Z,{title:eg.visits,variant:"secondary",value:null!==(t=null==s?void 0:s.visits.total)&&void 0!==t?t:0,percentChange:d,subtitle:r,isLoading:o,modalTitle:eg.visits,modalData:null==s?void 0:s.visits.series,timeframe:i,"data-sentry-element":"SwapStatCard","data-sentry-source-file":"PreSaveStatsColumn.tsx"}),(0,l.jsx)(E.Z,{title:eg.uniqueUsers,variant:"secondary",value:null!==(a=null==s?void 0:s.uniqueUsers.total)&&void 0!==a?a:0,percentChange:c,subtitle:r,isLoading:o,modalTitle:eg.uniqueUsers,modalData:null==s?void 0:s.uniqueUsers.series,timeframe:i,"data-sentry-element":"SwapStatCard","data-sentry-source-file":"PreSaveStatsColumn.tsx"}),(0,l.jsx)(E.Z,{title:eg.clicksToService,variant:"secondary",value:null!==(n=null==s?void 0:s.clicksToService.total)&&void 0!==n?n:0,percentChange:u,subtitle:r,isLoading:o,modalTitle:eg.clicksToService,modalData:null==s?void 0:s.clicksToService.series,timeframe:i,"data-sentry-element":"SwapStatCard","data-sentry-source-file":"PreSaveStatsColumn.tsx"})]})}function eC(e){let{data:t,timeframe:a,timeframeLabel:n,isLoading:s=!1,hasError:i=!1}=e;return(0,l.jsx)("div",{className:eu.root,"data-sentry-component":"PreSaveAnalytics","data-sentry-source-file":"PreSaveAnalytics.tsx",children:i?(0,l.jsx)(ev,{title:eg.errorTitle,caption:eg.errorCaption}):(0,l.jsxs)("div",{className:eu.grid,children:[(0,l.jsx)(eS,{data:t,isLoading:s}),(0,l.jsx)(eN,{data:t,timeframe:a,timeframeLabel:n,isLoading:s})]})})}function ek(e){var t,a,n,s,i,r,o,d,c,v,m,x,p,f,h,y,b,w,j,S;let{swap:N,accessToken:C}=e,{value:k}=(0,U.y)("hideSwapTopFans",!0),[T,P]=(0,g.useState)(R.lF[0].value),{stats:F,timeframe:M,handleTimeframeChange:D,loading:Z,errors:L}=er({initialTimeframe:"monthly",accessToken:C,swapType:null==N?void 0:N.type,swapId:null==N?void 0:N.id,ctaEnabled:null==N?void 0:null===(t=N.cta)||void 0===t?void 0:t.enabled}),{uniqueViewers:_,signups:K,conversionRate:J,revenue:W,breakdowns:Q,comments:X}=null!==(i=null==F?void 0:F.analytics)&&void 0!==i?i:{},{ctr:Y,clicks:$,groupSignups:et}=null!==(r=null==F?void 0:F.cta)&&void 0!==r?r:{ctr:{current:0,deltaPct:0},clicks:{total:0,deltaPct:0},groupSignups:{total:0,deltaPct:0}},{cities:ea,topSources:el}=null!=Q?Q:{},en=null==F?void 0:F.preSave,es=null==F?void 0:F.topFans,ei=null!==(o=null==el?void 0:el.reduce((e,t)=>
1e+t.count,0))&&void 0!==o?o:0;return(0,l.jsxs)("div",{className:R.up.container,"data-sentry-component":"Stats","data-sentry-source-file":"Stats.tsx",children:[(0,l.jsxs)("div",{className:R.up.header,children:[(0,l.jsx)("h1",{className:"text-2xl font-bold",children:"pre-save"===N.type?"Pre-Save Analytics":"Performance Analytics"}),(0,l.jsx)(O.Z,{options:R.Ue,selected:M,onChange:D,name:"timeframe","data-sentry-element":"Select","data-sentry-source-file":"Stats.tsx"})]}),"pre-save"===N.type&&(0,l.jsx)(eC,{data:en,timeframe:M,timeframeLabel:R.Dt[M].label,isLoading:Z.preSave,hasError:L.preSave}),(0,l.jsxs)("div",{className:R.up.container,children:["pre-save"===N.type&&(0,l.jsx)("h1",{className:R.up.sectionTitle,children:"Reward Page Analytics"}),(0,l.jsxs)("div",{className:R.up.cardRow,children:[(0,l.jsx)(E.Z,{title:"Total Views",variant:"secondary",modalTitle:"Total Views",modalData:null==_?void 0:_.series,value:null!==(d=null==_?void 0:_.total)&&void 0!==d?d:0,subtitle:R.Dt[M].label,percentChange:null==_?void 0:_.deltaPct,isLoading:Z.kpis,timeframe:M,"data-sentry-element":"SwapStatCard","data-sentry-source-file":"Stats.tsx"}),(0,l.jsx)(E.Z,{title:"Total Signups",variant:"secondary",modalTitle:"Total Signups",modalData:null==K?void 0:K.series,value:null!==(c=null==K?void 0:K.total)&&void 0!==c?c:0,subtitle:R.Dt[M].label,percentChange:null!==(v=null==K?void 0:K.deltaPct)&&void 0!==v?v:0,isLoading:Z.kpis,timeframe:M,"data-sentry-element":"SwapStatCard","data-sentry-source-file":"Stats.tsx"}),(0,l.jsx)(E.Z,{title:"Conversion Rate",variant:"secondary",value:"".concat((0,u.aQ)(null!==(m=null==J?void 0:J.current)&&void 0!==m?m:0),"%"),modalTitle:"Conversion Rate",modalData:null==J?void 0:J.series,subtitle:R.Dt[M].label,percentChange:null!==(x=null==J?void 0:J.deltaPct)&&void 0!==x?x:0,isLoading:Z.kpis,timeframe:M,"data-sentry-element":"SwapStatCard","data-sentry-source-file":"Stats.tsx"})]})]}),"paywall"===N.type&&(0,l.jsxs)("div",{className:R.up.card,children:[(0,l.jsx)("div",{className:R.up.sectionHeader,children:(0,l.jsx)("h1",{className:R.up.sectionTitle,children:"Revenue Performance"})}),(0,l.jsxs)("div",{className:R.up.contentCol,children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("span",{className:R.up.valueText,children:(0,q.lb)(null!==(p=null==W?void 0:W.total)&&void 0!==p?p:0,{minimumFractionDigits:(null!==(f=null==W?void 0:W.total)&&void 0!==f?f:0)%1?2:0,maximumFractionDigits:2})}),(0,l.jsx)(H.Z,{delta:null!==(h=null==W?void 0:W.deltaPct)&&void 0!==h?h:0})]}),(0,l.jsx)(z.Z,{data:null!==(y=null==W?void 0:W.series)&&void 0!==y?y:[],isLoading:Z.base,dataKey:"v",label:"Revenue",dateFormat:R.Dt[M].format})]})]}),"vote"===N.type&&(null==F?void 0:F.pollCounts)&&(0,l.jsx)(ed,{pollCounts:F.pollCounts,pollType:N.pollType,pollOptions:N.pollOptions}),(null==N?void 0:null===(a=N.cta)||void 0===a?void 0:a.enabled)&&(0,l.jsxs)("div",{className:R.up.container,children:[(0,l.jsx)("h1",{className:R.up.sectionTitle,children:"Next Step Performance"}),(0,l.jsxs)("div",{className:R.up.cardRow,children:[(0,l.jsx)(E.Z,{title:"Banner Clicks",variant:"secondary",value:null!==(b=null==$?void 0:$.total)&&void 0!==b?b:0,percentChange:null==$?void 0:$.deltaPct,subtitle:R.Dt[M].label,isLoading:Z.cta,modalTitle:"Banner Clicks",modalData:null==$?void 0:$.series}),(0,l.jsx)(E.Z,{title:"Click-Through Rate",variant:"secondary",value:"".concat((0,u.aQ)(null!==(w=null==Y?void 0:Y.current)&&void 0!==w?w:0),"%"),percentChange:null==Y?void 0:Y.deltaPct,subtitle:R.Dt[M].label,isLoading:Z.cta,modalTitle:"Click-Through Rate",modalData:null==Y?void 0:Y.series}),(null==N?void 0:null===(n=N.cta)||void 0===n?void 0:n.type)==="community"&&(0,l.jsx)(E.Z,{title:"Channel Joins",variant:"secondary",value:null!==(j=null==et?void 0:et.total)&&void 0!==j?j:0,percentChange:null==et?void 0:et.deltaPct,subtitle:R.Dt[M].label,isLoading:Z.cta,modalTitle:"Channel Joins",modalData:null==et?void 0:et.series})]})]}),(0,l.jsxs)("div",{className:R.up.twoColRow,children:[(!!ei||Z.breakdowns.topSources)&&(0,l.jsx)(I.Z,{title:"Top Sources",iconType:"external",isLoading:Z.breakdowns.topSources,children:(0,l.jsx)("div",{className:R.up.itemList,children:!Z.breakdowns.topSources&&(null==el?void 0:el.map(e=>(0,l.jsx)(G.Z,{name:e.label,icon:(0,V.j)(e.label),views:e.count,percentage:e.count/ei*100},e.label)))})}),!k&&(Z.base||!!(null==es?void 0:es.length))&&(0,l.jsx)(I.Z,{title:"Top Fans",iconType:"external",isLoading:Z.base,children:(0,l.jsx)("div",{className:R.up.itemList,children:null==es?void 0:es.map(e=>{var t;return(0,l.jsx)(A.Z,{name:e.name,email:e.email,score:e.score,avatarUrl:null===(t=e.displayPictureUrls)||void 0===t?void 0:t.default},e.id)})})})]}),X&&(0,l.jsxs)("div",{className:R.up.card,children:[(0,l.jsxs)("div",{className:R.up.sectionHeaderWithMargin,children:[(0,l.jsx)("h1",{className:R.up.sectionTitle,children:"Comments"}),Z.base?(0,l.jsx)(B.Od,{count:1,width:80,height:20}):(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:R.up.countText,children:null==X?void 0:X.total.toLocaleStr
1ing()}),!!(null==X?void 0:X.deltaPctNet)&&(0,l.jsx)(H.Z,{className:R.up.trendDeltaMedium,delta:null==X?void 0:X.deltaPctNet})]})]}),(0,l.jsx)("div",{className:R.up.chartContainer,children:(0,l.jsx)(z.Z,{data:null!==(S=null==X?void 0:null===(s=X.series)||void 0===s?void 0:s.net)&&void 0!==S?S:[],dataKey:"v",label:"Comments",isLoading:Z.base,dateFormat:R.Dt[M].format})})]}),((null==ea?void 0:ea.length)||Z.breakdowns.cities)&&(0,l.jsxs)("div",{className:R.up.card,children:[(0,l.jsxs)("div",{className:R.up.mapHeader,children:[(0,l.jsx)("h1",{className:R.up.sectionTitleWithPadding,children:"Top 10 Cities by Swap Activity"}),(0,l.jsx)("div",{className:R.up.selectWrapper,children:(0,l.jsx)(O.Z,{options:R.lF,selected:T,onChange:P})})]}),(0,l.jsx)(ee,{sortKey:T,isLoading:Z.breakdowns.cities,data:null!=ea?ea:[],moreDataLabel:"View all cities with Swap Activity",mapKey:T})]})]})}var eT=a(62286),eP=a.n(eT),eF=a(98918),eM=a(80966),eD=a(84729),eZ=a(21837),eL=a(31955);let eE=e=>{var t;let{swapId:a,swapTitle:l,kind:n,limit:s,search:i,sortBy:r,sortDir:o}=e,{exportParticipants:d,isExporting:c}=(0,eZ.e)({accessToken:eL.Z.get("token")}),v=(0,eM.N)({value:null!=i?i:"",delay:250}),m=(null===(t=eP().get())||void 0===t?void 0:t.token)||"",[x,p]=(0,g.useState)(),{data:f,isLoading:h,isFetching:y}=(0,en.zr)({id:a,accessToken:m,kind:n,limit:s,cursor:x,search:v,sortBy:r,sortDir:o},{skip:!m||!a}),b=(0,g.useMemo)(()=>{let e={active:"success",inactive:"default",rsvp:"warning"};return[{header:"Name",accessorKey:"identity.name",cell:e=>e.getValue()},{header:"Email",accessorKey:"identity.email",cell:e=>e.getValue(),meta:{cellClassName:"lowercase"}},{header:"Zip Code",accessorKey:"identity.zipCode",cell:e=>e.getValue()},{header:"Phone",accessorKey:"identity.phone",cell:e=>e.getValue()},{header:"Status",accessorKey:"status",cell:t=>(0,g.createElement)(eD.Z,{variant:e[t.getValue()]},t.getValue())},{header:"Opt-in Date",accessorKey:"optInAt",cell:e=>e.getValue()?(0,eF.WU)(new Date(e.getValue()),"yyyy-MM-dd"):""}]},[]),w=(0,g.useCallback)(async()=>{try{let e=new Date;await d({swapId:a,sortBy:r,sortDir:o,fileName:"".concat(null!=l?l:"swap","-contacts-").concat((0,eF.WU)(e,"yyyy-MM-dd"))})}catch(e){(0,u.S3)(e,"Failed to export fans")}},[d,r,o,a,l]),j=(0,g.useCallback)(()=>{(null==f?void 0:f.nextCursor)&&p(null==f?void 0:f.nextCursor)},[null==f?void 0:f.nextCursor]);return{data:null==f?void 0:f.items,hasMore:!!(null==f?void 0:f.nextCursor),loadMore:j,isLoading:h,isFetching:y,isExporting:c,exportFans:w,columns:b}};var eO=a(64853);function eR(e){let{swapId:t,swapTitle:a}=e,[s,i]=(0,g.useState)(""),[r,o]=(0,g.useState)(),{data:d,columns:c,exportFans:u,isFetching:v,isLoading:p,isExporting:f}=eE({swapId:t,swapTitle:a,search:s,sortBy:null==r?void 0:r.sortBy,sortDir:null==r?void 0:r.sortDir,limit:25}),h=(0,g.useCallback)(e=>{if(null==e?void 0:e.length){let{id:t,desc:a}=e[0];["identity_name","status","optInAt"].includes(t)&&o({sortBy:t.replace("identity_",""),sortDir:a?"desc":"asc"})}},[]);return d||p?(0,l.jsxs)("div",{"data-sentry-component":"Fans","data-sentry-source-file":"Fans.tsx",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(eO.Z,{variant:"outlined",className:"pl-9",onChange:e=>{i(e.target.value)},placeholder:"Search",value:s,"data-sentry-element":"TextInput","data-sentry-source-file":"Fans.tsx",children:(0,l.jsx)(x.G,{icon:m.Y$T,className:"absolute left-3 inset-y-0 my-auto text-core-t2","data-sentry-element":"FontAwesomeIcon","data-sentry-source-file":"Fans.tsx"})}),(0,l.jsxs)(n.Z,{onClick:u,variant:"secondary",className:"bg-surface-l1",isLoading:f,spinner:!0,"data-sentry-element":"Button","data-sentry-source-file":"Fans.tsx",children:[!f&&(0,l.jsx)(x.G,{icon:m.SJh,className:"mr-1"}),"Export"]})]}),(0,l.jsx)(Q.Z,{className:"bg-surface-l1",loading:p,isFetching:v,data:null!=d?d:[],columns:c,onSort:h,pageSize:25,"data-sentry-element":"Table","data-sentry-source-file":"Fans.tsx"})]}):(0,l.jsx)("div",{className:"text-center my-6",children:"No fan data yet..."})}var eU=a(69831),eI=a(8065),eA=a(13352),eG=a(71861),e_=a(22340);let eB=new Set(["backgroundColor","textColor","accentColor"]),eV=["pending","processing"],ez=["enableGoogleSheets"],eq=["mediaType","mediaFileUrl","embedCode","media","mediaRemoved","coverImageUrl","coverUrls","rewardThumbnailUrl","rewardThumbnailUrls"],eH=["mediaFileUrl","coverImageUrl","coverUrls"],eK=()=>window.location.hash.replace(/^#\/?/,"")||null,eJ=e=>{var t,a,l,n,s,i,r,o,d,c,v,m,x,p,f,w,j,S,N,C;let{swap:k,isLoading:T,isUpdating:F,onUpdate:M,accessToken:E}=e,{featureFmSettings:O}=(0,eG.V)({accessToken:E}),{currentPublishedGroup:U}=(0,eU.Z)(),{artistSubscription:I}=(0,Z.bW)(),A=(0,g.useMemo)(()=>(0,P.s2)({goal:P.B5[k.type]}),[k.type]),G=(0,g.useMemo)(()=>(0,D.cq)(A),[A]),_=(0,g.useMemo)(()=>(0,eA.Zz)({featureFmSettings:O,artistSubscription:I}),[I,O]),B=(0,g.useMemo)(()=>{var e;return null===(e=k.musicServices)||void 0===e?void 0:e.map(e=>{var t,a,l,n,s;return{...e,label:null!==(s=null!==(n=e.label)&&void 0!==n?n:null===(t=ew.ne[e.id])||void 0===t?void 0:t.label)&&void 0!==s?s:null===(l=P.G3.musicServices)||void 0===l?void 0:null===(a=l.find(t=>{let{id:a}=t;return a===e.id}))||void 0===a?void 0:a.label}})},[k.musicServices]),{cta:V,...z}=P.G3,q=(0,g.useCallback)(async e=>{let t=await (0,D.Uc)(e,G);if(t.embedCode&&!t.embedCode.includes("<iframe")){let{embedCode:e}=await (0,eI.W$)(t.embedCode);t.embedCode=e}return!!M&&!1!==await M(t)},[M,G]),H={...z,enableMetaPixel:!!(null==k?void 0:k.metaPixelId),includeEndDate:!!(null==k?void 0:k.endAt),includeDescription:!!(null==k?void 0:k.description),includeAccessLimit:!!(null==k?void 0:k.accessLimit),mediaType:(null==k?void 0:null===(t=k.media)||void 0===t?void 0:t.contentType)==="embed"?"link":"upload",...k,...(null==k?void 0:null===(a=k.media)||void 0===a?void 0:a.embedCode)?{embedCode:k.media.embedCode}:{},...(null==k?void 0:null===(n=k.media)||void 0===n?void 0:null===(l=n.hlsUrls)||void 0===l?void 0:l.default)?{mediaFileUrl:k.media.hlsUrls.default}:{},...(0,D.Ew)(k.theme),...B?{musicServices:B}:{},...void 0===k.cta?{}:{cta:k.cta},goal:P.B5[k.type],enableGoogleSheets:!!(null==k?void 0:k.enableGoogleSheets),activeGroup:U,collectRewardEmails:null===(N=null==k?void 0:k.collectRewardEmails)||void 0===N||N,price:(null==k?void 0:k.priceCents)!=null?k.priceCents/100:P.G3.price},K=(0,b.TA)({initialValues:H,validationSchema:G,onSubmit:async(e,t)=>{let{resetForm:a}=t;
1try{if(!await q(e))return;a({values:e,touched:{}}),e_.Am.success("Swap updated successfully")}catch(e){(0,u.S3)(e)}},validateOnBlur:!0}),{dirty:J,initialValues:W,resetForm:Q,setValues:X,values:$}=K,ee=(0,g.useRef)({values:$,initialValues:W});ee.current={values:$,initialValues:W};let et=(0,g.useCallback)(e=>{let{values:t,initialValues:a}=ee.current;Q({values:{...a,...e},touched:{}}),X({...t,...e},!0)},[Q,X]),ea=(0,g.useRef)(H);ea.current=H;let el=[k.id,k.version,k.updatedAt,null===(s=k.media)||void 0===s?void 0:s.id,null===(i=k.media)||void 0===i?void 0:i.contentType,null===(o=k.media)||void 0===o?void 0:null===(r=o.hlsUrls)||void 0===r?void 0:r.default,null===(c=k.media)||void 0===c?void 0:null===(d=c.previewHlsUrls)||void 0===d?void 0:d.default,null===(m=k.media)||void 0===m?void 0:null===(v=m.thumbnailUrls)||void 0===v?void 0:v.default,k.rewardThumbnailUrl,null===(x=k.rewardThumbnailUrls)||void 0===x?void 0:x.default,null===(p=k.coverUrls)||void 0===p?void 0:p.default,null===(f=k.coverUrls)||void 0===f?void 0:f.contentType].join("|"),en=(0,g.useRef)(el);(0,g.useEffect)(()=>{var e,t,a;if(en.current===el)return;let l=ea.current,n=eV.includes(null!==(a=null===(t=k.media)||void 0===t?void 0:null===(e=t.transcode)||void 0===e?void 0:e.status)&&void 0!==a?a:"");if(J){let{values:e,initialValues:t}=ee.current,a=[...n?eq.filter(e=>!eH.includes(e)):eq,...ez].reduce((a,n)=>(h()(e[n],t[n])&&!h()(l[n],t[n])&&(a[n]=l[n]),a),{});Object.keys(a).length&&(en.current=el,et(a));return}en.current=el,Q({values:n?{...l,mediaFileUrl:$.mediaFileUrl,coverImageUrl:$.coverImageUrl,coverUrls:$.coverUrls}:l,touched:{}})},[et,J,$,Q,null===(j=k.media)||void 0===j?void 0:null===(w=j.transcode)||void 0===w?void 0:w.status,el]),(0,g.useEffect)(()=>{if(!J&&(null==O?void 0:O.connected)){let e={...$},t=!1;Object.entries(_).forEach(a=>{let[l,n]=a;void 0!==n&&(eB.has(l)||null!=k[l]||e[l]===n||(e[l]=n,t=!0))}),t&&Q({values:e,touched:{}})}},[J,null==O?void 0:O.connected,_,$,Q,k]),(0,g.useEffect)(()=>{J||W.activeGroup===U||Q({values:{...$,activeGroup:U},touched:{}})},[U,J,W,$,Q]);let{selectedTab:es,setSelectedTab:ei}=(0,y.w)(R.mJ),er=null===(S=R.mJ[es])||void 0===S?void 0:S.name,eo="edit"===(null!==(C=(0,R.xk)(eK()))&&void 0!==C?C:er);return{selectedIndex:es,onTabChange:ei,tabs:(0,g.useMemo)(()=>[{...R.mJ[0],content:(0,g.createElement)(L,{isLoading:F,preview:(0,Y.hE)(k),authTokens:{accessToken:E},featureFmSettings:O,saasEnabled:eo})},{...R.mJ[1],content:(0,g.createElement)(ek,{swap:k,accessToken:E})},{...R.mJ[2],content:(0,g.createElement)(eR,{swapId:k.id,swapTitle:k.title})}],[E,O,eo,F,k]),formik:K,isLoading:T}};var eW=a(49224);function eQ(e){var t,a,n,s,f,h,y,w,j,S;let{swap:N,isLoading:C,isUpdating:k,onUpdate:T,accessToken:P}=e,{start:F,end:M}=(0,g.useMemo)(()=>({start:R.w2.toISOString(),end:new Date().toISOString()}),[]),{stats:D,loading:Z}=ei({swapId:N.id,accessToken:P,start:F,end:M,swapType:N.type,ctaEnabled:!1,includeKpis:!0,includeBase:!1,includeBreakdowns:!1,includeCta:!1,includePollCounts:!1,includePreSave:!1,refreshOnFocus:!1,refreshOnReconnect:!1}),{uniqueViewers:L,signups:E,conversionRate:O}=D.analytics||{},{tabs:U,selectedIndex:I,onTabChange:A,formik:G}=eJ({swap:N,isLoading:C,isUpdating:k,onUpdate:T,accessToken:P}),_=((null===(t=N.coverUrls)||void 0===t?void 0:t.contentType)==="image"?null===(a=N.coverUrls)||void 0===a?void 0:a.default:null===(s=N.media)||void 0===s?void 0:null===(n=s.thumbnailUrls)||void 0===n?void 0:n.default)||(null===(h=N.artist)||void 0===h?void 0:null===(f=h.displayPictureUrls)||void 0===f?void 0:f.default);return(0,l.jsxs)("div",{className:R.kS.container,"data-sentry-component":"SwapDetailsContent","data-sentry-source-file":"SwapDetails.tsx",children:[(0,l.jsxs)("div",{className:R.kS.content,children:[(0,l.jsxs)(r.Z,{groupName:N.title,artistName:null===(y=N.artist)||void 0===y?void 0:y.name,avatar:_,"data-sentry-element":"TitleBar","data-sentry-source-file":"SwapDetails.tsx",children:[(0,l.jsx)(o.Z,{icon:(0,l.jsx)(x.G,{icon:v.Mdf}),value:(0,u.JP)(null!==(w=null==L?void 0:L.total)&&void 0!==w?w:0),label:"Total Views",isLoading:C||Z.kpis,"data-sentry-element":"MetricCard","data-sentry-source-file":"SwapDetails.tsx"}),(0,l.jsx)(o.Z,{icon:(0,l.jsx)(p.Z,{}),value:(0,u.JP)(null!==(j=null==E?void 0:E.total)&&void 0!==j?j:0),label:"Total Signups",isLoading:C||Z.kpis,"data-sentry-element":"MetricCard","data-sentry-source-file":"SwapDetails.tsx"}),(0,l.jsx)(o.Z,{icon:(0,l.jsx)(x.G,{icon:m.imS}),value:"".concat((0,u.aQ)(null!==(S=null==O?void 0:O.current)&&void 0!==S?S:0),"%"),label:"Conversion Rate",isLoading:C||Z.kpis,"data-sentry-element":"MetricCard","data-sentry-source-file":"SwapDetails.tsx"})]}),(0,l.jsx)(b.Hy,{value:G,"data-sentry-element":"FormikProvider","data-sentry-source-file":"SwapDetails.tsx",children:(0,l.jsx)(i.Z,{tabs:U,orientation:"h",variant:"primary",selectedIndex:I,onChange:A,routing:"hash","data-sentry-element":"Tabs","data-sentry-source-file":"SwapDetails.tsx"})})]}),(0,l.jsx)(d.Z,{visible:G.dirty,isLoading:k,disabled:!G.isValid,onDiscard:G.resetForm,onSubmit:G.submitForm,leftContent:(0,l.jsxs)("div",{className:R.kS.unsavedChanges,children:[(0,l.jsx)(x.G,{icon:m.RLE,className:R.kS.unsavedChangesIcon}),(0,l.jsx)("span",{children:"This Swap has unsaved changes"})]}),"data-sentry-element":"ActionsFooter","data-sentry-source-file":"SwapDetails.tsx"}),(0,l.jsx)(c.Z,{onConfirm:G.submitForm,dirty:G.dirty,"data-sentry-element":"DirtyStateModal","data-sentry-source-file":"SwapDetails.tsx"})]})}function eX(e){return(0,l.jsx)(eW.LZ,{"data-sentry-element":"UploadProvider","data-sentry-component":"SwapDetails","data-sentry-source-file":"SwapDetails.tsx",children:(0,l.jsx)(Z.Of,{authTokens:{accessToken:e.accessToken},"data-sentry-element":"SaasCtaProvider","data-sentry-source-file":"SwapDetails.tsx",children:(0,l.jsx)(eQ,{...e,"data-sentry-element":"SwapDetailsContent","data-sentry-source-file":"SwapDetails.tsx"})})})}var eY=a(11163),e$=a(65123),e0=a(29150),e1=!0;function e2(e){var t;let{params:a,accessToken:i,user:r}=e,o=null==a?void 0:a.swapId,{swap:d,isLoading:c,updateSwap:u,isUpdating:v,error:p}=(0,eZ.e)({id:o,accessToken:i}),[f,h]=(0,g.useState)(!1),y=(0,eY.useRouter)(),{isMobile:b}=(0,e0.Z)(r);return(0,g.useEffect)(()=>{(d||!p)&&(c||(null==d?void 0:d.userId)===(null==r?void 0:r._id))||(console.error("Swap does not exist or user is not the owner of swap"),y.push("/swaps"))},[d,p,y,c,null==r?void 0:r._id]),(0,l.jsxs)("div",{className:"flex flex-col gap-2 items-center justify-center mx-auto","data-sentry-component":"EditSwap","data-sentry-source-file":"edit.tsx",children:[(0,l.jsx)(s.Z,{imageUrl:(null==d?void 0:null===(t=d.coverUrls)||void 0===t?void 0:t.default)||"",description:"Update your swap!",title:"Edit Swap - ".concat((null==d?void 0:d.title)||"Swap"),"data-sentry-element":"OGMetaTags","data-sentry-source-file":"edit.tsx"}),(0,l.jsxs)("div",{className:S()("w-full max-w-screen-xl px-4 top-0 z-10 bg-surface-l0 flex md:flex-row flex-col justify-between items-center gap-2",{"pt-4":b}),children:[(0,l.jsx)("h1",{className:"text-2xl text-core-t1 font-bold",children:"Swap Details"}),(0,l.jsxs)(n.Z,{variant:"secondary",onClick:()=>y.push("/swaps"),className:"w-fit","data-sentry-element":"Button","data-sentry-source-file":"edit.tsx",children:[(0,l.jsx)(x.G,{icon:m.acZ,className:"mr-2","data-sentry-element":"FontAwesomeIcon","data-sentry-source-file":"edit.tsx"}),(0,l.jsx)("span",{children:"Back to Swaps"})]})]}),(0,l.jsx)(e$.Z,{className:"w-[95%] max-w-[1220px]","data-sentry-element":"Divider","data-sentry-source-file":"edit.tsx"}),d&&(0,l.jsx)(eX,{swap:d,isLoading:c||f,isUpdating:v,onUpdate:u,accessToken:i})]})}},9636:function(e,t,a){"use strict";a.d(t,{Z:function(){return x}});var l=a(85893),n=a(96897),s=a(93967),i=a.n(s),r=a(73935);let o={container:"fixed bottom-[var(--sticky-player-height,0px)] left-0 z-10 w-full border border-core-card bg-surface-l1 py-3 shadow-[0px_-3px_4px_rgba(0,0,0,0.1)] transition-all duration-300 ease-in-out",visibility:{visible:"translate-y-0 opacity-100 pointer-events-auto",hidden:"translate-y-full opacity-0 pointer-events-none"}
1,content:"mx-auto flex w-full max-w-screen-xl items-center justify-between gap-4 px-8 transition-all duration-300 ease-in-out",leftContent:"flex-1 min-w-0 text-sm text-core-primary",actions:"flex items-center gap-4",button:"my-0 rounded-full"};var d=a(29150),c=a(32070),u=a(5969),v=a(91944),m=a(67294);function x(e){var t;let{onDiscard:a,onSubmit:s,isLoading:x,disabled:p,visible:f=!0,discardLabel:h="Discard Changes",submitLabel:y="Update",leftContent:g,className:b,discardButtonProps:w,submitButtonProps:j}=e,{isMounted:S,sidebarWidth:N}=function(e){let{user:t}=(0,c.Z)(),a=(0,u.T)(),{isMobile:l,isHidden:n}=(0,d.Z)(t),[s,i]=(0,m.useState)(!1),[r,o]=(0,m.useState)(0);return(0,m.useEffect)(()=>{i(!0)},[]),(0,m.useEffect)(()=>(a((0,v.PD)(e)),()=>{e&&a((0,v.PD)(!1))}),[a,e]),(0,m.useEffect)(()=>{if(!s||"undefined"==typeof ResizeObserver)return;let e=document.getElementById("sidebarComponent"),t=()=>{var t;o(l||n?0:null!==(t=null==e?void 0:e.getBoundingClientRect().width)&&void 0!==t?t:0)};t();let a=new ResizeObserver(t);return e&&a.observe(e),()=>a.disconnect()},[s,l,n]),{isMounted:s,sidebarWidth:r}}(f),C=f?o.visibility.visible:o.visibility.hidden;if(!S)return null;let k=null!==(t=document.getElementById("mainComponent"))&&void 0!==t?t:document.body;return(0,r.createPortal)((0,l.jsx)("div",{className:i()(o.container,C,b),style:{paddingLeft:N},children:(0,l.jsxs)("div",{className:o.content,children:[(0,l.jsx)("div",{className:o.leftContent,children:g}),(0,l.jsxs)("div",{className:o.actions,children:[(0,l.jsx)(n.Z,{variant:"secondary",className:o.button,onClick:a,disabled:x,...w,children:h}),(0,l.jsx)(n.Z,{className:o.button,onClick:s,isLoading:x,disabled:p||x,spinner:!0,...j,children:y})]})]})}),k)}},63688:function(e,t,a){"use strict";a.d(t,{ax:function(){return n},zF:function(){return l}});let l={container:{wrapper:"w-full mb-4",nav:"mx-auto w-full flex justify-end",list:"flex flex-row items-center gap-4"},info:{base:"flex items-center justify-center text-core-t2"},button:{base:"p-1 text-core-t2",enabled:"cursor-pointer hover:text-core-t1",disabled:"cursor-not-allowed opacity-50",icon:"flex items-center justify-center"}},n={container:{wrapper:"w-full h-fit tableResponsive bg-surface-l1 rounded-sm overflow-hidden",content:"min-h-[500px]",pagination:"w-full flex flex-row justify-end pt-5 pb-1 px-4"},table:{base:"w-full caption-bottom text-sm"},header:{row:"border-b border-core-divider text-core-t1 capitalize",cell:"px-4 py-4 font-bold text-left"},body:{row:"border-b border-core-divider text-core-t1 capitalize hover:bg-surface-l2 transition-colors group",rowHover:"cursor-pointer",rowSelected:"bg-surface-l2",cell:"px-4 py-3"}}},9814:function(e,t,a){"use strict";a.d(t,{w:function(){return s}});var l=a(67294),n=a(11163);function s(e){let t=(0,n.useRouter)(),[a,s]=(0,l.useState)(0),i=(0,l.useCallback)(()=>{let t=window.location.hash.replace(/^#\/?/,""),a=e.findIndex(e=>e.name===t);a>-1&&s(a)},[e]);return(0,l.useEffect)(()=>(i(),window.addEventListener("hashchange",i),t.events.on("hashChangeComplete",i),()=>{window.removeEventListener("hashchange",i),t.events.off("hashChangeComplete",i)}),[i,t.events]),{selectedTab:a,setSelectedTab:s}}},30089:function(e,t,a){"use strict";a.d(t,{u:function(){return n},v:function(){return l}});let l={base:"self-stretch p-3 md:p-5 bg-surface-l1 rounded-sm flex flex-col lg:flex-row justify-start items-start lg:items-center gap-4 md:gap-8 mt-[22px] border border-core-card",identity:"flex-1 flex justify-start items-center gap-3",avatar:"w-[64px] h-[64px] object-cover rounded-full border border-core-card",info:"flex-1 md:max-w-64 lg:max-w-120 xl:max-w-220 inline-flex flex-col justify-start items-start",groupName:"self-stretch justify-center text-lg md:text-xl lg:text-2xl font-medium leading-tight md:leading-loose text-core-t1",artistName:"self-stretch justify-center text-xs font-bold leading-none text-core-t2",metrics:"w-full lg:w-auto grid grid-cols-1 xl:flex justify-start xl:justify-end items-center gap-2 md:gap-2.5"},n={base:"gap-2 md:gap-6 p-4 bg-surface-l2 rounded-[10px] flex justify-start lg:justify-between items-center border border-core-card",icon:"w-8 flex justify-center flex-shrink-0 text-core-t2",content:"inline-flex flex-col justify-start items-start lg:items-end gap-1",value:"text-center text-base md:text-lg font-bold leading-6 md:leading-7 text-core-t1",label:"text-left md:text-center text-xs font-medium leading-none text-wrap text-core-t2",skeleton:"min-w-[100px] max-h-[36px] inline-flex flex-col justify-start items-start lg:items-end"}},92659:function(e,t,a){"use strict";a.d(t,{X:function(){return l}});let l=["featureFmEmail","enableForeverPreSaves","followOnSpotify","spotifyArtistUrl","enableReleaseNotifications","futureSpotifyArtistUrl","futureAppleArtistUrl","futureTidalArtistUrl","futureDeezerArtistUrl","futureAmazonArtistUrl","futureAudiomackArtistUrl","backgroundColor","textColor","accentColor"]},13352:function(e,t,a){"use strict";a.d(t,{GH:function(){return d},TY:function(){return u},Zz:function(){return o},u$:function(){return c}});var l=a(56327),n=a(92659),s=a(17386),i=a(48715),r=a(33081);let o=e=>{var t,a;let{featureFmSettings:l,artistSubscription:n,fallbackEmail:o}=e,d=null==l?void 0:l.settings,c=null!==(t=null==d?void 0:d.futureSaveServices)&&void 0!==t?t:[],u=!!(null==n?void 0:n.isActive),v=u&&(0,r.Z4)(n,i.g.FuturePresave),m=u&&(0,r.Z4)(n,i.g.ReleaseDayNotifications);return{...c.reduce((e,t)=>
1{let{id:a,artistUrl:l}=t,n=(0,s.f4)(a),i=n?s.ne[n]:void 0;return(null==i?void 0:i.futureSaveField)&&l?{...e,[i.futureSaveField]:l}:e},{}),featureFmEmail:null!==(a=null==d?void 0:d.featureFMEmail)&&void 0!==a?a:o,enableForeverPreSaves:v?null==d?void 0:d.enableFutureSave:void 0,followOnSpotify:null==d?void 0:d.preSaveFollow,spotifyArtistUrl:null==d?void 0:d.spotifyArtistUrl,enableReleaseNotifications:m?null==d?void 0:d.enableReleaseDayEmail:void 0}},d=(e,t,a)=>{e[t]=a},c=e=>{let t={};return n.X.forEach(a=>{d(t,a,e[a])}),t},u=e=>{var t,a;return{...c(e),enableForeverPreSaves:null!==(t=e.enableForeverPreSaves)&&void 0!==t?t:l.G3.enableForeverPreSaves,enableReleaseNotifications:null!==(a=e.enableReleaseNotifications)&&void 0!==a?a:l.G3.enableReleaseNotifications}}},71861:function(e,t,a){"use strict";a.d(t,{V:function(){return n}});var l=a(45684);let n=e=>{let{accessToken:t}=e,{data:a}=(0,l.oW)({accessToken:t||""},{skip:!t});return{featureFmSettings:a}}},80966:function(e,t,a){"use strict";a.d(t,{N:function(){return n}});var l=a(67294);function n(e){let[t,a]=(0,l.useState)(e.value);return(0,l.useEffect)(()=>{let t=setTimeout(()=>{a(e.value)},e.delay);return()=>{clearTimeout(t)}},[e.value,e.delay]),t}}},function(e){e.O(0,[5882,4094,5076,1968,2888,9774,179],function(){return e(e.s=73337)}),_N_E=e.O()}]);
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.