@saasquatch/mint-components 1.15.0-31 → 1.15.0-33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/dist/cjs/{ShadowViewAddon-850d768a.js → ShadowViewAddon-36b3007d.js} +29 -1
  2. package/dist/cjs/{global-6bd8c303.js → global-a2cfa133.js} +15 -1
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/mint-components.cjs.js +2 -2
  5. package/dist/cjs/sqm-banking-info-form_17.cjs.entry.js +2 -2
  6. package/dist/cjs/sqm-big-stat_41.cjs.entry.js +2 -2
  7. package/dist/cjs/sqm-email-verification.cjs.entry.js +1 -1
  8. package/dist/cjs/sqm-empty_4.cjs.entry.js +1 -1
  9. package/dist/cjs/{sqm-invoice-table-view-3bb179ee.js → sqm-invoice-table-view-08b22533.js} +1 -1
  10. package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
  11. package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
  12. package/dist/cjs/{sqm-portal-email-verification-view-6f299c4e.js → sqm-portal-email-verification-view-69f323b5.js} +1 -1
  13. package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
  14. package/dist/cjs/{sqm-portal-profile-view-900e7869.js → sqm-portal-profile-view-c83d82d6.js} +1 -1
  15. package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
  16. package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
  17. package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
  18. package/dist/cjs/sqm-stencilbook.cjs.entry.js +5 -5
  19. package/dist/collection/components/sqm-checkbox-field/sqm-checkbox-field.js +1 -0
  20. package/dist/collection/components/sqm-name-fields/sqm-name-fields-view.js +28 -0
  21. package/dist/collection/components/sqm-name-fields/sqm-name-fields.js +1 -0
  22. package/dist/collection/global/styles.js +15 -1
  23. package/dist/collection/global/styles.ts +15 -1
  24. package/dist/esm/{ShadowViewAddon-54fb4dd4.js → ShadowViewAddon-ed27f570.js} +29 -1
  25. package/dist/esm/{global-744bbb0d.js → global-4d92a41a.js} +15 -1
  26. package/dist/esm/loader.js +2 -2
  27. package/dist/esm/mint-components.js +2 -2
  28. package/dist/esm/sqm-banking-info-form_17.entry.js +2 -2
  29. package/dist/esm/sqm-big-stat_41.entry.js +2 -2
  30. package/dist/esm/sqm-email-verification.entry.js +1 -1
  31. package/dist/esm/sqm-empty_4.entry.js +1 -1
  32. package/dist/esm/{sqm-invoice-table-view-3497b375.js → sqm-invoice-table-view-4cd94e6b.js} +1 -1
  33. package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
  34. package/dist/esm/sqm-pagination_3.entry.js +1 -1
  35. package/dist/esm/{sqm-portal-email-verification-view-944b1660.js → sqm-portal-email-verification-view-34106b04.js} +1 -1
  36. package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
  37. package/dist/esm/{sqm-portal-profile-view-a34f266f.js → sqm-portal-profile-view-6bab8844.js} +1 -1
  38. package/dist/esm/sqm-portal-profile.entry.js +2 -2
  39. package/dist/esm/sqm-referral-table_11.entry.js +1 -1
  40. package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
  41. package/dist/esm/sqm-stencilbook.entry.js +5 -5
  42. package/dist/esm-es5/{ShadowViewAddon-54fb4dd4.js → ShadowViewAddon-ed27f570.js} +1 -1
  43. package/dist/esm-es5/{global-744bbb0d.js → global-4d92a41a.js} +1 -1
  44. package/dist/esm-es5/loader.js +1 -1
  45. package/dist/esm-es5/mint-components.js +1 -1
  46. package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
  47. package/dist/esm-es5/sqm-big-stat_41.entry.js +1 -1
  48. package/dist/esm-es5/sqm-email-verification.entry.js +1 -1
  49. package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
  50. package/dist/esm-es5/{sqm-invoice-table-view-3497b375.js → sqm-invoice-table-view-4cd94e6b.js} +1 -1
  51. package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
  52. package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
  53. package/dist/esm-es5/{sqm-portal-email-verification-view-944b1660.js → sqm-portal-email-verification-view-34106b04.js} +1 -1
  54. package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
  55. package/dist/esm-es5/{sqm-portal-profile-view-a34f266f.js → sqm-portal-profile-view-6bab8844.js} +1 -1
  56. package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
  57. package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
  58. package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
  59. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  60. package/dist/mint-components/global/styles.ts +15 -1
  61. package/dist/mint-components/mint-components.esm.js +1 -1
  62. package/dist/mint-components/mint-components.js +1 -1
  63. package/dist/mint-components/{p-ab9b6c78.system.entry.js → p-02adda97.system.entry.js} +1 -1
  64. package/dist/mint-components/{p-c8e7cf1a.system.js → p-034448e1.system.js} +1 -1
  65. package/dist/mint-components/{p-e3838694.system.js → p-0b298c02.system.js} +1 -1
  66. package/dist/mint-components/{p-2ea8a5dc.entry.js → p-1f2c1456.entry.js} +1 -1
  67. package/dist/mint-components/{p-d1d6960a.entry.js → p-1f46f9ed.entry.js} +1 -1
  68. package/dist/mint-components/{p-085bd196.system.entry.js → p-200b02d9.system.entry.js} +1 -1
  69. package/dist/mint-components/{p-d818c955.system.js → p-2621a795.system.js} +1 -1
  70. package/dist/mint-components/{p-0e55bac8.system.entry.js → p-428c26c2.system.entry.js} +1 -1
  71. package/dist/mint-components/{p-4f401683.js → p-5597ce59.js} +1 -1
  72. package/dist/mint-components/{p-92244c9a.entry.js → p-654a83ba.entry.js} +2 -2
  73. package/dist/mint-components/{p-e6ab5916.entry.js → p-6765acfd.entry.js} +1 -1
  74. package/dist/mint-components/{p-2b390d4c.entry.js → p-67da6496.entry.js} +1 -1
  75. package/dist/mint-components/{p-3a5875ff.system.entry.js → p-6d111648.system.entry.js} +1 -1
  76. package/dist/mint-components/p-6dc3de15.entry.js +33 -0
  77. package/dist/mint-components/{p-0fa24b5a.system.entry.js → p-6e010b7f.system.entry.js} +1 -1
  78. package/dist/mint-components/{p-f7f52384.system.entry.js → p-7b4323c2.system.entry.js} +1 -1
  79. package/dist/mint-components/{p-a5c6e3fc.entry.js → p-8209404e.entry.js} +1 -1
  80. package/dist/mint-components/{p-e6ef912f.system.entry.js → p-8295c9ac.system.entry.js} +1 -1
  81. package/dist/mint-components/{p-a84980fa.system.js → p-987af1e2.system.js} +1 -1
  82. package/dist/mint-components/{p-9f448767.system.entry.js → p-9cfe2ebb.system.entry.js} +1 -1
  83. package/dist/mint-components/{p-cbc6ab97.entry.js → p-a51bbdbe.entry.js} +1 -1
  84. package/dist/mint-components/{p-597c7fd9.entry.js → p-b58c87a6.entry.js} +1 -1
  85. package/dist/mint-components/{p-fd1cf704.js → p-c9231d78.js} +1 -1
  86. package/dist/mint-components/{p-9ed0682d.entry.js → p-ce06d019.entry.js} +1 -1
  87. package/dist/mint-components/{p-5d306985.system.entry.js → p-d43393f3.system.entry.js} +1 -1
  88. package/dist/mint-components/{p-b8eb84a6.entry.js → p-d4c43c57.entry.js} +1 -1
  89. package/dist/mint-components/{p-3152a30b.js → p-d8e5e40d.js} +1 -1
  90. package/dist/mint-components/{p-a531df5e.js → p-dc97f30c.js} +4 -4
  91. package/dist/mint-components/{p-ada29080.system.js → p-de782092.system.js} +1 -1
  92. package/dist/mint-components/{p-da363f6a.js → p-e697e80d.js} +1 -1
  93. package/dist/mint-components/{p-da09b40f.system.entry.js → p-eca3ad37.system.entry.js} +1 -1
  94. package/dist/mint-components/{p-cafb4671.system.js → p-f6086fff.system.js} +1 -1
  95. package/dist/mint-components/{p-d6f9ba8b.system.entry.js → p-fe20a986.system.entry.js} +1 -1
  96. package/dist/types/global/styles.d.ts +1 -1
  97. package/docs/docs.docx +0 -0
  98. package/package.json +1 -1
  99. package/dist/mint-components/p-1dbeeea9.entry.js +0 -33
