@uniformdev/context-devtools 14.2.1-alpha.181 → 14.2.1-alpha.249

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDescriptor;var Nt=Object.getOwnPropertyNames;var Ot=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var ct=e=>B(e,"__esModule",{value:!0});var Gt=(e,r)=>{for(var n in r)B(e,n,{get:r[n],enumerable:!0})},lt=(e,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of Nt(r))!_t.call(e,a)&&(n||a!=="default")&&B(e,a,{get:()=>r[a],enumerable:!(o=Ut(r,a))||o.enumerable});return e},T=(e,r)=>lt(ct(B(e!=null?Zt(Ot(e)):{},"default",!r&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),Kt=(e=>(r,n)=>e&&e.get(r)||(n=lt(ct({}),r,1),e&&e.set(r,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var ie={};Gt(ie,{ContextDevTools:()=>it,EmbeddedContextDevTools:()=>st,ToggleEmbeddedContextDevTools:()=>ae});var t=require("@emotion/react"),d=T(require("react"));var R=require("@emotion/react"),$t=[{title:"Dimensions",href:"/dimensions",icon:`<svg
1
+ var Pt=Object.create;var Y=Object.defineProperty;var Rt=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Vt=Object.getPrototypeOf,Ht=Object.prototype.hasOwnProperty;var Me=t=>Y(t,"__esModule",{value:!0});var At=(t,r)=>{for(var n in r)Y(t,n,{get:r[n],enumerable:!0})},Ve=(t,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Mt(r))!Ht.call(t,i)&&(n||i!=="default")&&Y(t,i,{get:()=>r[i],enumerable:!(o=Rt(r,i))||o.enumerable});return t},x=(t,r)=>Ve(Me(Y(t!=null?Pt(Vt(t)):{},"default",!r&&t&&t.__esModule?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),zt=(t=>(r,n)=>t&&t.get(r)||(n=Ve(Me({}),r,1),t&&t.set(r,n),n))(typeof WeakMap!="undefined"?new WeakMap:0);var ao={};At(ao,{ContextDevTools:()=>Ie,EmbeddedContextDevTools:()=>Pe,ToggleEmbeddedContextDevTools:()=>io});var e=require("@emotion/react"),b=x(require("react"));var P=require("@emotion/react");var X=require("react"),He=(0,X.createContext)({settings:{},saveSettings:()=>null}),Ae=()=>(0,X.useContext)(He),ze=({children:t,settings:r,saveSettings:n})=>(0,e.jsx)(He.Provider,{value:{settings:r,saveSettings:n}},t);var Et=({route:t,children:r,className:n})=>{let{settings:o,saveSettings:i}=Ae();return(0,e.jsx)("a",{href:"",className:n,onClick:a=>{a.preventDefault(),i({...o,route:t})}},r)},M=Et;var Bt=[{title:"Dimensions",href:"/dimensions",icon:`<svg
2
2
  width="24"
3
3
  height="24"
4
4
  viewBox="0 0 24 24"
@@ -15,6 +15,9 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
15
15
  fill="currentColor"
16
16
  />
17
17
  </svg>
18
+ `},{title:"What if?",href:"/overrides",icon:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M16.5123 7.91666L14.5804 8.4343L13.9179 5.96175L11.3371 10.0021L11.3575 10.0143C11.1348 10.3854 10.8997 10.7125 10.6556 11.0003H18.7603L16.9135 9.15347L18.3277 7.73926L22.5703 11.9819L18.3276 16.2245L16.9134 14.8103L18.7235 13.0003H6.65606C6.89995 13.2879 7.13495 13.6148 7.35749 13.9857L7.33713 13.9979L9.9179 18.0382L10.5804 15.5657L12.5123 16.0833L10.9594 21.8789L5.16384 20.326L5.68147 18.3941L8.20425 19.0701C8.20425 19.0701 6.17064 16.0325 5.21659 14.398C4.70173 13.7544 4.17055 13.4257 3.70352 13.2461C3.10532 13.016 2.54358 13.0011 2.06154 13.0003H2V13.0002V11.0003V11.0002L2.02253 11.0002C2.05059 11.0002 2.07985 11.0002 2.11025 11.0003H6V10.9998C6.49549 10.9998 7.07968 10.9939 7.70352 10.7539C8.17055 10.5743 8.70173 10.2456 9.21659 9.60198C10.1706 7.96745 12.2043 4.92988 12.2043 4.92988L9.68147 5.60586L9.16384 3.67401L14.9594 2.12109L16.5123 7.91666Z" fill="white"/>
20
+ </svg>
18
21
  `},{title:"Quirks",href:"/quirks",icon:`<svg
19
22
  width="24"
20
23
  height="24"
@@ -33,21 +36,21 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
33
36
  </svg>`},{title:"Settings",href:"/settings",icon:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
34
37
  <path d="M19.1469 12.716C19.1986 12.2636 19.201 11.8069 19.1539 11.354L21.7429 9.474C21.8681 9.3822 21.9548 9.24723 21.9862 9.0952C22.0176 8.94316 21.9915 8.78489 21.9129 8.651L19.9939 5.399C19.9182 5.26986 19.7985 5.17231 19.6568 5.1242C19.515 5.07608 19.3606 5.08063 19.2219 5.137L16.3599 6.292C15.9237 5.9578 15.4502 5.67525 14.9489 5.45L14.5739 2.545C14.5547 2.39441 14.4813 2.25598 14.3673 2.15566C14.2534 2.05534 14.1068 1.99999 13.9549 2H10.0859C9.93402 1.99997 9.78728 2.05527 9.67317 2.15558C9.55906 2.25588 9.48539 2.39432 9.46595 2.545L9.09395 5.433C8.63957 5.63249 8.20723 5.87882 7.80395 6.168L5.00895 4.954C4.87173 4.89484 4.71787 4.88672 4.57519 4.9311C4.4325 4.97549 4.3104 5.06945 4.23095 5.196L2.22195 8.398C2.1396 8.52998 2.10934 8.68789 2.13707 8.84096C2.1648 8.99403 2.24854 9.1313 2.37195 9.226L4.86795 11.142C4.83172 11.4266 4.81302 11.7131 4.81195 12C4.81195 12.18 4.82095 12.362 4.83795 12.558L2.26495 14.375C2.13766 14.4647 2.04844 14.5987 2.01478 14.7508C1.98112 14.9028 2.00543 15.0619 2.08295 15.197L3.95695 18.474C4.11095 18.742 4.43695 18.857 4.72595 18.746L7.56095 17.644C8.00795 17.997 8.49195 18.294 9.00795 18.53L9.33795 21.396C9.37495 21.709 9.63795 21.946 9.95195 21.95L13.8169 22H13.8249C14.1349 22 14.3989 21.771 14.4439 21.463L14.8549 18.59C15.3703 18.3674 15.8579 18.0855 16.3079 17.75L19.1279 18.93C19.4129 19.05 19.7419 18.944 19.9029 18.679L21.8669 15.452C21.9477 15.319 21.976 15.1608 21.9464 15.0081C21.9168 14.8554 21.8315 14.7192 21.7069 14.626L19.1469 12.716ZM11.9999 15C10.3459 15 8.99995 13.655 8.99995 12C8.99995 10.346 10.3449 9 11.9999 9C13.6539 9 14.9999 10.345 14.9999 12C14.9999 13.654 13.6539 15 11.9999 15Z" fill="white"/>
35
38
  </svg>
36
- `}],pt=({...e})=>{let r=o=>{if(o.preventDefault(),o.currentTarget.pathname)return e.saveSettings({...e.settings,route:o.currentTarget.pathname})},n=o=>{var i;let a="active";return!((i=e.settings)!=null&&i.route)&&o==="/dimensions"||e.settings.route===o?a:""};return(0,t.jsx)("nav",{css:R.css`
39
+ `}],Ee=({...t})=>{let r=n=>{var i;let o="active";return!((i=t.settings)!=null&&i.route)&&n==="/dimensions"||t.settings.route===n?o:""};return(0,e.jsx)("nav",{css:P.css`
37
40
  background: var(--brand-secondary-1);
38
41
  padding: var(--spacing-base);
39
42
  min-width: 200px;
40
- `},(0,t.jsx)("a",{css:R.css`
43
+ `},(0,e.jsx)(M,{css:P.css`
41
44
  display: inline-block;
42
45
  margin: 0 var(--spacing-base);
43
- `,href:"/settings",onClick:o=>r(o)},(0,t.jsx)("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.jsx)("g",{clipPath:"url(#clip0_41_612)"},(0,t.jsx)("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),(0,t.jsx)("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),(0,t.jsx)("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),(0,t.jsx)("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),(0,t.jsx)("defs",null,(0,t.jsx)("clipPath",{id:"clip0_41_612"},(0,t.jsx)("rect",{width:"120",height:"38",fill:"white"}))))),(0,t.jsx)("ul",{css:R.css`
46
+ `,route:"/settings"},(0,e.jsx)("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("g",{clipPath:"url(#clip0_41_612)"},(0,e.jsx)("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),(0,e.jsx)("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),(0,e.jsx)("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),(0,e.jsx)("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),(0,e.jsx)("defs",null,(0,e.jsx)("clipPath",{id:"clip0_41_612"},(0,e.jsx)("rect",{width:"120",height:"38",fill:"white"}))))),(0,e.jsx)("ul",{css:P.css`
44
47
  display: flex;
45
48
  flex-flow: column nowrap;
46
49
  padding: 0;
47
50
  margin: 0;
48
51
  list-style-type: none;
49
52
  height: calc(100% - var(--spacing-base) * 2.5);
50
- `},$t.map((o,a)=>(0,t.jsx)("li",{css:R.css`
53
+ `},Bt.map((n,o)=>(0,e.jsx)("li",{css:P.css`
51
54
  padding: 0;
52
55
  margin: 0;
53
56
  list-style-type: none;
@@ -55,7 +58,7 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
55
58
  &:last-of-type {
56
59
  margin-top: auto;
57
60
  }
58
- `,key:a},(0,t.jsx)("a",{css:R.css`
61
+ `,key:o},(0,e.jsx)(M,{css:P.css`
59
62
  align-items: center;
60
63
  border-radius: var(--rounded-base);
61
64
  display: flex;
@@ -69,14 +72,22 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
69
72
  &.active {
70
73
  background: var(--gray-700);
71
74
  }
72
- `,className:n(o.href),href:o.href,title:o.title,onClick:i=>r(i)},(0,t.jsx)("i",{css:R.css`
75
+ `,className:r(n.href),route:n.href},(0,e.jsx)("i",{css:P.css`
73
76
  align-items: center;
74
77
  display: flex;
75
- `,dangerouslySetInnerHTML:{__html:o.icon}}),o.title)))))};var dt=()=>(0,t.jsx)("article",null,(0,t.jsx)("h1",null,"Something when wrong"),(0,t.jsx)("p",null,"We could not find the page you're looking for."));var $=T(require("react"));var S=require("@emotion/react"),F=T(require("react")),mt=(0,S.css)({willChange:"height"}),qt=S.css`
78
+ `,dangerouslySetInnerHTML:{__html:n.icon}}),n.title,n.href==="/overrides"&&Object.keys(t.overrides.scores).length>0&&(0,e.jsx)("span",{css:P.css`
79
+ font-size: var(--font-xxs);
80
+ display: inline-block;
81
+ width: 12px;
82
+ height: 12px;
83
+ border-radius: 6px;
84
+ background-color: var(--red-tooltip);
85
+ text-align: center;
86
+ `},Object.keys(t.overrides.scores).length))))))};var Be=()=>(0,e.jsx)("article",null,(0,e.jsx)("h1",null,"Something when wrong"),(0,e.jsx)("p",null,"We could not find the page you're looking for."));var se=x(require("react"));var V=require("@emotion/react"),J=x(require("react")),Oe=(0,V.css)({willChange:"height"}),Ot=V.css`
76
87
  border-bottom: 2px solid var(--brand-secondary-1);
77
88
  font-size: var(--font-base);
78
89
  margin: 0;
79
- `,Wt=S.css`
90
+ `,Nt=V.css`
80
91
  align-items: center;
81
92
  border: none;
82
93
  background: none;
@@ -86,13 +97,13 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
86
97
  padding: var(--spacing-sm) 0;
87
98
  font-weight: var(--font-bold);
88
99
  justify-content: space-between;
89
- `,Qt=S.css`
100
+ `,Ft=V.css`
90
101
  align-self: center;
91
- `,Xt=S.css`
102
+ `,Zt=V.css`
92
103
  transform: rotate(-180deg);
93
- `,Z=({children:e})=>(0,t.jsx)("div",{css:[mt]},e),U=({title:e,children:r})=>{let[n,o]=F.useState(!1),a=e.split(" ").join("-").toLocaleLowerCase();return(0,t.jsx)(F.Fragment,null,(0,t.jsx)("h3",{css:qt},(0,t.jsx)("button",{"aria-expanded":n,css:Wt,title:e,id:a,"aria-controls":`${a}-section`,onClick:()=>o(i=>!i),type:"button"},e,(0,t.jsx)("i",{css:[Qt,n?Xt:void 0]},(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.jsx)("path",{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"}))))),(0,t.jsx)("div",{id:`${a}-section`,css:[mt,S.css`
104
+ `,B=({children:t})=>(0,e.jsx)("div",{css:[Oe]},t),O=({title:t,children:r})=>{let[n,o]=J.useState(!1),i=t.split(" ").join("-").toLocaleLowerCase();return(0,e.jsx)(J.Fragment,null,(0,e.jsx)("h3",{css:Ot},(0,e.jsx)("button",{"aria-expanded":n,css:Nt,title:t,id:i,"aria-controls":`${i}-section`,onClick:()=>o(a=>!a),type:"button"},t,(0,e.jsx)("i",{css:[Ft,n?Zt:void 0]},(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("path",{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"}))))),(0,e.jsx)("div",{id:`${i}-section`,css:[Oe,V.css`
94
105
  padding: var(--spacing-sm) 0;
95
- `],role:"region","aria-labelledby":a},n?r:null))};var k=require("@emotion/react"),ut=T(require("react")),Yt=k.css`
106
+ `],role:"region","aria-labelledby":i},n?r:null))};var R=require("@emotion/react"),Ne=x(require("react")),Qt=R.css`
96
107
  align-items: center;
97
108
  border: 1px solid transparent;
98
109
  cursor: pointer;
@@ -103,29 +114,29 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
103
114
  &:hover {
104
115
  opacity: 0.8;
105
116
  }
106
- `;function Jt(e){let r=k.css`
117
+ `;function Ut(t){let r=R.css`
107
118
  color: var(--white);
108
- `,n=k.css`
119
+ `,n=R.css`
109
120
  font-weight: var(--font-bold);
110
- `;switch(e){case"primary":return k.css`
121
+ `;switch(t){case"primary":return R.css`
111
122
  background: var(--brand-secondary-1);
112
123
  ${r}
113
124
  ${n}
114
- `;case"secondary":return k.css`
125
+ `;case"secondary":return R.css`
115
126
  background: var(--brand-secondary-5);
116
127
  ${r}
117
128
  ${n}
118
- `;case"unimportant":return k.css`
129
+ `;case"unimportant":return R.css`
119
130
  background: var(--brand-secondary-3);
120
131
  color: var(--brand-secondary-1);
121
132
  ${n}
122
- `;case"ghost":return k.css`
133
+ `;case"ghost":return R.css`
123
134
  background: transparent;
124
135
  color: var(--brand-secondary-5);
125
136
  &:hover {
126
137
  border: 1px solid var(--brand-secondary-5);
127
138
  }
128
- `}}var H=({buttonType:e="primary",children:r,className:n,...o})=>(0,t.jsx)(ut.Fragment,null,(0,t.jsx)("button",{type:"button",css:[Yt,Jt(e)],className:n,...o},r));var V=require("@emotion/react"),N=V.css`
139
+ `}}var C=({buttonType:t="primary",children:r,className:n,...o})=>(0,e.jsx)(Ne.Fragment,null,(0,e.jsx)("button",{type:"button",css:[Qt,Ut(t)],className:n,...o},r));var H=require("@emotion/react"),j=H.css`
129
140
  background-color: var(--gray-100);
130
141
  padding: var(--spacing-base) var(--spacing-md);
131
142
  margin: var(--spacing-base) 0;
@@ -133,21 +144,21 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
133
144
  &:first-of-type {
134
145
  margin: 0 0 var(--spacing-base);
135
146
  }
136
- `,gt=V.css`
147
+ `,Fe=H.css`
137
148
  background: var(--gray-100)
138
149
  url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%0A%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 2C8.44771 2 8 2.44772 8 3V5C8 5.55228 8.44771 6 9 6C9.55229 6 10 5.55228 10 5V3C10 2.44772 9.55229 2 9 2ZM8 9H16V11C16 13.2091 14.2091 15 12 15C9.79086 15 8 13.2091 8 11V9ZM13 16.917C15.8377 16.441 18 13.973 18 11V7H6V11C6 13.973 8.16229 16.441 11 16.917V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V16.917ZM14 3C14 2.44772 14.4477 2 15 2C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6C14.4477 6 14 5.55228 14 5V3Z' fill='%232ecdb4' /%3E%3C/svg%3E")
139
150
  no-repeat var(--spacing-sm) var(--spacing-base);
140
151
  padding: var(--spacing-base) var(--spacing-xl);
141
- `,O=V.css`
152
+ `,ee=H.css`
142
153
  color: var(--brand-secondary-1);
143
154
  margin: 0;
144
155
  font-size: var(--font-base);
145
156
  font-weight: var(--font-bold);
146
- `,_=V.css`
157
+ `,te=H.css`
147
158
  color: var(--brand-secondary-1);
148
159
  margin: var(--spacing-xs) 0 0;
149
160
  font-size: var(--font-sm);
150
- `,bt=V.css`
161
+ `,Ze=H.css`
151
162
  align-items: center;
152
163
  border: none;
153
164
  background: transparent
@@ -167,21 +178,22 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
167
178
  &:hover {
168
179
  opacity: 0.6;
169
180
  }
170
- `,G=V.css`
181
+ `,oe=H.css`
171
182
  display: flex;
172
183
  margin: var(--spacing-sm) 0 0;
173
184
  gap: var(--spacing-base);
174
- `;var K=({title:e,text:r,buttonGroup:n,children:o})=>(0,t.jsx)("div",{css:N},(0,t.jsx)("h2",{css:O},e),(0,t.jsx)("p",{css:_},r),o,n?(0,t.jsx)("div",{css:G},n):null);var M=require("@emotion/react"),ft=M.css`
185
+ `;var N=({title:t,text:r,buttonGroup:n,children:o})=>(0,e.jsx)("div",{css:j},(0,e.jsx)("h2",{css:ee},t),(0,e.jsx)("p",{css:te},r),o,n?(0,e.jsx)("div",{css:oe},n):null);var F=require("@emotion/react"),he=F.css`
175
186
  align-items: center;
176
187
  cursor: pointer;
177
188
  display: flex;
178
189
  gap: var(--spacing-xs);
179
- `,ht=M.css`
190
+ margin-top: var(--spacing-base);
191
+ `,ye=F.css`
180
192
  color: var(--gray-500);
181
193
  font-size: var(--font-sm);
182
- `,fe=M.css`
194
+ `,xo=F.css`
183
195
  background: var(--gray-600);
184
- `,vt=M.css`
196
+ `,Ce=F.css`
185
197
  display: block;
186
198
  background: var(--gray-400);
187
199
  border-radius: var(--rounded-full);
@@ -202,7 +214,7 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
202
214
  transform: translateX(2px);
203
215
  transition: transform 0.2s ease-in-out, background-color 0.3s ease-in-out;
204
216
  }
205
- `,yt=M.css`
217
+ `,we=F.css`
206
218
  overflow: hidden;
207
219
  clip: rect(0, 0, 0, 0);
208
220
  height: 0;
@@ -216,49 +228,21 @@ var Zt=Object.create;var B=Object.defineProperty;var Ut=Object.getOwnPropertyDes
216
228
  &:checked ~ span {
217
229
  background: var(--brand-secondary-5);
218
230
  }
219
- `;var wt=({label:e,...r})=>(0,t.jsx)("label",{css:ft},(0,t.jsx)("span",{css:ht},e),(0,t.jsx)("input",{type:"checkbox",css:yt,...r}),(0,t.jsx)("span",{css:vt}));var v=require("@emotion/react"),I=({children:e})=>(0,t.jsx)("table",{css:v.css`
220
- border-collapse: collapse;
221
- display: table;
222
- width: 100%;
223
- font-size: var(--font-sm);
224
- `},e),Ct=({children:e})=>(0,t.jsx)("thead",{css:v.css`
225
- background: var(--gray-50);
226
- text-align: left;
227
- & tr {
228
- border-bottom: 1px solid var(--gray-200);
229
- }
230
- `},e),E=({children:e})=>(0,t.jsx)("tbody",null,e),z=({border:e,children:r})=>(0,t.jsx)("tr",{css:e?v.css`
231
- border-bottom: 1px solid var(--gray-200);
232
- &:where(:last-child) {
233
- border: none;
234
- }
235
- `:void 0},r),et=({children:e})=>(0,t.jsx)("th",{css:v.css`
236
- outline: none;
237
- padding: var(--spacing-sm);
238
- `},e);function jt(e){switch(e){case"light":return v.css`
239
- color: var(--gray-400);
240
- `;case"dark":return v.css`
241
- color: var(--brand-secondary-1);
242
- `}}function te(e){return v.css`
243
- text-align: ${e};
244
- `}var w=({alignment:e="left",border:r,color:n="dark",children:o})=>(0,t.jsx)("td",{css:[v.css`
245
- padding: var(--spacing-base);
246
- max-width: 180px;
247
- overflow-wrap: break-word;
248
- position: relative;
249
- `,jt(n),te(e),r?v.css`
250
- border-left: 1px solid var(--gray-200);
251
- `:void 0]},o);var y=require("@emotion/react"),ee=y.keyframes`from {
231
+ `;var Qe=({label:t,...r})=>(0,e.jsx)("label",{css:he},(0,e.jsx)("span",{css:ye},t),(0,e.jsx)("input",{type:"checkbox",css:we,...r}),(0,e.jsx)("span",{css:Ce})),xe=({field:t,form:r,meta:n,...o})=>{let{label:i}=o;return(0,e.jsx)("label",{css:he},(0,e.jsx)("span",{css:ye},i),(0,e.jsx)("input",{type:"checkbox",css:we,checked:t.value,...t}),(0,e.jsx)("span",{css:Ce}))};var w=require("@emotion/react"),_t=w.keyframes`from {
252
232
  transform: scale(1);
253
233
  }
254
234
  to {
255
235
  transform: scale(1.2);
256
236
  }
257
- `,u={page:y.css`
237
+ `,v={page:w.css`
258
238
  color: var(--brand-secondary-1);
259
- `,text:y.css`
239
+ `,text:w.css`
260
240
  margin: var(--spacing-sm) 0;
261
- `,title:y.css`
241
+ `,reset:w.css`
242
+ margin: 0 var(--spacing-md);
243
+ font-size: var(--font-sm);
244
+ color: var(--gray-500);
245
+ `,title:w.css`
262
246
  margin: 0 0 var(--spacing-sm);
263
247
  font-size: var(--font-md);
264
248
  & > small {
@@ -267,11 +251,12 @@ to {
267
251
  font-weight: var(--font-regular);
268
252
  margin: var(--spacing-xxs) 0 0;
269
253
  }
270
- `,headingGroup:y.css`
254
+ `,headingGroup:w.css`
271
255
  align-items: baseline;
272
256
  display: flex;
273
257
  justify-content: space-between;
274
- `,divider:y.css`
258
+ align-items: center;
259
+ `,divider:w.css`
275
260
  background: var(--gray-300);
276
261
  display: block;
277
262
  width: 1px;
@@ -279,15 +264,102 @@ to {
279
264
  position: absolute;
280
265
  inset: 0 auto 0 0;
281
266
  margin: auto 0;
282
- `,submitButton:y.css`
267
+ `,submitButton:w.css`
283
268
  position: absolute;
284
269
  right: var(--spacing-base);
285
270
  bottom: var(--spacing-base);
286
- animation: 0.5s 2 alternate ${ee};
287
- `,error:y.css`
271
+ animation: 0.5s 2 alternate ${_t};
272
+ `,error:w.css`
288
273
  color: var(--brand-secondary-5);
289
274
  font-size: var(--font-sm);
290
- `};var Lt=({dimensionIndex:{index:e},state:{scores:r,data:n},actions:o})=>{let a=$.useMemo(()=>Object.keys(e).filter(c=>!r[c]).map(c=>{var l;return(l=e[c])!=null?l:{name:c,dim:c,type:"Unknown"}}),[r,e]),i=Object.keys(r).length,m=i+a.length,b=()=>{o.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return(0,t.jsx)($.Fragment,null,(0,t.jsx)("article",{css:u.page},(0,t.jsx)("div",{css:u.headingGroup},(0,t.jsx)("h2",{css:u.title},"Dimensions",(0,t.jsx)("small",null,i," active of ",m)),(0,t.jsx)(wt,{label:"Control Group",onChange:b,checked:n.controlGroup})),i>0?(0,t.jsx)(I,null,(0,t.jsx)(E,null,Object.entries(r).map(([c,l],p)=>{var L;let{name:f,type:h,category:g}=(L=e==null?void 0:e[c])!=null?L:{name:c,dim:c,type:"Unknown"};return(0,t.jsx)(z,{key:p},(0,t.jsx)(w,null,(0,t.jsx)("b",null,l)),(0,t.jsx)(w,null,(0,t.jsx)("span",{css:u.divider,role:"presentation"}),(0,t.jsx)("strong",null,g?`${g}:`:""," ",f)),(0,t.jsx)(w,{alignment:"right",color:"light"},h))}))):(0,t.jsx)(K,{title:n.controlGroup?"In control group":"No active dimensions",text:n.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have score in any dimensions yet.",buttonGroup:n.controlGroup?(0,t.jsx)(H,{buttonType:"secondary",onClick:b},"Exit control group"):null}),(0,t.jsx)(Z,null,(0,t.jsx)(U,{title:"Inactive Dimensions"},(0,t.jsx)(I,null,(0,t.jsx)(E,null,a.map(({dim:c,type:l,name:p,category:f})=>(0,t.jsx)(z,{key:c},(0,t.jsx)(w,null,(0,t.jsx)("strong",null,f?`${f}:`:""," ",p)),(0,t.jsx)(w,{alignment:"right",color:"light"},l)))))))))};var Tt=({...e})=>{let{state:{data:r}}=e;return(0,t.jsx)(d.Fragment,null,(0,t.jsx)("article",{css:u.page},(0,t.jsx)("h1",{css:u.title},"Quirks"),(0,t.jsx)("p",{css:u.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(r.quirks).length?(0,t.jsx)(I,null,(0,t.jsx)(Ct,null,(0,t.jsx)(z,null,(0,t.jsx)(et,null,"Key"),(0,t.jsx)(et,null,"Value"))),(0,t.jsx)(E,null,Object.entries(r.quirks).map(([n,o],a)=>(0,t.jsx)(z,{key:a,border:"bottom"},(0,t.jsx)(w,null,(0,t.jsx)("strong",null,n)),(0,t.jsx)(w,null,o))))):(0,t.jsx)(K,{title:"No quirks configured",text:"There are currently no quirks setup."})))};var C=require("formik");var Dt=require("formik");var x=require("@emotion/react"),kt=x.css`
275
+ `};var k=require("@emotion/react"),re=({children:t})=>(0,e.jsx)("table",{css:k.css`
276
+ border-collapse: collapse;
277
+ display: table;
278
+ width: 100%;
279
+ font-size: var(--font-sm);
280
+ `},t),Ue=({children:t})=>(0,e.jsx)("thead",{css:k.css`
281
+ background: var(--gray-50);
282
+ text-align: left;
283
+ & tr {
284
+ border-bottom: 1px solid var(--gray-200);
285
+ }
286
+ `},t),ne=({children:t})=>(0,e.jsx)("tbody",null,t),$=({border:t,children:r})=>(0,e.jsx)("tr",{css:t?k.css`
287
+ border-bottom: 1px solid var(--gray-200);
288
+ &:where(:last-child) {
289
+ border: none;
290
+ }
291
+ `:void 0},r),ke=({children:t})=>(0,e.jsx)("th",{css:k.css`
292
+ outline: none;
293
+ padding: var(--spacing-sm);
294
+ `},t);function Gt(t){switch(t){case"light":return k.css`
295
+ color: var(--gray-400);
296
+ `;case"dark":return k.css`
297
+ color: var(--brand-secondary-1);
298
+ `}}function $t(t){return k.css`
299
+ text-align: ${t};
300
+ `}var D=({alignment:t="left",border:r,color:n="dark",children:o})=>(0,e.jsx)("td",{css:[k.css`
301
+ padding: var(--spacing-base);
302
+ max-width: 180px;
303
+ overflow-wrap: break-word;
304
+ position: relative;
305
+ `,Gt(n),$t(t),r?k.css`
306
+ border-left: 1px solid var(--gray-200);
307
+ `:void 0]},o);var ie=require("@emotion/react"),_e=ie.css`
308
+ position: relative;
309
+ display: inline-block;
310
+ font-size: var(--font-base);
311
+ `,Ge=ie.css`
312
+ display: block;
313
+ `,$e=ie.css`
314
+ position: absolute;
315
+ width: 6px;
316
+ height: 6px;
317
+ right: -10px;
318
+ top: 9px;
319
+ background: var(--red-tooltip);
320
+ border-radius: 3px;
321
+ `;var We=require("@emotion/react"),Kt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
322
+ <path d="M4.2 7.2C4.53137 7.2 4.8 6.93137 4.8 6.6C4.8 6.26863 4.53137 6 4.2 6C3.86863 6 3.6 6.26863 3.6 6.6C3.6 6.93137 3.86863 7.2 4.2 7.2Z" fill="#828282"/>
323
+ <path d="M8.4 6.6C8.4 6.93137 8.13137 7.2 7.8 7.2C7.46863 7.2 7.2 6.93137 7.2 6.6C7.2 6.26863 7.46863 6 7.8 6C8.13137 6 8.4 6.26863 8.4 6.6Z" fill="#828282"/>
324
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM6 10.8C8.65097 10.8 10.8 8.65097 10.8 6C10.8 5.49824 10.723 5.01447 10.5802 4.55984C10.0795 4.69533 9.55274 4.76763 9.00913 4.76763C6.77526 4.76763 4.82652 3.54683 3.79366 1.73601C2.25282 2.53492 1.2 4.14451 1.2 6C1.2 8.65097 3.34903 10.8 6 10.8Z" fill="#828282"/>
325
+ </svg>`,Wt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
326
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M3.59995 5.05775C4.9254 5.05775 5.99992 3.98325 5.99992 2.65778C5.99992 1.33232 4.9254 0.257812 3.59995 0.257812C2.27448 0.257812 1.19998 1.33232 1.19998 2.65778C1.19998 3.98325 2.27448 5.05775 3.59995 5.05775ZM3.59999 3.85777C4.26272 3.85777 4.79997 3.32052 4.79997 2.65778C4.79997 1.99505 4.26272 1.4578 3.59999 1.4578C2.93725 1.4578 2.4 1.99505 2.4 2.65778C2.4 3.32052 2.93725 3.85777 3.59999 3.85777Z" fill="#828282"/>
327
+ <path d="M5.39993 6.8577C5.73131 6.8577 5.99993 7.12632 5.99993 7.45769V11.0576H7.19991V7.45769C7.19991 6.46356 6.39406 5.65771 5.39993 5.65771H1.79998C0.80588 5.65771 0 6.46356 0 7.45769V11.0576H1.19999V7.45769C1.19999 7.12632 1.46861 6.8577 1.79998 6.8577H5.39993Z" fill="#828282"/>
328
+ <path d="M11.9999 5.05762H8.3999V6.2576H11.9999V5.05762Z" fill="#828282"/>
329
+ <path d="M8.3999 7.45752H11.9999V8.6575H8.3999V7.45752Z" fill="#828282"/>
330
+ <path d="M11.9999 2.65771H8.3999V3.8577H11.9999V2.65771Z" fill="#828282"/>
331
+ </svg>`,Ke=`<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">
332
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M7.113 3.12646C8.16729 3.12646 9.02195 3.98113 9.02195 5.03541C9.02195 5.86658 8.49075 6.57368 7.74932 6.83573V10.1259H6.47669V6.83573C5.73526 6.57368 5.20405 5.86658 5.20405 5.03541C5.20405 3.98113 6.05872 3.12646 7.113 3.12646ZM7.113 4.39909C7.46443 4.39909 7.74932 4.68398 7.74932 5.03541C7.74932 5.38684 7.46443 5.67172 7.113 5.67172C6.76158 5.67172 6.47669 5.38684 6.47669 5.03541C6.47669 4.68398 6.76158 4.39909 7.113 4.39909Z" fill="#828282"/>
333
+ <path d="M3.96336 1.88578C3.15733 2.69183 2.65879 3.80537 2.65879 5.03535C2.65879 6.42093 3.29145 7.65875 4.28366 8.47569L5.1895 7.56984C4.42501 6.98876 3.93142 6.06969 3.93142 5.03535C3.93142 4.1568 4.28752 3.36142 4.86325 2.78567L3.96336 1.88578Z" fill="#828282"/>
334
+ <path d="M9.36269 2.7856C9.93846 3.36136 10.2946 4.15676 10.2946 5.03535C10.2946 6.06973 9.80096 6.98882 9.03643 7.5699L9.94228 8.47575C10.9345 7.65881 11.5672 6.42096 11.5672 5.03535C11.5672 3.80533 11.0687 2.69177 10.2626 1.88571L9.36269 2.7856Z" fill="#828282"/>
335
+ <path d="M0.113525 5.03534C0.113525 3.10251 0.896953 1.35266 2.16359 0.0860049L3.06347 0.985892C2.02714 2.02224 1.38616 3.45394 1.38616 5.03534C1.38616 6.61674 2.02714 8.04844 3.06347 9.08479L2.16358 9.98468C0.89695 8.71802 0.113525 6.96817 0.113525 5.03534Z" fill="#828282"/>
336
+ <path d="M12.0624 9.98474C13.329 8.71809 14.1125 6.96821 14.1125 5.03534C14.1125 3.10248 13.329 1.3526 12.0624 0.0859375L11.1625 0.985824C12.1988 2.02218 12.8398 3.4539 12.8398 5.03534C12.8398 6.61678 12.1988 8.0485 11.1625 9.08486L12.0624 9.98474Z" fill="#828282"/>
337
+ </svg>`,qe=({type:t})=>{let r="";switch(t){case"Audience":r=Kt;break;case"Signal":r=Ke;break;case"Intent":r=Ke;break;case"Enrichment":r=Wt;break}return(0,e.jsx)("i",{css:We.css`
338
+ align-items: center;
339
+ display: inline-block;
340
+ `,dangerouslySetInnerHTML:{__html:r}})};var qt=({dimensionIndex:t,dimensions:r,overrides:n})=>(0,e.jsx)(re,null,(0,e.jsx)(ne,null,Object.entries(r).map(([o,i])=>{var c;let{dim:a,name:m,type:u,category:s}=(c=t[o])!=null?c:{name:o,dim:o,type:void 0,category:void 0};return(0,e.jsx)($,{key:a},(0,e.jsx)(D,null,n.scores[a]!==void 0&&(0,e.jsx)("s",{css:Ge},i-n.scores[a]),(0,e.jsx)("b",{css:_e},i,n.scores[a]!==void 0&&(0,e.jsx)("i",{css:$e}))),(0,e.jsx)(D,null,(0,e.jsx)("span",{css:v.divider,role:"presentation"}),(0,e.jsx)("div",null,(0,e.jsx)(qe,{type:u})," ",u),(0,e.jsx)("strong",null,s?`${s}:`:""," ",m)),(0,e.jsx)(D,{alignment:"right",color:"light"},n.scores[a]!==void 0&&(0,e.jsx)(M,{route:`/overrides/${a}`},"Edit override")))}))),A=qt;var Ye=require("@emotion/react"),Yt=Ye.css`
341
+ background: none;
342
+ border: none;
343
+ color: var(--brand-secondary-3);
344
+ cursor: pointer;
345
+ padding: 0;
346
+ font-weight: var(--font-bold);
347
+ margin-left: auto;
348
+ font-size: var(--font-sm);
349
+ `,ae=({children:t,...r})=>(0,e.jsx)("button",{type:"button",css:Yt,...r},t);var Xe=({dimensionIndex:{index:t},state:{scores:r,data:n},overrides:o,actions:i})=>{let a=se.useMemo(()=>{let c={};return Object.keys(t).filter(l=>!r[l]).map(l=>{c[t[l].dim]=0}),c},[r,t]),m=Object.keys(r).length,u=m+Object.keys(a).length,s=()=>{i.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return(0,e.jsx)(se.Fragment,null,(0,e.jsx)("article",{css:v.page},(0,e.jsx)("div",{css:v.headingGroup},(0,e.jsx)("h2",{css:v.title},"Dimensions",(0,e.jsx)("small",null,m," active of ",u)),(0,e.jsx)("div",{css:v.reset},(0,e.jsx)(ae,{onClick:()=>i.resetOverrides().then(i.forget)},"clear all dimensions")),(0,e.jsx)(Qe,{label:"Control Group",onChange:s,checked:n.controlGroup})),m>0?(0,e.jsx)(A,{dimensionIndex:t,dimensions:r,overrides:o}):(0,e.jsx)(N,{title:n.controlGroup?"In control group":"No active dimensions",text:n.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have score in any dimensions yet.",buttonGroup:n.controlGroup?(0,e.jsx)(C,{buttonType:"secondary",onClick:s},"Exit control group"):null}),(0,e.jsx)(B,null,(0,e.jsx)(O,{title:`Inactive Dimensions (${Object.keys(a).length})`},(0,e.jsx)(A,{dimensionIndex:t,dimensions:a,overrides:o})))))};var je=x(require("react"));var Je=require("@emotion/react");function Le({onClick:t}){return(0,e.jsx)("button",{css:Je.css`
350
+ width: 3.5rem;
351
+ height: 3.5rem;
352
+ display: flex;
353
+ align-items: center;
354
+ border-radius: 9999px;
355
+ border: none;
356
+ cursor: pointer;
357
+ background-color: var(--red-button);
358
+
359
+ svg {
360
+ color: var(--red-button);
361
+ }
362
+ `,onClick:t,"aria-label":"Add new override",className:"text-secondary shadow-xl rounded-full flex items-center bg-secondary","data-test-id":"add-new-overrides-button"},(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66"},(0,e.jsx)("g",{fill:"none",fillRule:"evenodd"},(0,e.jsx)("circle",{cx:"33",cy:"33",r:"33",fill:"currentColor"}),(0,e.jsx)("g",{fill:"#FFF",transform:"translate(19 19)"},(0,e.jsx)("rect",{width:"4",height:"28",x:"12",rx:"2"}),(0,e.jsx)("path",{d:"M14,0 C15.1045695,-2.02906125e-16 16,0.8954305 16,2 L16,26 C16,27.1045695 15.1045695,28 14,28 C12.8954305,28 12,27.1045695 12,26 L12,2 C12,0.8954305 12.8954305,2.02906125e-16 14,0 Z",transform:"rotate(90 14 14)"})))))}var et=({dimensionIndex:{index:t},state:{data:r,scores:n},overrides:o,actions:i,settings:a,saveSettings:m})=>{let u=o.scores?Object.keys(o.scores).length:0,s=p=>(p.preventDefault(),m({...a,route:"/overrides/add"})),c=()=>{i.rawUpdate([{type:"setcontrol",data:!r.controlGroup}])},l={};return Object.entries(n).map(([p,g])=>{o.scores[p]!==void 0&&(l[p]=g)}),(0,e.jsx)(je.Fragment,null,(0,e.jsx)("article",{css:v.page},(0,e.jsx)("div",{css:v.headingGroup},(0,e.jsx)("h2",{css:v.title},"What if?"),(0,e.jsx)("div",{css:v.reset},(0,e.jsx)(ae,{onClick:i.resetOverrides},"delete all overrides")),(0,e.jsx)(Le,{onClick:s})),(0,e.jsx)("p",null,"Override dimension scores to test personalization"),u>0?(0,e.jsx)(A,{dimensionIndex:t,dimensions:l,overrides:o}):(0,e.jsx)(N,{title:r.controlGroup?"In control group":"No overrides",text:r.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have any dimension overrides yet.",buttonGroup:r.controlGroup?(0,e.jsx)(C,{buttonType:"secondary",onClick:c},"Exit control group"):null})))};var _=require("formik");var G=x(require("yup"));var ot=require("formik");var L=require("@emotion/react"),ce=L.css`
291
363
  background: var(--white);
292
364
  border: 1px solid var(--gray-500);
293
365
  border-radius: var(--rounded-base);
@@ -298,9 +370,11 @@ to {
298
370
  cursor: not-allowed;
299
371
  color: var(--gray-200);
300
372
  }
301
- `,xt=x.css`
373
+ `,le=L.css`
302
374
  appearance: none;
303
- background: var(--white) url('./assets/chevon-down.svg') no-repeat 98% 50%;
375
+ background: var(--white)
376
+ url('data:image/svg+xml;base64,PHN2ZwogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKPgogIDxwYXRoCiAgICBkPSJNNi4zNDMxNyA3Ljc1NzMyTDQuOTI4OTYgOS4xNzE1NEwxMiAxNi4yNDI2TDE5LjA3MTEgOS4xNzE1N0wxNy42NTY5IDcuNzU3MzVMMTIgMTMuNDE0Mkw2LjM0MzE3IDcuNzU3MzJaIgogICAgZmlsbD0iIzgyODI4MiIKICAvPgo8L3N2Zz4=')
377
+ no-repeat 98% 50%;
304
378
  border: 1px solid var(--gray-500);
305
379
  border-radius: var(--rounded-base);
306
380
  color: var(--brand-secondary-1);
@@ -309,31 +383,105 @@ to {
309
383
  cursor: not-allowed;
310
384
  color: var(--gray-200);
311
385
  }
312
- `,q=x.css`
386
+ `,de=L.css`
387
+ padding: var(--spacing-sm);
388
+ max-width: 160px;
389
+ `,pe=L.css`
313
390
  margin: var(--spacing-base) 0;
314
- `,W=x.css`
391
+ `,Z=L.css`
315
392
  color: var(--brand-secondary-1);
316
393
  display: flex;
317
394
  flex-direction: column;
318
395
  margin: 0 0 var(--spacing-sm);
319
- `,Q=x.css`
396
+ `,Q=L.css`
320
397
  color: var(--brand-secondary-1);
321
398
  display: block;
399
+ flex: 1 100%;
322
400
  font-weight: var(--font-bold);
323
401
  margin: 0 0 var(--spacing-sm);
324
- `,X=x.css`
402
+ `,U=L.css`
325
403
  color: var(--gray-600);
326
404
  font-size: var(--font-sm);
327
- `,Y=x.css`
405
+ `,me=L.css`
328
406
  color: var(--brand-secondary-5);
329
407
  display: block;
330
- `;var J=({field:e,form:r,meta:n,...o})=>{let{label:a,caption:i,...m}=o;return(0,t.jsx)("div",{css:q},(0,t.jsx)("label",{css:W},(0,t.jsx)("span",{css:Q},a),(0,t.jsx)("input",{type:"text",css:kt,...e,...m})),i?(0,t.jsx)("span",{css:X},i):null,(0,t.jsx)(Dt.ErrorMessage,{component:"div",css:Y,name:e.name}))};var Rt=require("formik");var St=({field:e,form:r,meta:n,...o})=>{let{label:a,options:i,caption:m,...b}=o;return(0,t.jsx)("div",{css:q},(0,t.jsx)("label",{css:W},(0,t.jsx)("span",{css:Q},a),(0,t.jsx)("select",{...e,...b,css:xt},i.map((c,l)=>(0,t.jsx)("option",{value:c.value,key:l},c.text)))),m?(0,t.jsx)("span",{css:X},m):null,(0,t.jsx)(Rt.ErrorMessage,{component:"div",css:Y,name:e.name}))};var P=T(require("yup"));var Ht=require("@emotion/react"),ot=({children:e,...r})=>(0,t.jsx)("fieldset",{css:Ht.css`
408
+ `,tt=L.css`
409
+ flex-direction: row;
410
+ flex-wrap: wrap;
411
+
412
+ input[type='range'] {
413
+ height: 28px;
414
+ -webkit-appearance: none;
415
+ margin: 10px 0;
416
+ width: 100%;
417
+ flex: 1 0 80%;
418
+ }
419
+
420
+ input[type='range']:focus {
421
+ outline: none;
422
+ }
423
+
424
+ input[type='range']::-webkit-slider-runnable-track {
425
+ width: 100%;
426
+ height: 6px;
427
+ cursor: pointer;
428
+ animate: 0.2s;
429
+ box-shadow: 0 0 0 #000000;
430
+ background: #2ecdb4;
431
+ border-radius: 0;
432
+ border: 0 solid #000000;
433
+ }
434
+
435
+ input[type='range']::-moz-range-track {
436
+ width: 100%;
437
+ height: 6px;
438
+ cursor: pointer;
439
+ animate: 0.2s;
440
+ box-shadow: 0 0 0 #000000;
441
+ background: #2ecdb4;
442
+ border-radius: 0;
443
+ border: 0 solid #000000;
444
+ }
445
+
446
+ input[type='range']::-webkit-slider-thumb {
447
+ box-shadow: 1px 1px 2px #000000;
448
+ border: 1px solid #000000;
449
+ height: 20px;
450
+ width: 20px;
451
+ border-radius: 20px;
452
+ background: #ffffff;
453
+ cursor: pointer;
454
+ -webkit-appearance: none;
455
+ margin-top: -7.5px;
456
+ }
457
+ input[type='range']::-moz-range-thumb {
458
+ box-shadow: 1px 1px 2px #000000;
459
+ border: 1px solid #000000;
460
+ height: 20px;
461
+ width: 20px;
462
+ border-radius: 20px;
463
+ background: #ffffff;
464
+ cursor: pointer;
465
+ -webkit-appearance: none;
466
+ margin-top: -7.5px;
467
+ }
468
+ input[type='range']:focus::-webkit-slider-runnable-track {
469
+ background: #2ecdb4;
470
+ }
471
+
472
+ .value-display {
473
+ flex: 1 0 20%;
474
+ padding: 10px;
475
+ }
476
+ `;var rt=({field:t,form:r,meta:n,...o})=>{let{label:i,options:a,caption:m,...u}=o;return(0,e.jsx)("div",{css:pe},(0,e.jsx)("label",{css:Z},(0,e.jsx)("span",{css:Q},i),(0,e.jsx)("select",{...t,...u,css:le},a.map((s,c)=>(0,e.jsx)("option",{value:s.value,key:c},s.text)))),m?(0,e.jsx)("span",{css:U},m):null,(0,e.jsx)(ot.ErrorMessage,{component:"div",css:me,name:t.name}))};var it=require("formik");var Xt=({field:t,form:r,meta:n,...o})=>{var c,l;let{label:i,caption:a,min:m=0,max:u=100,step:s}=o;return(0,e.jsx)("div",null,(0,e.jsx)("label",{css:[Z,tt]},(0,e.jsx)("span",{css:Q},i),(0,e.jsx)("input",{type:"range",min:m,max:u,step:s,...t,value:(c=t.value)!=null?c:0}),(0,e.jsx)("span",{className:"value-display"},(l=t.value)!=null?l:0)),(0,e.jsx)("p",{css:U},a))},nt=Xt;var Jt=({name:t,label:r,dimensionToOverride:n,isSubmitting:o})=>{let i={max:100,step:20};return n&&(i.max=n.cap,i.step=n.str),(0,e.jsx)(it.Field,{component:nt,label:r,caption:`Range: 0 - ${i.max} in increments of ${i.step}`,id:t,name:t,disabled:o,...i})},at=Jt;var st=require("@emotion/react"),z=({children:t,...r})=>(0,e.jsx)("fieldset",{css:st.css`
331
477
  border: none;
332
478
  padding: 0;
333
- `,...r},e);var Vt=require("@emotion/react"),rt=({children:e})=>(0,t.jsx)("legend",{css:Vt.css`
334
- font-size: var(--font-base);
479
+ `,...r},t);var ct=require("@emotion/react"),K=({children:t})=>(0,e.jsx)("legend",{css:ct.css`
480
+ font-size: var(--font-md);
335
481
  font-weight: var(--font-bold);
336
- `},e);var oe=P.object({apiKey:P.string().matches(/^uf.+$/,"API keys start with `uf`, double check your API key"),apiHost:P.string().matches(/^https:\/\/(localhost:8889|([a-z]+\.)?uniform.app)$/,"API host must be a Uniform domain."),logLevel:P.string(),projectId:P.string().uuid()}),Pt=({settings:e,saveSettings:r,dimensionIndex:{error:n,loading:o}})=>{let a=[{value:"none",text:"Logging off"},{value:"info",text:"Log info, warnings, and errors"},{value:"warn",text:"Log warnings and errors"},{value:"error",text:"Log errors"},{value:"debug",text:"Verbose debug logging"}];return(0,t.jsx)(C.Formik,{initialValues:{apiHost:"",apiKey:"",projectId:"",logLevel:"none",...e},validationSchema:oe,enableReinitialize:!0,onSubmit:i=>{r({...e,apiHost:i.apiHost,apiKey:i.apiKey,projectId:i.projectId,logLevel:i.logLevel})}},({dirty:i,isValid:m,isSubmitting:b})=>(0,t.jsx)(C.Form,{css:u.page},(0,t.jsx)("h1",{css:u.title},"Settings"),(0,t.jsx)(C.Field,{component:St,label:"Logging",caption:"Logs can be viewed in the browser console",id:"logging",name:"logLevel",options:a,disabled:b}),(0,t.jsx)(ot,{disabled:b},(0,t.jsx)(rt,null,"Data Connection"),!o&&n?(0,t.jsx)("p",{css:u.error},"Unable to fetch data from Uniform",(0,t.jsx)("br",null),(0,t.jsx)("em",null,n.message)):null,(0,t.jsx)("p",{css:u.text},(0,t.jsx)("small",null,"Adding an API key and project ID enables richer dimension data to be shown. You must have access to the Uniform project to do this.")),(0,t.jsx)(C.Field,{component:J,label:"Uniform API key",caption:"Generate an API key in your Uniform team settings. Grant only Context: Read Drafts permission.",id:"api-key",name:"apiKey",autoComplete:"off"}),(0,t.jsx)(C.Field,{component:J,label:"Uniform Project ID",caption:"Available after generating an API key ",id:"project-id",name:"projectId",autoComplete:"off"}),(0,t.jsx)(Z,null,(0,t.jsx)(U,{title:"Advanced"},(0,t.jsx)(C.Field,{component:J,label:"Alternative API Host",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option.",id:"api-host",name:"apiHost",autoComplete:"off"}))),i?(0,t.jsx)(H,{type:"submit",css:u.submitButton,disabled:!m},"Save"):null)))};var nt=({settings:e,saveSettings:r})=>{let n=()=>{r({...e,route:"/settings"})},o=()=>{r({...e,ignoreApiKeyPrompt:!0})},a=!(e!=null&&e.apiKey);return!e.ignoreApiKeyPrompt&&a?(0,t.jsx)("div",{css:[N,gt]},(0,t.jsx)("h2",{css:O},"Connect this site"),(0,t.jsx)("p",{css:_},"Add a Uniform API key to get better data."),(0,t.jsx)("div",{css:G},(0,t.jsx)(H,{buttonType:"secondary",onClick:n},"Connect this site"),(0,t.jsx)(H,{buttonType:"ghost",onClick:o},"Skip for now")),(0,t.jsx)("button",{type:"button",css:bt,title:"close",onClick:o},(0,t.jsx)("span",{hidden:!0},"Close"))):null};var A=require("@uniformdev/context/api"),At=require("react-use"),Mt=T(require("react"));function zt({apiHost:e,apiKey:r,projectId:n},o){let a=Mt.useMemo(()=>{var l,p,f,h;let c={};return o&&(Object.keys((p=(l=o==null?void 0:o.project.pz)==null?void 0:l.sig)!=null?p:{}).forEach(g=>{let L=(0,A.computeDimensionDisplayData)(g,o);L&&(c[g]=L)}),Object.keys((h=(f=o==null?void 0:o.project.pz)==null?void 0:f.agg)!=null?h:{}).forEach(g=>{let L=(0,A.computeDimensionDisplayData)(g,o);L&&(c[g]=L)})),c},[o]),{loading:i,error:m,value:b}=(0,At.useAsync)(async()=>{if(!r||!n)return a;let l=(await new A.DimensionClient({projectId:n,apiKey:r,apiHost:e||void 0}).get()).dimensions,p={...a};return l.forEach(f=>{p[f.dim]=(0,A.computeDimensionDefinitionDisplayData)(f)}),p},[e,r,n,a]);return{loading:i,error:m,index:b!=null?b:a}}var at=require("@emotion/react");function j(){return(0,t.jsx)("style",null,`
482
+ border-bottom: 1px solid var(--gray-400);
483
+ width: 100%;
484
+ `},t);var jt=G.object({dimension:G.string(),score:G.number()}),Te=({settings:t,saveSettings:r,state:n,actions:o,dimensionIndex:{index:i}})=>{var s,c;let a=t.route?[...t.route.matchAll(/overrides\/(?!.*add)(\w+)?/g)]:[],m=a[0]?a[0][1]:"";if(!((s=n.manifest.project.pz)!=null&&s.sig))return(0,e.jsx)("p",null,"Error, manifest is broken or there is no signal to override.");let u=Object.entries(i).filter(([,l])=>l.type!=="Audience"&&l.type!=="Intent").map(([l,p])=>{let g=p.type?`${p.type}: `:"",f=p.category?`${p.category} - `:"",h=`${g}${f}${p.name}`;return{value:l,text:h}});return u.unshift({value:"_none",text:"Choose your dimension"}),(0,e.jsx)(_.Formik,{initialValues:{dimension:m,score:(c=n.scores[m])!=null?c:0},validationSchema:jt,enableReinitialize:!0,onSubmit:l=>{var g;let p=l.score-((g=n.scores[l.dimension])!=null?g:0);o.override([{type:"modscore",data:{dimension:l.dimension,delta:p}}]),r({...t,route:"/overrides"})}},({dirty:l,isValid:p,isSubmitting:g,values:f})=>{var h;return(0,e.jsx)(_.Form,{css:v.page},(0,e.jsx)("h1",{css:v.title},"Override Dimension"),(0,e.jsx)(_.Field,{component:rt,label:"Dimension",id:"dimension",name:"dimension",options:u,disabled:g}),(0,e.jsx)("p",{css:v.text},(0,e.jsx)("small",null,"Audiences and Intents are aggregated from other dimension scores and cannot be overridden directly.")),f.dimension?(0,e.jsx)(at,{name:"score",label:"Score",dimensionToOverride:i[f.dimension],isSubmitting:g}):(0,e.jsx)("span",null,"Dimensions is not selected yet"),(0,e.jsx)(z,{disabled:g},(0,e.jsx)(B,null,(0,e.jsx)(O,{title:"Impacted Dimensions"},f.score!==void 0&&(0,e.jsx)(A,{dimensionIndex:i,dimensions:{[f.dimension]:((h=n.scores[f.dimension])!=null?h:0)+f.score},overrides:{quirks:{},scores:{[f.dimension]:f.score}}}))),l?(0,e.jsx)(C,{type:"submit",css:v.submitButton,disabled:!p},"Save"):null,(0,e.jsx)(M,{route:"overrides"},"cancel")))})};var mt=require("react");var W=require("react"),lt=require("react-use");var eo=({name:t,value:r,submit:n,editable:o,setEditable:i})=>{let[a,m]=(0,W.useState)(!1),[u,s]=(0,W.useState)(r!=null?r:"");(0,lt.useDebounce)(()=>{u!==r&&n(t,u)},400,[u,t]),(0,W.useEffect)(()=>{o&&m(o)},[o]);let c=p=>{s(p.target.value)},l=()=>{m(!1),i&&i("")};return a?(0,e.jsx)("input",{type:"text",css:[ce,de],name:t,defaultValue:u,onBlur:l,onChange:c}):(0,e.jsx)(b.Fragment,null,r||"undefined")},dt=eo;var ue=require("react");var to=({name:t,value:r,submit:n,editable:o,options:i})=>{let[a,m]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{o&&m(o)},[o]);let u=s=>{n(s.target.name,s.target.value)};return!a||!i?(0,e.jsx)(b.Fragment,null,r||"undefined"):(0,e.jsx)("select",{name:t,defaultValue:r,onChange:u,css:[le,de]},(0,e.jsx)("option",{key:"_none",value:"_none"},"None"),i.map(s=>(0,e.jsx)("option",{key:s.value,value:s.value},s.name)))},pt=to;var ut=({...t})=>{let{actions:r,quirksIndex:{index:n}}=t,[o,i]=(0,mt.useState)(""),a;o&&(a=n[o]);let m=(u,s)=>{i(""),r.override([{type:"setquirk",data:{key:u,value:s}}])};return(0,e.jsx)(b.Fragment,null,(0,e.jsx)("article",{css:v.page},(0,e.jsx)("h1",{css:v.title},"Quirks"),(0,e.jsx)("p",{css:v.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(n).length?(0,e.jsx)(re,null,(0,e.jsx)(Ue,null,(0,e.jsx)($,null,(0,e.jsx)(ke,null,"Key"),(0,e.jsx)(ke,null,"Value"),(0,e.jsx)(D,null,""))),(0,e.jsx)(ne,null,Object.values(n).map(({name:u,value:s,id:c})=>(0,e.jsx)($,{key:c,border:"bottom"},(0,e.jsx)(D,null,(0,e.jsx)("strong",null,u)),(0,e.jsx)(D,null,(!a||!a.options)&&(0,e.jsx)(dt,{name:c,value:s,submit:m,setEditable:i,editable:o===c}),a&&a.options&&(0,e.jsx)(pt,{name:c,value:s,submit:m,editable:o===c,options:a.options})),(0,e.jsx)(D,null,(0,e.jsx)("a",{href:"#",onClick:l=>{l.preventDefault(),i(c)}},(0,e.jsx)("small",null,"Override"))))))):(0,e.jsx)(N,{title:"No quirks configured",text:"There are currently no quirks setup. Try to connect to Uniform API to load additional information about Quirks and Quirks without defined value."})))};var T=require("formik");var gt=require("formik");var ge=({field:t,form:r,meta:n,...o})=>{let{label:i,caption:a,...m}=o;return(0,e.jsx)("div",{css:pe},(0,e.jsx)("label",{css:Z},(0,e.jsx)("span",{css:Q},i),(0,e.jsx)("input",{type:"text",css:ce,...t,...m})),a?(0,e.jsx)("span",{css:U},a):null,(0,e.jsx)(gt.ErrorMessage,{component:"div",css:me,name:t.name}))};var S=x(require("yup"));var oo=S.object({apiKey:S.string().matches(/^uf.+$/,"API keys start with `uf`, double check your API key"),apiHost:S.string().matches(/^https:\/\/(localhost:8889|([a-z]+\.)?uniform.app)$/,"API host must be a Uniform domain."),logging:S.boolean(),projectId:S.string().uuid(),consentMode:S.boolean()}),ft=({settings:t,saveSettings:r,actions:n,state:{data:o},dimensionIndex:{error:i,loading:a}})=>{var m,u,s;return(0,e.jsx)(T.Formik,{initialValues:{apiHost:(m=t.apiHost)!=null?m:"",apiKey:(u=t.apiKey)!=null?u:"",projectId:(s=t.projectId)!=null?s:"",consentMode:!!o.consent,logging:t.logLevel!=="none"&&Boolean(t.logLevel)},validationSchema:oo,enableReinitialize:!0,onSubmit:c=>{r({...t,apiHost:c.apiHost,apiKey:c.apiKey,projectId:c.projectId,logLevel:c.logging?"debug":"none",consentMode:c.consentMode}),n.rawUpdate([{type:"consent",data:c.consentMode}])}},({dirty:c,isValid:l,isSubmitting:p})=>(0,e.jsx)(T.Form,{css:v.page},(0,e.jsx)("h1",{css:v.title},"Settings"),(0,e.jsx)(z,{disabled:p},(0,e.jsx)(K,null,"Data Connection"),!a&&i?(0,e.jsx)("p",{css:v.error},"Unable to fetch data from Uniform",(0,e.jsx)("br",null),(0,e.jsx)("em",null,i.message)):null,(0,e.jsx)("p",{css:v.text},(0,e.jsx)("small",null,"Adding an API key and project ID enables richer dimension data to be shown. You must have access to the Uniform project to do this.")),(0,e.jsx)(T.Field,{component:ge,label:"Uniform API key",caption:"Generate an API key in your Uniform team settings. Grant only Context: Read Drafts permission.",id:"api-key",name:"apiKey",autoComplete:"off"}),(0,e.jsx)(T.Field,{component:ge,label:"Uniform Project ID",caption:"Available to copy after generating an API key",id:"project-id",name:"projectId",autoComplete:"off"}),(0,e.jsx)(B,null,(0,e.jsx)(O,{title:"Advanced"},(0,e.jsx)(T.Field,{component:ge,label:"Alternative API Host",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option.",id:"api-host",name:"apiHost",autoComplete:"off"}))),(0,e.jsx)(z,null,(0,e.jsx)(K,null,"Storage Consent"),(0,e.jsx)(T.Field,{component:xe,label:"Store visitor data",id:"consent-mode",name:"consentMode"}),(0,e.jsx)("p",null,"Defaults off to comply with CCPA and GDPR. Turning on consents to storing behavior in this browser for personalization across sessions. Only affects this browser. Personalization works with this disabled, but dimension scores are lost on refresh.")),(0,e.jsx)(z,null,(0,e.jsx)(K,null,"Logging"),(0,e.jsx)(T.Field,{component:xe,label:"Write Uniform Context diagnostic logs to browser console",id:"logging",name:"logging"})),c?(0,e.jsx)(C,{type:"submit",css:v.submitButton,disabled:!l},"Save"):null)))};var De=({settings:t,saveSettings:r})=>{let n=()=>{r({...t,route:"/settings"})},o=()=>{r({...t,ignoreApiKeyPrompt:!0})},i=!(t!=null&&t.apiKey);return!t.ignoreApiKeyPrompt&&i?(0,e.jsx)("div",{css:[j,Fe]},(0,e.jsx)("h2",{css:ee},"Connect this site"),(0,e.jsx)("p",{css:te},"Add a Uniform API key to get better data."),(0,e.jsx)("div",{css:oe},(0,e.jsx)(C,{buttonType:"secondary",onClick:n},"Connect this site"),(0,e.jsx)(C,{buttonType:"ghost",onClick:o},"Skip for now")),(0,e.jsx)("button",{type:"button",css:Ze,title:"close",onClick:o},(0,e.jsx)("span",{hidden:!0},"Close"))):null};var E=require("@uniformdev/context/api"),bt=require("react-use"),vt=x(require("react"));function ht({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:a,value:m}=(0,bt.useAsync)(async()=>{if(!r||!n)return u;let c=(await new E.DimensionClient({projectId:n,apiKey:r,apiHost:t||void 0}).get()).dimensions,l={};return c.map(p=>{var g,f,h,y;if(l[p.dim]={...(0,E.computeDimensionDefinitionDisplayData)(p),cap:p.cap,str:10},l[p.dim].type==="Enrichment"){let q=p.dim.split("_")[0];l[p.dim].cap=(y=(h=(f=(g=o==null?void 0:o.project.pz)==null?void 0:g.enr)==null?void 0:f[q])==null?void 0:h.cap)!=null?y:100}}),l},[t,r,n]),u=vt.useMemo(()=>{var c,l,p,g;let s={};return o&&(Object.entries((l=(c=o==null?void 0:o.project.pz)==null?void 0:c.sig)!=null?l:{}).map(([f,h])=>{let y=(0,E.computeDimensionDisplayData)(f,o);y&&(s[f]={...h,...y})}),Object.entries((g=(p=o==null?void 0:o.project.pz)==null?void 0:p.enr)!=null?g:{}).map(([f,h])=>{var Re;let y=(0,E.computeDimensionDisplayData)(f,o),q={cap:(Re=h.cap)!=null?Re:100,str:10};y&&(s[f]={...y,cap:q.cap,str:q.str})}),m&&Object.entries(m).map(([f,h])=>{s[f]={...s[f],...h}})),s},[o,m]);return{loading:i,error:a,index:u}}var yt=require("react"),Ct=require("@uniformdev/context/api"),wt=require("react-use");function xt({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:a,value:m}=(0,wt.useAsync)(async()=>{if(!r||!n)return{};let c=await new Ct.QuirkClient({projectId:n,apiKey:r,apiHost:t||void 0}).get(),l={};return c.quirks.map(p=>{l[p.id]={...p,value:o[p.id]}}),l},[t,r,n]),u=(0,yt.useMemo)(()=>{let s={};return Object.entries(o).map(([c,l])=>s[c]={value:l,id:c,name:c}),m&&Object.entries(m).map(([c,l])=>s[c]={...l,value:o[c]}),s},[o,m]);return{loading:i,error:a,index:u}}var Se=require("@emotion/react");function fe(){return(0,e.jsx)("style",null,`
337
485
  :root {
338
486
  --brand-primary-1: #438fd5; /* bright blue */
339
487
  --brand-primary-2: #f4220b; /* red */
@@ -393,6 +541,10 @@ to {
393
541
  --gray-800: #1f2937;
394
542
  --gray-900: #111827;
395
543
 
544
+ /* Red CTA */
545
+ --red-button: rgb(217 83 79);
546
+ --red-tooltip: #D9534F;
547
+
396
548
  /* z-indexs */
397
549
  --z-10: 10;
398
550
  }
@@ -694,7 +846,7 @@ Add the correct display in Chrome and Safari.
694
846
 
695
847
  summary {
696
848
  display: list-item;
697
- }`)}var re=at.css`
849
+ }`)}var be=require("react"),kt=require("react-use");var Lt=()=>{let[t,r]=(0,be.useState)(!1),n=(0,kt.useMountedState)();return(0,be.useEffect)(()=>{setTimeout(()=>{n()&&r(!0)},1e3)},[n]),t?(0,e.jsx)("article",{css:v.page},(0,e.jsx)("h1",null,"Loading..."),(0,e.jsx)("p",null,"Connecting to Uniform API for complete data.")):null};var ro=Se.css`
698
850
  background: var(--white);
699
851
  padding: var(--spacing-base);
700
852
  overflow-y: auto;
@@ -723,7 +875,7 @@ summary {
723
875
  &::-webkit-scrollbar-thumb:hover {
724
876
  background: var(--gray-500);
725
877
  }
726
- `;function it(e){let r=zt(e.settings,e.state.manifest),n={...e,dimensionIndex:r},o=()=>{var a;switch((a=e.settings)==null?void 0:a.route){case void 0:case"/":case"/dimensions":return(0,t.jsx)(Lt,{...n});case"/quirks":return(0,t.jsx)(Tt,{...n});case"/settings":return(0,t.jsx)(Pt,{...n});default:return(0,t.jsx)(dt,null)}};return(0,t.jsx)(d.Fragment,null,(0,t.jsx)(j,null),(0,t.jsx)("div",{css:at.css`
878
+ `;function Ie(t){let r=ht(t.settings,t.state.manifest),n=xt(t.settings,t.state.data.quirks),o={...t,dimensionIndex:r,quirksIndex:n},i=()=>{var a;if(r.loading||n.loading)return(0,e.jsx)(Lt,null);if(t.settings.route&&t.settings.route.match(/overrides\/\w+/))return(0,e.jsx)(Te,{...o});switch((a=t.settings)==null?void 0:a.route){case void 0:case"/":case"/dimensions":return(0,e.jsx)(Xe,{...o});case"/overrides":return(0,e.jsx)(et,{...o});case"/overrides/add":return(0,e.jsx)(Te,{...o});case"/quirks":return(0,e.jsx)(ut,{...o});case"/settings":return(0,e.jsx)(ft,{...o});default:return(0,e.jsx)(Be,null)}};return(0,e.jsx)(ze,{settings:t.settings,saveSettings:t.saveSettings},(0,e.jsx)(fe,null),(0,e.jsx)("div",{css:Se.css`
727
879
  display: grid;
728
880
  grid-template-columns: 200px auto;
729
881
  font-weight: var(--font-regular);
@@ -732,7 +884,7 @@ summary {
732
884
  line-height: var(--base-line-height);
733
885
  height: var(--min-height);
734
886
  min-width: var(--site-width);
735
- `},(0,t.jsx)(pt,{...e}),(0,t.jsx)("main",{css:re},(0,t.jsx)(nt,{...e}),o())))}var tt=require("@uniformdev/context"),D=T(require("react"));function st({context:e,initialSettings:r}){let n=e!=null?e:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new tt.Context({manifest:{project:{}}}),[a,i]=D.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[m,b]=D.useState(r!=null?r:{});D.useEffect(()=>{var p;let l=(0,tt.createDebugConsoleLogDrain)((p=m.logLevel)!=null?p:"none");return o.events.on("log",l),()=>{o.events.off("log",l)}},[m,o]),D.useEffect(()=>{let l=()=>{i(h=>({...h,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},p=h=>{!h.changed||i(g=>({...g,personalizations:[...g.personalizations,h]}))},f=h=>{!h.variantAssigned||i(g=>({...g,tests:[...g.tests,h]}))};return o.events.on("personalizationResult",p),o.events.on("testResult",f),o.storage.events.on("*",l),()=>{o.storage.events.off("*",l),o.events.off("personalizationResult",p),o.events.off("testResult",f)}},[o,m]);let c=D.useMemo(()=>({update:p=>o.update(p),forget:()=>o.forget(!1),rawUpdate:p=>o.storage.updateData(p)}),[o]);return n?(0,t.jsx)(it,{state:a,actions:c,settings:m,saveSettings:b}):(0,t.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}var Bt=require("@emotion/react"),Ft=T(require("react"));var It=require("@emotion/react"),ne=It.css`
887
+ `},(0,e.jsx)(Ee,{...t}),(0,e.jsx)("main",{css:ro},(0,e.jsx)(De,{...t}),i())))}var ve=require("@uniformdev/context"),I=x(require("react"));function Pe({context:t,initialSettings:r}){let n=t!=null?t:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new ve.Context({manifest:{project:{}}}),[i,a]=I.useState({scores:{},quirks:{}}),[m,u]=I.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[s,c]=I.useState(r!=null?r:{});I.useEffect(()=>{var g;let p=(0,ve.createDebugConsoleLogDrain)((g=s.logLevel)!=null?g:"none");return o.events.on("log",p),()=>{o.events.off("log",p)}},[s,o]),I.useEffect(()=>{let p=()=>{u(h=>({...h,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},g=h=>{!h.changed||u(y=>({...y,personalizations:[...y.personalizations,h]}))},f=h=>{!h.variantAssigned||u(y=>({...y,tests:[...y.tests,h]}))};return o.events.on("personalizationResult",g),o.events.on("testResult",f),o.storage.events.on("*",p),()=>{o.storage.events.off("*",p),o.events.off("personalizationResult",g),o.events.off("testResult",f)}},[o,s]);let l=I.useMemo(()=>({update:g=>o.update(g),forget:()=>o.forget(!1),rawUpdate:g=>o.storage.updateData(g),resetOverrides:()=>{let g=[];return Object.entries(i.scores).map(([f,h])=>{g.push({type:"modscore",data:{dimension:f,delta:-h}})}),a({...i,scores:{}}),o.storage.updateData(g)},override:g=>{let f={},h={};return g.map(y=>{y.type==="modscore"&&(f[y.data.dimension]=y.data.delta),y.type==="setquirk"&&(h[y.data.key]=y.data.value)}),a({scores:{...i.scores,...f},quirks:{...i.quirks,...h}}),o.storage.updateData(g)}}),[o,i]);return n?(0,e.jsx)(Ie,{state:m,actions:l,overrides:i,settings:s,saveSettings:c}):(0,e.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}var St=require("@emotion/react"),It=x(require("react"));var Tt=require("@emotion/react"),no=Tt.css`
736
888
  align-items: center;
737
889
  border-radius: var(--rounded-full);
738
890
  background: var(--brand-secondary-5);
@@ -758,11 +910,11 @@ summary {
758
910
  max-width: 100%;
759
911
  height: auto;
760
912
  }
761
- `,Et=({...e})=>(0,t.jsx)("button",{type:"button",css:ne,...e},(0,t.jsx)("span",{hidden:!0},"Uniform devtools"),(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.jsx)("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M7.61197 18.3608L8.97136 16.9124L8.97086 16.8933L3.87657 12.1121L8.66699 7.00798L7.20868 5.63928L1.04956 12.2017L7.61197 18.3608Z",fill:"currentColor"}),(0,t.jsx)("path",{d:"M16.388 18.3608L15.0286 16.9124L15.0291 16.8933L20.1234 12.1121L15.333 7.00798L16.7913 5.63928L22.9504 12.2017L16.388 18.3608Z",fill:"currentColor"})));function ae(e){var a;let[r,n]=Ft.useState(!1);return((a=e.context)!=null?a:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?(0,t.jsx)("div",null,(0,t.jsx)(j,null),(0,t.jsx)(Et,{onClick:()=>n(i=>!i)}),r?(0,t.jsx)("div",{css:Bt.css`
913
+ `,Dt=({...t})=>(0,e.jsx)("button",{type:"button",css:no,...t},(0,e.jsx)("span",{hidden:!0},"Uniform devtools"),(0,e.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.jsx)("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),(0,e.jsx)("path",{d:"M7.61197 18.3608L8.97136 16.9124L8.97086 16.8933L3.87657 12.1121L8.66699 7.00798L7.20868 5.63928L1.04956 12.2017L7.61197 18.3608Z",fill:"currentColor"}),(0,e.jsx)("path",{d:"M16.388 18.3608L15.0286 16.9124L15.0291 16.8933L20.1234 12.1121L15.333 7.00798L16.7913 5.63928L22.9504 12.2017L16.388 18.3608Z",fill:"currentColor"})));function io(t){var i;let[r,n]=It.useState(!1);return((i=t.context)!=null?i:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?(0,e.jsx)("div",null,(0,e.jsx)(fe,null),(0,e.jsx)(Dt,{onClick:()=>n(a=>!a)}),r?(0,e.jsx)("div",{css:St.css`
762
914
  box-shadow: var(--shadow-base);
763
915
  position: fixed;
764
916
  bottom: 82px;
765
917
  right: var(--spacing-base);
766
918
  z-index: var(--z-10);
767
919
  max-width: var(--site-width);
768
- `},(0,t.jsx)(st,{...e})):null):(0,t.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}module.exports=Kt(ie);0&&(module.exports={ContextDevTools,EmbeddedContextDevTools,ToggleEmbeddedContextDevTools});
920
+ `},(0,e.jsx)(Pe,{...t})):null):(0,e.jsx)("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}module.exports=zt(ao);0&&(module.exports={ContextDevTools,EmbeddedContextDevTools,ToggleEmbeddedContextDevTools});