@saasquatch/mint-components 1.15.0-116 → 1.15.0-117
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.
- package/dist/cjs/RewardExchangeListData-a787ce54.js +1144 -0
- package/dist/cjs/{ShadowViewAddon-c468a0a7.js → ShadowViewAddon-f1bd9b26.js} +1 -1
- package/dist/cjs/{copy-text-view-b9a8fbb1.js → copy-text-view-44dfefc7.js} +1 -1
- package/dist/cjs/copy-text-view-f0313f78.js +121 -0
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +2 -2
- package/dist/cjs/sqm-coupon-code-view-a869384e.js +35 -0
- package/dist/cjs/sqm-coupon-code.cjs.entry.js +285 -0
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referral-code.cjs.entry.js +177 -0
- package/dist/cjs/sqm-reward-exchange-list.cjs.entry.js +1018 -0
- package/dist/cjs/sqm-share-code.cjs.entry.js +147 -0
- package/dist/cjs/sqm-share-link.cjs.entry.js +102 -0
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
- package/dist/collection/components/views/copy-text-view.js +1 -1
- package/dist/esm/RewardExchangeListData-11c043e3.js +1122 -0
- package/dist/esm/{ShadowViewAddon-518e026d.js → ShadowViewAddon-c0600f22.js} +1 -1
- package/dist/esm/copy-text-view-3129fb22.js +119 -0
- package/dist/esm/{copy-text-view-b219d166.js → copy-text-view-a319c261.js} +1 -1
- package/dist/esm/sqm-big-stat_43.entry.js +2 -2
- package/dist/esm/sqm-coupon-code-view-af016712.js +33 -0
- package/dist/esm/sqm-coupon-code.entry.js +281 -0
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/sqm-referral-code.entry.js +173 -0
- package/dist/esm/sqm-reward-exchange-list.entry.js +1014 -0
- package/dist/esm/sqm-share-code.entry.js +143 -0
- package/dist/esm/sqm-share-link.entry.js +98 -0
- package/dist/esm/sqm-stencilbook.entry.js +2 -2
- package/dist/esm-es5/RewardExchangeListData-11c043e3.js +1 -0
- package/dist/esm-es5/{ShadowViewAddon-518e026d.js → ShadowViewAddon-c0600f22.js} +1 -1
- package/dist/esm-es5/copy-text-view-3129fb22.js +1 -0
- package/dist/esm-es5/copy-text-view-a319c261.js +1 -0
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm-es5/sqm-coupon-code-view-af016712.js +1 -0
- package/dist/esm-es5/sqm-coupon-code.entry.js +1 -0
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-code.entry.js +1 -0
- package/dist/esm-es5/sqm-reward-exchange-list.entry.js +1 -0
- package/dist/esm-es5/sqm-share-code.entry.js +1 -0
- package/dist/esm-es5/sqm-share-link.entry.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/RewardExchangeListData-11c043e3.js +1122 -0
- package/dist/mint-components/RewardExchangeListData-546ffbb9.system.js +1 -0
- package/dist/mint-components/copy-text-view-3129fb22.js +119 -0
- package/dist/mint-components/copy-text-view-33cac657.system.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-5cbcff66.entry.js → p-1276830a.entry.js} +1 -1
- package/dist/mint-components/p-1de49f76.js +1 -0
- package/dist/mint-components/{p-761a02d5.js → p-6b904749.js} +1 -1
- package/dist/mint-components/p-a89baf7b.system.js +1 -1
- package/dist/mint-components/{p-8432d8c2.system.entry.js → p-aa77d858.system.entry.js} +1 -1
- package/dist/mint-components/{p-b8ddc820.system.js → p-bdc86ee3.system.js} +1 -1
- package/dist/mint-components/{p-b5fe3d2c.system.entry.js → p-be770d69.system.entry.js} +1 -1
- package/dist/mint-components/{p-5aeb80dc.entry.js → p-e34b460e.entry.js} +1 -1
- package/dist/mint-components/{p-db14cf82.system.entry.js → p-ed69dc98.system.entry.js} +1 -1
- package/dist/mint-components/p-f4f57363.system.js +1 -0
- package/dist/mint-components/{p-53eaaebf.entry.js → p-f9f67437.entry.js} +1 -1
- package/dist/mint-components/sqm-coupon-code-view-40fd8d8b.system.js +1 -0
- package/dist/mint-components/sqm-coupon-code-view-af016712.js +33 -0
- package/dist/mint-components/sqm-coupon-code.entry.js +281 -0
- package/dist/mint-components/sqm-coupon-code.system.entry.js +1 -0
- package/dist/mint-components/sqm-referral-code.entry.js +173 -0
- package/dist/mint-components/sqm-referral-code.system.entry.js +1 -0
- package/dist/mint-components/sqm-reward-exchange-list.entry.js +1014 -0
- package/dist/mint-components/sqm-reward-exchange-list.system.entry.js +1 -0
- package/dist/mint-components/sqm-share-code.entry.js +143 -0
- package/dist/mint-components/sqm-share-code.system.entry.js +1 -0
- package/dist/mint-components/sqm-share-link.entry.js +98 -0
- package/dist/mint-components/sqm-share-link.system.entry.js +1 -0
- package/dist/mint-components/sqm-stencilbook.entry.js +20330 -0
- package/dist/mint-components/sqm-stencilbook.system.entry.js +1 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/copy-text-view-b219d166.js +0 -1
- package/dist/mint-components/p-25e70b59.js +0 -1
- package/dist/mint-components/p-a4bbb947.system.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r))e[r]=t[r]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,n,a){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function o(e){try{l(a.next(e))}catch(e){i(e)}}function s(e){try{l(a["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):r(e.value).then(o,s)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,r,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return l([e,t])}}function l(o){if(a)throw new TypeError("Generator is already executing.");while(n)try{if(a=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){n.label=o[1];break}if(o[0]===6&&n.label<i[1]){n.label=i[1];i=o;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(o);break}if(i[2])n.ops.pop();n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e];r=0}finally{a=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./index-bfed5e90.system.js","./global-c9084753.system.js","./dom-context-hooks.module-7cdc0e68.system.js","./index.module-3ae23e6a.system.js","./GoogleFonts-eea308bc.system.js","./jss-preset-default.esm-62a04d6d.system.js","./JSS-840a8fea.system.js","./mixins-8c4521b7.system.js","./utils-e473b250.system.js","./cjs-f0ef8d23.system.js","./copy-text-view-33cac657.system.js","./RewardExchangeListData-546ffbb9.system.js","./parseStates-5fae0361.system.js"],(function(e){"use strict";var t,n,a,r,i,o,s,l,u,c,d,f,h,g,v,m,p,y,b;return{setters:[function(e){t=e.r;n=e.h;a=e.i},function(){},function(e){r=e.u;i=e.i;o=e.j;s=e.k;l=e.o},function(e){u=e.d;c=e.J;d=e.$;f=e.w;h=e.o;g=e.i},function(){},function(){},function(){},function(){},function(e){v=e.g},function(e){m=e.c},function(){},function(e){p=e.p;y=e.R},function(e){b=e.p}],execute:function(){var w={};(function e(t,n,a,r){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL);function o(){}function s(e){var a=n.exports.Promise;var r=a!==void 0?a:t.Promise;if(typeof r==="function"){return new r(e)}e(o,o);return null}var l=function(){var e=Math.floor(1e3/60);var t,n;var a={};var r=0;if(typeof requestAnimationFrame==="function"&&typeof cancelAnimationFrame==="function"){t=function(t){var n=Math.random();a[n]=requestAnimationFrame((function i(o){if(r===o||r+e-1<o){r=o;delete a[n];t()}else{a[n]=requestAnimationFrame(i)}}));return n};n=function(e){if(a[e]){cancelAnimationFrame(a[e])}}}else{t=function(t){return setTimeout(t,e)};n=function(e){return clearTimeout(e)}}return{frame:t,cancel:n}}();var u=function(){var t;var n;var r={};function o(e){function t(t,n){e.postMessage({options:t||{},callback:n})}e.init=function t(n){var a=n.transferControlToOffscreen();e.postMessage({canvas:a},[a])};e.fire=function a(i,o,l){if(n){t(i,null);return n}var u=Math.random().toString(36).slice(2);n=s((function(a){function o(t){if(t.data.callback!==u){return}delete r[u];e.removeEventListener("message",o);n=null;l();a()}e.addEventListener("message",o);t(i,u);r[u]=o.bind(null,{data:{callback:u}})}));return n};e.reset=function t(){e.postMessage({reset:true});for(var n in r){r[n]();delete r[n]}}}return function(){if(t){return t}if(!a&&i){var n=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{t=new Worker(URL.createObjectURL(new Blob([n])))}catch(e){typeof console!==undefined&&typeof console.warn==="function"?console.warn("🎊 Could not load worker",e):null;return null}o(t)}return t}}();var c={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:false,scalar:1};function d(e,t){return t?t(e):e}function f(e){return!(e===null||e===undefined)}function h(e,t,n){return d(e&&f(e[t])?e[t]:c[t],n)}function g(e){return e<0?0:Math.floor(e)}function v(e,t){return Math.floor(Math.random()*(t-e))+e}function m(e){return parseInt(e,16)}function p(e){return e.map(y)}function y(e){var t=String(e).replace(/[^0-9a-f]/gi,"");if(t.length<6){t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]}return{r:m(t.substring(0,2)),g:m(t.substring(2,4)),b:m(t.substring(4,6))}}function b(e){var t=h(e,"origin",Object);t.x=h(t,"x",Number);t.y=h(t,"y",Number);return t}function w(e){e.width=document.documentElement.clientWidth;e.height=document.documentElement.clientHeight}function x(e){var t=e.getBoundingClientRect();e.width=t.width;e.height=t.height}function _(e){var t=document.createElement("canvas");t.style.position="fixed";t.style.top="0px";t.style.left="0px";t.style.pointerEvents="none";t.style.zIndex=e;return t}function R(e,t,n,a,r,i,o,s,l){e.save();e.translate(t,n);e.rotate(i);e.scale(a,r);e.arc(0,0,1,o,s,l);e.restore()}function E(e){var t=e.angle*(Math.PI/180);var n=e.spread*(Math.PI/180);return{x:e.x,y:e.y,wobble:Math.random()*10,velocity:e.startVelocity*.5+Math.random()*e.startVelocity,angle2D:-t+(.5*n-Math.random()*n),tiltAngle:Math.random()*Math.PI,color:e.color,shape:e.shape,tick:0,totalTicks:e.ticks,decay:e.decay,drift:e.drift,random:Math.random()+5,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:e.gravity*3,ovalScalar:.6,scalar:e.scalar}}function M(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift;t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity;t.wobble+=.1;t.velocity*=t.decay;t.tiltAngle+=.1;t.tiltSin=Math.sin(t.tiltAngle);t.tiltCos=Math.cos(t.tiltAngle);t.random=Math.random()+5;t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble);t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble);var n=t.tick++/t.totalTicks;var a=t.x+t.random*t.tiltCos;var r=t.y+t.random*t.tiltSin;var i=t.wobbleX+t.random*t.tiltCos;var o=t.wobbleY+t.random*t.tiltSin;e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-n)+")";e.beginPath();if(t.shape==="circle"){e.ellipse?e.ellipse(t.x,t.y,Math.abs(i-a)*t.ovalScalar,Math.abs(o-r)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):R(e,t.x,t.y,Math.abs(i-a)*t.ovalScalar,Math.abs(o-r)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI)}else{e.moveTo(Math.floor(t.x),Math.floor(t.y));e.lineTo(Math.floor(t.wobbleX),Math.floor(r));e.lineTo(Math.floor(i),Math.floor(o));e.lineTo(Math.floor(a),Math.floor(t.wobbleY))}e.closePath();e.fill();return t.tick<t.totalTicks}function I(e,t,n,i,o){var u=t.slice();var c=e.getContext("2d");var d;var f;var h=s((function(t){function s(){d=f=null;c.clearRect(0,0,i.width,i.height);o();t()}function h(){if(a&&!(i.width===r.width&&i.height===r.height)){i.width=e.width=r.width;i.height=e.height=r.height}if(!i.width&&!i.height){n(e);i.width=e.width;i.height=e.height}c.clearRect(0,0,i.width,i.height);u=u.filter((function(e){return M(c,e)}));if(u.length){d=l.frame(h)}else{s()}}d=l.frame(h);f=s}));return{addFettis:function(e){u=u.concat(e);return h},canvas:e,promise:h,reset:function(){if(d){l.cancel(d)}if(f){f()}}}}function T(e,n){var a=!e;var r=!!h(n||{},"resize");var o=h(n,"disableForReducedMotion",Boolean);var l=i&&!!h(n||{},"useWorker");var c=l?u():null;var d=a?w:x;var f=e&&c?!!e.__confetti_initialized:false;var m=typeof matchMedia==="function"&&matchMedia("(prefers-reduced-motion)").matches;var y;function R(t,n,a){var r=h(t,"particleCount",g);var i=h(t,"angle",Number);var o=h(t,"spread",Number);var s=h(t,"startVelocity",Number);var l=h(t,"decay",Number);var u=h(t,"gravity",Number);var c=h(t,"drift",Number);var f=h(t,"colors",p);var m=h(t,"ticks",Number);var w=h(t,"shapes");var x=h(t,"scalar");var _=b(t);var R=r;var M=[];var T=e.width*_.x;var C=e.height*_.y;while(R--){M.push(E({x:T,y:C,angle:i,spread:o,startVelocity:s,color:f[R%f.length],shape:w[v(0,w.length)],ticks:m,decay:l,gravity:u,drift:c,scalar:x}))}if(y){return y.addFettis(M)}y=I(e,M,d,n,a);return y.promise}function M(n){var i=o||h(n,"disableForReducedMotion",Boolean);var l=h(n,"zIndex",Number);if(i&&m){return s((function(e){e()}))}if(a&&y){e=y.canvas}else if(a&&!e){e=_(l);document.body.appendChild(e)}if(r&&!f){d(e)}var u={width:e.width,height:e.height};if(c&&!f){c.init(e)}f=true;if(c){e.__confetti_initialized=true}function g(){if(c){var t={getBoundingClientRect:function(){if(!a){return e.getBoundingClientRect()}}};d(t);c.postMessage({resize:{width:t.width,height:t.height}});return}u.width=u.height=null}function v(){y=null;if(r){t.removeEventListener("resize",g)}if(a&&e){document.body.removeChild(e);e=null;f=false}}if(r){t.addEventListener("resize",g,false)}if(c){return c.fire(n,u,v)}return R(n,u,v)}M.reset=function(){if(c){c.reset()}if(y){y.reset()}};return M}n.exports=T(null,{useWorker:true,resize:true});n.exports.create=T})(function(){if(typeof window!=="undefined"){return window}if(typeof self!=="undefined"){return self}return this||{}}(),w,false);var x=w.exports;var _=w.exports.create;var R=u.gql(__makeTemplateObject(["\n query getExchangeList {\n viewer {\n ... on User {\n visibleRewardExchangeItems(limit: 20, offset: 0) {\n data {\n key\n name\n description\n imageUrl\n available\n unavailableReasonCode\n ruleType\n sourceUnit\n sourceValue\n prettySourceValue\n sourceMinValue\n prettySourceMinValue\n sourceMaxValue\n prettySourceMaxValue\n destinationMinValue\n prettyDestinationMinValue\n destinationMaxValue\n prettyDestinationMaxValue\n globalRewardKey\n destinationUnit\n steps {\n sourceValue\n prettySourceValue\n destinationValue\n prettyDestinationValue\n available\n globalRewardKey\n unavailableReasonCode\n rewardInput\n }\n }\n totalCount\n }\n }\n }\n }\n"],["\n query getExchangeList {\n viewer {\n ... on User {\n visibleRewardExchangeItems(limit: 20, offset: 0) {\n data {\n key\n name\n description\n imageUrl\n available\n unavailableReasonCode\n ruleType\n sourceUnit\n sourceValue\n prettySourceValue\n sourceMinValue\n prettySourceMinValue\n sourceMaxValue\n prettySourceMaxValue\n destinationMinValue\n prettyDestinationMinValue\n destinationMaxValue\n prettyDestinationMaxValue\n globalRewardKey\n destinationUnit\n steps {\n sourceValue\n prettySourceValue\n destinationValue\n prettyDestinationValue\n available\n globalRewardKey\n unavailableReasonCode\n rewardInput\n }\n }\n totalCount\n }\n }\n }\n }\n"]));var E=u.gql(__makeTemplateObject(["\n mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {\n exchangeReward(exchangeRewardInput: $exchangeRewardInput) {\n reward {\n id\n fuelTankCode\n }\n }\n }\n"],["\n mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {\n exchangeReward(exchangeRewardInput: $exchangeRewardInput) {\n reward {\n id\n fuelTankCode\n }\n }\n }\n"]));function M(e){var t,n,a,l,u;var g=r((function(e,t){return __assign(__assign({},e),t)}),{selectedItem:undefined,selectedStep:undefined,redeemStage:"chooseReward",amount:0,exchangeError:false}),v=g[0],m=g[1];var p=i(false),y=p[0],b=p[1];var w=v.selectedItem,_=v.selectedStep,M=v.redeemStage,I=v.amount,T=v.exchangeError;var C=c();var S=d(E),k=S[0],V=S[1],A=V.data,j=V.loading,L=V.errors;var D=f(R,{},!(C===null||C===void 0?void 0:C.jwt)),O=D.data,U=D.loading,P=D.refetch,F=D.errors;o((function(){var e,t;if((t=(e=A===null||A===void 0?void 0:A.exchangeReward)===null||e===void 0?void 0:e.reward)===null||t===void 0?void 0:t.id){m({redeemStage:"success",exchangeError:false})}if(!!L){m({exchangeError:true})}}),[A,L]);var N=s();o((function(){if(!N.current)return;var e=N.current;e.confetti=e.confetti||x.create(e,{resize:true});e.confetti()}),[N.current]);var q=h().refresh;function B(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!w)return[2];e={accountId:C===null||C===void 0?void 0:C.accountId,userId:C.id};switch(w.ruleType){case"FIXED_GLOBAL_REWARD":e=__assign(__assign({},e),{redeemCreditInput:{amount:w.sourceValue,unit:w.sourceUnit},globalRewardKey:w.globalRewardKey});break;case"STEPPED_FIXED_GLOBAL_REWARD":e=__assign(__assign({},e),{redeemCreditInput:{amount:_.sourceValue,unit:w.sourceUnit},globalRewardKey:_.globalRewardKey});break;case"VARIABLE_GLOBAL_REWARD":e=__assign(__assign({},e),{redeemCreditInput:{amount:I,unit:w.sourceUnit},globalRewardKey:w.globalRewardKey,rewardInput:_.rewardInput});break;case"VARIABLE_CREDIT_REWARD":e=__assign(__assign({},e),{redeemCreditInput:{amount:I,unit:w.sourceUnit},rewardInput:{type:"CREDIT",unit:w.destinationUnit,assignedCredit:_.destinationValue}});break;default:e=__assign(__assign({},e),_.rewardInput)}return[4,k({exchangeRewardInput:e})];case 1:t.sent();q();return[2]}}))}))}var z=function(e){e&&P();m({amount:0,selectedStep:undefined,selectedItem:undefined,exchangeError:false,redeemStage:"chooseReward"})};function K(e){m({redeemStage:e})}function W(){var e,t;navigator.clipboard.writeText((t=(e=A===null||A===void 0?void 0:A.exchangeReward)===null||e===void 0?void 0:e.reward)===null||t===void 0?void 0:t.fuelTankCode);b(true);setTimeout((function(){return b(false)}),1e3)}return{states:{content:{text:e},selectedItem:w,redeemStage:M,amount:I,selectedStep:_,exchangeError:T,queryError:!!F,loading:U||j,open:y,noExchangeOptions:((t=O===null||O===void 0?void 0:O.viewer)===null||t===void 0?void 0:t.visibleRewardExchangeItems.totalCount)===0},data:{exchangeList:(a=(n=O===null||O===void 0?void 0:O.viewer)===null||n===void 0?void 0:n.visibleRewardExchangeItems)===null||a===void 0?void 0:a.data,fuelTankCode:(u=(l=A===null||A===void 0?void 0:A.exchangeReward)===null||l===void 0?void 0:l.reward)===null||u===void 0?void 0:u.fuelTankCode},callbacks:{exchangeReward:B,setExchangeState:m,setStage:K,resetState:z,copyFuelTankCode:W},refs:{canvasRef:N}}}var I=e("sqm_reward_exchange_list",function(){function e(e){t(this,e);this.ignored=true;this.notAvailableError="{unavailableReasonCode, select, US_TAX {US Tax limit} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {{unavailableReasonCode}} }";this.chooseRewardTitle="Rewards";this.chooseAmountTitle="Select";this.confirmationTitle="Confirm";this.rewardTitle="Choose a reward";this.cancelText="Cancel";this.backText="Back";this.continueText="Continue";this.continueToConfirmationText="Continue to confirmation";this.redeemText="Redeem";this.redeemTitle="Confirm and redeem";this.redemptionSuccessText="Redeemed {sourceValue} for {destinationValue}";this.sourceAmountMessage="{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}";this.tooltipText="Copied";this.doneText="Done";this.selectText="Select amount to receive";this.queryError="Unable to load reward exchange list. Please try again";this.redemptionError="An error occured trying to redeem this reward. Please try again";this.notEnoughError="Not enough {sourceUnit} to redeem for this reward";this.rewardRedeemedText="Reward redeemed";this.promoCode="Promo Code";this.skeletonCardNum=8;this.rewardNameTitle="Reward";this.rewardAmountTitle="Reward Amount";this.costTitle="Cost to Redeem";this.stateController="{}";l(this)}e.prototype.disconnectedCallback=function(){};e.prototype.render=function(){var e=__assign(__assign({},v(this)),{empty:n(T,null)});var t=g()?C(e):M(e),r=t.states,i=t.data,o=t.callbacks,s=t.refs;return n(a,{style:{display:"contents"}},n(y,{states:r,data:i,callbacks:o,refs:s}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}());function T(){return n("slot",{name:"empty"},n("sqm-empty",{emptyStateImage:"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png",emptyStateHeader:"Redeem rewards",emptyStateText:"Use your points to redeem rewards once they become available"}))}function C(e){var t=b(e.stateController);var n=Object.keys(t).reduce((function(e,n){var a;return n==="reward-exchange-list"?__assign(__assign({},e),t[n]):__assign(__assign({},e),(a={},a[n+"_stateController"]=t[n],a))}),{});return m({states:{content:{text:e},redeemStage:"chooseReward",amount:0,selectedStep:undefined,selectedItem:undefined,open:false,exchangeError:false,queryError:false,loading:false,noExchangeOptions:false},data:{exchangeList:p.data.exchangeList},callbacks:{exchangeReward:function(){},setExchangeState:function(e){},setStage:function(e){},resetState:function(){},copyFuelTankCode:function(){}},refs:{canvasRef:{}}},e.demoData||n||{},{arrayMerge:function(e,t){return t}})}}}}));
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { r as registerInstance, h as h$1 } from './index-bfb7f924.js';
|
|
2
|
+
import { i as useState, o as h } from './dom-context-hooks.module-01c1b885.js';
|
|
3
|
+
import { d as dist, H, J, B, w as wn, $ as $e, i as isDemo } from './index.module-83586215.js';
|
|
4
|
+
import './jss-preset-default.esm-c36417f8.js';
|
|
5
|
+
import './JSS-8c381d8b.js';
|
|
6
|
+
import './mixins-acc245cc.js';
|
|
7
|
+
import { g as getProps } from './utils-93e14db3.js';
|
|
8
|
+
import { c as cjs } from './cjs-e829b75b.js';
|
|
9
|
+
import { C as CopyTextView } from './copy-text-view-3129fb22.js';
|
|
10
|
+
|
|
11
|
+
const MessageLinkQuery = dist.gql `
|
|
12
|
+
query ($programId: ID) {
|
|
13
|
+
user: viewer {
|
|
14
|
+
... on User {
|
|
15
|
+
referralCode(programId: $programId)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
const WIDGET_ENGAGEMENT_EVENT = dist.gql `
|
|
21
|
+
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
22
|
+
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
function useShareCode(props) {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
const { programId = H() } = props;
|
|
28
|
+
const user = J();
|
|
29
|
+
const engagementMedium = B();
|
|
30
|
+
const { data } = wn(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
31
|
+
const [sendLoadEvent] = $e(WIDGET_ENGAGEMENT_EVENT);
|
|
32
|
+
const copyString = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.referralCode) !== null && _b !== void 0 ? _b :
|
|
33
|
+
// Shown during loading
|
|
34
|
+
"...";
|
|
35
|
+
const [open, setOpen] = useState(false);
|
|
36
|
+
function onClick() {
|
|
37
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
38
|
+
// Only if called from a user-initiated event
|
|
39
|
+
navigator.clipboard.writeText(copyString);
|
|
40
|
+
setOpen(true);
|
|
41
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
42
|
+
sendLoadEvent({
|
|
43
|
+
eventMeta: {
|
|
44
|
+
programId,
|
|
45
|
+
id: user === null || user === void 0 ? void 0 : user.id,
|
|
46
|
+
accountId: user === null || user === void 0 ? void 0 : user.accountId,
|
|
47
|
+
type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
|
|
48
|
+
meta: {
|
|
49
|
+
engagementMedium,
|
|
50
|
+
shareMedium: "DIRECT",
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return { ...props, onClick, open, copyString: copyString };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const ShareCode = class {
|
|
59
|
+
constructor(hostRef) {
|
|
60
|
+
registerInstance(this, hostRef);
|
|
61
|
+
/**
|
|
62
|
+
* Shown inside a tooltip after someone has successfully copied the link to their clipboard
|
|
63
|
+
*
|
|
64
|
+
* @uiName Tooltip text
|
|
65
|
+
*/
|
|
66
|
+
this.tooltiptext = "Copied to Clipboard";
|
|
67
|
+
/**
|
|
68
|
+
* The number of milliseconds that the tooltip appears for
|
|
69
|
+
*
|
|
70
|
+
* @uiName Tooltip lifespan
|
|
71
|
+
*/
|
|
72
|
+
this.tooltiplifespan = 1000;
|
|
73
|
+
/**
|
|
74
|
+
* Change the text alignment
|
|
75
|
+
*
|
|
76
|
+
* @uiName Share code alignment
|
|
77
|
+
* @uiType string
|
|
78
|
+
* @uiEnum ["left", "center", "right"]
|
|
79
|
+
* @uiEnumNames ["Left", "Center", "Right"]
|
|
80
|
+
* @uiGroup Style
|
|
81
|
+
*/
|
|
82
|
+
this.textAlign = "left";
|
|
83
|
+
/**
|
|
84
|
+
* @uiName Copy button label
|
|
85
|
+
*/
|
|
86
|
+
this.copyButtonLabel = "Copy Code";
|
|
87
|
+
/**
|
|
88
|
+
* Set the copy button style and placement
|
|
89
|
+
*
|
|
90
|
+
* @uiName Style
|
|
91
|
+
* @uiType string
|
|
92
|
+
* @uiEnum ["icon", "button-outside", "button-below"]
|
|
93
|
+
* @uiEnumNames ["Icon", "Button outside", "Button below"]
|
|
94
|
+
* @uiGroup Style
|
|
95
|
+
*/
|
|
96
|
+
this.buttonStyle = "icon";
|
|
97
|
+
/**
|
|
98
|
+
* The type of the button that is used (primary or secondary).
|
|
99
|
+
* @uiName Button Type
|
|
100
|
+
* @uiType string
|
|
101
|
+
* @uiEnum ["primary", "secondary"]
|
|
102
|
+
* @uiEnumNames ["Primary", "Secondary"]
|
|
103
|
+
* @uiGroup Style
|
|
104
|
+
*/
|
|
105
|
+
this.buttonType = "primary";
|
|
106
|
+
h(this);
|
|
107
|
+
}
|
|
108
|
+
disconnectedCallback() { }
|
|
109
|
+
render() {
|
|
110
|
+
const thisProps = getProps(this);
|
|
111
|
+
const props = isDemo()
|
|
112
|
+
? useDemoShareCode(thisProps)
|
|
113
|
+
: useShareCode(thisProps);
|
|
114
|
+
return h$1(CopyTextView, Object.assign({}, props));
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
function useDemoShareCode(props) {
|
|
118
|
+
const [open, setOpen] = useState(false);
|
|
119
|
+
const copyString = "SHARECODE001";
|
|
120
|
+
return cjs({
|
|
121
|
+
copyString: copyString,
|
|
122
|
+
tooltiptext: props.tooltiptext,
|
|
123
|
+
textAlign: props.textAlign,
|
|
124
|
+
copyButtonLabel: props.copyButtonLabel,
|
|
125
|
+
buttonStyle: props.buttonStyle,
|
|
126
|
+
backgroundColor: props.backgroundColor,
|
|
127
|
+
textColor: props.textColor,
|
|
128
|
+
borderRadius: props.borderRadius,
|
|
129
|
+
borderColor: props.borderColor,
|
|
130
|
+
buttonType: props.buttonType,
|
|
131
|
+
rewardStatus: "AVAILABLE",
|
|
132
|
+
open,
|
|
133
|
+
onClick: () => {
|
|
134
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
135
|
+
// Only if called from a user-initiated event
|
|
136
|
+
navigator.clipboard.writeText(copyString);
|
|
137
|
+
setOpen(true);
|
|
138
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
139
|
+
},
|
|
140
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { ShareCode as sqm_share_code };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(t,e){if(Object.defineProperty){Object.defineProperty(t,"raw",{value:e})}else{t.raw=e}return t};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]}return t};return __assign.apply(this,arguments)};System.register(["./index-bfed5e90.system.js","./dom-context-hooks.module-7cdc0e68.system.js","./index.module-3ae23e6a.system.js","./jss-preset-default.esm-62a04d6d.system.js","./JSS-840a8fea.system.js","./mixins-8c4521b7.system.js","./utils-e473b250.system.js","./cjs-f0ef8d23.system.js","./copy-text-view-33cac657.system.js"],(function(t){"use strict";var e,n,r,o,i,a,s,u,l,c,d,p,v,f;return{setters:[function(t){e=t.r;n=t.h},function(t){r=t.i;o=t.o},function(t){i=t.d;a=t.H;s=t.J;u=t.B;l=t.w;c=t.$;d=t.i},function(){},function(){},function(){},function(t){p=t.g},function(t){v=t.c},function(t){f=t.C}],execute:function(){var m=i.gql(__makeTemplateObject(["\n query ($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"],["\n query ($programId: ID) {\n user: viewer {\n ... on User {\n referralCode(programId: $programId)\n }\n }\n }\n"]));var y=i.gql(__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"]));function g(t){var e,n;var o=t.programId,i=o===void 0?a():o;var d=s();var p=u();var v=l(m,{programId:i},!(d===null||d===void 0?void 0:d.jwt)).data;var f=c(y)[0];var g=(n=(e=v===null||v===void 0?void 0:v.user)===null||e===void 0?void 0:e.referralCode)!==null&&n!==void 0?n:"...";var b=r(false),_=b[0],j=b[1];function h(){navigator.clipboard.writeText(g);j(true);setTimeout((function(){return j(false)}),t.tooltiplifespan);f({eventMeta:{programId:i,id:d===null||d===void 0?void 0:d.id,accountId:d===null||d===void 0?void 0:d.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:p,shareMedium:"DIRECT"}}})}return __assign(__assign({},t),{onClick:h,open:_,copyString:g})}var b=t("sqm_share_code",function(){function t(t){e(this,t);this.tooltiptext="Copied to Clipboard";this.tooltiplifespan=1e3;this.textAlign="left";this.copyButtonLabel="Copy Code";this.buttonStyle="icon";this.buttonType="primary";o(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=p(this);var e=d()?_(t):g(t);return n(f,Object.assign({},e))};return t}());function _(t){var e=r(false),n=e[0],o=e[1];var i="SHARECODE001";return v({copyString:i,tooltiptext:t.tooltiptext,textAlign:t.textAlign,copyButtonLabel:t.copyButtonLabel,buttonStyle:t.buttonStyle,backgroundColor:t.backgroundColor,textColor:t.textColor,borderRadius:t.borderRadius,borderColor:t.borderColor,buttonType:t.buttonType,rewardStatus:"AVAILABLE",open:n,onClick:function(){navigator.clipboard.writeText(i);o(true);setTimeout((function(){return o(false)}),t.tooltiplifespan)}},t.demoData||{},{arrayMerge:function(t,e){return e}})}}}}));
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { r as registerInstance, h as h$1 } from './index-bfb7f924.js';
|
|
2
|
+
import { o as h, i as useState } from './dom-context-hooks.module-01c1b885.js';
|
|
3
|
+
import { i as isDemo } from './index.module-83586215.js';
|
|
4
|
+
import './jss-preset-default.esm-c36417f8.js';
|
|
5
|
+
import './JSS-8c381d8b.js';
|
|
6
|
+
import './mixins-acc245cc.js';
|
|
7
|
+
import { g as getProps } from './utils-93e14db3.js';
|
|
8
|
+
import { c as cjs } from './cjs-e829b75b.js';
|
|
9
|
+
import './useReferralCodes-ec892d5c.js';
|
|
10
|
+
import { C as CopyTextView } from './copy-text-view-3129fb22.js';
|
|
11
|
+
import { u as useShareLink } from './useShareLink-d31795c1.js';
|
|
12
|
+
|
|
13
|
+
const ShareLink = class {
|
|
14
|
+
constructor(hostRef) {
|
|
15
|
+
registerInstance(this, hostRef);
|
|
16
|
+
/**
|
|
17
|
+
* Shown inside a tooltip after someone has successfully copied the link to their clipboard
|
|
18
|
+
*
|
|
19
|
+
* @uiName Tooltip text
|
|
20
|
+
*/
|
|
21
|
+
this.tooltiptext = "Copied to Clipboard";
|
|
22
|
+
/**
|
|
23
|
+
* The number of milliseconds that the tooltip appears for
|
|
24
|
+
*
|
|
25
|
+
* @uiName Tooltip lifespan
|
|
26
|
+
*/
|
|
27
|
+
this.tooltiplifespan = 1000;
|
|
28
|
+
/**
|
|
29
|
+
* Change the text alignment
|
|
30
|
+
*
|
|
31
|
+
* @uiName Share link alignment
|
|
32
|
+
* @uiType string
|
|
33
|
+
* @uiEnum ["left", "center", "right"]
|
|
34
|
+
* @uiEnumNames ["Left", "Center", "Right"]
|
|
35
|
+
* @uiGroup Style
|
|
36
|
+
*/
|
|
37
|
+
this.textAlign = "left";
|
|
38
|
+
/**
|
|
39
|
+
* @uiName Copy button label
|
|
40
|
+
*/
|
|
41
|
+
this.copyButtonLabel = "Copy Link";
|
|
42
|
+
/**
|
|
43
|
+
* The type of the button that is used (primary or secondary).
|
|
44
|
+
* @uiName Button Type
|
|
45
|
+
* @uiType string
|
|
46
|
+
* @uiEnum ["primary", "secondary"]
|
|
47
|
+
* @uiEnumNames ["Primary", "Secondary"]
|
|
48
|
+
* @uiGroup Style
|
|
49
|
+
*/
|
|
50
|
+
this.buttonType = "primary";
|
|
51
|
+
/**
|
|
52
|
+
* Set the copy button style and placement
|
|
53
|
+
*
|
|
54
|
+
* @uiName Button style
|
|
55
|
+
* @uiType string
|
|
56
|
+
* @uiEnum ["icon", "button-outside", "button-below"]
|
|
57
|
+
* @uiEnumNames ["Icon", "Button outside", "Button below"]
|
|
58
|
+
* @uiGroup Style
|
|
59
|
+
*/
|
|
60
|
+
this.buttonStyle = "icon";
|
|
61
|
+
h(this);
|
|
62
|
+
}
|
|
63
|
+
disconnectedCallback() { }
|
|
64
|
+
render() {
|
|
65
|
+
const thisProps = getProps(this);
|
|
66
|
+
const props = isDemo()
|
|
67
|
+
? useDemoShareLink(thisProps)
|
|
68
|
+
: useShareLink(thisProps);
|
|
69
|
+
return h$1(CopyTextView, Object.assign({}, props));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function useDemoShareLink(props) {
|
|
73
|
+
const [open, setOpen] = useState(false);
|
|
74
|
+
const copyString = "https://www.example.com/sharelink/abc";
|
|
75
|
+
return cjs({
|
|
76
|
+
copyString: copyString,
|
|
77
|
+
tooltiptext: props.tooltiptext,
|
|
78
|
+
textAlign: props.textAlign,
|
|
79
|
+
buttonStyle: props.buttonStyle,
|
|
80
|
+
backgroundColor: props.backgroundColor,
|
|
81
|
+
textColor: props.textColor,
|
|
82
|
+
borderRadius: props.borderRadius,
|
|
83
|
+
buttonType: props.buttonType,
|
|
84
|
+
copyButtonLabel: props.copyButtonLabel,
|
|
85
|
+
borderColor: props.borderColor,
|
|
86
|
+
rewardStatus: "AVAILABLE",
|
|
87
|
+
open,
|
|
88
|
+
onClick: () => {
|
|
89
|
+
// Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
|
|
90
|
+
// Only if called from a user-initiated event
|
|
91
|
+
navigator.clipboard.writeText(copyString);
|
|
92
|
+
setOpen(true);
|
|
93
|
+
setTimeout(() => setOpen(false), props.tooltiplifespan);
|
|
94
|
+
},
|
|
95
|
+
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export { ShareLink as sqm_share_link };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./index-bfed5e90.system.js","./dom-context-hooks.module-7cdc0e68.system.js","./index.module-3ae23e6a.system.js","./jss-preset-default.esm-62a04d6d.system.js","./JSS-840a8fea.system.js","./mixins-8c4521b7.system.js","./utils-e473b250.system.js","./cjs-f0ef8d23.system.js","./useReferralCodes-c5a6014c.system.js","./copy-text-view-33cac657.system.js","./useShareLink-e6cd9153.system.js"],(function(t){"use strict";var e,o,n,s,i,r,u,c,a;return{setters:[function(t){e=t.r;o=t.h},function(t){n=t.o;s=t.i},function(t){i=t.i},function(){},function(){},function(){},function(t){r=t.g},function(t){u=t.c},function(){},function(t){c=t.C},function(t){a=t.u}],execute:function(){var l=t("sqm_share_link",function(){function t(t){e(this,t);this.tooltiptext="Copied to Clipboard";this.tooltiplifespan=1e3;this.textAlign="left";this.copyButtonLabel="Copy Link";this.buttonType="primary";this.buttonStyle="icon";n(this)}t.prototype.disconnectedCallback=function(){};t.prototype.render=function(){var t=r(this);var e=i()?f(t):a(t);return o(c,Object.assign({},e))};return t}());function f(t){var e=s(false),o=e[0],n=e[1];var i="https://www.example.com/sharelink/abc";return u({copyString:i,tooltiptext:t.tooltiptext,textAlign:t.textAlign,buttonStyle:t.buttonStyle,backgroundColor:t.backgroundColor,textColor:t.textColor,borderRadius:t.borderRadius,buttonType:t.buttonType,copyButtonLabel:t.copyButtonLabel,borderColor:t.borderColor,rewardStatus:"AVAILABLE",open:o,onClick:function(){navigator.clipboard.writeText(i);n(true);setTimeout((function(){return n(false)}),t.tooltiplifespan)}},t.demoData||{},{arrayMerge:function(t,e){return e}})}}}}));
|