@@ -1,4 +1,4 @@
1
- import{h as t,F as e,r as a}from"./p-f708da7b.js";import{n as s,k as n}from"./p-cd651f81.js";import{i as o}from"./p-4f401683.js";import{F as r,i,d as l,H as c,J as d,w as u,$ as p,B as m}from"./p-94a876b9.js";import{c as g}from"./p-c1086930.js";import{g as f}from"./p-9ec99ced.js";import{c as h}from"./p-cef45012.js";import{R as v,a as y,S as x,u as b}from"./p-3f7b81b8.js";import"./p-49b20dae.js";import{C}from"./p-10586a3f.js";const T=h({Container:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"var(--sl-spacing-small)",width:"100%"},TextContainer:{display:"flex",gap:"var(--sl-spacing-xx-small)"}}),P=T.toString();function j(a){const{states:s,callbacks:n,text:o}=a,{onNext:r,onPrev:i}=n,{currentPage:l,totalPages:c,loading:d}=s;return 1===c?t(e,null):t("span",{class:T.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},P),!d&&t(e,null,t("sl-button",{exportparts:`base: ${"primary"===a.buttonType?"primary":"secondary"}button-base`,onClick:i,part:"sqm-pagination-button",circle:!0,disabled:1===l},t("sl-icon",{name:"chevron-left",label:"Previous Page"})),t("div",{class:T.classes.TextContainer},o.paginationText)),t("sl-button",{exportparts:`base: ${"primary"===a.buttonType?"primary":"secondary"}button-base`,onClick:r,part:"sqm-pagination-button",circle:!0,disabled:l===c},t("sl-icon",{name:"chevron-right",label:"Previous Page"})))}const k=class{constructor(t){a(this,t),this.ignored=!0,this.paginationText="{currentPage} of {totalPages}",this.buttonType="secondary",s(this)}disconnectedCallback(){}render(){const e=i()?function(t){const[e,a]=n(1);return g({states:{currentPage:e,totalPages:5,loading:!1},buttonType:t.buttonType,callbacks:{onNext:()=>a(e+1),onPrev:()=>a(e-1)},text:{paginationText:o.formatMessage({id:"paginationText",defaultMessage:t.paginationText||"{currentPage} of {totalPages}"},{currentPage:e,totalPages:5})}},t.demoData||{},{arrayMerge:(t,e)=>e})}(f(this)):function(t){var e;const a=r(v),s=a.states.currentPage+1,n=null===(e=a.states)||void 0===e?void 0:e.pageCount;return{states:{currentPage:s,totalPages:n,loading:a.states.loading},callbacks:{onNext:()=>{var t,e;return null===(t=a.callbacks)||void 0===t?void 0:t.setCurrentPage((null===(e=a.states)||void 0===e?void 0:e.currentPage)+1)},onPrev:()=>{var t,e;return null===(t=a.callbacks)||void 0===t?void 0:t.setCurrentPage((null===(e=a.states)||void 0===e?void 0:e.currentPage)-1)}},text:{paginationText:o.formatMessage({id:"paginationText",defaultMessage:t.paginationText},{currentPage:s,totalPages:n})}}}(f(this));return t(j,Object.assign({},e))}},E=l.gql`
1
+ import{h as t,F as e,r as a}from"./p-f708da7b.js";import{n as s,k as n}from"./p-cd651f81.js";import{i as o}from"./p-5597ce59.js";import{F as r,i,d as l,H as c,J as d,w as u,$ as p,B as m}from"./p-94a876b9.js";import{c as g}from"./p-c1086930.js";import{g as f}from"./p-9ec99ced.js";import{c as h}from"./p-cef45012.js";import{R as v,a as y,S as x,u as b}from"./p-3f7b81b8.js";import"./p-49b20dae.js";import{C}from"./p-10586a3f.js";const T=h({Container:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:"var(--sl-spacing-small)",width:"100%"},TextContainer:{display:"flex",gap:"var(--sl-spacing-xx-small)"}}),P=T.toString();function j(a){const{states:s,callbacks:n,text:o}=a,{onNext:r,onPrev:i}=n,{currentPage:l,totalPages:c,loading:d}=s;return 1===c?t(e,null):t("span",{class:T.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},P),!d&&t(e,null,t("sl-button",{exportparts:`base: ${"primary"===a.buttonType?"primary":"secondary"}button-base`,onClick:i,part:"sqm-pagination-button",circle:!0,disabled:1===l},t("sl-icon",{name:"chevron-left",label:"Previous Page"})),t("div",{class:T.classes.TextContainer},o.paginationText)),t("sl-button",{exportparts:`base: ${"primary"===a.buttonType?"primary":"secondary"}button-base`,onClick:r,part:"sqm-pagination-button",circle:!0,disabled:l===c},t("sl-icon",{name:"chevron-right",label:"Previous Page"})))}const k=class{constructor(t){a(this,t),this.ignored=!0,this.paginationText="{currentPage} of {totalPages}",this.buttonType="secondary",s(this)}disconnectedCallback(){}render(){const e=i()?function(t){const[e,a]=n(1);return g({states:{currentPage:e,totalPages:5,loading:!1},buttonType:t.buttonType,callbacks:{onNext:()=>a(e+1),onPrev:()=>a(e-1)},text:{paginationText:o.formatMessage({id:"paginationText",defaultMessage:t.paginationText||"{currentPage} of {totalPages}"},{currentPage:e,totalPages:5})}},t.demoData||{},{arrayMerge:(t,e)=>e})}(f(this)):function(t){var e;const a=r(v),s=a.states.currentPage+1,n=null===(e=a.states)||void 0===e?void 0:e.pageCount;return{states:{currentPage:s,totalPages:n,loading:a.states.loading},callbacks:{onNext:()=>{var t,e;return null===(t=a.callbacks)||void 0===t?void 0:t.setCurrentPage((null===(e=a.states)||void 0===e?void 0:e.currentPage)+1)},onPrev:()=>{var t,e;return null===(t=a.callbacks)||void 0===t?void 0:t.setCurrentPage((null===(e=a.states)||void 0===e?void 0:e.currentPage)-1)}},text:{paginationText:o.formatMessage({id:"paginationText",defaultMessage:t.paginationText},{currentPage:s,totalPages:n})}}}(f(this));return t(j,Object.assign({},e))}},E=l.gql`
2
2
  query getReferralCode($programId: ID) {
3
3
  user: viewer {
4
4
  ... on User {
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{o(n.next(e))}catch(e){i(e)}}function l(e){try{o(n["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):a(e.value).then(s,l)}o((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return o([e,t])}}function o(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,l=i.length;s<l;s++,a++)n[a]=i[s];return n};System.register(["./p-f26aedcd.system.js","./p-48135f99.system.js","./p-e3838694.system.js","./p-6cd4f2b1.system.js","./p-4bd679a7.system.js","./p-6333265f.system.js","./p-1a673057.system.js","./p-8a6494c7.system.js","./p-ffaaec76.system.js","./p-5488fdd9.system.js","./p-6b7a595f.system.js","./p-6d9e52c7.system.js","./p-8413ade9.system.js","./p-59274a91.system.js","./p-74afdafb.system.js"],(function(e){"use strict";var t,r,n,a,i,s,l,o,d,u,c,f,v,p,h,E,m,_,T,N,g,D;return{setters:[function(e){t=e.r;r=e.h;n=e.g;a=e.c},function(e){i=e.n;s=e.j;l=e.u;o=e.f},function(e){d=e.i},function(e){u=e.i},function(e){c=e.c},function(e){f=e.l},function(e){v=e.c},function(){},function(e){p=e.G},function(e){h=e.a;E=e.u},function(e){m=e.u},function(e){_=e.l},function(e){T=e.g},function(e){N=e.u;g=e.t},function(e){D=e.T}],execute:function(){var y=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return x()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var P=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var A=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var I=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var x=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:A[Math.floor(Math.random()*A.length)],lastName:I[Math.floor(Math.random()*I.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?_.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:_.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(Math.random()*10)>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:P[Math.floor(Math.random()*P.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},T()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:P[Math.floor(Math.random()*P.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:P[Math.floor(Math.random()*P.length)],type:"CREDIT",value:1},depth:1}]}}};var R=e("sqm_referral_table",function(){function e(e){t(this,e);this.perPage=4;this.hideLabels=false;this.prevLabel="Prev";this.moreLabel="Next";this.showReferrer=false;this.hiddenColumns="0";this.smBreakpoint=599;this.mdBreakpoint=799;i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=r(b,null);var t=r(w,null);var n=u()?S(this,e,t):N(this,e,t),a=n.states,i=n.data,s=n.callbacks,l=n.elements;h([this.showReferrer,this.perPage]);return r(p,{states:a,data:i,callbacks:s,elements:l})};return e}());function b(){return r("slot",{name:"empty"},r("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function w(){return r("slot",{name:"loading"},r(C,null),r(C,null),r(C,null),r(C,null))}function C(){return r("sqm-table-row",null,r("sqm-table-cell",{colspan:5},r("sl-skeleton",null)))}function S(e,t,r){var n=s((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),a=n[0],i=n[1];var d=E();var u=l((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||y(e.perPage)}),[e.perPage]);var f=m();function v(t){return __awaiter(this,void 0,void 0,(function(){var r,n,a,s,l,o,d,c,f,v,p,h,E,m;var _=this;return __generator(this,(function(T){switch(T.label){case 0:a=u===null||u===void 0?void 0:u.referredByReferral;s=e.showReferrer&&!!((r=u===null||u===void 0?void 0:u.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(s){n=u.data.slice(0,e.perPage-1)}else{n=u.data.slice(0,e.perPage)}l=t.filter((function(e){var t,r;return e.slot!=="loading"&&e.slot!=="empty"&&((t=e===null||e===void 0?void 0:e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("slot"))!=="loading"&&((r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot"))!=="empty"}));o=l===null||l===void 0?void 0:l.map((function(e,t){return __awaiter(_,void 0,void 0,(function(){var r,n,a;return __generator(this,(function(i){n=(r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot");if(e.tagName==="RAISINS-PLOP-TARGET"&&n!=="loading"&&n!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";a=e.firstElementChild.childNodes[1];a.innerHTML="+";a.style.lineHeight="20px";return[2,g(e,(function(){return e.renderLabel(t)}))]}return[2,g(e,(function(){return e.renderLabel()}))]}))}))}));if(!s)return[3,2];c=l===null||l===void 0?void 0:l.map((function(e){return __awaiter(_,void 0,void 0,(function(){return __generator(this,(function(t){return[2,g(e,(function t(){return e.renderCell(a,e)}))]}))}))}));return[4,Promise.all(c)];case 1:d=T.sent();T.label=2;case 2:f=n===null||n===void 0?void 0:n.map((function(e){return __awaiter(_,void 0,void 0,(function(){var t,r;var n=this;return __generator(this,(function(a){switch(a.label){case 0:t=l===null||l===void 0?void 0:l.map((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(r){return[2,g(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=a.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];h=[[d]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,h.concat([T.sent()])).filter((function(e){return e}));T.label=4;case 4:v=p;i({rows:v});m=o;if(!m)return[3,6];return[4,Promise.all(o)];case 5:m=T.sent();T.label=6;case 6:E=m;i({columns:E,loading:false,page:0});return[2]}}))}))}o((function(){i({loading:true});(u===null||u===void 0?void 0:u.data)&&v(f)}),[u===null||u===void 0?void 0:u.data,f,d]);var p=c({states:{hasPrev:false,hasNext:false,loading:false,show:"rows"},callbacks:{prevPage:function(){return console.log("Prev")},nextPage:function(){return console.log("Next")}},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:a.columns,rows:a.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return p}var L=e("sqm_referral_table_cell",function(){function e(e){t(this,e);this.ignored=true;i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return r("div",{innerHTML:this.innerTemplate})};return e}());var M=e("sqm_referral_table_column",function(){function e(e){t(this,e);i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,r("sqm-referral-table-cell",{"inner-template":n(this).innerHTML})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,Promise.resolve(this.columnTitle)]}))}))};e.prototype.render=function(){h([this.columnTitle]);return r(a,{style:{display:"none"}},r("slot",null))};return e}());var O=e("sqm_referral_table_date_cell",function(){function e(e){t(this,e);this.ignored=true;this.locale="en";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=_.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(f(this.locale)).toLocaleString(_.DateTime.DATE_MED);return t};return e}());var U=e("sqm_referral_table_date_column",function(){function e(e){t(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,r("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){h([this.dateShown,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}());var G=e("sqm_referral_table_rewards_cell",function(){function e(e){t(this,e);this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward approved for payout and was scheduled for payment based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.locale="en"}e.prototype.render=function(){var e=this;var t;d.locale=this.locale;var n={"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:""+(this.hideDetails?"default":"pointer")},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{opacity:"1"},"&::part(summary-icon)":{display:""+(this.hideDetails?"none":"flex")},"&::part(summary-icon[open])":{transform:"rotate(-90deg)",background:"red"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},StatusBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line"}},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{background:"var(--sl-color-blue-600)"}}};var a=v(n);var i=a.toString();var s=function(e,t){var r,n,a,i,s,l,o,d,u,c,f,v;var p=["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION"];if(((n=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||n===void 0?void 0:n.moderationStatus)!=="APPROVED"){if(((i=(a=e.referral)===null||a===void 0?void 0:a.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((l=(s=e.referral)===null||s===void 0?void 0:s.fraudData)===null||l===void 0?void 0:l.moderationStatus)==="DENIED")return"DENIED"}var h=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(h==="NOT_YET_DUE"||h==="TRANSFERRED"){return"PAYOUT_APPROVED"}else if(h==="OVERDUE")return"PAYOUT_FAILED";else if(h==="REVERSED")return"PAYOUT_CANCELLED";if((d=e===null||e===void 0?void 0:e.pendingReasons)===null||d===void 0?void 0:d.includes("US_TAX")){if(!(t===null||t===void 0?void 0:t.taxHandlingEnabled))return"PENDING";if(!(t===null||t===void 0?void 0:t.connected))return"PENDING_PARTNER_CREATION";if((u=t===null||t===void 0?void 0:t.publisher)===null||u===void 0?void 0:u.requiredTaxDocumentType){if(!((c=t===null||t===void 0?void 0:t.publisher)===null||c===void 0?void 0:c.currentTaxDocument))return"PENDING_TAX_SUBMISSION";var E=t.publisher.currentTaxDocument.status;if(E==="INACTIVE")return"PENDING_NEW_TAX_FORM";if(E==="NOT_VERIFIED")return"PENDING_TAX_REVIEW"}if(!((f=t===null||t===void 0?void 0:t.publisher)===null||f===void 0?void 0:f.withdrawalSettings))return"PENDING_PARTNER_CREATION"}if((v=e===null||e===void 0?void 0:e.pendingReasons)===null||v===void 0?void 0:v.includes("PAYOUT_CONFIGURATION_MISSING")){return"PENDING_PARTNER_CREATION"}if(e.statuses.length===1)return e.statuses[0];return p.find((function(t){return e.statuses.includes(t)&&t}))};var l=function(e){switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":return"warning";case"AVAILABLE":return"success"}};var o=function(t){return _.DateTime.fromMillis(t).setLocale(f(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var n,u;var c=s(t,e.taxConnection);var v=l(c);var p=d.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:c});var h=d.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:c});return r("sl-details",{class:a.classes.Details,disabled:e.hideDetails},r("style",{type:"text/css"},i),r("div",{slot:"summary",class:a.classes.DetailsContainer},r(D,{type:"p"},r("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),r("div",{class:a.classes.BadgeContainer},c==="PENDING"&&t.dateScheduledFor?r("sl-badge",{class:v==="primary"?a.classes.RedeemBadge:a.classes.StatusBadge,type:v,pill:true},d.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:p,date:o(t.dateScheduledFor)})):r("sl-badge",{class:v==="primary"?a.classes.RedeemBadge:a.classes.StatusBadge,type:v,pill:true},p),t.dateExpires&&c==="AVAILABLE"&&r("sl-badge",{class:v==="primary"?a.classes.RedeemBadge:a.classes.StatusBadge,type:"info",pill:true},e.expiringText," "+o(t.dateExpires)))),r("div",null,c==="PENDING_REVIEW"&&((n=t.referral)===null||n===void 0?void 0:n.dateModerated)&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="PAYOUT_APPROVED"&&r("div",null,r(D,{type:"p"},h)),c==="PAYOUT_FAILED"&&r("div",null,r(D,{type:"p"},h)),c==="PAYOUT_CANCELLED"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_TAX_REVIEW"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_NEW_TAX_FORM"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_TAX_SUBMISSION"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_PARTNER_CREATION"&&r("div",null,r(D,{type:"p"},h)),c==="DENIED"&&((u=t.referral)===null||u===void 0?void 0:u.dateModerated)&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&r("div",null,r(D,{type:"p"},e.rewardReceivedText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateGiven).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="EXPIRED"&&t.dateExpires&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="CANCELLED"&&t.dateCancelled&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateCancelled).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="PENDING"&&t.dateScheduledFor&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateScheduledFor).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED))))," ",c==="AVAILABLE"&&t.dateExpires&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),t.fuelTankCode&&r("div",null,e.fuelTankText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}());var B=e("sqm_referral_table_rewards_column",function(){function e(e){t(this,e);this.columnTitle="Rewards";this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward approved for payout and was scheduled for payment based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.fuelTankText="Your code is";this.rewardReceivedText="Reward received on";this.expiringText="Expiring in";this.pendingForText="{status} for {date}";this.deniedHelpText="Contact support if you think this is a mistake.";this.hideDetails=false;i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:t===null||t===void 0?void 0:t.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:t===null||t===void 0?void 0:t.locale,exportparts:"sqm-cell-value"})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,r("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return r(a,{style:{display:"none"}})};return e}());var k={Badge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",whiteSpace:"pre-line"}},SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)",margin:"0"}};var V=v(k);var q=V.toString();var F=e("sqm_referral_table_status_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){var e=this;var t=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};return r("div",null,r("style",{type:"text/css"},q),r("sl-badge",{pill:true,type:t(this.fraudStatus),class:V.classes.Badge},this.statusText),this.statusSubText?r("p",{class:V.classes.SubText},this.statusSubText):null)};return e}());var X=e("sqm_referral_table_status_column",function(){function e(e){t(this,e);this.columnTitle="Status";this.convertedStatusText="Converted";this.inProgressStatusText="In Progress";this.pendingReviewStatusText="Pending";this.deniedStatusText="Denied";this.pendingReviewStatusSubText="Awaiting review";this.deniedStatusSubText="Detected self-referral";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i;return __generator(this,(function(s){i=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(i==="DENIED"){n=this.deniedStatusText;a=this.deniedStatusSubText}else if(i==="PENDING"){n=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{n=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,r("sqm-referral-table-status-cell",{"status-text":n,"status-sub-text":a,"fraud-status":i,converted:e.dateConverted?true:false})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,r("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return r(a,{style:{display:"none"}})};return e}());var Y=e("sqm_referral_table_user_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){return this.name};return e}());var W=e("sqm_referral_table_user_column",function(){function e(e){t(this,e);this.columnTitle="Customer";this.anonymousUser="Anonymous User";this.deletedUser="Deleted User";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i,s,l,o,d,u;return __generator(this,(function(c){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){u=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((n=e===null||e===void 0?void 0:e.referredUser)===null||n===void 0?void 0:n.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)){u=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){u=((s=e===null||e===void 0?void 0:e.referrerUser)===null||s===void 0?void 0:s.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{u=((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.firstName)+" "+((d=e===null||e===void 0?void 0:e.referredUser)===null||d===void 0?void 0:d.lastName)}return[2,r("sqm-referral-table-user-cell",{name:u})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i,s;return __generator(this,(function(l){if(!e){s=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((n=e.referrerUser)===null||n===void 0?void 0:n.lastName)){s=this.anonymousUser}else{s=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)}return[2,r("sqm-referral-table-user-cell",{name:s})]}))}))};e.prototype.render=function(){h([this.deletedUser,this.anonymousUser,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}())}}}));
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))e[a]=t[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function s(e){try{o(n.next(e))}catch(e){i(e)}}function l(e){try{o(n["throw"](e))}catch(e){i(e)}}function o(e){e.done?r(e.value):a(e.value).then(s,l)}o((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return o([e,t])}}function o(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,a&&(i=s[0]&2?a["return"]:s[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;if(a=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),a=0,t=0;t<r;t++)for(var i=arguments[t],s=0,l=i.length;s<l;s++,a++)n[a]=i[s];return n};System.register(["./p-f26aedcd.system.js","./p-48135f99.system.js","./p-0b298c02.system.js","./p-6cd4f2b1.system.js","./p-4bd679a7.system.js","./p-6333265f.system.js","./p-1a673057.system.js","./p-8a6494c7.system.js","./p-ffaaec76.system.js","./p-5488fdd9.system.js","./p-6b7a595f.system.js","./p-6d9e52c7.system.js","./p-8413ade9.system.js","./p-59274a91.system.js","./p-74afdafb.system.js"],(function(e){"use strict";var t,r,n,a,i,s,l,o,d,u,c,f,v,p,h,E,m,_,T,N,g,D;return{setters:[function(e){t=e.r;r=e.h;n=e.g;a=e.c},function(e){i=e.n;s=e.j;l=e.u;o=e.f},function(e){d=e.i},function(e){u=e.i},function(e){c=e.c},function(e){f=e.l},function(e){v=e.c},function(){},function(e){p=e.G},function(e){h=e.a;E=e.u},function(e){m=e.u},function(e){_=e.l},function(e){T=e.g},function(e){N=e.u;g=e.t},function(e){D=e.T}],execute:function(){var y=function(e){if(e===void 0){e=4}var t=__spreadArrays(Array(e)).map((function(){return x()}));return{totalCount:6,count:e,referredByReferral:{dateConverted:null,dateReferralStarted:1643912659850,referrerUser:{firstName:"John",lastName:"Snow",rewards:[]}},data:t}};var P=[["AVAILABLE"],["PENDING"],["CANCELLED"],["EXPIRED"],["REDEEMED"]];var A=["Rajesh","Pierre","Ji-Ho","Chinua","Charleston","Sally","Gael","Jill","Jane","Khadija"];var I=["Smith","Parker","Kent","Chew","Stark","Banner","Jones","Odinson","Pym","Rogers"];var x=function(){return{id:"5cae6b0fcc540e209db45b53",referredUser:{id:"5cae6b0ce4b0d81c67b78e82",accountId:"SPX1MZBIPTFL3E1H",firstName:A[Math.floor(Math.random()*A.length)],lastName:I[Math.floor(Math.random()*I.length)],email:"example.uexwltgh@mailosaur.io",programGoals:[]},shareLinkUsed:null,referralCodeUsed:"JIMBONEUTRON2",moderationStatus:"PENDING",dateConverted:Math.floor(Math.random()*10)>=5?_.DateTime.now().minus({days:6}).toMillis():null,dateFraudChecksCompleted:null,dateModerated:1558730033306,dateModified:1554934543447,dateReferralEnded:null,dateReferralPaid:null,dateReferralStarted:_.DateTime.now().minus({days:8}).toMillis(),dateUserModified:null,programId:"sam-partner-test-2",program:{id:"sam-partner-test-2",name:"Partner Program 2.0"},rewards:Math.floor(Math.random()*10)>=5?[{id:"5cae6b16cc540e209db45cfa",type:"CREDIT",value:1,unit:"POINT",name:"Partner Reward",dateGiven:1554934550726,dateExpires:null,dateCancelled:null,dateRedeemed:1637004373582,dateScheduledFor:null,fuelTankCode:null,fuelTankType:null,currency:null,prettyValue:"1 Point",statuses:P[Math.floor(Math.random()*P.length)],globalRewardKey:null,programRewardKey:"partnerReward",meta:__assign({},T()),rewardRedemptionTransactions:{data:[{exchangedRewards:{data:[{prettyValue:"CAD10.00 Visa* Prepaid Card CAD",type:"INTEGRATION",fuelTankCode:null,globalRewardKey:"gc1"}]}}]}}]:[],childNodes:{data:[{data:{id:"5cae6b16cc540e209db45cb3",statuses:P[Math.floor(Math.random()*P.length)],type:"PCT_DISCOUNT",value:50},depth:1},{data:{id:"5cae6b16cc540e209db45cfa",statuses:P[Math.floor(Math.random()*P.length)],type:"CREDIT",value:1},depth:1}]}}};var R=e("sqm_referral_table",function(){function e(e){t(this,e);this.perPage=4;this.hideLabels=false;this.prevLabel="Prev";this.moreLabel="Next";this.showReferrer=false;this.hiddenColumns="0";this.smBreakpoint=599;this.mdBreakpoint=799;i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=r(b,null);var t=r(w,null);var n=u()?S(this,e,t):N(this,e,t),a=n.states,i=n.data,s=n.callbacks,l=n.elements;h([this.showReferrer,this.perPage]);return r(p,{states:a,data:i,callbacks:s,elements:l})};return e}());function b(){return r("slot",{name:"empty"},r("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644000223/squatch-assets/empty_referral2.png","empty-state-header":"View your referral details","empty-state-text":"Refer a friend to view the status of your referrals and rewards earned"}))}function w(){return r("slot",{name:"loading"},r(C,null),r(C,null),r(C,null),r(C,null))}function C(){return r("sqm-table-row",null,r("sqm-table-cell",{colspan:5},r("sl-skeleton",null)))}function S(e,t,r){var n=s((function(e,t){return __assign(__assign({},e),t)}),{columns:[],rows:[],loading:false,page:0}),a=n[0],i=n[1];var d=E();var u=l((function(){var t;return((t=e.demoData)===null||t===void 0?void 0:t.mockData)||y(e.perPage)}),[e.perPage]);var f=m();function v(t){return __awaiter(this,void 0,void 0,(function(){var r,n,a,s,l,o,d,c,f,v,p,h,E,m;var _=this;return __generator(this,(function(T){switch(T.label){case 0:a=u===null||u===void 0?void 0:u.referredByReferral;s=e.showReferrer&&!!((r=u===null||u===void 0?void 0:u.referredByReferral)===null||r===void 0?void 0:r.dateReferralStarted);if(s){n=u.data.slice(0,e.perPage-1)}else{n=u.data.slice(0,e.perPage)}l=t.filter((function(e){var t,r;return e.slot!=="loading"&&e.slot!=="empty"&&((t=e===null||e===void 0?void 0:e.firstElementChild)===null||t===void 0?void 0:t.getAttribute("slot"))!=="loading"&&((r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot"))!=="empty"}));o=l===null||l===void 0?void 0:l.map((function(e,t){return __awaiter(_,void 0,void 0,(function(){var r,n,a;return __generator(this,(function(i){n=(r=e===null||e===void 0?void 0:e.firstElementChild)===null||r===void 0?void 0:r.getAttribute("slot");if(e.tagName==="RAISINS-PLOP-TARGET"&&n!=="loading"&&n!=="empty"){e.setAttribute("slot","column-"+t);e.style.position="absolute";a=e.firstElementChild.childNodes[1];a.innerHTML="+";a.style.lineHeight="20px";return[2,g(e,(function(){return e.renderLabel(t)}))]}return[2,g(e,(function(){return e.renderLabel()}))]}))}))}));if(!s)return[3,2];c=l===null||l===void 0?void 0:l.map((function(e){return __awaiter(_,void 0,void 0,(function(){return __generator(this,(function(t){return[2,g(e,(function t(){return e.renderCell(a,e)}))]}))}))}));return[4,Promise.all(c)];case 1:d=T.sent();T.label=2;case 2:f=n===null||n===void 0?void 0:n.map((function(e){return __awaiter(_,void 0,void 0,(function(){var t,r;var n=this;return __generator(this,(function(a){switch(a.label){case 0:t=l===null||l===void 0?void 0:l.map((function(t){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(r){return[2,g(t,(function(){return t.renderCell(e,undefined)}))]}))}))}));return[4,Promise.all(t)];case 1:r=a.sent();return[2,r]}}))}))}));p=f;if(!p)return[3,4];h=[[d]];return[4,Promise.all(f)];case 3:p=__spreadArrays.apply(void 0,h.concat([T.sent()])).filter((function(e){return e}));T.label=4;case 4:v=p;i({rows:v});m=o;if(!m)return[3,6];return[4,Promise.all(o)];case 5:m=T.sent();T.label=6;case 6:E=m;i({columns:E,loading:false,page:0});return[2]}}))}))}o((function(){i({loading:true});(u===null||u===void 0?void 0:u.data)&&v(f)}),[u===null||u===void 0?void 0:u.data,f,d]);var p=c({states:{hasPrev:false,hasNext:false,loading:false,show:"rows"},callbacks:{prevPage:function(){return console.log("Prev")},nextPage:function(){return console.log("Next")}},data:{textOverrides:{showLabels:!e.hideLabels,prevLabel:e.prevLabel,moreLabel:e.moreLabel},hiddenColumns:e.hiddenColumns,referralData:[],mdBreakpoint:799,smBreakpoint:599},elements:{columns:a.columns,rows:a.rows,emptyElement:t,loadingElement:r}},e.demoData||{},{arrayMerge:function(e,t){return t}});return p}var L=e("sqm_referral_table_cell",function(){function e(e){t(this,e);this.ignored=true;i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){return r("div",{innerHTML:this.innerTemplate})};return e}());var M=e("sqm_referral_table_column",function(){function e(e){t(this,e);i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,r("sqm-referral-table-cell",{"inner-template":n(this).innerHTML})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,Promise.resolve(this.columnTitle)]}))}))};e.prototype.render=function(){h([this.columnTitle]);return r(a,{style:{display:"none"}},r("slot",null))};return e}());var O=e("sqm_referral_table_date_cell",function(){function e(e){t(this,e);this.ignored=true;this.locale="en";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e;var t=!this.date?"-":(e=_.DateTime.fromMillis(this.date))===null||e===void 0?void 0:e.setLocale(f(this.locale)).toLocaleString(_.DateTime.DATE_MED);return t};return e}());var U=e("sqm_referral_table_date_column",function(){function e(e){t(this,e);this.columnTitle="Date converted";this.dateShown="dateConverted";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("sqm-referral-table-date-cell",{date:e[this.dateShown],locale:t===null||t===void 0?void 0:t.locale})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,r("sqm-referral-table-date-cell",{date:e[this.dateShown]})]}))}))};e.prototype.render=function(){h([this.dateShown,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}());var G=e("sqm_referral_table_rewards_cell",function(){function e(e){t(this,e);this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward approved for payout and was scheduled for payment based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.locale="en"}e.prototype.render=function(){var e=this;var t;d.locale=this.locale;var n={"@keyframes slideRight":{from:{opacity:0},to:{opacity:1}},DetailsContainer:{width:"100%",display:"flex","align-items":"center","justify-content":"space-between","margin-right":"var(--sl-spacing-small)","flex-wrap":"wrap"},Details:{"max-width":"500px","&::part(header)":{padding:"var(--sl-spacing-x-small)",cursor:""+(this.hideDetails?"default":"pointer")},"&::part(content)":{padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)"},"&::part(base)":{opacity:"1"},"&::part(summary-icon)":{display:""+(this.hideDetails?"none":"flex")},"&::part(summary-icon[open])":{transform:"rotate(-90deg)",background:"red"}},BadgeContainer:{"& > :not(:last-child)":{"margin-right":"var(--sl-spacing-x-small)"}},BoldText:{"font-weight":"var(--sl-font-weight-semibold)"},StatusBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{textAlign:"center",maxWidth:"170px",whiteSpace:"pre-line"}},RedeemBadge:{paddingLeft:"var(--sl-spacing-xxx-small)","&::part(base)":{background:"var(--sl-color-blue-600)"}}};var a=v(n);var i=a.toString();var s=function(e,t){var r,n,a,i,s,l,o,d,u,c,f,v;var p=["REDEEMED","CANCELLED","EXPIRED","PENDING","AVAILABLE","PENDING_REVIEW","DENIED","PAYOUT_APPROVED","PAYOUT_CANCELLED","PAYOUT_FAILED","PENDING_TAX_REVIEW","PENDING_NEW_TAX_FORM","PENDING_TAX_SUBMISSION","PENDING_PARTNER_CREATION"];if(((n=(r=e.referral)===null||r===void 0?void 0:r.fraudData)===null||n===void 0?void 0:n.moderationStatus)!=="APPROVED"){if(((i=(a=e.referral)===null||a===void 0?void 0:a.fraudData)===null||i===void 0?void 0:i.moderationStatus)==="PENDING")return"PENDING_REVIEW";if(((l=(s=e.referral)===null||s===void 0?void 0:s.fraudData)===null||l===void 0?void 0:l.moderationStatus)==="DENIED")return"DENIED"}var h=(o=e.partnerFundsTransfer)===null||o===void 0?void 0:o.status;if(h==="NOT_YET_DUE"||h==="TRANSFERRED"){return"PAYOUT_APPROVED"}else if(h==="OVERDUE")return"PAYOUT_FAILED";else if(h==="REVERSED")return"PAYOUT_CANCELLED";if((d=e===null||e===void 0?void 0:e.pendingReasons)===null||d===void 0?void 0:d.includes("US_TAX")){if(!(t===null||t===void 0?void 0:t.taxHandlingEnabled))return"PENDING";if(!(t===null||t===void 0?void 0:t.connected))return"PENDING_PARTNER_CREATION";if((u=t===null||t===void 0?void 0:t.publisher)===null||u===void 0?void 0:u.requiredTaxDocumentType){if(!((c=t===null||t===void 0?void 0:t.publisher)===null||c===void 0?void 0:c.currentTaxDocument))return"PENDING_TAX_SUBMISSION";var E=t.publisher.currentTaxDocument.status;if(E==="INACTIVE")return"PENDING_NEW_TAX_FORM";if(E==="NOT_VERIFIED")return"PENDING_TAX_REVIEW"}if(!((f=t===null||t===void 0?void 0:t.publisher)===null||f===void 0?void 0:f.withdrawalSettings))return"PENDING_PARTNER_CREATION"}if((v=e===null||e===void 0?void 0:e.pendingReasons)===null||v===void 0?void 0:v.includes("PAYOUT_CONFIGURATION_MISSING")){return"PENDING_PARTNER_CREATION"}if(e.statuses.length===1)return e.statuses[0];return p.find((function(t){return e.statuses.includes(t)&&t}))};var l=function(e){switch(e){case"REDEEMED":case"PAYOUT_APPROVED":return"primary";case"DENIED":case"EXPIRED":case"CANCELLED":case"PAYOUT_FAILED":case"PAYOUT_CANCELLED":return"danger";case"PENDING":case"PENDING_REVIEW":case"PENDING_TAX_REVIEW":case"PENDING_NEW_TAX_FORM":case"PENDING_TAX_SUBMISSION":case"PENDING_PARTNER_CREATION":return"warning";case"AVAILABLE":return"success"}};var o=function(t){return _.DateTime.fromMillis(t).setLocale(f(e.locale)).toRelative().replace("in","").trim()};return(t=this.rewards)===null||t===void 0?void 0:t.map((function(t){var n,u;var c=s(t,e.taxConnection);var v=l(c);var p=d.formatMessage({id:"statusShortMessage",defaultMessage:e.statusText},{status:c});var h=d.formatMessage({id:"statusLongMessage",defaultMessage:e.statusLongText},{status:c});return r("sl-details",{class:a.classes.Details,disabled:e.hideDetails},r("style",{type:"text/css"},i),r("div",{slot:"summary",class:a.classes.DetailsContainer},r(D,{type:"p"},r("span",{part:"sqm-cell-value",class:a.classes.BoldText},t.prettyValue)),r("div",{class:a.classes.BadgeContainer},c==="PENDING"&&t.dateScheduledFor?r("sl-badge",{class:v==="primary"?a.classes.RedeemBadge:a.classes.StatusBadge,type:v,pill:true},d.formatMessage({id:"pendingForText",defaultMessage:e.pendingForText},{status:p,date:o(t.dateScheduledFor)})):r("sl-badge",{class:v==="primary"?a.classes.RedeemBadge:a.classes.StatusBadge,type:v,pill:true},p),t.dateExpires&&c==="AVAILABLE"&&r("sl-badge",{class:v==="primary"?a.classes.RedeemBadge:a.classes.StatusBadge,type:"info",pill:true},e.expiringText," "+o(t.dateExpires)))),r("div",null,c==="PENDING_REVIEW"&&((n=t.referral)===null||n===void 0?void 0:n.dateModerated)&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="PAYOUT_APPROVED"&&r("div",null,r(D,{type:"p"},h)),c==="PAYOUT_FAILED"&&r("div",null,r(D,{type:"p"},h)),c==="PAYOUT_CANCELLED"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_TAX_REVIEW"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_NEW_TAX_FORM"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_TAX_SUBMISSION"&&r("div",null,r(D,{type:"p"},h)),c==="PENDING_PARTNER_CREATION"&&r("div",null,r(D,{type:"p"},h)),c==="DENIED"&&((u=t.referral)===null||u===void 0?void 0:u.dateModerated)&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.referral.dateModerated).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)),".",e.deniedHelpText?" "+e.deniedHelpText:"")),t.dateGiven&&r("div",null,r(D,{type:"p"},e.rewardReceivedText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateGiven).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="EXPIRED"&&t.dateExpires&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="CANCELLED"&&t.dateCancelled&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateCancelled).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),c==="PENDING"&&t.dateScheduledFor&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateScheduledFor).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED))))," ",c==="AVAILABLE"&&t.dateExpires&&r("div",null,r(D,{type:"p"},h," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},_.DateTime.fromMillis(t.dateExpires).setLocale(f(e.locale)).toLocaleString(_.DateTime.DATE_MED)))),t.fuelTankCode&&r("div",null,e.fuelTankText," ",r("span",{class:a.classes.BoldText,part:"sqm-cell-value"},t.fuelTankCode))))}))};return e}());var B=e("sqm_referral_table_rewards_column",function(){function e(e){t(this,e);this.columnTitle="Rewards";this.statusText="{status, select, AVAILABLE {Available} CANCELLED {Cancelled} PENDING {Pending} PENDING_REVIEW {Pending} PAYOUT_APPROVED {Payout Approved} PAYOUT_FAILED {Payout Failed} PAYOUT_CANCELLED {Payout Cancelled} PENDING_TAX_REVIEW {Pending} PENDING_NEW_TAX_FORM {Pending} PENDING_TAX_SUBMISSION {Pending} PENDING_PARTNER_CREATION {Pending} DENIED {Denied} EXPIRED {Expired} REDEEMED {Redeemed} other {Not available} }";this.statusLongText="{status, select, AVAILABLE {Reward expiring on} CANCELLED {Reward cancelled on} PENDING {Available on} PENDING_REVIEW {Pending since} PAYOUT_APPROVED {Reward approved for payout and was scheduled for payment based on your settings.} PAYOUT_FAILED {Payout failed due to a fulfillment issue and is currently being retried.} PAYOUT_CANCELLED {If you think this is a mistake, contact our Support team.} PENDING_TAX_REVIEW {Awaiting tax form review} PENDING_NEW_TAX_FORM {Invalid tax form. Submit a new form to receive your rewards.} PENDING_TAX_SUBMISSION {Submit your tax documents to receive your rewards} PENDING_PARTNER_CREATION {Complete your tax and cash payout setup to receive your rewards} DENIED {Denied on} EXPIRED {Reward expired on} other {Not available} }";this.fuelTankText="Your code is";this.rewardReceivedText="Reward received on";this.expiringText="Expiring in";this.pendingForText="{status} for {date}";this.deniedHelpText="Contact support if you think this is a mistake.";this.hideDetails=false;i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){return[2,r("sqm-referral-table-rewards-cell",{rewards:e.rewards,taxConnection:t===null||t===void 0?void 0:t.taxConnection,statusText:this.statusText,statusLongText:this.statusLongText,fuelTankText:this.fuelTankText,rewardReceivedText:this.rewardReceivedText,expiringText:this.expiringText,pendingForText:this.pendingForText,hideDetails:this.hideDetails,deniedHelpText:this.deniedHelpText,locale:t===null||t===void 0?void 0:t.locale,exportparts:"sqm-cell-value"})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,r("sqm-referral-table-rewards-cell",{rewards:e.rewards,exportparts:"sqm-cell-value"})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.statusText,this.statusLongText,this.fuelTankText,this.rewardReceivedText,this.expiringText,this.pendingForText,this.hideDetails]);return r(a,{style:{display:"none"}})};return e}());var k={Badge:{"&::part(base)":{fontSize:"var(--sl-font-size-small)",padding:"4px 8px",whiteSpace:"pre-line"}},SubText:{fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)",margin:"0"}};var V=v(k);var q=V.toString();var F=e("sqm_referral_table_status_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){var e=this;var t=function(t){if(t==="PENDING")return"warning";if(t==="DENIED")return"danger";if(e.converted)return"success";return"warning"};return r("div",null,r("style",{type:"text/css"},q),r("sl-badge",{pill:true,type:t(this.fraudStatus),class:V.classes.Badge},this.statusText),this.statusSubText?r("p",{class:V.classes.SubText},this.statusSubText):null)};return e}());var X=e("sqm_referral_table_status_column",function(){function e(e){t(this,e);this.columnTitle="Status";this.convertedStatusText="Converted";this.inProgressStatusText="In Progress";this.pendingReviewStatusText="Pending";this.deniedStatusText="Denied";this.pendingReviewStatusSubText="Awaiting review";this.deniedStatusSubText="Detected self-referral";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i;return __generator(this,(function(s){i=(t=e===null||e===void 0?void 0:e.fraudData)===null||t===void 0?void 0:t.moderationStatus;if(i==="DENIED"){n=this.deniedStatusText;a=this.deniedStatusSubText}else if(i==="PENDING"){n=this.pendingReviewStatusText;a=this.pendingReviewStatusSubText}else{n=e.dateConverted?this.convertedStatusText:this.inProgressStatusText}return[2,r("sqm-referral-table-status-cell",{"status-text":n,"status-sub-text":a,"fraud-status":i,converted:e.dateConverted?true:false})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){t=e.dateConverted?this.convertedStatusText:this.inProgressStatusText;return[2,r("sqm-referral-table-status-cell",{"status-text":t,converted:e.dateConverted?true:false})]}))}))};e.prototype.render=function(){h([this.columnTitle,this.convertedStatusText,this.inProgressStatusText]);return r(a,{style:{display:"none"}})};return e}());var Y=e("sqm_referral_table_user_cell",function(){function e(e){t(this,e)}e.prototype.render=function(){return this.name};return e}());var W=e("sqm_referral_table_user_column",function(){function e(e){t(this,e);this.columnTitle="Customer";this.anonymousUser="Anonymous User";this.deletedUser="Deleted User";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.renderCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i,s,l,o,d,u;return __generator(this,(function(c){if(!(e===null||e===void 0?void 0:e.referredUser)&&!(e===null||e===void 0?void 0:e.referrerUser)){u=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referredUser)===null||t===void 0?void 0:t.firstName)&&!((n=e===null||e===void 0?void 0:e.referredUser)===null||n===void 0?void 0:n.lastName)&&!((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)&&!((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)){u=this.anonymousUser}else if(e===null||e===void 0?void 0:e.referrerUser){u=((s=e===null||e===void 0?void 0:e.referrerUser)===null||s===void 0?void 0:s.firstName)+" "+((l=e===null||e===void 0?void 0:e.referrerUser)===null||l===void 0?void 0:l.lastName)}else{u=((o=e===null||e===void 0?void 0:e.referredUser)===null||o===void 0?void 0:o.firstName)+" "+((d=e===null||e===void 0?void 0:e.referredUser)===null||d===void 0?void 0:d.lastName)}return[2,r("sqm-referral-table-user-cell",{name:u})]}))}))};e.prototype.renderLabel=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this.columnTitle]}))}))};e.prototype.renderReferrerCell=function(e){return __awaiter(this,void 0,void 0,(function(){var t,n,a,i,s;return __generator(this,(function(l){if(!e){s=this.deletedUser}else if(!((t=e===null||e===void 0?void 0:e.referrerUser)===null||t===void 0?void 0:t.firstName)&&!((n=e.referrerUser)===null||n===void 0?void 0:n.lastName)){s=this.anonymousUser}else{s=((a=e===null||e===void 0?void 0:e.referrerUser)===null||a===void 0?void 0:a.firstName)+" "+((i=e===null||e===void 0?void 0:e.referrerUser)===null||i===void 0?void 0:i.lastName)}return[2,r("sqm-referral-table-user-cell",{name:s})]}))}))};e.prototype.render=function(){h([this.deletedUser,this.anonymousUser,this.columnTitle]);return r(a,{style:{display:"none"}})};return e}())}}}));
@@ -0,0 +1,33 @@
1
+ import{r as e,h as t}from"./p-f708da7b.js";import{k as r,f as i,n as o}from"./p-cd651f81.js";import"./p-5597ce59.js";import{d as s,J as a,w as l,$ as n,i as u}from"./p-94a876b9.js";import{c as d}from"./p-c1086930.js";import{g as m}from"./p-9ec99ced.js";import"./p-cef45012.js";import"./p-e309a219.js";import{P as c}from"./p-d8e5e40d.js";import{i as v}from"./p-8c23d1b8.js";const f=s.gql`
2
+ query {
3
+ viewer {
4
+ ... on User {
5
+ id
6
+ accountId
7
+ firstName
8
+ lastName
9
+ email
10
+ countryCode
11
+ }
12
+ }
13
+ }
14
+ `,h=s.gql`
15
+ mutation (
16
+ $id: String!
17
+ $accountId: String!
18
+ $firstName: String!
19
+ $lastName: String!
20
+ ) {
21
+ upsertUser(
22
+ userInput: {
23
+ id: $id
24
+ accountId: $accountId
25
+ firstName: $firstName
26
+ lastName: $lastName
27
+ }
28
+ ) {
29
+ firstName
30
+ lastName
31
+ }
32
+ }
33
+ `,p={country:"",email:"",firstName:"",lastName:"",errors:{},error:""},b=class{constructor(t){e(this,t),this.ignored=!0,this.firstnametext="First Name",this.lastnametext="Last Name",this.emailtext="Email",this.countrytext="Country",this.editProfileHeader="Edit your profile",this.editProfileSubHeader="Personal Information",this.submitChangeButtonText="Submit Changes",this.hideCountry=!1,this.networkRequestMessage="An error occurred while loading this page. Please refresh the page.",this.fieldEmptyText="Field is required",this.formErrorText="Please correct the errors below to update your profile.",this.submissionSuccessText="Your profile has been successfully updated.",o(this)}disconnectedCallback(){}render(){const e=u()?function(e){return d({states:{success:!1,loading:!1,submitDisabled:!1,showCountry:!e.hideCountry,user:{id:"01",accountId:"111100000",firstName:"Joe",lastName:"Smith",email:"jsmith@gmail.com",countryCode:"CA"},text:{firstnametext:e.firstnametext,lastnametext:e.lastnametext,emailtext:e.emailtext,countrytext:e.countrytext,editProfileHeader:e.editProfileHeader,editProfileSubHeader:e.editProfileSubHeader,submitChangeButtonText:e.submitChangeButtonText,submissionSuccessText:e.submissionSuccessText,fieldEmptyText:e.fieldEmptyText},formState:{country:"Canada",firstName:"Joe",lastName:"Smith",errors:null,error:""}},callbacks:{onSubmit:e=>console.log(e),onChange:e=>console.log(e)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(m(this)):function(e){const t=a(),[o,s]=r(!1),[u,d]=r(void 0),[m,c]=r(p),b=l(f,{},!(null==t?void 0:t.jwt)),[N,g]=n(h);return i((()=>{(null==g?void 0:g.loading)||((null==g?void 0:g.errors)?c((e=>{var t,r,i;return{...e,error:null===(i=null===(r=null===(t=null==g?void 0:g.errors)||void 0===t?void 0:t.response)||void 0===r?void 0:r.errors)||void 0===i?void 0:i[0].message}})):(d((e=>{var t;return{...e,...null===(t=null==g?void 0:g.data)||void 0===t?void 0:t.upsertUser}})),(null==g?void 0:g.data)&&s(!0)))}),[null==g?void 0:g.loading]),i((()=>{var e,t;d((e=>{var t;return{...e,...null===(t=null==b?void 0:b.data)||void 0===t?void 0:t.viewer}})),c({...p,...null===(e=b.data)||void 0===e?void 0:e.viewer,...null===(t=g.data)||void 0===t?void 0:t.upsertUser})}),[null==b?void 0:b.data]),i((()=>{var t,r;(null===(t=null==g?void 0:g.errors)||void 0===t?void 0:t.message)&&c({...null===(r=b.data)||void 0===r?void 0:r.viewer,error:e.networkRequestMessage})}),[null==g?void 0:g.errors]),{states:{success:o,loading:(null==b?void 0:b.loading)||g.loading,submitDisabled:!1,showCountry:!e.hideCountry,formState:m,user:u,text:{firstnametext:e.firstnametext,lastnametext:e.lastnametext,countrytext:e.countrytext,emailtext:e.emailtext,editProfileHeader:e.editProfileHeader,editProfileSubHeader:e.editProfileSubHeader,submitChangeButtonText:e.submitChangeButtonText}},callbacks:{onSubmit:()=>{if(s(!1),m.firstName&&m.lastName)return N({id:null==t?void 0:t.id,accountId:null==t?void 0:t.accountId,firstName:m.firstName,lastName:m.lastName}),void c((e=>({...e,errors:{},error:""})));const r={};m.firstName||(r.firstName={message:e.fieldEmptyText}),m.lastName||(r.lastName={message:e.fieldEmptyText}),v(r)||c((t=>({...t,error:e.formErrorText}))),c((e=>({...e,errors:r})))},onChange:e=>{const{name:t,value:r}=e.target;c((e=>({...e,[t]:r})))}}}}(m(this));return t(c,Object.assign({},e))}};export{b as sqm_portal_profile}