1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[1738],{42298:(e,t,a)=>{a.r(t),a.d(t,{AffiliateAreaPageComponent:()=>_a,default:()=>ha});var l=a(72791),n=a(47375),i=a(60331),r=a(52745),s=a(67600),o=a(46902),c=a(74182),m=a(23872);const d="AffiliateUrlsTab_root__Uprgv",u="AffiliateUrlsTab_heading__tGtBp",f="AffiliateUrlsTab_section__NCrRE",p="AffiliateUrlsTab_sectionTitle__TpktE",_="AffiliateUrlsTab_hint__k4H2G",h="AffiliateUrlsTab_errorMessage__Y13jP",b="AffiliateUrlsTab_idBox__BkWmX",g="AffiliateUrlsTab_inputRow__dAfJD",v="AffiliateUrlsTab_readOnlyInput__h2oki",E="AffiliateUrlsTab_textInput__Wu2P4",y="AffiliateUrlsTab_copyButton__p7Vz7",N="AffiliateUrlsTab_generateButton__auTKP",T="AffiliateUrlsTab_socialPostsGrid__PGWFA",A="AffiliateUrlsTab_socialPostCard__5hhgb",k="AffiliateUrlsTab_socialPostHeader__+lGIC",w="AffiliateUrlsTab_socialDot__BTxjX",C="AffiliateUrlsTab_socialPostTextarea__u2183",S="AffiliateUrlsTab_socialPostActions__s+8lt",P="AffiliateUrlsTab_socialButton__-3CWC",U="AffiliateUrlsTab_facebook__Ul0y2",x="AffiliateUrlsTab_twitter__UZcd5",L="AffiliateUrlsTab_linkedin__9vtMY",R="AffiliateUrlsTab_pinterest__SX6ik",D="AffiliateUrlsTab_whatsapp__wW8Gy",M="AffiliateUrlsTab_snippetSection__ZNw3L",H="AffiliateUrlsTab_snippetLabel__d8WE-",B="AffiliateUrlsTab_creativeSelect__cVZZA",F="AffiliateUrlsTab_snippetOutput__fNoxh",G="AffiliateUrlsTab_creativePreview__dT5Vv",I="AffiliateUrlsTab_downloadButton__JTXvm",O="AffiliateUrlsTab_creativePreviewImg__OKseS",j="AffiliateUrlsTab_socialCreativeSection__cygOs",z="AffiliateUrlsTab_snippetTextarea__Cl79G",V="AffiliateUrlsTab_tipBox__iMCMo",W=(e,t)=>{const a=e.split("?")[0].split(".").pop(),l=t?"".concat(t.replace(/[^a-z0-9]/gi,"_"),".").concat(a):"creative.".concat(a),n=(0,m.ny)(),i="".concat(n,"/api/affiliate/download-creative?url=").concat(encodeURIComponent(e),"&filename=").concat(encodeURIComponent(l));fetch(i,{credentials:"include"}).then((e=>{if(!e.ok)throw new Error(e.status);return e.blob()})).then((e=>{const t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download=l,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(t)})).catch((()=>window.open(e,"_blank")))},Y=e=>{var t,a,n,i,r,s;let{currentUser:o,creatives:c=[],affiliateId:m}=e;const Y=m||(null===o||void 0===o||null===(t=o.attributes)||void 0===t||null===(a=t.profile)||void 0===a||null===(n=a.protectedData)||void 0===n?void 0:n.affiliateId),K=(null===o||void 0===o||null===(i=o.attributes)||void 0===i||null===(r=i.profile)||void 0===r||null===(s=r.protectedData)||void 0===s?void 0:s.affiliateReferralUrl)||(Y?"".concat("https://housesitmatch.com","/?ref=").concat(Y):""),[Z,q]=(0,l.useState)(!1),[X,J]=(0,l.useState)(""),[Q,$]=(0,l.useState)(""),[ee,te]=(0,l.useState)(!1),ae=(e,t)=>{navigator.clipboard.writeText(e).then((()=>{t(!0),setTimeout((()=>t(!1)),2e3)}))},[le,ne]=(0,l.useState)(""),[ie,re]=(0,l.useState)(""),[se,oe]=(0,l.useState)(!1),[ce,me]=(0,l.useState)(!1),[de,ue]=(0,l.useState)(null),[fe,pe]=(0,l.useState)(""),[_e,he]=(0,l.useState)(!1),be="https://housesitmatch.com".replace(/\/$/,""),ge=encodeURIComponent(K);return l.createElement("div",{className:d},l.createElement("h2",{className:u},"Links & Tools"),l.createElement("section",{className:f},l.createElement("h3",{className:p},"Your Affiliate ID"),l.createElement("div",{className:b},null!==Y&&void 0!==Y?Y:"\u2014")),l.createElement("section",{className:f},l.createElement("h3",{className:p},"Your Referral URL"),l.createElement("div",{className:g},l.createElement("input",{className:v,type:"text",readOnly:!0,value:K}),l.createElement("button",{className:y,onClick:()=>ae(K,q),type:"button"},Z?"Copied!":"Copy"))),l.createElement("section",{className:f},l.createElement("h3",{className:p},"Share on Social"),l.createElement("p",{className:_},"Copy the ready-made message, then click the platform button to open the share dialog and paste it."),c.length>0&&l.createElement("div",{className:j},l.createElement("div",{className:V},l.createElement("strong",null,"Tip:")," To share your affiliate link via an image on your website or social media \u2014 select a creative below and download it."),l.createElement("h4",{className:H},"Include a Creative (HTML embed)"),l.createElement("p",{className:_},"Select a banner or image to generate an HTML snippet you can embed alongside your social posts."),l.createElement("select",{className:B,value:fe,onChange:e=>{pe(e.target.value),he(!1)}},l.createElement("option",{value:""},"\u2014 No creative selected \u2014"),c.map((e=>l.createElement("option",{key:e.id,value:e.id},e.title," (",e.type,e.width_px?" \xb7 ".concat(e.width_px,"\xd7").concat(e.height_px):"",")")))),fe&&(()=>{const e=c.find((e=>String(e.id)===String(fe)));if(!e)return null;const t=e.html_template?e.html_template.replace(/\{ref\}/g,Y||"").replace(/\{\{REFERRAL_URL\}\}
1/g,K):'<a href="'.concat(K,'" target="_blank" rel="noopener noreferrer"><img src="').concat(e.file_url,'" alt="').concat(e.title,'" width="').concat(e.width_px||"auto",'" height="').concat(e.height_px||"auto",'" style="max-width:100%;height:auto;" /></a>');return l.createElement("div",{className:F},e.file_url&&l.createElement("div",{className:G},l.createElement("img",{src:e.file_url,alt:e.title,className:O}),l.createElement("button",{type:"button",className:I,title:"Download creative",onClick:()=>W(e.file_url,e.title)},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},l.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),l.createElement("polyline",{points:"7 10 12 15 17 10"}),l.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"})),"Download")),l.createElement("textarea",{className:z,readOnly:!0,value:t}),l.createElement("button",{className:y,onClick:()=>{navigator.clipboard.writeText(t),he(!0),setTimeout((()=>he(!1)),2e3)},type:"button"},_e?"Copied!":"Copy HTML"))})()),l.createElement("div",{className:V},l.createElement("strong",null,"Tip:")," To share your affiliate link via social media \u2014 make sure your social media account is open/logged in before clicking Share."),(()=>{const e=[{platform:"Facebook",cssClass:U,message:"\ud83c\udfe1 Looking for trusted house sitters or want to travel while caring for pets? Check out HouseSit Match!\n\n".concat(K),shareUrl:"https://www.facebook.com/sharer/sharer.php?u=".concat(ge)},{platform:"Twitter / X",cssClass:x,message:"\ud83c\udfe1 Looking for trusted house sitters or want to travel while caring for pets? Check out @HouseSitMatch!\n\n".concat(K),shareUrl:"https://twitter.com/intent/tweet?text=".concat(encodeURIComponent("\ud83c\udfe1 Looking for trusted house sitters or want to travel while caring for pets? Check out @HouseSitMatch!\n\n".concat(K)))},{platform:"LinkedIn",cssClass:L,message:"\ud83c\udfe1 Looking for trusted house sitters or want to travel while caring for pets?\n\nHouseSit Match connects homeowners with verified, responsible house sitters. Whether you need someone to look after your home and pets, or you're a sitter looking for your next adventure \u2013 this is for you!\n\n".concat(K),shareUrl:"https://www.linkedin.com/feed/?shareActive=true&text=".concat(encodeURIComponent("\ud83c\udfe1 Looking for trusted house sitters or want to travel while caring for pets?\n\nHouseSit Match connects homeowners with verified, responsible house sitters.\n\n".concat(K)))},{platform:"Pinterest",cssClass:R,message:"\ud83c\udfe1 HouseSit Match \u2013 Find trusted house sitters or sit for free! Perfect for pet lovers and travellers.\n\n".concat(K),shareUrl:"https://pinterest.com/pin/create/button/?url=".concat(ge,"&description=").concat(encodeURIComponent("HouseSit Match \u2013 Find trusted house sitters or sit for free! Perfect for pet lovers and travellers."))},{platform:"WhatsApp",cssClass:D,message:"\ud83c\udfe1 Hey! Check out HouseSit Match \u2013 it connects homeowners with trusted house sitters. Great if you love pets or want someone reliable to look after your home.\n\n".concat(K),shareUrl:"https://wa.me/?text=".concat(encodeURIComponent("\ud83c\udfe1 Hey! Check out HouseSit Match \u2013 it connects homeowners with trusted house sitters. Great if you love pets or want someone reliable to look after your home.\n\n".concat(K)))}];return l.createElement("div",{className:T},e.map(((e,t)=>l.createElement("div",{key:e.platform,className:A},l.createElement("div",{className:k},l.createElement("span",{className:"".concat(w," ").concat(e.cssClass)}),l.createElement("strong",null,e.platform)),l.createElement("textarea",{className:C,readOnly:!0,value:e.message}),l.createElement("div",{className:S},l.createElement("button",{className:y,onClick:()=>{navigator.clipboard.writeText(e.message),ue(t),setTimeout((()=>ue(null)),2e3)},type:"button"},de===t?"Copied!":"Copy"),l.createElement("a",{className:"".concat(P," ").concat(e.cssClass),href:e.shareUrl,target:"_blank",rel:"noopener noreferrer"},"Share"))))))})()),l.createElement("section",{className:f},l.createElement("h3",{className:p},"Custom Link Generator"),l.createElement("p",{className:_},"Enter a HouseSit Match page URL to generate a tracked link with your affiliate ID."),l.createElement("div",{className:g},l.createElement("input",{className:E,type:"url",placeholder:"".concat(be,"/s"),value:X,onChange:e=>{J(e.target.value),ne("")}}),l.createElement("button",{className:N,onClick:()=>
1{if(X.trim()){try{const e=new URL(X.trim()),t=new URL(be);if(e.hostname!==t.hostname)return ne("Only ".concat(t.hostname," URLs are supported.")),void $("")}catch{return ne("Please enter a valid URL."),void $("")}ne(""),X.includes("ref=")?$(X):X.includes("?")?$("".concat(X,"&ref=").concat(Y)):$("".concat(X,"?ref=").concat(Y)),te(!1)}},type:"button"},"Generate")),le&&l.createElement("p",{className:h},le),Q&&l.createElement("div",{className:g,style:{marginTop:8}},l.createElement("input",{className:v,type:"text",readOnly:!0,value:Q}),l.createElement("button",{className:y,onClick:()=>ae(Q,te),type:"button"},ee?"Copied!":"Copy")),Q&&(()=>{const e='<a href="'.concat(Q,'" target="_blank" rel="noopener noreferrer">Visit HouseSit Match</a>');return l.createElement("div",{className:M},l.createElement("h4",{className:H},"Text Link HTML"),l.createElement("p",{className:_},"Copy this HTML to add a text link on your website."),l.createElement("div",{className:F},l.createElement("textarea",{className:z,readOnly:!0,value:e}),l.createElement("button",{className:y,onClick:()=>ae(e,me),type:"button"},ce?"Copied!":"Copy HTML")))})(),Q&&c.length>0&&l.createElement("div",{className:M},l.createElement("h4",{className:H},"Embed with a Creative"),l.createElement("p",{className:_},"Select a creative to generate an HTML snippet you can paste on your website."),l.createElement("select",{className:B,value:ie,onChange:e=>{re(e.target.value),oe(!1)}},l.createElement("option",{value:""},"\u2014 Choose a creative \u2014"),c.map((e=>l.createElement("option",{key:e.id,value:e.id},e.title," (",e.type,e.width_px?" \xb7 ".concat(e.width_px,"\xd7").concat(e.height_px):"",")")))),ie&&(()=>{const e=c.find((e=>String(e.id)===String(ie)));if(!e)return null;const t=e.html_template?e.html_template.replace(/\{ref\}/g,Y||"").replace(/\{\{REFERRAL_URL\}\}/g,Q):'<a href="'.concat(Q,'" target="_blank" rel="noopener noreferrer"><img src="').concat(e.file_url,'" alt="').concat(e.title,'" width="').concat(e.width_px||"auto",'" height="').concat(e.height_px||"auto",'" /></a>');return l.createElement("div",{className:F},e.file_url&&l.createElement("div",{className:G},l.createElement("img",{src:e.file_url,alt:e.title,className:O}),l.createElement("button",{type:"button",className:I,title:"Download creative",onClick:()=>W(e.file_url,e.title)},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},l.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),l.createElement("polyline",{points:"7 10 12 15 17 10"}),l.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"})),"Download")),l.createElement("textarea",{className:z,readOnly:!0,value:t}),l.createElement("button",{className:y,onClick:()=>ae(t,oe),type:"button"},se?"Copied!":"Copy HTML"))})())))}
1,K="AffiliateCreativesTab_root__jgFfP",Z="AffiliateCreativesTab_heading__MuU2z",q="AffiliateCreativesTab_filterBar__tpAJa",X="AffiliateCreativesTab_filterButton__TugOg",J="AffiliateCreativesTab_filterButtonActive__Vwqrj",Q="AffiliateCreativesTab_grid__pjqjM",$="AffiliateCreativesTab_card__R2Nk9",ee="AffiliateCreativesTab_thumbnailWrapper__R2m2t",te="AffiliateCreativesTab_thumbnail__sGG8L",ae="AffiliateCreativesTab_thumbnailPlaceholder__8kZGb",le="AffiliateCreativesTab_cardBody__DPin0",ne="AffiliateCreativesTab_cardTitleRow__j8+aE",ie="AffiliateCreativesTab_cardTitle__ZNOh5",re="AffiliateCreativesTab_cardDownloadBtn__HrO5H",se="AffiliateCreativesTab_typeBadge__Y1RuY",oe="AffiliateCreativesTab_cardMeta__LmqCN",ce="AffiliateCreativesTab_emptyMessage__uCB-5",me="AffiliateCreativesTab_modalOverlay__PciS3",de="AffiliateCreativesTab_modalBox__DoZLU",ue="AffiliateCreativesTab_closeButton__xAyzR",fe="AffiliateCreativesTab_modalTitle__Zez3z",pe="AffiliateCreativesTab_modalMeta__vIPos",_e="AffiliateCreativesTab_modalDescription__SlPYJ",he="AffiliateCreativesTab_downloadRow__ue6on",be="AffiliateCreativesTab_downloadLink__lhqyA",ge="AffiliateCreativesTab_downloadDisabled__WeEKG",ve="AffiliateCreativesTab_htmlSection__kxsSw",Ee="AffiliateCreativesTab_htmlLabel__ywHPd",ye="AffiliateCreativesTab_htmlTextarea__LUCd8",Ne="AffiliateCreativesTab_copyButton__ESBMW",Te=(e,t)=>{const a=e.split("?")[0].split(".").pop(),l=t?"".concat(t.replace(/[^a-z0-9]/gi,"_"),".").concat(a):"creative.".concat(a),n=(0,m.ny)(),i="".concat(n,"/api/affiliate/download-creative?url=").concat(encodeURIComponent(e),"&filename=").concat(encodeURIComponent(l));fetch(i,{credentials:"include"}).then((e=>{if(!e.ok)throw new Error(e.status);return e.blob()})).then((e=>{const t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download=l,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(t)})).catch((()=>window.open(e,"_blank")))},Ae=["All","Logo","Image","Video"],ke=e=>{if(!e)return"\u2014";const t=String(e).replace(" ","T").replace(/([^Z])$/,"$1Z"),a=new Date(t);return isNaN(a.getTime())?"\u2014":a.toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric"})},we=e=>{let{creatives:t=[],affiliateId:a}=e;const[n,i]=(0,l.useState)("All"),[r,s]=(0,l.useState)(null),[o,c]=(0,l.useState)(!1),m="All"===n?t:"Logo"===n?t.filter((e=>{var t;return"logo"===(null===(t=e.category)||void 0===t?void 0:t.toLowerCase())})):t.filter((e=>{var t;return(null===(t=e.type)||void 0===t?void 0:t.toLowerCase())===n.toLowerCase()})),d=e=>{c(!1),s(e)},u=()=>{s(null),c(!1)};return l.createElement("div",{className:K},l.createElement("h2",{className:Z},"Creatives"),l.createElement("div",{className:q},Ae.map((e=>l.createElement("button",{key:e,className:"".concat(X," ").concat(n===e?J:""),onClick:()=>i(e)},e)))),0===m.length?l.createElement("p",{className:ce},"No creatives found for this filter."):l.createElement("div",{className:Q},m.map((e=>l.createElement("div",{key:e.id,className:$,onClick:()=>d(e),role:"button",tabIndex:0,onKeyDown:t=>"Enter"===t.key&&d(e)},l.createElement("div",{className:ee},e.file_url?l.createElement("img",{src:e.file_url,alt:e.title,className:te}):l.createElement("div",{className:ae})),l.createElement("div",{className:le},l.createElement("div",{className:ne},l.createElement("p",{className:ie},e.title),e.file_url&&l.createElement("button",{type:"button",className:re,title:"Download",onClick:t=>{t.stopPropagation(),Te(e.file_url,e.title)}},l.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true"},l.createElement("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),l.createElement("polyline",{points:"7 10 12 15 17 10"}),l.createElement("line",{x1:"12",y1:"15",x2:"12",y2:"3"})))),l.createElement("span",{className:se},e.type),(e.width_px||e.height_px)&&l.createElement("p",{className:oe},e.width_px,"\xd7",e.height_px," px"),l.createElement("p",{className:oe},"Updated ",ke(e.updated_at))))))),r&&l.createElement("div",{className:me,onClick:u},l.createElement("div",{className:de,onClick:e=>e.stopPropagation()},l.createElement("button",{className:ue,onClick:u,"aria-label":"Close"},"\u2715"),l.createElement("h3",{className:fe},r.title),l.createElement("p",{className:pe},l.createElement("span",{className:se},r.type)," \xb7 Updated ",ke(r.updated_at)),r.description&&l.createElement("p",{className:_e}
1,r.description),(r.width_px||r.height_px)&&l.createElement("p",{className:pe},r.width_px,"\xd7",r.height_px," px",r.file_size_kb?" \xb7 ".concat(r.file_size_kb," KB"):""),"video"!==r.type&&l.createElement("div",{className:he},r.file_url?l.createElement("button",{type:"button",className:be,onClick:()=>Te(r.file_url,r.title)},"Download"):l.createElement("span",{className:ge},"Download (not available)")),l.createElement("div",{className:ve},l.createElement("h4",{className:Ee},"HTML Code"),l.createElement("textarea",{className:ye,readOnly:!0,value:r.html_template.replace("{ref}",null!==a&&void 0!==a?a:"")}),l.createElement("button",{className:Ne,onClick:()=>{return e=r.html_template.replace("{ref}",null!==a&&void 0!==a?a:""),void navigator.clipboard.writeText(e).then((()=>{c(!0),setTimeout((()=>c(!1)),2e3)}));var e}},o?"Copied!":"Copy Code")))))},Ce="PaginatedTable_root__ueHwP",Se="PaginatedTable_table__HX5A6",Pe="PaginatedTable_th__jEnqm",Ue="PaginatedTable_td__pHKAh",xe="PaginatedTable_rowEven__qF7SM",Le="PaginatedTable_rowOdd__n6JNB",Re="PaginatedTable_emptyCell__23Zuj",De="PaginatedTable_pagination__Krsdi",Me="PaginatedTable_pageButton__Yi+LT",He="PaginatedTable_pageLabel__b6d7C",Be=e=>{const{columns:t,rows:a,pageSize:n=25,emptyMessage:i="No records found.",totalPages:r,onPageChange:s}=e,[o,c]=(0,l.useState)(0),m="number"===typeof r,d=m?r:Math.max(1,Math.ceil(a.length/n)),u=Math.min(o,d-1),f=m?a:a.slice(u*n,u*n+n);return l.createElement("div",{className:Ce},l.createElement("table",{className:Se},l.createElement("thead",null,l.createElement("tr",null,t.map((e=>l.createElement("th",{key:e.key,className:Pe},e.label))))),l.createElement("tbody",null,0===a.length?l.createElement("tr",null,l.createElement("td",{className:Re,colSpan:t.length},i)):f.map(((e,a)=>l.createElement("tr",{key:a,className:a%2===0?xe:Le},t.map((t=>l.createElement("td",{key:t.key,className:Ue},t.render?t.render(e[t.key],e):e[t.key])))))))),a.length>0&&l.createElement("div",{className:De},l.createElement("button",{className:Me,onClick:()=>{const e=Math.max(0,u-1);c(e),m&&s&&s(e+1)},disabled:0===u,type:"button"},"Previous"),l.createElement("span",{className:He},"Page ",u+1," of ",d),l.createElement("button",{className:Me,onClick:()=>{const e=Math.min(d-1,u+1);c(e),m&&s&&s(e+1)},disabled:u>=d-1,type:"button"},"Next")))};Be.defaultProps={pageSize:25,emptyMessage:"No records found.",totalPages:null,onPageChange:null};const Fe=Be,Ge="AffiliateStatsTab_root__zkeOX",Ie="AffiliateStatsTab_cardRow__OjVMv",Oe="AffiliateStatsTab_card__AYrCl",je="AffiliateStatsTab_cardValue__QpGb6",ze="AffiliateStatsTab_cardLabel__+ysv5",Ve="AffiliateStatsTab_tableSection__sqwwh",We="AffiliateStatsTab_tableHeading__rNgEa",Ye=[{key:"campaign",label:"Campaign",render:e=>e||"Direct"},{key:"count",label:"Referrals"},{key:"earningsGbp",label:"Earnings",render:e=>"\xa3".concat(Number(e||0).toFixed(2))}],Ke=e=>{let{label:t,value:a}=e;return l.createElement("div",{className:Oe},l.createElement("span",{className:je},a),l.createElement("span",{className:ze},t))},Ze=e=>{let{stats:t}=e;const{unpaidReferrals:a=0,paidReferrals:n=0,totalVisits:i=0,convertedVisits:r=0,conversionRate:s=0,unpaidEarningsGbp:o=0,paidEarningsGbp:c=0,commissionRate:m=0,campaignBreakdown:d=[]}=t||{},u=Number(s||(i>0?r/i*100:0)).toFixed(2);return l.createElement("div",{className:Ge},l.createElement("div",{className:Ie},l.createElement(Ke,{label:"Unpaid Referrals",value:a}),l.createElement(Ke,{label:"Paid Referrals",value:n}),l.createElement(Ke,{label:"Visits",value:i}),l.createElement(Ke,{label:"Conversion %",value:"".concat(u,"%")})),l.createElement("div",{className:Ie},l.createElement(Ke,{label:"Unpaid Earnings",value:"\xa3".concat(Number(o).toFixed(2))}),l.createElement(Ke,{label:"Paid Earnings",value:"\xa3".concat(Number(c).toFixed(2))}),l.createElement(Ke,{label:"Commission Rate",value:"".concat(m,"%")})),l.createElement("div",{className:Ve},l.createElement("h3",{className:We},"Campaigns"),l.createElement(Fe,{columns:Ye,rows:d,pageSize:25,emptyMessage:"No campaign data yet."})))};Ze.defaultProps={stats:null};const qe=Ze;var Xe=a(19913),Je=a(75754),Qe=a(82839),$e=a(90466),et=a(12891),tt=a(71827),at=a(27281),lt=a(62066);const nt="AffiliateGraphsTab_root__twV6c",it="AffiliateGraphsTab_controls__bJA9B",rt="AffiliateGraphsTab_periodLabel__rgVxY",st="AffiliateGraphsTab_periodSelect__mKzrX",ot="AffiliateGraphsTab_emptyMessage__H1Bez",ct=[{value:"this_week",label:"This Week"},{value:"this_month",label:"This Month"},{value:"this_quarter",label:"This Quarter"},{value:"this_year",label:"This Year"}],mt=e=>{let{graphData:t,onPeriodChange:a}=e;const[n,i]=(0,l.useState)("this_month");return l.createElement("div",{className:nt},l.createElement("div",{className:it},l.createElement("label",{htmlFor:"period-select",className:rt},"Period:"),l.createElement("select",{id:"period-select",className:st,value:n,onChange:e=>(e=>{const t=e.target.value;i(t),a&&a(t)})(e)},ct.map((e=>l.createElement("option",{key:e.value,value:e.value},e.label))))),l.createElement(Xe.h,{width:"100%",height:300},l.createElement(Je.w,{data:t},l.createElement(Qe.q,{strokeDasharray:"3 3"}),l.createElement($e.K,{dataKey:"date"}),l.createElement(et.B,null),l.createElement(tt.u,null),l.createElement(at.D,null),l.createElement(lt.x,{dataKey:"unpaid",stroke:"#f0b429",name:"Unpaid",dot:!1}),l.createElement(lt.x,{dataKey:"pending",stroke:"#63b3ed",name:"Pending",dot:!1}),l.createElement(lt.x,{dataKey:"rejected",stroke:"#fc8181",name:"Rejected",dot:!1}),l.createElement(lt.x,{dataKey:"paid",stroke:"#68d391",name:"Paid",dot:!1}))),0===t.length&&l.createElement("p",{className:ot},"No earnings data for this period."))};mt.defaultProps={graphData:[],onPeriodChange:null};const dt=mt,ut="AffiliateReferralsTab_badge__109Xj",ft={unpaid:"AffiliateReferralsTab_badgeUnpaid__mvfRd",paid:"AffiliateReferralsTab_badgePaid__4D8px",rejected:"Aff
1iliateReferralsTab_badgeRejected__8HN05"},pt=[{key:"referred_user_name",label:"Referred User",render:(e,t)=>{const a=t.referred_user_name||"Unknown user",n=t.referred_user_email_masked;return l.createElement("div",null,l.createElement("div",null,a),n?l.createElement("div",{style:{fontSize:12,opacity:.75}},n):null)}},{key:"amount_gbp",label:"Commission (GBP)",render:e=>"\xa3".concat(Number(e||0).toFixed(2))},{key:"membership_type",label:"Membership"},{key:"status",label:"Status",render:e=>l.createElement("span",{className:"".concat(ut," ").concat(ft[e]||"")},e?e.charAt(0).toUpperCase()+e.slice(1):"")},{key:"reference",label:"Reference"},{key:"created_at",label:"Date",render:e=>(e=>{if(!e)return"";const t=new Date(e),a=String(t.getDate()).padStart(2,"0"),l=String(t.getMonth()+1).padStart(2,"0"),n=t.getFullYear();return"".concat(a,"/").concat(l,"/").concat(n)})(e)}],_t=e=>{let{referrals:t=[],totalPages:a,onPageChange:n}=e;return l.createElement("div",null,l.createElement("h2",null,"Referrals"),l.createElement(Fe,{columns:pt,rows:t,emptyMessage:"You have no referrals yet.",totalPages:a,onPageChange:n}))},ht="AffiliatePayoutsTab_badge__OGf1S",bt="AffiliatePayoutsTab_badgePaid__2Dng8",gt="AffiliatePayoutsTab_paypalSection__ZLWIs",vt="AffiliatePayoutsTab_paypalHeading__7eyZx",Et="AffiliatePayoutsTab_optionalBadge__NRhtP",yt="AffiliatePayoutsTab_paypalDescription__a8lD-",Nt="AffiliatePayoutsTab_paypalForm__aq0Q3",Tt="AffiliatePayoutsTab_paypalInput__+qHYq",At="AffiliatePayoutsTab_paypalInputError__iN+-1",kt="AffiliatePayoutsTab_fieldError__95V+T",wt="AffiliatePayoutsTab_paypalFooter__r98Qo",Ct="AffiliatePayoutsTab_saveButton__lxigf",St="AffiliatePayoutsTab_savedMessage__aDIyh",Pt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ut=[{key:"created_at",label:"Date",render:e=>(e=>{if(!e)return"";const t=new Date(e),a=String(t.getDate()).padStart(2,"0"),l=String(t.getMonth()+1).padStart(2,"0"),n=t.getFullYear();return"".concat(a,"/").concat(l,"/").concat(n)})(e)},{key:"amount_gbp",label:"Amount",render:e=>"\xa3".concat(Number(e||0).toFixed(2))},{key:"payout_method",label:"Method",render:e=>{return(t=e)?t.charAt(0).toUpperCase()+t.slice(1):"";var t}},{key:"status",label:"Status",render:()=>l.createElement("span",{className:"".concat(ht," ").concat(bt)},"Paid")}],xt=e=>{let{payouts:t=[],totalPages:a,onPageChange:n,affiliateProfile:i,onSaveSettings:r}=e;const[s,o]=(0,l.useState)((null===i||void 0===i?void 0:i.paypalEmail)||(null===i||void 0===i?void 0:i.paypal_email)||""),[c,m]=(0,l.useState)(!1),[d,u]=(0,l.useState)(!1),[f,p]=(0,l.useState)("");return l.createElement("div",null,l.createElement("h2",null,"Payouts"),l.createElement("section",{className:gt},l.createElement("h3",{className:vt},"PayPal Email ",l.createElement("span",{className:Et},"Optional")),l.createElement("p",{className:yt},"Provide your PayPal email address so we can send your commissions directly to you."),l.createElement("form",{onSubmit:e=>{e.preventDefault();const t=s.trim();!t||Pt.test(t)?(p(""),m(!0),Promise.resolve(r({paypalEmail:t||null})).finally((()=>{m(!1),u(!0),setTimeout((()=>u(!1)),2e3)}))):p("Please enter a valid email address.")},className:Nt},l.createElement("input",{type:"email",className:"".concat(Tt).concat(f?" ".concat(At):""),value:s,onChange:e=>{o(e.target.value),p("")},placeholder:"[email protected]","aria-label":"PayPal email address"}),f&&l.createElement("span",{className:kt},f),l.createElement("div",{className:wt},l.createElement("button",{type:"submit",className:Ct,disabled:c},c?"Saving\u2026":"Save"),d&&l.createElement("span",{className:St},"Saved!")))),l.createElement(Fe,{columns:Ut,rows:t,emptyMessage:"No payouts have been processed yet.",totalPages:a,onPageChange:n}))};xt.defaultProps={onSaveSettings:()=>Promise.resolve()};const Lt=xt,Rt=(e,t)=>e?e.length>t?e.slice(0,t)+"\u2026":e:"",Dt=e=>e?e.replace(/^https?:\/\//,""):"",Mt=e=>(e||"").replace(/^www\./i,""),Ht=(()=>{try{return Mt(new URL("https://housesitmatch.com").host)}catch(e){return""}})(),Bt=/\/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\/?$/i,Ft=[[/facebook\.com|fb\.com|fb\.me|fb\.watch/i,"Facebook"],[/instagram\.com/i,"Instagram"],[/t\.co|twitter\.com|\bx\.com/i,"X / Twitter"],[/linkedin\.com|lnkd\.in/i,"LinkedIn"],[/pinterest\.|pin\.it/i,"Pinterest"],[/wa\.me|whatsapp\.com/i,"WhatsApp"],[/google\./i,"Google"],[/youtube\.com|youtu\.be/i,"YouTube"],[/bing\.com/i,"Bing"],[/t\.me|telegram\./i,"Telegram"]],Gt=[{key:"destinationUrl",label:"Link",render:e=>e?l.createElement("span",{title:e},Rt((e=>{try{const t=new URL(e),a=t.pathname.replace(Bt,"");return t.host+("/"===a||""===a?"":a)}catch(t){return Dt(e).split("?")[0]}})(e),60)):"\u2014"},{key:"referringUrl",label:"Source",render:e=>{if(!e)return"Direct";let t="";try{t=new URL(e).host}catch(n){}if(t&&Ht&&Mt(t)===Ht)return"Direct";const a=Ft.find((a=>{let[l]=a;return l.test(t||e)}));return a?l.createElement("span",{title:e},a[1]):l.createElement("span",{title:e},Rt(Dt(e),40))}},{key:"converted",label:"Converted",render:e=>e?"\u2713":"\u2717"},{key:"createdAt",label:"Date",render:e=>(e=>{if(!e)return"";const t=new Date(e),a=String(t.getDate()).padStart(2,"0"),l=String(t.getMonth()+1).padStart(2,"0"),n=t.getFullYear(),i=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");return"".concat(a,"/").concat(l,"/").concat(n," ").concat(i,":").concat(r)})(e)}],It=e=>{let{visits:t=[],totalPages:a,onPageChange:n}=e;return l.createElement("div",null,l.createElement("h2",null,"Visits"),l.createElement(Fe,{columns:Gt,rows:t,emptyMessage:"No visit data recorded yet.",totalPages:a,onPageChange:n}))},Ot=(e,t)=>t>0?"".concat((e/t*100).toFixed(1),"%"):"\u2014",jt={flex:"1 1 140px",minWidth:140,padding:"16px 18px",border:"1px solid #e0e0e0",borderRadius:8,textAlign:"center"},zt=e=>{let{label:t,value:a,hint:n}=e;return l.createElement("div",{style:jt},l.createElement("div",{style:{fontSize:28,fontWeight:700,lineHeight:1.1}},a),l.createElement("div",{style:{marginTop:4}},t),n?l.createElement("div",{style:{fontSize:12,opacity:.7,marginTop:2}},n):null)},Vt=[{key:"displayName",label:"User",render:(e,t)=>l.createElement("div",null,l.createElement("div",null,e||"New member"),t.emailMasked?l.createElement("div",{style:{fontSize:12,opacity:.75}},t.emailMasked):null)},{key:"subscribed",label:"Status",render:e=>e?"\u2713 Subscribed":"Signed up"},{key:"membershipType",label:"Membership",render:e=>e||"\u2014"},{key:"createdAt",label:"Signed up",render:e=>(e=>{if(!e)return"";const t=new Date(e),a=String(t.getDate()).padStart(2,"0"),l=String(t.getMonth()+1).padStart(2,"0"),n=t.getFullYear();return"".concat(a,"/").concat(l,"/").concat(n)})(e)}],Wt=e=>{let{visits:t=0,funnel:a={},signups:n=[],totalPages:i,onPageChange:r}=e;const s=a.signups||0,o=a.subscribers||0;return l.createElement("div",null,l.createElement("h2",null,"Funnel"),l.createElement("p",{style:{opacity:.8,maxWidth:640}}
1,"How your traffic moves from clicks to paying members. A ",l.createElement("strong",null,"visit")," is a click on your link; a ",l.createElement("strong",null,"sign-up")," is someone who created an account; a"," ",l.createElement("strong",null,"subscriber")," has paid for membership \u2014 that's when you earn commission."),l.createElement("div",{style:{display:"flex",gap:16,flexWrap:"wrap",margin:"20px 0"}},l.createElement(zt,{label:"Visits",value:t}),l.createElement(zt,{label:"Sign-ups",value:s,hint:"".concat(Ot(s,t)," of visits")}),l.createElement(zt,{label:"Subscribers",value:o,hint:"".concat(Ot(o,s)," of sign-ups")})),l.createElement("h3",null,"Sign-ups"),l.createElement(Fe,{columns:Vt,rows:n,emptyMessage:"No sign-ups recorded yet.",totalPages:i,onPageChange:r}))};var Yt=a(55269),Kt=a(84480);const Zt="AffiliateSettingsTab_root__+CebP",qt="AffiliateSettingsTab_heading__45Cr6",Xt="AffiliateSettingsTab_form__1Zw9i",Jt="AffiliateSettingsTab_section__yATo3",Qt="AffiliateSettingsTab_sectionHeading__i7uQ5",$t="AffiliateSettingsTab_sectionDescription__ckiSQ",ea="AffiliateSettingsTab_checkboxLabel__z1bMw",ta="AffiliateSettingsTab_checkbox__UkfJ5",aa="AffiliateSettingsTab_footer__hK9FH",la="AffiliateSettingsTab_saveButton__Nx7Gs",na="AffiliateSettingsTab_savedMessage__4tsMm",ia=e=>{var t,a,n;const{currentUser:r,onSaveSettings:s}=e,[o,c]=(0,l.useState)(!1),m=(null===r||void 0===r||null===(t=r.attributes)||void 0===t||null===(a=t.profile)||void 0===a?void 0:a.protectedData)||{},d=m.affiliatePaymentEmail||(null===r||void 0===r||null===(n=r.attributes)||void 0===n?void 0:n.email)||"",u=void 0===m.affiliateNotificationsEnabled||m.affiliateNotificationsEnabled,f=Kt.C1("Email is required."),p=Kt.gX("Please enter a valid email address."),_=e=>f(e)||p(e);return l.createElement("div",{className:Zt},l.createElement("h2",{className:qt},"Settings"),l.createElement(Yt.l0,{onSubmit:e=>{const t={paymentEmail:e.paymentEmail,notificationsEnabled:!!e.notificationsEnabled};return Promise.resolve(s(t)).then((()=>{c(!0),setTimeout((()=>c(!1)),2e3)}))},initialValues:{paymentEmail:d,notificationsEnabled:u},render:e=>{let{handleSubmit:t,submitting:a}=e;return l.createElement("form",{onSubmit:t,className:Xt},l.createElement("section",{className:Jt},l.createElement("h3",{className:Qt},"Payment Email"),l.createElement("p",{className:$t},"Commission payouts will be sent to this email address."),l.createElement(i.gC,{id:"paymentEmail",name:"paymentEmail",type:"email",label:"Payment Email",placeholder:"[email protected]",validate:_})),l.createElement("section",{className:Jt},l.createElement("h3",{className:Qt},"Notifications"),l.createElement("label",{className:ea},l.createElement(Yt.gN,{name:"notificationsEnabled",type:"checkbox",render:e=>{let{input:t}=e;return l.createElement("input",Object.assign({},t,{type:"checkbox",className:ta}))}}),l.createElement("span",null,"Email me when a new referral is recorded"))),l.createElement("div",{className:aa},l.createElement("button",{type:"submit",className:la,disabled:a},"Save Settings"),o&&l.createElement("span",{className:na},"Saved!")))}}))};ia.defaultProps={onSaveSettings:()=>Promise.resolve()};const ra="AffiliateAreaPage_root__JA72W",sa="AffiliateAreaPage_content__RV3Yi",oa="AffiliateAreaPage_message__qnpyh",ca="AffiliateAreaPage_tabNav__oAtCy",ma="AffiliateAreaPage_tabContent__umOjc",da="AffiliateAreaPage_loading__aYU4c",ua="AffiliateAreaPage_error__BEcp1",fa=[{key:"urls",label:"Links"},{key:"creatives",label:"Creatives"},{key:"stats",label:"Statistics"},{key:"graphs",label:"Graphs"},{key:"referrals",label:"Referrals"},{key:"payouts",label:"Payouts"},{key:"visits",label:"Visits"},{key:"funnel",label:"Funnel"},{key:"settings",label:"Settings"}],pa={urls:Y,creatives:we,stats:qe,graphs:dt,referrals:_t,payouts:Lt,visits:It,funnel:Wt,settings:ia},_a=e=>{var t,a,n;const{currentUser:o,scrollingDisabled:c,affiliateState:m,onFetchAffiliateData:d,onFetchGraphData:u,onFetchReferrals:f,onFetchPayouts:p,onFetchVisits:_,onFetchSignups:h,onSaveSettings:b}=e,[g,v]=(0,l.useState)("urls"),E=null===o||void 0===o||null===(t=o.attributes)||void 0===t||null===(a=t.profile)||void 0===a||null===(n=a.protectedData)||void 0===n?void 0:n.affiliateStatus;(0,l.useEffect)((()=>{"active"===E&&d()}),[E]),(0,l.useEffect)((()=>{"active"===E&&("stats"===g?d():"graphs"===g?u("this_month"):"referrals"===g?f(1):"payouts"===g?p(1):"visits"===g?_(1):"funnel"===g&&h(1))}),[g,E]);return l.createElement(i.T3,{title:"Affiliate Area",scrollingDisabled:c},l.createElement(i.ip,{topbar:l.createElement(r.Z,null),footer:l.createElement(s.Z,null)},l.createElement("div",{className:ra},(()=>{if("active"===E){var e,t,a;const{affiliateProfile:n,stats:r,graphData:s,referrals:c,referralsTotalPages:d,payouts:E,payoutsTotalPages:y,visits:N,visitsTotalPages:T,signups:A,signupsTotalPages:k,signupsFunnel:w,
1creatives:C,loading:S,error:P}=m,U=pa[g],x=fa.map((e=>({text:e.label,selected:e.key===g,onClick:()=>v(e.key)}))),L=null===o||void 0===o||null===(e=o.attributes)||void 0===e||null===(t=e.profile)||void 0===t||null===(a=t.protectedData)||void 0===a?void 0:a.affiliateId,R="settings"===g?{onSaveSettings:b}:"stats"===g?{stats:r}:"graphs"===g?{graphData:s,onPeriodChange:u}:"referrals"===g?{referrals:c,totalPages:d,onPageChange:f}:"payouts"===g?{payouts:E,totalPages:y,onPageChange:p,affiliateProfile:n,onSaveSettings:b}:"visits"===g?{visits:N,totalPages:T,onPageChange:_}:"funnel"===g?{visits:(null===r||void 0===r?void 0:r.totalVisits)||0,funnel:w,signups:A,totalPages:k,onPageChange:h}:"creatives"===g||"urls"===g?{creatives:C,affiliateId:L}:{};return l.createElement("div",{className:sa},l.createElement(i.Q7,{className:ca,tabs:x}),l.createElement("div",{className:ma},S&&l.createElement("p",{className:da},"Loading\u2026"),!S&&P&&l.createElement("p",{className:ua},"Data temporarily unavailable. Please try again later."),l.createElement(U,Object.assign({currentUser:o},R))))}return"pending"===E?l.createElement("div",{className:sa},l.createElement("p",{className:oa},"Your application is under review.")):"rejected"===E?l.createElement("div",{className:sa},l.createElement("p",{className:oa},"Your application was not approved.")):l.createElement(i.d9,{name:"BecomeAffiliatePage"})})())))},ha=(0,n.$j)((e=>{const{currentUser:t}=e.user;return{currentUser:t,scrollingDisabled:(0,o.uS)(e),affiliateState:e.AffiliateAreaPage}}),(e=>({onFetchAffiliateData:()=>e((0,c.Ii)()),onFetchGraphData:t=>e((0,c.to)(t)),onFetchReferrals:t=>e((0,c.CP)(t)),onFetchPayouts:t=>e((0,c.S4)(t)),onFetchVisits:t=>e((0,c.zv)(t)),onFetchSignups:t=>e((0,c.eh)(t)),onSaveSettings:t=>e((0,c.zQ)(t))})))(_a)}}]); 2//# sourceMappingURL=AffiliateAreaPage.123ec260.chunk.js.map
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.