@saasquatch/mint-components 2.1.8-27 → 2.1.8-28

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 (40) hide show
  1. package/dist/cjs/{ShadowViewAddon-e1e20b3a.js → ShadowViewAddon-363fcb59.js} +4 -3
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/mint-components.cjs.js +1 -1
  4. package/dist/cjs/sqm-big-stat_45.cjs.entry.js +10 -2
  5. package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -1
  6. package/dist/cjs/useShareLink-94e077a4.js +454 -0
  7. package/dist/collection/components/sqm-share-link/ShareLink.stories.js +1 -0
  8. package/dist/collection/components/sqm-share-link/sqm-share-link-view.js +3 -2
  9. package/dist/collection/components/sqm-share-link/sqm-share-link.js +41 -3
  10. package/dist/collection/components/sqm-share-link/useShareLink.js +1 -1
  11. package/dist/esm/{ShadowViewAddon-abfb02b8.js → ShadowViewAddon-667b4e9b.js} +4 -3
  12. package/dist/esm/loader.js +1 -1
  13. package/dist/esm/mint-components.js +1 -1
  14. package/dist/esm/sqm-big-stat_45.entry.js +10 -2
  15. package/dist/esm/sqm-stencilbook.entry.js +2 -1
  16. package/dist/esm/useShareLink-416a856a.js +451 -0
  17. package/dist/esm-es5/{ShadowViewAddon-abfb02b8.js → ShadowViewAddon-667b4e9b.js} +1 -1
  18. package/dist/esm-es5/loader.js +1 -1
  19. package/dist/esm-es5/mint-components.js +1 -1
  20. package/dist/esm-es5/sqm-big-stat_45.entry.js +1 -1
  21. package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
  22. package/dist/esm-es5/useShareLink-416a856a.js +1 -0
  23. package/dist/mint-components/mint-components.esm.js +1 -1
  24. package/dist/mint-components/{p-5167f62c.entry.js → p-154642b1.entry.js} +2 -2
  25. package/dist/mint-components/{p-97b2aabc.js → p-17ebb16a.js} +2 -2
  26. package/dist/mint-components/{p-608be5f4.system.entry.js → p-33caf964.system.entry.js} +1 -1
  27. package/dist/mint-components/p-4b365f1f.system.js +1 -1
  28. package/dist/mint-components/{p-95304aa0.system.js → p-609d0fc4.system.js} +1 -1
  29. package/dist/mint-components/{p-d36f7dcf.system.entry.js → p-627789fa.system.entry.js} +1 -1
  30. package/dist/mint-components/{p-38491d20.entry.js → p-7db028eb.entry.js} +2 -2
  31. package/dist/mint-components/useShareLink-416a856a.js +451 -0
  32. package/dist/mint-components/useShareLink-af6ede83.system.js +1 -0
  33. package/dist/types/components/sqm-share-link/sqm-share-link-view.d.ts +1 -0
  34. package/dist/types/components/sqm-share-link/sqm-share-link.d.ts +7 -0
  35. package/dist/types/components/sqm-share-link/useShareLink.d.ts +1 -0
  36. package/dist/types/components.d.ts +14 -0
  37. package/docs/docs.docx +0 -0
  38. package/docs/raisins.json +1 -1
  39. package/grapesjs/grapesjs.js +1 -1
  40. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import{r as e,h as t,c as r}from"./p-083180bf.js";import{b as o,i as a}from"./p-e7a9ce16.js";import{n as i,f as n,i as s,k as l,m as d,u as c,b as u,j as h}from"./p-a7fc1e02.js";import{i as m,_ as p,d as f,J as g,H as v,B as b,$ as y,w as x,b as w,L as k,y as C,j as E,r as _,e as F,Q as I,k as S,M as T,I as R,S as A}from"./p-1d450b85.js";import{j as q}from"./p-e7e129ac.js";import{c as N}from"./p-c1086930.js";import{g as M,a as D}from"./p-9ec99ced.js";import{c as L}from"./p-cef45012.js";import"./p-21851092.js";import"./p-49b20dae.js";import{C as P}from"./p-d276468c.js";import"./p-cabf6326.js";import{A as B,u as O}from"./p-33a6ab09.js";import{R as j,a as z}from"./p-e5e8e13e.js";import{P as V}from"./p-669d52c4.js";import{a as $}from"./p-30967f75.js";import{u as U}from"./p-a03189bd.js";import"./p-2786819c.js";import{p as H}from"./p-8d363802.js";import{o as Y}from"./p-f75de169.js";import{E as W}from"./p-7010498f.js";import{u as G}from"./p-bd804f4c.js";import{R as K,L as J,u as Z}from"./p-6684e9ad.js";import{i as X}from"./p-fca34d77.js";import{E as Q}from"./p-044a76f1.js";import{u as ee,W as te,B as re,C as oe,d as ae,e as ie,D as ne,E as se,H as le,I as de,U as ce,Q as ue,X as he,L as me,N as pe,f as fe,P as ge,g as ve,h as be,c as ye,R as xe,i as we,Y as ke,G as Ce,a as Ee,K as _e,J as Fe,S as Ie,T as Se}from"./p-97b2aabc.js";import"./p-b6a1e2ac.js";import{T as Te,a as Re,U as Ae,C as qe,b as Ne,S as Me,g as De,c as Le,G as Pe,d as Be,e as Oe,h as je,i as ze,j as Ve,k as $e,L as Ue}from"./p-9fa6606e.js";import{p as He,e as Ye}from"./p-0797a946.js";import{u as We}from"./p-df9cfdc9.js";const Ge={main:{brandFont:"Netflix Sans, Arial, sans-serif",brandColor:"#E50914"},border:{borderColor:"#333333",borderRadius:4,borderThickness:1},color:{loadingSkeleton:{background:"#272727",animationBackground:"#E50914"},textColorShades:{mainText:"white",subduedText:"#B3B3B3"},backgroundColor:"#101010",accentColorShades:{text:"#E50914",icon:"#E50914",border:"#E50914",background:"#300609"},success:{text:"#66BB6A",border:"#4CAF50",background:"#1B5E20",iconAndBadge:"#4CAF50"},warning:{text:"#FFCA28",border:"#FFA726",background:"#F57C00",iconAndBadge:"#FFA726"},critical:{text:"#EF9A9A",border:"#E50914",background:"#B71C1C",iconAndBadge:"#E50914"},informative:{text:"#64B5F6",border:"#42A5F5",background:"#1976D2",iconAndBadge:"#42A5F5"},neutral:{text:"white",iconAndBadge:"#B3B3B3",border:"#333333",background:"#222222"}},primaryButton:{buttonColor:{background:"#E50914",border:"transparent",label:"#FFFFFF"},buttonHoverColor:{background:"#CC0000",border:"transparent",label:"#FFFFFF"},borderRadius:4},secondaryButton:{buttonColor:{background:"transparent",border:"#B3B3B3",label:"#FFFFFF"},buttonHoverColor:{background:"#333333",border:"#B3B3B3",label:"#FFFFFF"},borderRadius:4},formFields:{formFieldColor:{background:"#222222",border:"#B3B3B3",inputText:"#B3B3B3"},hoverStateColor:"#777777",selectedStateColor:"#E50914",borderRadius:4}},Ke=Object.freeze({__proto__:null,Default:null,Netflix:Ge,Amazon:{main:{brandFont:"Amazon Ember, Arial, sans-serif",brandColor:"#FF9900"},border:{borderColor:"#D5D9D9",borderRadius:4,borderThickness:1},color:{backgroundColor:"#ffffff",loadingSkeleton:{background:"hsl(240 4.8% 95.9%)",animationBackground:"#FF9900"},textColorShades:{mainText:"#2f2f2f",subduedText:"#565959"},accentColorShades:{text:"#FF9900",icon:"#FF9900",border:"#FFBF66",background:"#FFF4DD"},success:{text:"#198754",border:"#BCE8B2",background:"#D4EDDA",iconAndBadge:"#28A745"},warning:{text:"#856404",border:"#FFEBA2",background:"#FFF3CD",iconAndBadge:"#FFC107"},critical:{text:"#721C24",border:"#F5C6CB",background:"#F8D7DA",iconAndBadge:"#DC3545"},informative:{text:"#004085",border:"#B8DAFF",background:"#CCE5FF",iconAndBadge:"#007BFF"},neutral:{text:"#232F3E",iconAndBadge:"#565959",border:"#D5D9D9",background:"#F0F2F2"}},primaryButton:{buttonColor:{background:"#FF9900",border:"transparent",label:"#FFFFFF"},buttonHoverColor:{background:"#EB9100",border:"transparent",label:"#FFFFFF"},borderRadius:4},secondaryButton:{buttonColor:{background:"#FFFFFF",border:"#888C8C",label:"#232F3E"},buttonHoverColor:{background:"#F0F2F2",border:"#888C8C",label:"#232F3E"},borderRadius:4},formFields:{formFieldColor:{background:"#FFFFFF",border:"#D5D9D9",inputText:"#2f2f2f"},borderRadius:4,hoverStateColor:"#A2A2A2",selectedStateColor:"#007185"}},Spotify:{main:{brandColor:"#1ed760"},border:{borderColor:"#f4f4f4",borderRadius:18,borderThickness:1},color:{loadingSkeleton:{background:"#282928",animationBackground:"#1ed760"},textColorShades:{mainText:"white",subduedText:"white"},backgroundColor:"#121212",accentColorShades:{icon:"#1ed760"}},primaryButton:{buttonColor:{background:"#1ed760",border:"transparent",label:"#121212"},buttonHoverColor:{background:"#1DB954",border:"transparent",label:"#121212"},borderRadius:30},secondaryButton:{buttonColor:{background:"#191414",border:"#FFFFFF",label:"#FFFFFF"},buttonHoverColor:{background:"#282828",border:"#FFFFFF",label:"#121212"},borderRadius:30},formFields:{formFieldColor:{background:"#121212",border:"#7c7c7c",inputText:"#fff"},borderRadius:30,hoverStateColor:"white",selectedStateColor:"white"}},Google:{main:{brandColor:"#4285F4",brandFont:"Roboto, Arial, sans-serif"},border:{borderColor:"#DADCE0",borderRadius:4,borderThickness:1},color:{textColorShades:{mainText:"#212124",subduedText:"#5F6368"},backgroundColor:"#FFFFFF",accentColorShades:{text:"#1A73E8",border:"#8AB4F8",background:"#E8F0FE",icon:"#4285F4"},success:{text:"#044e1d",border:"#A8DCD7",background:"#E6F4EA",iconAndBadge:"#34A853"},warning:{text:"#996a3d",border:"#FCD667",background:"#FFF7EE",iconAndBadge:"#FBBC04"},critical:{text:"#760b09",border:"#F28B82",background:"#FCE8E6",iconAndBadge:"#EA4335"},informative:{text:"#01368c",border:"#BFDBFE",background:"#E8F0FE",iconAndBadge:"#4285F4"},neutral:{text:"#202124",border:"#DADCE0",background:"#F8F9FA",iconAndBadge:"#5F6368"}},primaryButton:{buttonColor:{background:"#4285F4",border:"transparent",label:"#FFFFFF"},buttonHoverColor:{background:"#3C7CD1",border:"transparent",label:"#FFFFFF"},borderRadius:4},secondaryButton:{buttonColor:{background:"#FFFFFF",border:"#DADCE0",label:"#4285F4"},buttonHoverColor:{background:"#E8F0FE",border:"#DADCE0",label:"#4285F4"},borderRadius:4},formFields:{formFieldColor:{background:"#FFFFFF",border:"#DADCE0",inputText:"#202124"},borderRadius:4,hoverStateColor:"#9AA0A6",selectedStateColor:"#4285F4"}}}),Je=class{constructor(t){e(this,t),this.flexReverse=!1,this.alignment="center",this.ignored=!0,i(this)}disconnectedCallback(){}render(){var e;const{props:r,label:o}=m()?ee(this):te(this),a=!!(null===(e=p().innerHTML)||void 0===e?void 0:e.trim()),i=t("slot",{name:"label"},a?t("slot",null):o);return t(re,Object.assign({},r,{labelSlot:i}))}};function Ze(e,t,r){return Math.min(Math.max(e,r),t)}class Xe extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}function Qe(e){if("string"!=typeof e)throw new Xe(e);if("transparent"===e.trim().toLowerCase())return[0,0,0,0];let t=e.trim();t=st.test(e)?function(e){const t=e.toLowerCase().trim(),r=tt[function(e){let t=5381,r=e.length;for(;r;)t=33*t^e.charCodeAt(--r);return(t>>>0)%2341}(t)];if(!r)throw new Xe(e);return`#${r}`}(e):e;const r=ot.exec(t);if(r){const e=Array.from(r).slice(1);return[...e.slice(0,3).map((e=>parseInt(rt(e,2),16))),parseInt(rt(e[3]||"f",2),16)/255]}const o=at.exec(t);if(o){const e=Array.from(o).slice(1);return[...e.slice(0,3).map((e=>parseInt(e,16))),parseInt(e[3]||"ff",16)/255]}const a=it.exec(t);if(a){const e=Array.from(a).slice(1);return[...e.slice(0,3).map((e=>parseInt(e,10))),parseFloat(e[3]||"1")]}const i=nt.exec(t);if(i){const[t,r,o,a]=Array.from(i).slice(1).map(parseFloat);if(Ze(0,100,r)!==r)throw new Xe(e);if(Ze(0,100,o)!==o)throw new Xe(e);return[...dt(t,r,o),a||1]}throw new Xe(e)}const et=e=>parseInt(e.replace(/_/g,""),36),tt="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(((e,t)=>{const r=et(t.substring(0,3)),o=et(t.substring(3)).toString(16);let a="";for(let e=0;e<6-o.length;e++)a+="0";return e[r]=`${a}${o}`,e}),{}),rt=(e,t)=>Array.from(Array(t)).map((()=>e)).join(""),ot=new RegExp(`^#${rt("([a-f0-9])",3)}([a-f0-9])?$`,"i"),at=new RegExp(`^#${rt("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),it=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${rt(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),nt=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,st=/^[a-z]+$/i,lt=e=>Math.round(255*e),dt=(e,t,r)=>{let o=r/100;if(0===t)return[o,o,o].map(lt);const a=(e%360+360)%360/60,i=(1-Math.abs(2*o-1))*(t/100),n=i*(1-Math.abs(a%2-1));let s=0,l=0,d=0;a>=0&&a<1?(s=i,l=n):a>=1&&a<2?(s=n,l=i):a>=2&&a<3?(l=i,d=n):a>=3&&a<4?(l=n,d=i):a>=4&&a<5?(s=n,d=i):a>=5&&a<6&&(s=i,d=n);const c=o-i/2;return[s+c,l+c,d+c].map(lt)},ct=[50,100,200,300,400,500,600,700,800,900,950],ut=[.95,.86,.76,.66,.56,.46,.39,.32,.25,.18,.15],ht=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;function mt(e,t="primary"){const[r,o,a,i]=function(e){const t=e.trim(),r=ht.exec(t);if(r){const[t,o,a,i]=Array.from(r).slice(1).map(parseFloat);if(Ze(0,100,o)!==o)throw new Xe(e);if(Ze(0,100,a)!==a)throw new Xe(e);return[t,o/100,a,i||1]}return function(e){const[t,r,o,a]=Qe(e).map(((e,t)=>3===t?e:e/255)),i=Math.max(t,r,o),n=Math.min(t,r,o),s=(i+n)/2;if(i===n)return[0,0,s,a];const l=i-n;return[60*(t===i?(r-o)/l+(r<o?6:0):r===i?(o-t)/l+2:(t-r)/l+4),s>.5?l/(2-i-n):l/(i+n),s,a]}(e)}(e);return ut.map((e=>function(e,t,r,o){return`hsla(${(e%360).toFixed()}, ${Ze(0,100,100*t).toFixed()}%, ${Ze(0,100,100*r).toFixed()}%, ${parseFloat(Ze(0,1,o).toFixed(3))})`}(r,o,e,i))).map(((e,r)=>`--sl-color-${t}-${ct[r]}: ${e};\n`))}const pt=class{constructor(t){e(this,t),i(this)}disconnectedCallback(){}render(){var e,a,i,s,l,d;const c=null===(a=null===(e=window.SquatchBrandingConfig)||void 0===e?void 0:e.main)||void 0===a?void 0:a.brandFont,u=(null===(s=null===(i=window.SquatchBrandingConfig)||void 0===i?void 0:i.main)||void 0===s?void 0:s.brandColor)?"":null!==(l=function(e){if(e)try{return function(e,t="primary"){return mt(e,t).join("\n")}(e)}catch{}}(this.brandColor))&&void 0!==l?l:"",h=(null!==(d=this.brandFont)&&void 0!==d?d:"Nunito Sans").trim()||void 0;n((()=>{if(!h||c)return;const e=document.createElement("link");return e.setAttribute("href",o(h)),e.setAttribute("rel","stylesheet"),document.head.appendChild(e),()=>document.head.removeChild(e)}),[h]);const m=null!=h?h:"";return t(r,null,t("style",null,`\n\n :host{\n display: contents;\n }\n /* \n Selects any element placed inside a slot\n - resets css variable inheritence for fonts\n \n */\n\n ${c?"":`\n ::slotted(*) {\n --sl-font-sans: "${m}", arial;\n --sl-input-font-family: "${m}", arial;\n --sl-tooltip-font-family: "${m}", arial;\n font-family: "${m}", arial;\n\t\t\t\n ${u}\n `}\n\n --sl-focus-ring-color-primary: var(--sl-color-primary-100);\n --sl-input-border-color-focus: var(--sl-color-primary-500);\n --sl-color-primary-hue: var(--sl-color-primary-500);\n }`),t("slot",null))}},ft=class{constructor(t){e(this,t),this.selectedBrand="Netflix",this.brands=[{name:"Netflix",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803365/netflix_ftjbrr.png"},{name:"Amazon",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803366/amazon_mc22fr.png"},{name:"Spotify",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803510/spotify_j5qi1r.png"},{name:"Google",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803168/pngimg.com_-_google_PNG19644_jvypwl.png"}];const r=localStorage.getItem("localStorageBrandKey");this.selectedBrand=r,window.SquatchBrandingConfig=Ke[r]||Ge;const o=new CustomEvent("brandingConfigUpdated",{detail:window.SquatchBrandingConfig});window.dispatchEvent(o)}componentDidLoad(){const e=localStorage.getItem("localStorageBrandKey");this.selectedBrand=e}disconnectedCallback(){}updateBrand(e){this.selectedBrand=e;const t=Ke[e]||Ge,r=JSON.stringify(t);localStorage.setItem("localStorageBrandKey",e),localStorage.setItem("localStorageBrandConfigKey",r),window.SquatchBrandingConfig=t,window.location.reload();const o=new CustomEvent("brandingConfigUpdated",{detail:window.SquatchBrandingConfig});window.dispatchEvent(o)}render(){return t(r,null,t("style",null,"\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');\n\n :host {\n display: block; /* Ensure the custom element itself is a block-level element */\n font-family: 'Inter', sans-serif;\n }\n\n .card-container {\n background-color: #fff !important; \n border-radius: 18px; \n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); \n width: 100%;\n max-width: 350px;\n overflow: hidden;\n padding: 10px;\n position: fixed;\n bottom: 0;\n right: 0;\n z-index: 999999;\n border: 1px solid #ccc;\n margin: 10px;\n }\n\n .card-heading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-bottom: 10px;\n color: black;\n margin: 0;\n font-size: 16px;\n }\n\n .segmented-control-container {\n display: flex;\n background-color: #e5e7eb !important; \n border-radius: 9999px; \n padding: 0.25rem; \n margin-left: auto;\n margin-right: auto;\n max-width: 28rem;\n box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05); \n }\n\n .brand-segment {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n flex: 1;\n padding: 0px 8px; \n cursor: pointer;\n transition: all 300ms ease-in-out;\n border-radius: 9999px;\n color: #4b5563; \n cursor: pointer;\n }\n\n .brand-segment:hover {\n background-color: #f3f4f6 !important;\n }\n\n .brand-segment.active {\n background-color: #fff !important;\n color: #1f2937; \n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n }\n\n .brand-logo {\n height: 40px;\n width: 40px; \n object-fit: contain;\n }\n\n .brand-name {\n font-size: 0.75rem; \n line-height: 1rem; \n font-weight: 600; \n color: #4b5563;\n }\n\n .brand-segment.active .brand-name {\n color: #1f2937; \n }\n\n .content-area {\n padding: 2rem; \n }\n\n .selected-text {\n color: #4b5563; \n text-align: center;\n font-size: 1.125rem; \n line-height: 1.75rem; \n }\n\n .selected-brand-name {\n font-weight: 700; /* font-bold */\n color: #6d28d9; /* text-purple-700 */\n }\n\n .dynamic-content-box {\n margin-top: 1.5rem; /* mt-6 */\n padding: 1rem; /* p-4 */\n background-color: #f9fafb; /* bg-gray-50 */\n border-radius: 0.5rem; /* rounded-lg */\n color: #374151; /* text-gray-700 */\n font-size: 0.875rem; /* text-sm */\n line-height: 1.25rem; /* text-sm */\n font-style: italic;\n }\n\n /* Responsive adjustments for smaller screens if needed */\n @media (max-width: 640px) {\n .segmented-control-container {\n max-width: 100%; /* Allows it to take full width on small screens */\n padding: 0.15rem; /* Slightly less padding */\n }\n .brand-segment {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n .brand-logo {\n height: 1.8rem; /* Slightly smaller on mobile */\n }\n }\n "),t("div",{class:"card-container"},t("h2",{class:"card-heading"},"Select Branding"),t("div",{class:"segmented-control-container"},this.brands.map((e=>t("div",{key:e.name,class:"brand-segment "+(this.selectedBrand===e.name?"active":""),onClick:()=>this.updateBrand(e.name)},t("img",{src:e.logoUrl,alt:`${e.name} Logo`,class:"brand-logo",onError:e=>{e.target.src="https://placehold.co/80x40/cccccc/000000?text=Logo"}})))))))}},gt=class{constructor(t){e(this,t),this.ignored=!0,this.width=347,this.gap=24,i(this)}disconnectedCallback(){}render(){return t(oe,Object.assign({},M(this)),t("slot",null))}};function vt(e){var t;const r=s(j),[o,a]=l(!1);return n((()=>{var t,o;(null===(t=null==r?void 0:r.initialData)||void 0===t?void 0:t[e.checkboxName])&&a(!!(null===(o=null==r?void 0:r.initialData)||void 0===o?void 0:o[e.checkboxName]))}),[null===(t=null==r?void 0:r.initialData)||void 0===t?void 0:t[e.checkboxName]]),{states:{registrationFormState:r,checked:o},callbacks:{setChecked:a}}}const bt=class{constructor(t){e(this,t),this.ignored=!0,this.checkboxLabel="By signing up you agree to the {labelLink}",this.checkboxLabelLink="https://example.com",this.checkboxLabelLinkText="Terms and Conditions",this.errorMessage="Must be checked",this.checkboxOptional=!1,i(this)}disconnectedCallback(){}render(){const e=D([{attribute:"checkbox-name",value:this.checkboxName}]);if(!m()&&e)return t(K,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const r={...M(this)},{states:o,callbacks:a}=m()?N({states:{registrationFormState:{},checked:!1},callbacks:{setChecked:()=>{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):vt(this);return t(ae,{states:o,content:r,callbacks:a})}},yt=f.gql`
1
+ import{r as e,h as t,c as r}from"./p-083180bf.js";import{b as o,i as a}from"./p-e7a9ce16.js";import{n as i,f as n,i as s,k as l,m as d,u as c,b as u,j as h}from"./p-a7fc1e02.js";import{i as m,_ as p,d as f,J as g,H as v,B as b,$ as y,w as x,b as w,L as k,y as C,j as E,r as _,e as F,Q as I,k as S,M as T,I as R,S as A}from"./p-1d450b85.js";import{j as q}from"./p-e7e129ac.js";import{c as N}from"./p-c1086930.js";import{g as M,a as D}from"./p-9ec99ced.js";import{c as L}from"./p-cef45012.js";import"./p-21851092.js";import"./p-49b20dae.js";import{C as P}from"./p-d276468c.js";import"./p-cabf6326.js";import{A as B,u as O}from"./p-33a6ab09.js";import{R as j,a as z}from"./p-e5e8e13e.js";import{P as V}from"./p-669d52c4.js";import{a as $}from"./p-30967f75.js";import{u as U}from"./p-a03189bd.js";import"./p-2786819c.js";import{p as H}from"./p-8d363802.js";import{o as Y}from"./p-f75de169.js";import{E as W}from"./p-7010498f.js";import{u as G}from"./p-bd804f4c.js";import{R as K,L as J,u as Z}from"./p-6684e9ad.js";import{i as X}from"./p-fca34d77.js";import{E as Q}from"./p-044a76f1.js";import{u as ee,W as te,B as re,C as oe,d as ae,e as ie,D as ne,E as se,H as le,I as de,U as ce,Q as ue,X as he,L as me,N as pe,f as fe,P as ge,g as ve,h as be,c as ye,R as xe,i as we,Y as ke,G as Ce,a as Ee,K as _e,J as Fe,S as Ie,T as Se}from"./p-17ebb16a.js";import"./p-b6a1e2ac.js";import{T as Te,a as Re,U as Ae,C as qe,b as Ne,S as Me,g as De,c as Le,G as Pe,d as Be,e as Oe,h as je,i as ze,j as Ve,k as $e,L as Ue}from"./p-9fa6606e.js";import{p as He,e as Ye}from"./p-0797a946.js";import{u as We}from"./p-df9cfdc9.js";const Ge={main:{brandFont:"Netflix Sans, Arial, sans-serif",brandColor:"#E50914"},border:{borderColor:"#333333",borderRadius:4,borderThickness:1},color:{loadingSkeleton:{background:"#272727",animationBackground:"#E50914"},textColorShades:{mainText:"white",subduedText:"#B3B3B3"},backgroundColor:"#101010",accentColorShades:{text:"#E50914",icon:"#E50914",border:"#E50914",background:"#300609"},success:{text:"#66BB6A",border:"#4CAF50",background:"#1B5E20",iconAndBadge:"#4CAF50"},warning:{text:"#FFCA28",border:"#FFA726",background:"#F57C00",iconAndBadge:"#FFA726"},critical:{text:"#EF9A9A",border:"#E50914",background:"#B71C1C",iconAndBadge:"#E50914"},informative:{text:"#64B5F6",border:"#42A5F5",background:"#1976D2",iconAndBadge:"#42A5F5"},neutral:{text:"white",iconAndBadge:"#B3B3B3",border:"#333333",background:"#222222"}},primaryButton:{buttonColor:{background:"#E50914",border:"transparent",label:"#FFFFFF"},buttonHoverColor:{background:"#CC0000",border:"transparent",label:"#FFFFFF"},borderRadius:4},secondaryButton:{buttonColor:{background:"transparent",border:"#B3B3B3",label:"#FFFFFF"},buttonHoverColor:{background:"#333333",border:"#B3B3B3",label:"#FFFFFF"},borderRadius:4},formFields:{formFieldColor:{background:"#222222",border:"#B3B3B3",inputText:"#B3B3B3"},hoverStateColor:"#777777",selectedStateColor:"#E50914",borderRadius:4}},Ke=Object.freeze({__proto__:null,Default:null,Netflix:Ge,Amazon:{main:{brandFont:"Amazon Ember, Arial, sans-serif",brandColor:"#FF9900"},border:{borderColor:"#D5D9D9",borderRadius:4,borderThickness:1},color:{backgroundColor:"#ffffff",loadingSkeleton:{background:"hsl(240 4.8% 95.9%)",animationBackground:"#FF9900"},textColorShades:{mainText:"#2f2f2f",subduedText:"#565959"},accentColorShades:{text:"#FF9900",icon:"#FF9900",border:"#FFBF66",background:"#FFF4DD"},success:{text:"#198754",border:"#BCE8B2",background:"#D4EDDA",iconAndBadge:"#28A745"},warning:{text:"#856404",border:"#FFEBA2",background:"#FFF3CD",iconAndBadge:"#FFC107"},critical:{text:"#721C24",border:"#F5C6CB",background:"#F8D7DA",iconAndBadge:"#DC3545"},informative:{text:"#004085",border:"#B8DAFF",background:"#CCE5FF",iconAndBadge:"#007BFF"},neutral:{text:"#232F3E",iconAndBadge:"#565959",border:"#D5D9D9",background:"#F0F2F2"}},primaryButton:{buttonColor:{background:"#FF9900",border:"transparent",label:"#FFFFFF"},buttonHoverColor:{background:"#EB9100",border:"transparent",label:"#FFFFFF"},borderRadius:4},secondaryButton:{buttonColor:{background:"#FFFFFF",border:"#888C8C",label:"#232F3E"},buttonHoverColor:{background:"#F0F2F2",border:"#888C8C",label:"#232F3E"},borderRadius:4},formFields:{formFieldColor:{background:"#FFFFFF",border:"#D5D9D9",inputText:"#2f2f2f"},borderRadius:4,hoverStateColor:"#A2A2A2",selectedStateColor:"#007185"}},Spotify:{main:{brandColor:"#1ed760"},border:{borderColor:"#f4f4f4",borderRadius:18,borderThickness:1},color:{loadingSkeleton:{background:"#282928",animationBackground:"#1ed760"},textColorShades:{mainText:"white",subduedText:"white"},backgroundColor:"#121212",accentColorShades:{icon:"#1ed760"}},primaryButton:{buttonColor:{background:"#1ed760",border:"transparent",label:"#121212"},buttonHoverColor:{background:"#1DB954",border:"transparent",label:"#121212"},borderRadius:30},secondaryButton:{buttonColor:{background:"#191414",border:"#FFFFFF",label:"#FFFFFF"},buttonHoverColor:{background:"#282828",border:"#FFFFFF",label:"#121212"},borderRadius:30},formFields:{formFieldColor:{background:"#121212",border:"#7c7c7c",inputText:"#fff"},borderRadius:30,hoverStateColor:"white",selectedStateColor:"white"}},Google:{main:{brandColor:"#4285F4",brandFont:"Roboto, Arial, sans-serif"},border:{borderColor:"#DADCE0",borderRadius:4,borderThickness:1},color:{textColorShades:{mainText:"#212124",subduedText:"#5F6368"},backgroundColor:"#FFFFFF",accentColorShades:{text:"#1A73E8",border:"#8AB4F8",background:"#E8F0FE",icon:"#4285F4"},success:{text:"#044e1d",border:"#A8DCD7",background:"#E6F4EA",iconAndBadge:"#34A853"},warning:{text:"#996a3d",border:"#FCD667",background:"#FFF7EE",iconAndBadge:"#FBBC04"},critical:{text:"#760b09",border:"#F28B82",background:"#FCE8E6",iconAndBadge:"#EA4335"},informative:{text:"#01368c",border:"#BFDBFE",background:"#E8F0FE",iconAndBadge:"#4285F4"},neutral:{text:"#202124",border:"#DADCE0",background:"#F8F9FA",iconAndBadge:"#5F6368"}},primaryButton:{buttonColor:{background:"#4285F4",border:"transparent",label:"#FFFFFF"},buttonHoverColor:{background:"#3C7CD1",border:"transparent",label:"#FFFFFF"},borderRadius:4},secondaryButton:{buttonColor:{background:"#FFFFFF",border:"#DADCE0",label:"#4285F4"},buttonHoverColor:{background:"#E8F0FE",border:"#DADCE0",label:"#4285F4"},borderRadius:4},formFields:{formFieldColor:{background:"#FFFFFF",border:"#DADCE0",inputText:"#202124"},borderRadius:4,hoverStateColor:"#9AA0A6",selectedStateColor:"#4285F4"}}}),Je=class{constructor(t){e(this,t),this.flexReverse=!1,this.alignment="center",this.ignored=!0,i(this)}disconnectedCallback(){}render(){var e;const{props:r,label:o}=m()?ee(this):te(this),a=!!(null===(e=p().innerHTML)||void 0===e?void 0:e.trim()),i=t("slot",{name:"label"},a?t("slot",null):o);return t(re,Object.assign({},r,{labelSlot:i}))}};function Ze(e,t,r){return Math.min(Math.max(e,r),t)}class Xe extends Error{constructor(e){super(`Failed to parse color: "${e}"`)}}function Qe(e){if("string"!=typeof e)throw new Xe(e);if("transparent"===e.trim().toLowerCase())return[0,0,0,0];let t=e.trim();t=st.test(e)?function(e){const t=e.toLowerCase().trim(),r=tt[function(e){let t=5381,r=e.length;for(;r;)t=33*t^e.charCodeAt(--r);return(t>>>0)%2341}(t)];if(!r)throw new Xe(e);return`#${r}`}(e):e;const r=ot.exec(t);if(r){const e=Array.from(r).slice(1);return[...e.slice(0,3).map((e=>parseInt(rt(e,2),16))),parseInt(rt(e[3]||"f",2),16)/255]}const o=at.exec(t);if(o){const e=Array.from(o).slice(1);return[...e.slice(0,3).map((e=>parseInt(e,16))),parseInt(e[3]||"ff",16)/255]}const a=it.exec(t);if(a){const e=Array.from(a).slice(1);return[...e.slice(0,3).map((e=>parseInt(e,10))),parseFloat(e[3]||"1")]}const i=nt.exec(t);if(i){const[t,r,o,a]=Array.from(i).slice(1).map(parseFloat);if(Ze(0,100,r)!==r)throw new Xe(e);if(Ze(0,100,o)!==o)throw new Xe(e);return[...dt(t,r,o),a||1]}throw new Xe(e)}const et=e=>parseInt(e.replace(/_/g,""),36),tt="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(((e,t)=>{const r=et(t.substring(0,3)),o=et(t.substring(3)).toString(16);let a="";for(let e=0;e<6-o.length;e++)a+="0";return e[r]=`${a}${o}`,e}),{}),rt=(e,t)=>Array.from(Array(t)).map((()=>e)).join(""),ot=new RegExp(`^#${rt("([a-f0-9])",3)}([a-f0-9])?$`,"i"),at=new RegExp(`^#${rt("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),it=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${rt(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),nt=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,st=/^[a-z]+$/i,lt=e=>Math.round(255*e),dt=(e,t,r)=>{let o=r/100;if(0===t)return[o,o,o].map(lt);const a=(e%360+360)%360/60,i=(1-Math.abs(2*o-1))*(t/100),n=i*(1-Math.abs(a%2-1));let s=0,l=0,d=0;a>=0&&a<1?(s=i,l=n):a>=1&&a<2?(s=n,l=i):a>=2&&a<3?(l=i,d=n):a>=3&&a<4?(l=n,d=i):a>=4&&a<5?(s=n,d=i):a>=5&&a<6&&(s=i,d=n);const c=o-i/2;return[s+c,l+c,d+c].map(lt)},ct=[50,100,200,300,400,500,600,700,800,900,950],ut=[.95,.86,.76,.66,.56,.46,.39,.32,.25,.18,.15],ht=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i;function mt(e,t="primary"){const[r,o,a,i]=function(e){const t=e.trim(),r=ht.exec(t);if(r){const[t,o,a,i]=Array.from(r).slice(1).map(parseFloat);if(Ze(0,100,o)!==o)throw new Xe(e);if(Ze(0,100,a)!==a)throw new Xe(e);return[t,o/100,a,i||1]}return function(e){const[t,r,o,a]=Qe(e).map(((e,t)=>3===t?e:e/255)),i=Math.max(t,r,o),n=Math.min(t,r,o),s=(i+n)/2;if(i===n)return[0,0,s,a];const l=i-n;return[60*(t===i?(r-o)/l+(r<o?6:0):r===i?(o-t)/l+2:(t-r)/l+4),s>.5?l/(2-i-n):l/(i+n),s,a]}(e)}(e);return ut.map((e=>function(e,t,r,o){return`hsla(${(e%360).toFixed()}, ${Ze(0,100,100*t).toFixed()}%, ${Ze(0,100,100*r).toFixed()}%, ${parseFloat(Ze(0,1,o).toFixed(3))})`}(r,o,e,i))).map(((e,r)=>`--sl-color-${t}-${ct[r]}: ${e};\n`))}const pt=class{constructor(t){e(this,t),i(this)}disconnectedCallback(){}render(){var e,a,i,s,l,d;const c=null===(a=null===(e=window.SquatchBrandingConfig)||void 0===e?void 0:e.main)||void 0===a?void 0:a.brandFont,u=(null===(s=null===(i=window.SquatchBrandingConfig)||void 0===i?void 0:i.main)||void 0===s?void 0:s.brandColor)?"":null!==(l=function(e){if(e)try{return function(e,t="primary"){return mt(e,t).join("\n")}(e)}catch{}}(this.brandColor))&&void 0!==l?l:"",h=(null!==(d=this.brandFont)&&void 0!==d?d:"Nunito Sans").trim()||void 0;n((()=>{if(!h||c)return;const e=document.createElement("link");return e.setAttribute("href",o(h)),e.setAttribute("rel","stylesheet"),document.head.appendChild(e),()=>document.head.removeChild(e)}),[h]);const m=null!=h?h:"";return t(r,null,t("style",null,`\n\n :host{\n display: contents;\n }\n /* \n Selects any element placed inside a slot\n - resets css variable inheritence for fonts\n \n */\n\n ${c?"":`\n ::slotted(*) {\n --sl-font-sans: "${m}", arial;\n --sl-input-font-family: "${m}", arial;\n --sl-tooltip-font-family: "${m}", arial;\n font-family: "${m}", arial;\n\t\t\t\n ${u}\n `}\n\n --sl-focus-ring-color-primary: var(--sl-color-primary-100);\n --sl-input-border-color-focus: var(--sl-color-primary-500);\n --sl-color-primary-hue: var(--sl-color-primary-500);\n }`),t("slot",null))}},ft=class{constructor(t){e(this,t),this.selectedBrand="Netflix",this.brands=[{name:"Netflix",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803365/netflix_ftjbrr.png"},{name:"Amazon",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803366/amazon_mc22fr.png"},{name:"Spotify",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803510/spotify_j5qi1r.png"},{name:"Google",logoUrl:"https://res.cloudinary.com/saasquatch-staging/image/upload/v1750803168/pngimg.com_-_google_PNG19644_jvypwl.png"}];const r=localStorage.getItem("localStorageBrandKey");this.selectedBrand=r,window.SquatchBrandingConfig=Ke[r]||Ge;const o=new CustomEvent("brandingConfigUpdated",{detail:window.SquatchBrandingConfig});window.dispatchEvent(o)}componentDidLoad(){const e=localStorage.getItem("localStorageBrandKey");this.selectedBrand=e}disconnectedCallback(){}updateBrand(e){this.selectedBrand=e;const t=Ke[e]||Ge,r=JSON.stringify(t);localStorage.setItem("localStorageBrandKey",e),localStorage.setItem("localStorageBrandConfigKey",r),window.SquatchBrandingConfig=t,window.location.reload();const o=new CustomEvent("brandingConfigUpdated",{detail:window.SquatchBrandingConfig});window.dispatchEvent(o)}render(){return t(r,null,t("style",null,"\n @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');\n\n :host {\n display: block; /* Ensure the custom element itself is a block-level element */\n font-family: 'Inter', sans-serif;\n }\n\n .card-container {\n background-color: #fff !important; \n border-radius: 18px; \n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); \n width: 100%;\n max-width: 350px;\n overflow: hidden;\n padding: 10px;\n position: fixed;\n bottom: 0;\n right: 0;\n z-index: 999999;\n border: 1px solid #ccc;\n margin: 10px;\n }\n\n .card-heading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-bottom: 10px;\n color: black;\n margin: 0;\n font-size: 16px;\n }\n\n .segmented-control-container {\n display: flex;\n background-color: #e5e7eb !important; \n border-radius: 9999px; \n padding: 0.25rem; \n margin-left: auto;\n margin-right: auto;\n max-width: 28rem;\n box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05); \n }\n\n .brand-segment {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n flex: 1;\n padding: 0px 8px; \n cursor: pointer;\n transition: all 300ms ease-in-out;\n border-radius: 9999px;\n color: #4b5563; \n cursor: pointer;\n }\n\n .brand-segment:hover {\n background-color: #f3f4f6 !important;\n }\n\n .brand-segment.active {\n background-color: #fff !important;\n color: #1f2937; \n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n }\n\n .brand-logo {\n height: 40px;\n width: 40px; \n object-fit: contain;\n }\n\n .brand-name {\n font-size: 0.75rem; \n line-height: 1rem; \n font-weight: 600; \n color: #4b5563;\n }\n\n .brand-segment.active .brand-name {\n color: #1f2937; \n }\n\n .content-area {\n padding: 2rem; \n }\n\n .selected-text {\n color: #4b5563; \n text-align: center;\n font-size: 1.125rem; \n line-height: 1.75rem; \n }\n\n .selected-brand-name {\n font-weight: 700; /* font-bold */\n color: #6d28d9; /* text-purple-700 */\n }\n\n .dynamic-content-box {\n margin-top: 1.5rem; /* mt-6 */\n padding: 1rem; /* p-4 */\n background-color: #f9fafb; /* bg-gray-50 */\n border-radius: 0.5rem; /* rounded-lg */\n color: #374151; /* text-gray-700 */\n font-size: 0.875rem; /* text-sm */\n line-height: 1.25rem; /* text-sm */\n font-style: italic;\n }\n\n /* Responsive adjustments for smaller screens if needed */\n @media (max-width: 640px) {\n .segmented-control-container {\n max-width: 100%; /* Allows it to take full width on small screens */\n padding: 0.15rem; /* Slightly less padding */\n }\n .brand-segment {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n }\n .brand-logo {\n height: 1.8rem; /* Slightly smaller on mobile */\n }\n }\n "),t("div",{class:"card-container"},t("h2",{class:"card-heading"},"Select Branding"),t("div",{class:"segmented-control-container"},this.brands.map((e=>t("div",{key:e.name,class:"brand-segment "+(this.selectedBrand===e.name?"active":""),onClick:()=>this.updateBrand(e.name)},t("img",{src:e.logoUrl,alt:`${e.name} Logo`,class:"brand-logo",onError:e=>{e.target.src="https://placehold.co/80x40/cccccc/000000?text=Logo"}})))))))}},gt=class{constructor(t){e(this,t),this.ignored=!0,this.width=347,this.gap=24,i(this)}disconnectedCallback(){}render(){return t(oe,Object.assign({},M(this)),t("slot",null))}};function vt(e){var t;const r=s(j),[o,a]=l(!1);return n((()=>{var t,o;(null===(t=null==r?void 0:r.initialData)||void 0===t?void 0:t[e.checkboxName])&&a(!!(null===(o=null==r?void 0:r.initialData)||void 0===o?void 0:o[e.checkboxName]))}),[null===(t=null==r?void 0:r.initialData)||void 0===t?void 0:t[e.checkboxName]]),{states:{registrationFormState:r,checked:o},callbacks:{setChecked:a}}}const bt=class{constructor(t){e(this,t),this.ignored=!0,this.checkboxLabel="By signing up you agree to the {labelLink}",this.checkboxLabelLink="https://example.com",this.checkboxLabelLinkText="Terms and Conditions",this.errorMessage="Must be checked",this.checkboxOptional=!1,i(this)}disconnectedCallback(){}render(){const e=D([{attribute:"checkbox-name",value:this.checkboxName}]);if(!m()&&e)return t(K,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const r={...M(this)},{states:o,callbacks:a}=m()?N({states:{registrationFormState:{},checked:!1},callbacks:{setChecked:()=>{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):vt(this);return t(ae,{states:o,content:r,callbacks:a})}},yt=f.gql`
2
2
  query fuelTankRewardsQuery($programId: ID!) {
3
3
  user: viewer {
4
4
  ... on User {
@@ -255,7 +255,7 @@ import{r as e,h as t,c as r}from"./p-083180bf.js";import{b as o,i as a}from"./p-
255
255
  mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
256
256
  createUserAnalyticsEvent(eventMeta: $eventMeta)
257
257
  }
258
- `,Vr=class{constructor(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",i(this)}disconnectedCallback(){}render(){const e=M(this),r=m()?function(e){const[t,r]=l(!1),o="SHARECODE001";return N({copyString:o,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,borderColor:e.borderColor,buttonType:e.buttonType,open:t,onClick:()=>{navigator.clipboard.writeText(o),r(!0),setTimeout((()=>r(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,r;const{programId:o=v()}=e,a=g(),i=b(),{data:n}=x(jr,{programId:o},!(null==a?void 0:a.jwt)),[s]=y(zr),d=null!==(r=null===(t=null==n?void 0:n.user)||void 0===t?void 0:t.referralCode)&&void 0!==r?r:"...",[c,u]=l(!1);return{...e,onClick:function(){navigator.clipboard.writeText(d),u(!0),setTimeout((()=>u(!1)),e.tooltiplifespan),s({eventMeta:{programId:o,id:null==a?void 0:a.id,accountId:null==a?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:i,shareMedium:"DIRECT"}}})},open:c,copyString:d}}(e);return t(P,Object.assign({},r))}},$r=class{constructor(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",this.allowCustomization=!1,this.cancelLabelText="Cancel",this.customizeDisabledTooltip="Link customization is not available.",this.customizeLinkButtonLabel="Customize Link",this.editLimitReachedText="5 edit limit reached. To make more changes, please contact {supportLink}.",this.editLimitText="You can edit your link up to {editsRemaining} more times.",this.invalidCharactersErrorDescription="Special characters can break the link when sharing.",this.invalidCharactersErrorTitle="Please use only letters, numbers, dashes and underscores",this.linkTakenErrorDescription="Try adding numbers, a dash or underscore to create a unique link.",this.linkTakenErrorTitle="This link is already taken",this.restrictedWordsErrorDescription="This link contains a restricted word.",this.restrictedWordsErrorTitle="Please try a different link",this.saveLabelText="Save",this.supportLinkText="Support",i(this)}disconnectedCallback(){}render(){const e=M(this),r=m()?function(e){var t;const[r,o]=l(!1),[a,i]=l(!1),[n,s]=l(""),d="https://www.example.com/sharelink/abc",c={copyTextViewProps:{copyString:d,tooltiptext:e.tooltiptext,textAlign:e.textAlign,buttonStyle:e.buttonStyle,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,buttonType:e.buttonType,copyButtonLabel:e.copyButtonLabel,borderColor:e.borderColor,open:r,onClick:()=>{navigator.clipboard.writeText(d),o(!0),setTimeout((()=>o(!1)),e.tooltiplifespan)}},allowCustomization:e.allowCustomization,customizeLinkLabel:e.customizeLinkButtonLabel,saveLabelText:e.saveLabelText,cancelLabelText:e.cancelLabelText,isEditing:a,editValue:n,domainPrefix:"https://www.example.com/",editsRemaining:5,maxEdits:5,limitReached:!1,validationError:null,isValidating:!1,isSaving:!1,characterLimit:15,minCharacters:3,charactersRemaining:15-n.length,editLimitText:e.editLimitText,editLimitReachedText:e.editLimitReachedText,supportLinkText:e.supportLinkText,customizeDisabled:!1,customizeDisabledTooltip:null!==(t=e.customizeDisabledTooltip)&&void 0!==t?t:"Link customization is not available.",onCustomizeClick:()=>{i(!0),s("")},onEditValueChange:e=>{s(e)},onSave:()=>{i(!1)},onCancel:()=>{i(!1),s("")}};return N(c,e.demoData||{},{arrayMerge:(e,t)=>t})}(e):_e(e);return t(Fe,Object.assign({},r))}},Ur=class{constructor(t){e(this,t),this.ignored=!0,this.space="xxx-large",this.display="flex",this.alignment="center",this.gap="x-large",i(this)}disconnectedCallback(){}render(){return t(Ie,Object.assign({},M(this)),t("slot",null))}},Hr=f.gql`
258
+ `,Vr=class{constructor(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",i(this)}disconnectedCallback(){}render(){const e=M(this),r=m()?function(e){const[t,r]=l(!1),o="SHARECODE001";return N({copyString:o,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,borderColor:e.borderColor,buttonType:e.buttonType,open:t,onClick:()=>{navigator.clipboard.writeText(o),r(!0),setTimeout((()=>r(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,r;const{programId:o=v()}=e,a=g(),i=b(),{data:n}=x(jr,{programId:o},!(null==a?void 0:a.jwt)),[s]=y(zr),d=null!==(r=null===(t=null==n?void 0:n.user)||void 0===t?void 0:t.referralCode)&&void 0!==r?r:"...",[c,u]=l(!1);return{...e,onClick:function(){navigator.clipboard.writeText(d),u(!0),setTimeout((()=>u(!1)),e.tooltiplifespan),s({eventMeta:{programId:o,id:null==a?void 0:a.id,accountId:null==a?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:i,shareMedium:"DIRECT"}}})},open:c,copyString:d}}(e);return t(P,Object.assign({},r))}},$r=class{constructor(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",this.allowCustomization=!1,this.cancelLabelText="Cancel",this.customizeDisabledTooltip="Link customization is not available.",this.customizeLinkButtonLabel="Customize Link",this.editLimitReachedText="5 edit limit reached. To make more changes, please contact {supportLink}.",this.editLimitText="You can edit your link up to {editsRemaining} more time(s).",this.invalidCharactersErrorDescription="Special characters can break the link when sharing.",this.invalidCharactersErrorTitle="Please use only letters, numbers, dashes and underscores",this.linkTakenErrorDescription="Try adding numbers, a dash or underscore to create a unique link.",this.linkTakenErrorTitle="This link is already taken",this.restrictedWordsErrorDescription="This link contains a restricted word.",this.restrictedWordsErrorTitle="Please try a different link",this.saveLabelText="Save",this.minCharactersText="Minimum 3 characters.",this.supportLinkText="Support",i(this)}disconnectedCallback(){}render(){const e=M(this),r=m()?function(e){var t;const[r,o]=l(!1),[a,i]=l(!1),[n,s]=l(""),d="https://www.example.com/sharelink/abc",c={copyTextViewProps:{copyString:d,tooltiptext:e.tooltiptext,textAlign:e.textAlign,buttonStyle:e.buttonStyle,backgroundColor:e.backgroundColor,textColor:e.textColor,borderRadius:e.borderRadius,buttonType:e.buttonType,copyButtonLabel:e.copyButtonLabel,borderColor:e.borderColor,open:r,onClick:()=>{navigator.clipboard.writeText(d),o(!0),setTimeout((()=>o(!1)),e.tooltiplifespan)}},allowCustomization:e.allowCustomization,customizeLinkLabel:e.customizeLinkButtonLabel,saveLabelText:e.saveLabelText,cancelLabelText:e.cancelLabelText,isEditing:a,editValue:n,domainPrefix:"https://www.example.com/",editsRemaining:5,maxEdits:5,limitReached:!1,validationError:null,isValidating:!1,isSaving:!1,characterLimit:15,minCharacters:3,charactersRemaining:15-n.length,editLimitText:e.editLimitText,editLimitReachedText:e.editLimitReachedText,supportLinkText:e.supportLinkText,minCharactersText:e.minCharactersText,customizeDisabled:!1,customizeDisabledTooltip:null!==(t=e.customizeDisabledTooltip)&&void 0!==t?t:"Link customization is not available.",onCustomizeClick:()=>{i(!0),s("")},onEditValueChange:e=>{s(e)},onSave:()=>{i(!1)},onCancel:()=>{i(!1),s("")}};return N(c,e.demoData||{},{arrayMerge:(e,t)=>t})}(e):_e(e);return t(Fe,Object.assign({},r))}},Ur=class{constructor(t){e(this,t),this.ignored=!0,this.space="xxx-large",this.display="flex",this.alignment="center",this.gap="x-large",i(this)}disconnectedCallback(){}render(){return t(Ie,Object.assign({},M(this)),t("slot",null))}},Hr=f.gql`
259
259
  mutation taskCardEvent($userEventInput: UserEventInput!) {
260
260
  logUserEvent(userEventInput: $userEventInput) {
261
261
  userId
@@ -0,0 +1,451 @@
1
+ import { h } from './index-d9876cd5.js';
2
+ import { i as intl } from './global-f98f005d.js';
3
+ import { i as useState, k as useRef } from './dom-context-hooks.module-8411297a.js';
4
+ import { d as dist, H, J, B, F as Fn, w as wn, $ as $e, X as Xe, f as Qe } from './index.module-5db56a7a.js';
5
+ import { c as createStyleSheet } from './JSS-8c381d8b.js';
6
+ import { R as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED } from './useReferralCodes-d1e86c6f.js';
7
+ import { C as CopyTextView } from './copy-text-view-c508f2e1.js';
8
+
9
+ const vanillaStyle = `
10
+ :host {
11
+ display: block;
12
+ width: 100%;
13
+ }
14
+ `;
15
+ function ShareLinkView(props) {
16
+ const { copyTextViewProps, allowCustomization, customizeLinkLabel, saveLabelText, cancelLabelText, isEditing, editValue, domainPrefix, editsRemaining, maxEdits, limitReached, validationError, isValidating, isSaving, characterLimit, minCharacters, charactersRemaining, editLimitText, editLimitReachedText, supportLinkText, customizeDisabled, customizeDisabledTooltip, onCustomizeClick, onEditValueChange, onSave, onCancel, minCharactersText, } = props;
17
+ const style = {
18
+ Container: {
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ gap: "var(--sl-spacing-xx-small)",
22
+ width: "100%",
23
+ },
24
+ CustomizeLinkText: {
25
+ paddingTop: "var(--sl-spacing-xx-small)",
26
+ margin: "0",
27
+ fontSize: "var(--sl-font-size-small)",
28
+ fontWeight: "600",
29
+ cursor: "pointer",
30
+ color: "var(--sl-color-neutral-900)",
31
+ textAlign: "left",
32
+ "&:hover": {
33
+ textDecoration: "underline",
34
+ },
35
+ },
36
+ CustomizeLinkDisabled: {
37
+ paddingTop: "var(--sl-spacing-xx-small)",
38
+ margin: "0",
39
+ fontSize: "var(--sl-font-size-small)",
40
+ fontWeight: "600",
41
+ color: "var(--sl-color-neutral-400)",
42
+ cursor: "default",
43
+ textAlign: "left",
44
+ },
45
+ EditContainer: {
46
+ display: "flex",
47
+ flexDirection: "column",
48
+ gap: "var(--sl-spacing-x-small)",
49
+ width: "100%",
50
+ },
51
+ EditInputWrapper: {
52
+ display: "flex",
53
+ alignItems: "center",
54
+ width: "100%",
55
+ border: "var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",
56
+ borderRadius: "var(--sqm-border-radius-normal, 4px)",
57
+ background: "var(--sqm-input-background, #fff)",
58
+ overflow: "hidden",
59
+ "&:focus-within": {
60
+ borderColor: "#999999",
61
+ boxShadow: "0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)",
62
+ },
63
+ },
64
+ DomainPrefix: {
65
+ padding: "0 0 0 var(--sl-spacing-medium)",
66
+ fontSize: "var(--sl-font-size-medium)",
67
+ color: "var(--sl-color-neutral-500)",
68
+ whiteSpace: "nowrap",
69
+ userSelect: "none",
70
+ lineHeight: "var(--sl-input-height-medium)",
71
+ },
72
+ EditInput: {
73
+ flex: "1",
74
+ border: "none",
75
+ outline: "none",
76
+ padding: "0 var(--sl-spacing-medium) 0 0",
77
+ fontSize: "var(--sl-font-size-medium)",
78
+ fontFamily: "var(--sl-font-sans)",
79
+ color: "var(--sl-input-color)",
80
+ background: "transparent",
81
+ lineHeight: "var(--sl-input-height-medium)",
82
+ minWidth: "0",
83
+ },
84
+ EditLabel: {
85
+ margin: "0",
86
+ fontSize: "var(--sl-font-size-small)",
87
+ color: "var(--sl-color-neutral-500)",
88
+ },
89
+ HelperText: {
90
+ paddingTop: "var(--sl-spacing-xx-small)",
91
+ margin: "0",
92
+ fontSize: "var(--sl-font-size-small)",
93
+ color: "var(--sl-color-neutral-500)",
94
+ },
95
+ ErrorText: {
96
+ margin: "0",
97
+ fontSize: "var(--sl-font-size-small)",
98
+ color: "var(--sqm-danger-color-text, #dc2626)",
99
+ },
100
+ ActionRow: {
101
+ display: "flex",
102
+ gap: "var(--sl-spacing-medium)",
103
+ alignItems: "center",
104
+ },
105
+ SaveButton: {
106
+ cursor: "pointer",
107
+ fontFamily: "var(--sl-font-sans)",
108
+ fontSize: "var(--sl-font-size-small)",
109
+ fontWeight: "600",
110
+ padding: "var(--sl-spacing-x-small) var(--sl-spacing-medium)",
111
+ borderRadius: "var(--sqm-border-radius-normal, 4px)",
112
+ border: "1px solid var(--sl-color-neutral-900)",
113
+ background: "var(--sl-color-neutral-900)",
114
+ color: "#fff",
115
+ "&:disabled": {
116
+ opacity: "0.5",
117
+ cursor: "default",
118
+ },
119
+ },
120
+ CancelButton: {
121
+ margin: "0",
122
+ fontSize: "var(--sl-font-size-small)",
123
+ fontWeight: "600",
124
+ cursor: "pointer",
125
+ background: "none",
126
+ border: "none",
127
+ fontFamily: "var(--sl-font-sans)",
128
+ color: "var(--sl-color-neutral-500)",
129
+ "&::part(label)": {
130
+ padding: "0",
131
+ },
132
+ },
133
+ LimitReachedContainer: {
134
+ display: "flex",
135
+ alignItems: "center",
136
+ gap: "var(--sl-spacing-x-small)",
137
+ },
138
+ };
139
+ const sheet = createStyleSheet(style);
140
+ const styleString = sheet.toString();
141
+ const errorMessageType = (validationError === null || validationError === void 0 ? void 0 : validationError.code) === "EXISTING_CODE_CONFLICT" ? "info" : "warning";
142
+ const showCharactersRemaining = charactersRemaining <= 14;
143
+ const editLimitMessage = intl.formatMessage({
144
+ id: "editLimitText",
145
+ defaultMessage: editLimitText,
146
+ }, { editsRemaining });
147
+ // Editing state
148
+ if (isEditing) {
149
+ return (h("div", { class: sheet.classes.Container },
150
+ h("style", { type: "text/css" },
151
+ styleString,
152
+ vanillaStyle),
153
+ h("p", { class: sheet.classes.EditLabel }, "Enter your link"),
154
+ h("div", { class: sheet.classes.EditInputWrapper },
155
+ h("span", { class: sheet.classes.DomainPrefix }, domainPrefix),
156
+ h("input", { class: sheet.classes.EditInput, type: "text", value: editValue, onInput: (e) => onEditValueChange(e.target.value), onKeyDown: (e) => {
157
+ if (e.key === "/" || e.key === "@")
158
+ e.preventDefault();
159
+ }, disabled: isSaving, maxLength: characterLimit })),
160
+ h("p", { class: sheet.classes.HelperText },
161
+ editLimitMessage,
162
+ " ",
163
+ charactersRemaining > 12 && minCharactersText,
164
+ showCharactersRemaining &&
165
+ ` Characters remaining: ${charactersRemaining}`),
166
+ validationError && (h("sqm-form-message", { type: errorMessageType, style: { paddingBottom: "var(--sl-spacing-xx-small)" } },
167
+ h("p", { part: "alert-title" }, validationError.title),
168
+ validationError.description)),
169
+ isValidating && h("p", { class: sheet.classes.HelperText }, "Validating..."),
170
+ h("div", { class: sheet.classes.ActionRow },
171
+ h("button", { class: sheet.classes.SaveButton, onClick: onSave, disabled: isSaving ||
172
+ isValidating ||
173
+ !!validationError ||
174
+ !editValue ||
175
+ editValue.length < minCharacters }, isSaving ? "Saving..." : saveLabelText),
176
+ h("sl-button", { type: "text", class: sheet.classes.CancelButton, onClick: onCancel, disabled: isSaving }, cancelLabelText))));
177
+ }
178
+ // Default / Customized / Limit reached states
179
+ return (h("div", { class: sheet.classes.Container },
180
+ h("style", { type: "text/css" },
181
+ styleString,
182
+ vanillaStyle),
183
+ h(CopyTextView, Object.assign({}, copyTextViewProps)),
184
+ allowCustomization &&
185
+ (customizeDisabled ? (h("sl-tooltip", { content: customizeDisabledTooltip, placement: "top", style: { display: "inline-block", width: "fit-content" } },
186
+ h("p", { class: sheet.classes.CustomizeLinkDisabled }, customizeLinkLabel))) : (h("div", { class: sheet.classes.LimitReachedContainer },
187
+ h("p", { class: limitReached
188
+ ? sheet.classes.CustomizeLinkDisabled
189
+ : sheet.classes.CustomizeLinkText, onClick: limitReached ? undefined : onCustomizeClick }, customizeLinkLabel),
190
+ allowCustomization && limitReached && (h("p", { class: sheet.classes.HelperText }, intl.formatMessage({
191
+ id: "editLimitReached",
192
+ defaultMessage: editLimitReachedText,
193
+ }, {
194
+ supportLink: (h("a", { target: "_blank", href: "https://help.impact.com/other/readme/get-help-and-support" }, supportLinkText)),
195
+ }))))))));
196
+ }
197
+
198
+ const MAX_EDITS = 5;
199
+ const CHARACTER_LIMIT = 15;
200
+ const MIN_CHARACTERS = 3;
201
+ const MessageLinkQuery = dist.gql `
202
+ query ($programId: ID) {
203
+ user: viewer {
204
+ ... on User {
205
+ shareLink(programId: $programId)
206
+ }
207
+ }
208
+ }
209
+ `;
210
+ const WIDGET_ENGAGEMENT_EVENT = dist.gql `
211
+ mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
212
+ createUserAnalyticsEvent(eventMeta: $eventMeta)
213
+ }
214
+ `;
215
+ const ADD_SHARE_LINK_CODE = dist.gql `
216
+ mutation ($addShareLinkCodeInput: AddShareLinkCodeInput!) {
217
+ addShareLinkCode(addShareLinkCodeInput: $addShareLinkCodeInput) {
218
+ linkCode {
219
+ linkCode
220
+ shortUrl
221
+ referralCode {
222
+ code
223
+ }
224
+ }
225
+ }
226
+ }
227
+ `;
228
+ const VALIDATE_LINK_CODE = dist.gql `
229
+ query validateLinkCode($linkCode: String!) {
230
+ validateLinkCode(linkCode: $linkCode) {
231
+ valid
232
+ invalidReason
233
+ }
234
+ }
235
+ `;
236
+ const GET_LINK_DOMAIN = dist.gql `
237
+ query getLinkDomain {
238
+ tenantSettings {
239
+ primaryLinkDomain {
240
+ host
241
+ }
242
+ }
243
+ }
244
+ `;
245
+ const SHARE_LINK_EDIT_COUNT = dist.gql `
246
+ query shareLinkEditCount {
247
+ viewer {
248
+ ... on User {
249
+ shareLinkCodes {
250
+ totalCount
251
+ data {
252
+ isVanity
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
258
+ `;
259
+ function parseShareUrl(url) {
260
+ try {
261
+ const parsed = new URL(url);
262
+ return {
263
+ url: parsed.origin + parsed.pathname,
264
+ domain: parsed.origin + "/",
265
+ path: parsed.pathname.slice(1),
266
+ };
267
+ }
268
+ catch {
269
+ return { url, domain: url, path: "" };
270
+ }
271
+ }
272
+ function useShareLink(props) {
273
+ var _a, _b, _c, _d, _e, _f, _g;
274
+ const { programId = H() } = props;
275
+ const user = J();
276
+ const engagementMedium = B();
277
+ const contextData = Fn(REFERRAL_CODES_NAMESPACE);
278
+ const { data, refetch } = wn(MessageLinkQuery, { programId }, !(user === null || user === void 0 ? void 0 : user.jwt) || !!props.linkOverride || (contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) !== undefined);
279
+ const [sendLoadEvent] = $e(WIDGET_ENGAGEMENT_EVENT);
280
+ const [setCopied] = $e(SET_CODE_COPIED);
281
+ const [addShareLinkCode, { loading: isSaving }] = $e(ADD_SHARE_LINK_CODE);
282
+ const [validateLinkCode] = Xe(VALIDATE_LINK_CODE);
283
+ const { refresh } = Qe();
284
+ const { data: linkDomainData } = wn(GET_LINK_DOMAIN, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.allowCustomization);
285
+ const { data: editCountData, refetch: refetchEditCount } = wn(SHARE_LINK_EDIT_COUNT, {}, !(user === null || user === void 0 ? void 0 : user.jwt) || !props.allowCustomization);
286
+ const { url: copyString, domain: domainPrefix, path: pathSuffix, } = parseShareUrl((_b = ((contextData === null || contextData === void 0 ? void 0 : contextData.shareLink) || ((_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.shareLink))) !== null && _b !== void 0 ? _b :
287
+ // Shown during loading
288
+ "...");
289
+ const [open, setOpen] = useState(false);
290
+ const [isEditing, setIsEditing] = useState(false);
291
+ const [editValue, setEditValue] = useState("");
292
+ const [validationError, setValidationError] = useState(null);
293
+ const [isValidating, setIsValidating] = useState(false);
294
+ const debounceTimerRef = useRef(undefined);
295
+ const hasPrimaryLinkDomain = ((_c = linkDomainData === null || linkDomainData === void 0 ? void 0 : linkDomainData.tenantSettings) === null || _c === void 0 ? void 0 : _c.primaryLinkDomain) != null;
296
+ const customizeDisabled = !hasPrimaryLinkDomain;
297
+ const vanityCount = (_g = (_f = (_e = (_d = editCountData === null || editCountData === void 0 ? void 0 : editCountData.viewer) === null || _d === void 0 ? void 0 : _d.shareLinkCodes) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.filter((code) => code.isVanity).length) !== null && _g !== void 0 ? _g : 0;
298
+ const editCount = vanityCount;
299
+ const editsRemaining = Math.max(0, MAX_EDITS - editCount);
300
+ const limitReached = editsRemaining <= 0;
301
+ function mapErrorCodeToInfo(errorCode) {
302
+ if (!errorCode)
303
+ return null;
304
+ const errorMap = {
305
+ EXISTING_CODE_CONFLICT: {
306
+ code: "EXISTING_CODE_CONFLICT",
307
+ title: props.linkTakenErrorTitle,
308
+ description: props.linkTakenErrorDescription,
309
+ },
310
+ INVALID_CHARACTER: {
311
+ code: "INVALID_CHARACTER",
312
+ title: props.invalidCharactersErrorTitle,
313
+ description: props.invalidCharactersErrorDescription,
314
+ },
315
+ BLOCKED_WORD: {
316
+ code: "BLOCKED_WORD",
317
+ title: props.restrictedWordsErrorTitle,
318
+ description: props.restrictedWordsErrorDescription,
319
+ },
320
+ };
321
+ return errorMap[errorCode];
322
+ }
323
+ async function onClick() {
324
+ if (contextData) {
325
+ await setCopied({ referralCode: contextData.referralCode });
326
+ contextData.refresh();
327
+ }
328
+ // Should well supported: https://developer.mozilla.org/en-US/docs/Web/API/Clipboard#browser_compatibility
329
+ // Only if called from a user-initiated event
330
+ navigator.clipboard.writeText(copyString);
331
+ setOpen(true);
332
+ setTimeout(() => setOpen(false), props.tooltiplifespan);
333
+ sendLoadEvent({
334
+ eventMeta: {
335
+ programId,
336
+ id: user === null || user === void 0 ? void 0 : user.id,
337
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
338
+ type: "USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",
339
+ meta: {
340
+ engagementMedium,
341
+ shareMedium: "DIRECT",
342
+ },
343
+ },
344
+ });
345
+ }
346
+ function onCustomizeClick() {
347
+ if (limitReached || customizeDisabled)
348
+ return;
349
+ setIsEditing(true);
350
+ setEditValue(editCount === 0 ? "" : pathSuffix);
351
+ setValidationError(null);
352
+ }
353
+ function onEditValueChange(value) {
354
+ const trimmed = value.slice(0, CHARACTER_LIMIT);
355
+ setEditValue(trimmed);
356
+ setValidationError(null);
357
+ if (debounceTimerRef.current)
358
+ clearTimeout(debounceTimerRef.current);
359
+ if (!trimmed || trimmed.length < MIN_CHARACTERS) {
360
+ setIsValidating(false);
361
+ return;
362
+ }
363
+ setIsValidating(true);
364
+ debounceTimerRef.current = setTimeout(async () => {
365
+ var _a, _b;
366
+ try {
367
+ const result = await validateLinkCode({ linkCode: trimmed });
368
+ if (!((_a = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _a === void 0 ? void 0 : _a.valid)) {
369
+ const reason = (_b = result === null || result === void 0 ? void 0 : result.validateLinkCode) === null || _b === void 0 ? void 0 : _b.invalidReason;
370
+ setValidationError(mapErrorCodeToInfo(reason));
371
+ }
372
+ }
373
+ catch {
374
+ // Validation query failed — don't block the user
375
+ }
376
+ setIsValidating(false);
377
+ }, 2000);
378
+ }
379
+ async function onSave() {
380
+ var _a, _b;
381
+ if (!editValue ||
382
+ editValue.length < MIN_CHARACTERS ||
383
+ validationError ||
384
+ isValidating)
385
+ return;
386
+ try {
387
+ await addShareLinkCode({
388
+ addShareLinkCodeInput: {
389
+ userId: user === null || user === void 0 ? void 0 : user.id,
390
+ accountId: user === null || user === void 0 ? void 0 : user.accountId,
391
+ programId,
392
+ linkCode: editValue,
393
+ makeShareLinkCodePrimaryForReferralCode: true,
394
+ },
395
+ });
396
+ setIsEditing(false);
397
+ await Promise.all([refetch(), refetchEditCount()]);
398
+ refresh();
399
+ }
400
+ catch (e) {
401
+ const errorCode = (_a = e === null || e === void 0 ? void 0 : e.extensions) === null || _a === void 0 ? void 0 : _a.code;
402
+ setValidationError((_b = mapErrorCodeToInfo(errorCode)) !== null && _b !== void 0 ? _b : {
403
+ code: null,
404
+ title: "Error",
405
+ description: (e === null || e === void 0 ? void 0 : e.message) || "Failed to save custom link. Please try again.",
406
+ });
407
+ }
408
+ }
409
+ function onCancel() {
410
+ setIsEditing(false);
411
+ setEditValue("");
412
+ setValidationError(null);
413
+ setIsValidating(false);
414
+ }
415
+ return {
416
+ copyTextViewProps: {
417
+ ...props,
418
+ onClick,
419
+ open,
420
+ copyString,
421
+ },
422
+ minCharactersText: props.minCharactersText,
423
+ allowCustomization: props.allowCustomization,
424
+ customizeLinkLabel: props.customizeLinkButtonLabel,
425
+ saveLabelText: props.saveLabelText,
426
+ cancelLabelText: props.cancelLabelText,
427
+ isEditing,
428
+ editValue,
429
+ domainPrefix,
430
+ editsRemaining,
431
+ maxEdits: MAX_EDITS,
432
+ limitReached,
433
+ validationError,
434
+ isValidating,
435
+ isSaving,
436
+ characterLimit: CHARACTER_LIMIT,
437
+ minCharacters: MIN_CHARACTERS,
438
+ charactersRemaining: CHARACTER_LIMIT - editValue.length,
439
+ editLimitText: props.editLimitText,
440
+ editLimitReachedText: props.editLimitReachedText,
441
+ supportLinkText: props.supportLinkText,
442
+ customizeDisabled,
443
+ customizeDisabledTooltip: props.customizeDisabledTooltip,
444
+ onCustomizeClick,
445
+ onEditValueChange,
446
+ onSave,
447
+ onCancel,
448
+ };
449
+ }
450
+
451
+ export { ShareLinkView as S, useShareLink as u };
@@ -0,0 +1 @@
1
+ var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,n){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:n})}else{e.raw=n}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var a in n)if(Object.prototype.hasOwnProperty.call(n,a))e[a]=n[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,t,i){function a(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,r){function o(e){try{s(i.next(e))}catch(e){r(e)}}function l(e){try{s(i["throw"](e))}catch(e){r(e)}}function s(e){e.done?t(e.value):a(e.value).then(o,l)}s((i=i.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(e){return function(n){return s([e,n])}}function s(o){if(i)throw new TypeError("Generator is already executing.");while(t)try{if(i=1,a&&(r=o[0]&2?a["return"]:o[0]?a["throw"]||((r=a["return"])&&r.call(a),0):a.next)&&!(r=r.call(a,o[1])).done)return r;if(a=0,r)o=[o[0]&2,r.value];switch(o[0]){case 0:case 1:r=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;a=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!r||o[1]>r[0]&&o[1]<r[3])){t.label=o[1];break}if(o[0]===6&&t.label<r[1]){t.label=r[1];r=o;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(o);break}if(r[2])t.ops.pop();t.trys.pop();continue}o=n.call(e,t)}catch(e){o=[6,e];a=0}finally{i=r=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./index-6582b378.system.js","./global-b2082fd2.system.js","./dom-context-hooks.module-d6e89c16.system.js","./index.module-3103d9ae.system.js","./JSS-840a8fea.system.js","./useReferralCodes-4fd0f0c1.system.js","./copy-text-view-7713c6c8.system.js"],(function(e){"use strict";var n,t,i,a,r,o,l,s,d,c,u,v,m,p,f,h,g;return{setters:[function(e){n=e.h},function(e){t=e.i},function(e){i=e.i;a=e.k},function(e){r=e.d;o=e.H;l=e.J;s=e.B;d=e.F;c=e.w;u=e.$;v=e.X;m=e.f},function(e){p=e.c},function(e){f=e.R;h=e.S},function(e){g=e.C}],execute:function(){e({S:k,u:z});var C="\n :host {\n display: block;\n width: 100%;\n }\n";function k(e){var i=e.copyTextViewProps,a=e.allowCustomization,r=e.customizeLinkLabel,o=e.saveLabelText,l=e.cancelLabelText,s=e.isEditing,d=e.editValue,c=e.domainPrefix,u=e.editsRemaining,v=e.maxEdits,m=e.limitReached,f=e.validationError,h=e.isValidating,k=e.isSaving,b=e.characterLimit,x=e.minCharacters,y=e.charactersRemaining,L=e.editLimitText,T=e.editLimitReachedText,_=e.supportLinkText,w=e.customizeDisabled,E=e.customizeDisabledTooltip,S=e.onCustomizeClick,I=e.onEditValueChange,z=e.onSave,R=e.onCancel,D=e.minCharactersText;var O={Container:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-xx-small)",width:"100%"},CustomizeLinkText:{paddingTop:"var(--sl-spacing-xx-small)",margin:"0",fontSize:"var(--sl-font-size-small)",fontWeight:"600",cursor:"pointer",color:"var(--sl-color-neutral-900)",textAlign:"left","&:hover":{textDecoration:"underline"}},CustomizeLinkDisabled:{paddingTop:"var(--sl-spacing-xx-small)",margin:"0",fontSize:"var(--sl-font-size-small)",fontWeight:"600",color:"var(--sl-color-neutral-400)",cursor:"default",textAlign:"left"},EditContainer:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-x-small)",width:"100%"},EditInputWrapper:{display:"flex",alignItems:"center",width:"100%",border:"var(--sqm-border-thickness, 1px) solid var(--sqm-input-border-color, #d1d5db)",borderRadius:"var(--sqm-border-radius-normal, 4px)",background:"var(--sqm-input-background, #fff)",overflow:"hidden","&:focus-within":{borderColor:"#999999",boxShadow:"0 0 0 var(--sl-focus-ring-width) var(--sl-input-focus-ring-color)"}},DomainPrefix:{padding:"0 0 0 var(--sl-spacing-medium)",fontSize:"var(--sl-font-size-medium)",color:"var(--sl-color-neutral-500)",whiteSpace:"nowrap",userSelect:"none",lineHeight:"var(--sl-input-height-medium)"},EditInput:{flex:"1",border:"none",outline:"none",padding:"0 var(--sl-spacing-medium) 0 0",fontSize:"var(--sl-font-size-medium)",fontFamily:"var(--sl-font-sans)",color:"var(--sl-input-color)",background:"transparent",lineHeight:"var(--sl-input-height-medium)",minWidth:"0"},EditLabel:{margin:"0",fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"},HelperText:{paddingTop:"var(--sl-spacing-xx-small)",margin:"0",fontSize:"var(--sl-font-size-small)",color:"var(--sl-color-neutral-500)"},ErrorText:{margin:"0",fontSize:"var(--sl-font-size-small)",color:"var(--sqm-danger-color-text, #dc2626)"},ActionRow:{display:"flex",gap:"var(--sl-spacing-medium)",alignItems:"center"},SaveButton:{cursor:"pointer",fontFamily:"var(--sl-font-sans)",fontSize:"var(--sl-font-size-small)",fontWeight:"600",padding:"var(--sl-spacing-x-small) var(--sl-spacing-medium)",borderRadius:"var(--sqm-border-radius-normal, 4px)",border:"1px solid var(--sl-color-neutral-900)",background:"var(--sl-color-neutral-900)",color:"#fff","&:disabled":{opacity:"0.5",cursor:"default"}},CancelButton:{margin:"0",fontSize:"var(--sl-font-size-small)",fontWeight:"600",cursor:"pointer",background:"none",border:"none",fontFamily:"var(--sl-font-sans)",color:"var(--sl-color-neutral-500)","&::part(label)":{padding:"0"}},LimitReachedContainer:{display:"flex",alignItems:"center",gap:"var(--sl-spacing-x-small)"}};var j=p(O);var q=j.toString();var A=(f===null||f===void 0?void 0:f.code)==="EXISTING_CODE_CONFLICT"?"info":"warning";var $=y<=14;var M=t.formatMessage({id:"editLimitText",defaultMessage:L},{editsRemaining:u});if(s){return n("div",{class:j.classes.Container},n("style",{type:"text/css"},q,C),n("p",{class:j.classes.EditLabel},"Enter your link"),n("div",{class:j.classes.EditInputWrapper},n("span",{class:j.classes.DomainPrefix},c),n("input",{class:j.classes.EditInput,type:"text",value:d,onInput:function(e){return I(e.target.value)},onKeyDown:function(e){if(e.key==="/"||e.key==="@")e.preventDefault()},disabled:k,maxLength:b})),n("p",{class:j.classes.HelperText},M," ",y>12&&D,$&&" Characters remaining: "+y),f&&n("sqm-form-message",{type:A,style:{paddingBottom:"var(--sl-spacing-xx-small)"}},n("p",{part:"alert-title"},f.title),f.description),h&&n("p",{class:j.classes.HelperText},"Validating..."),n("div",{class:j.classes.ActionRow},n("button",{class:j.classes.SaveButton,onClick:z,disabled:k||h||!!f||!d||d.length<x},k?"Saving...":o),n("sl-button",{type:"text",class:j.classes.CancelButton,onClick:R,disabled:k},l)))}return n("div",{class:j.classes.Container},n("style",{type:"text/css"},q,C),n(g,Object.assign({},i)),a&&(w?n("sl-tooltip",{content:E,placement:"top",style:{display:"inline-block",width:"fit-content"}},n("p",{class:j.classes.CustomizeLinkDisabled},r)):n("div",{class:j.classes.LimitReachedContainer},n("p",{class:m?j.classes.CustomizeLinkDisabled:j.classes.CustomizeLinkText,onClick:m?undefined:S},r),a&&m&&n("p",{class:j.classes.HelperText},t.formatMessage({id:"editLimitReached",defaultMessage:T},{supportLink:n("a",{target:"_blank",href:"https://help.impact.com/other/readme/get-help-and-support"},_)})))))}var b=5;var x=15;var y=3;var L=r.gql(__makeTemplateObject(["\n query ($programId: ID) {\n user: viewer {\n ... on User {\n shareLink(programId: $programId)\n }\n }\n }\n"],["\n query ($programId: ID) {\n user: viewer {\n ... on User {\n shareLink(programId: $programId)\n }\n }\n }\n"]));var T=r.gql(__makeTemplateObject(["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"],["\n mutation loadEvent($eventMeta: UserAnalyticsEvent!) {\n createUserAnalyticsEvent(eventMeta: $eventMeta)\n }\n"]));var _=r.gql(__makeTemplateObject(["\n mutation ($addShareLinkCodeInput: AddShareLinkCodeInput!) {\n addShareLinkCode(addShareLinkCodeInput: $addShareLinkCodeInput) {\n linkCode {\n linkCode\n shortUrl\n referralCode {\n code\n }\n }\n }\n }\n"],["\n mutation ($addShareLinkCodeInput: AddShareLinkCodeInput!) {\n addShareLinkCode(addShareLinkCodeInput: $addShareLinkCodeInput) {\n linkCode {\n linkCode\n shortUrl\n referralCode {\n code\n }\n }\n }\n }\n"]));var w=r.gql(__makeTemplateObject(["\n query validateLinkCode($linkCode: String!) {\n validateLinkCode(linkCode: $linkCode) {\n valid\n invalidReason\n }\n }\n"],["\n query validateLinkCode($linkCode: String!) {\n validateLinkCode(linkCode: $linkCode) {\n valid\n invalidReason\n }\n }\n"]));var E=r.gql(__makeTemplateObject(["\n query getLinkDomain {\n tenantSettings {\n primaryLinkDomain {\n host\n }\n }\n }\n"],["\n query getLinkDomain {\n tenantSettings {\n primaryLinkDomain {\n host\n }\n }\n }\n"]));var S=r.gql(__makeTemplateObject(["\n query shareLinkEditCount {\n viewer {\n ... on User {\n shareLinkCodes {\n totalCount\n data {\n isVanity\n }\n }\n }\n }\n }\n"],["\n query shareLinkEditCount {\n viewer {\n ... on User {\n shareLinkCodes {\n totalCount\n data {\n isVanity\n }\n }\n }\n }\n }\n"]));function I(e){try{var n=new URL(e);return{url:n.origin+n.pathname,domain:n.origin+"/",path:n.pathname.slice(1)}}catch(n){return{url:e,domain:e,path:""}}}function z(e){var n,t,r,p,g,C,k;var z=e.programId,R=z===void 0?o():z;var D=l();var O=s();var j=d(f);var q=c(L,{programId:R},!(D===null||D===void 0?void 0:D.jwt)||!!e.linkOverride||(j===null||j===void 0?void 0:j.shareLink)!==undefined),A=q.data,$=q.refetch;var M=u(T)[0];var V=u(h)[0];var P=u(_),U=P[0],N=P[1].loading;var W=v(w)[0];var F=m().refresh;var B=c(E,{},!(D===null||D===void 0?void 0:D.jwt)||!e.allowCustomization).data;var H=c(S,{},!(D===null||D===void 0?void 0:D.jwt)||!e.allowCustomization),G=H.data,X=H.refetch;var K=I((t=(j===null||j===void 0?void 0:j.shareLink)||((n=A===null||A===void 0?void 0:A.user)===null||n===void 0?void 0:n.shareLink))!==null&&t!==void 0?t:"..."),J=K.url,Q=K.domain,Y=K.path;var Z=i(false),ee=Z[0],ne=Z[1];var te=i(false),ie=te[0],ae=te[1];var re=i(""),oe=re[0],le=re[1];var se=i(null),de=se[0],ce=se[1];var ue=i(false),ve=ue[0],me=ue[1];var pe=a(undefined);var fe=((r=B===null||B===void 0?void 0:B.tenantSettings)===null||r===void 0?void 0:r.primaryLinkDomain)!=null;var he=!fe;var ge=(k=(C=(g=(p=G===null||G===void 0?void 0:G.viewer)===null||p===void 0?void 0:p.shareLinkCodes)===null||g===void 0?void 0:g.data)===null||C===void 0?void 0:C.filter((function(e){return e.isVanity})).length)!==null&&k!==void 0?k:0;var Ce=ge;var ke=Math.max(0,b-Ce);var be=ke<=0;function xe(n){if(!n)return null;var t={EXISTING_CODE_CONFLICT:{code:"EXISTING_CODE_CONFLICT",title:e.linkTakenErrorTitle,description:e.linkTakenErrorDescription},INVALID_CHARACTER:{code:"INVALID_CHARACTER",title:e.invalidCharactersErrorTitle,description:e.invalidCharactersErrorDescription},BLOCKED_WORD:{code:"BLOCKED_WORD",title:e.restrictedWordsErrorTitle,description:e.restrictedWordsErrorDescription}};return t[n]}function ye(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:if(!j)return[3,2];return[4,V({referralCode:j.referralCode})];case 1:n.sent();j.refresh();n.label=2;case 2:navigator.clipboard.writeText(J);ne(true);setTimeout((function(){return ne(false)}),e.tooltiplifespan);M({eventMeta:{programId:R,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:O,shareMedium:"DIRECT"}}});return[2]}}))}))}function Le(){if(be||he)return;ae(true);le(Ce===0?"":Y);ce(null)}function Te(e){var n=this;var t=e.slice(0,x);le(t);ce(null);if(pe.current)clearTimeout(pe.current);if(!t||t.length<y){me(false);return}me(true);pe.current=setTimeout((function(){return __awaiter(n,void 0,void 0,(function(){var e,n,i,a,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);return[4,W({linkCode:t})];case 1:i=o.sent();if(!((e=i===null||i===void 0?void 0:i.validateLinkCode)===null||e===void 0?void 0:e.valid)){a=(n=i===null||i===void 0?void 0:i.validateLinkCode)===null||n===void 0?void 0:n.invalidReason;ce(xe(a))}return[3,3];case 2:r=o.sent();return[3,3];case 3:me(false);return[2]}}))}))}),2e3)}function _e(){return __awaiter(this,void 0,void 0,(function(){var e,n,t,i;return __generator(this,(function(a){switch(a.label){case 0:if(!oe||oe.length<y||de||ve)return[2];a.label=1;case 1:a.trys.push([1,4,,5]);return[4,U({addShareLinkCodeInput:{userId:D===null||D===void 0?void 0:D.id,accountId:D===null||D===void 0?void 0:D.accountId,programId:R,linkCode:oe,makeShareLinkCodePrimaryForReferralCode:true}})];case 2:a.sent();ae(false);return[4,Promise.all([$(),X()])];case 3:a.sent();F();return[3,5];case 4:t=a.sent();i=(e=t===null||t===void 0?void 0:t.extensions)===null||e===void 0?void 0:e.code;ce((n=xe(i))!==null&&n!==void 0?n:{code:null,title:"Error",description:(t===null||t===void 0?void 0:t.message)||"Failed to save custom link. Please try again."});return[3,5];case 5:return[2]}}))}))}function we(){ae(false);le("");ce(null);me(false)}return{copyTextViewProps:__assign(__assign({},e),{onClick:ye,open:ee,copyString:J}),minCharactersText:e.minCharactersText,allowCustomization:e.allowCustomization,customizeLinkLabel:e.customizeLinkButtonLabel,saveLabelText:e.saveLabelText,cancelLabelText:e.cancelLabelText,isEditing:ie,editValue:oe,domainPrefix:Q,editsRemaining:ke,maxEdits:b,limitReached:be,validationError:de,isValidating:ve,isSaving:N,characterLimit:x,minCharacters:y,charactersRemaining:x-oe.length,editLimitText:e.editLimitText,editLimitReachedText:e.editLimitReachedText,supportLinkText:e.supportLinkText,customizeDisabled:he,customizeDisabledTooltip:e.customizeDisabledTooltip,onCustomizeClick:Le,onEditValueChange:Te,onSave:_e,onCancel:we}}}}}));
@@ -25,6 +25,7 @@ export interface ShareLinkViewProps {
25
25
  charactersRemaining: number;
26
26
  editLimitText: string;
27
27
  editLimitReachedText: string;
28
+ minCharactersText: string;
28
29
  supportLinkText: string;
29
30
  customizeDisabled: boolean;
30
31
  customizeDisabledTooltip: string;
@@ -211,6 +211,13 @@ export declare class ShareLink {
211
211
  * @requiredFlavor impact
212
212
  */
213
213
  saveLabelText?: string;
214
+ /**
215
+ * @uiName Min characters text
216
+ * @uiType string
217
+ * @uiGroup Customizable Vanity Link
218
+ * @requiredFlavor impact
219
+ */
220
+ minCharactersText?: string;
214
221
  /**
215
222
  * Display text for the support link in the edit limit reached message
216
223
  *
@@ -27,5 +27,6 @@ export interface ShareLinkProps {
27
27
  editLimitReachedText?: string;
28
28
  supportLinkText?: string;
29
29
  customizeDisabledTooltip?: string;
30
+ minCharactersText?: string;
30
31
  }
31
32
  export declare function useShareLink(props: ShareLinkProps): ShareLinkViewProps;