@uniformdev/mesh-sdk-react 13.0.1-alpha.278 → 13.0.1-alpha.311

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.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enumerable:!0})};import{jsx as e}from"@emotion/react";import*as k from"react";import{createContext as nr,useContext as ar,useState as ir}from"react";var Le=nr(void 0),Me=({children:t})=>{let[n,o]=ir(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let c=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:c.getValue,getMetadata:c.getMetadata,setValue:async d=>{await c.setValue(d),o(window.UniformMeshSDK.getCurrentLocation())}}}}return e(Le.Provider,{value:r},t)},Ve=()=>{let t=ar(Le);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function go(){let{location:t}=Ve();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata()}}import{initializeUniformMeshSDK as sr}from"@uniformdev/mesh-sdk";import{useEffect as cr,useState as Ee}from"react";var yo=({autoResizingDisabled:t}={})=>{let[n,o]=Ee(),[r,c]=Ee();return cr(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?sr({autoResizingDisabled:t}).then(d=>{c(d)}).catch(d=>{o(d)}):c(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};import{createContext as dr,useContext as lr}from"react";import{Theme as pr}from"@uniformdev/design-system";var Ie=dr(void 0),ko=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),e(Ie.Provider,{value:n},e(pr,null),e(Me,null,t))},Te=()=>{let t=lr(Ie);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Mo(){let{sdk:t}=Te();return t}import Ke from"react";import fr,{useMemo as le,useContext as vr}from"react";import{css as q}from"@emotion/react";import{InputSelect as mr}from"@uniformdev/design-system";import De from"react";var Ge=({value:t,text:n,loading:o})=>e(De.Fragment,null,!!n&&n,!n&&e(De.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var ze=({name:t,loading:n,selectedValues:o,values:r,onAdd:c,onRemove:d})=>{var h;let v=(h=r==null?void 0:r.filter(u=>!(o!=null&&o.includes(u.id.toString()))))!=null?h:[],b=(u,s)=>{u.preventDefault(),d(s)};return e("div",null,e(mr,{id:"product-query",name:"product-query",label:t,onChange:u=>c(u.target.value),disabled:n,options:[{value:"",label:"Add..."},...v.map(u=>({value:u.id,label:u.name||u.id}))],css:Array.isArray(o)&&o.length>0?q`
1
+ var rr=Object.defineProperty;var or=(t,a)=>{for(var o in a)rr(t,o,{get:a[o],enumerable:!0})};import{jsx as e}from"@emotion/react";import*as L from"react";import{createContext as nr,useContext as ar,useState as ir}from"react";var Ve=nr(void 0),Ee=({children:t})=>{let[a,o]=ir(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let s=a||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:s.getValue,getMetadata:s.getMetadata,setValue:async d=>{await s.setValue(d),o(window.UniformMeshSDK.getCurrentLocation())}}}}return e(Ve.Provider,{value:r},t)},Te=()=>{let t=ar(Ve);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function vo(){let{location:t}=Te();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata()}}import{initializeUniformMeshSDK as sr}from"@uniformdev/mesh-sdk";import{useEffect as cr,useState as Ie}from"react";var wo=({autoResizingDisabled:t}={})=>{let[a,o]=Ie(),[r,s]=Ie();return cr(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?sr({autoResizingDisabled:t}).then(d=>{s(d)}).catch(d=>{o(d)}):s(window.UniformMeshSDK))},[t]),{initializing:!r&&!a,error:a,sdk:r}};import{createContext as dr,useContext as lr}from"react";import{Theme as pr}from"@uniformdev/design-system";var De=dr(void 0),Lo=({children:t})=>{let a;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(a={sdk:window.UniformMeshSDK}),e(De.Provider,{value:a},e(pr,null),e(Ee,null,t))},Ge=()=>{let t=lr(De);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Eo(){let{sdk:t}=Ge();return t}import Ne from"react";import fr,{useMemo as me,useContext as vr}from"react";import{css as J}from"@emotion/react";import{InputSelect as mr}from"@uniformdev/design-system";import ze from"react";var Ue=({value:t,text:a,loading:o})=>e(ze.Fragment,null,!!a&&a,!a&&e(ze.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Ae=({id:t,label:a,loading:o,selectedValues:r,values:s,onAdd:d,onRemove:m})=>{var b;let g=(b=s==null?void 0:s.filter(i=>!(r!=null&&r.includes(i.id.toString()))))!=null?b:[],f=(i,v)=>{i.preventDefault(),m(v)};return e("div",null,e(mr,{id:t,name:t,label:a,onChange:i=>d(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...g.map(i=>({value:i.id,label:i.name||i.id}))],css:Array.isArray(r)&&r.length>0?J`
2
2
  margin-bottom: var(--spacing-base);
3
- `:""}),o==null?void 0:o.map(u=>{var s;return e("div",{css:q`
3
+ `:""}),r==null?void 0:r.map(i=>{var v;return e("div",{css:J`
4
4
  font-size: var(--fs-sm);
5
5
  display: inline-flex;
6
6
  align-items: center;
@@ -9,67 +9,67 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
9
9
  border: 1px solid var(--gray-300);
10
10
  margin-bottom: var(--spacing-sm);
11
11
  margin-right: var(--spacing-sm);
12
- `,key:u},e("span",{css:q`
12
+ `,key:i},e("span",{css:J`
13
13
  padding: var(--spacing-3);
14
14
  color: var(--gray-800);
15
- `},e(Ge,{value:u,loading:n,text:(s=r.find(g=>g.id===u))==null?void 0:s.name})),e("button",{css:q`
15
+ `},e(Ue,{value:i,loading:o,text:(v=s.find(S=>S.id===i))==null?void 0:v.name})),e("button",{css:J`
16
16
  padding: var(--spacing-3);
17
17
  border-left: 1px solid var(--gray-300);
18
- `,title:"remove",onClick:g=>b(g,u)},e("svg",{xmlns:"http://www.w3.org/2000/svg",css:q`
18
+ `,title:"remove",onClick:S=>f(S,i)},e("svg",{xmlns:"http://www.w3.org/2000/svg",css:J`
19
19
  height: 1.25rem;
20
20
  width: 1.25rem;
21
21
  pointer-events: none;
22
22
  display: block;
23
- `,viewBox:"0 0 20 20",fill:"currentColor"},e("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var ur=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})),ee=ur;var gr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),te=gr;import{useAsyncFn as hr,useDebounce as br}from"react-use";import{Input as Ue,InputSelect as pe,mq as re}from"@uniformdev/design-system";import{css as w}from"@emotion/react";var Ae={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},Zo=({value:t,setValue:n,brands:o,categories:r,loading:c,categoriesLoading:d,brandsLoading:v,logoIcon:b,onGetProducts:h,sortOptions:u,sortOrderOptions:s})=>{var I;let g=async i=>{n({...Ae,...t||{},...i})},f=le(()=>({...Ae,...t||{}}),[t]),[H,M]=hr(async i=>await h(i),[h]);br(async()=>{await M({brand:f.brand,categories:f.categories,keyword:f.keyword,sort:f.sort,sortOrder:f.sortOrder,count:f.count})},250,[f]);let F=le(()=>{let i=[];return r==null||r.forEach(m=>{let T=Oe(m,void 0);i.push(...T)}),i},[r]),G=le(()=>(o==null?void 0:o.map(i=>({id:i.id.toString(),name:i.name})))||[],[o]),z=i=>{let m=(t==null?void 0:t.categories)||[];g({categories:[...m,i]})},A=i=>{var m;g({categories:(m=t==null?void 0:t.categories)==null?void 0:m.filter(T=>T!==i)})},J=i=>{g({brand:i.target.value})},E=i=>{g({count:i||1})};return c?e("div",null,"Loading..."):e(He.Provider,{value:{categories:r,logoIcon:b}},e("div",{css:w`
23
+ `,viewBox:"0 0 20 20",fill:"currentColor"},e("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"}))))}))};var ur=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{d:"M44.203 21.203H24.797V1.797a1.797 1.797 0 1 0-3.594 0v19.406H1.797a1.797 1.797 0 1 0 0 3.594h19.406v19.406a1.797 1.797 0 0 0 3.594 0V24.797h19.406a1.797 1.797 0 0 0 0-3.594Z"})),re=ur;var gr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})),oe=gr;import{useAsyncFn as hr,useDebounce as br}from"react-use";import{Input as Be,InputSelect as ue,mq as ne}from"@uniformdev/design-system";import{css as P}from"@emotion/react";var Oe={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},qo=({value:t,setValue:a,brands:o,categories:r,loading:s,categoriesLoading:d,brandsLoading:m,logoIcon:g,onGetProducts:f,sortOptions:b,sortOrderOptions:i,categoryLabel:v="Product Category",brandLabel:S="Brand",disableBrands:F})=>{var E;let C=async n=>{a({...Oe,...t||{},...n})},h=me(()=>({...Oe,...t||{}}),[t]),[W,$]=hr(async n=>await f(n),[f]);br(async()=>{await $({brand:h.brand,categories:h.categories,keyword:h.keyword,sort:h.sort,sortOrder:h.sortOrder,count:h.count})},250,[h]);let B=me(()=>{let n=[];return r==null||r.forEach(y=>{let D=Fe(y,void 0);n.push(...D)}),n},[r]),z=me(()=>(o==null?void 0:o.map(n=>({id:n.id.toString(),name:n.name})))||[],[o]),U=n=>{let y=(t==null?void 0:t.categories)||[];C({categories:[...y,n]})},Y=n=>{var y;C({categories:(y=t==null?void 0:t.categories)==null?void 0:y.filter(D=>D!==n)})},K=n=>{C({brand:n.target.value})},I=n=>{C({count:n||1})};return s?e("div",null,"Loading..."):e($e.Provider,{value:{categories:r,logoIcon:g}},e("div",{css:P`
24
24
  > :not(:last-child) {
25
25
  margin-bottom: var(--spacing-md);
26
26
  }
27
- `},e(ze,{loading:d||!1,name:"Product Category",onAdd:z,onRemove:A,selectedValues:f.categories,values:F}),e("div",{css:w`
27
+ `},e(Ae,{loading:d||!1,id:"selection-field-product-category",label:v,onAdd:U,onRemove:Y,selectedValues:h.categories,values:B}),e("div",{css:P`
28
28
  display: flex;
29
29
  flex-wrap: wrap;
30
30
  column-gap: var(--spacing-lg);
31
31
  row-gap: var(--spacing-md);
32
- ${re("md")} {
32
+ ${ne("md")} {
33
33
  flex-wrap: nowrap;
34
34
  }
35
- `},e("div",{css:w`
36
- width: 50%;
37
- flex-grow: 1;
38
- `},e(pe,{id:"brand",name:"brand",label:"Brand",disabled:v,value:f.brand,onChange:J,options:[{value:"",label:"Select a brand"},...G.map(i=>({value:i.id,label:i.name}))]})),e("div",{css:w`
35
+ `},F?null:e("div",{css:P`
36
+ width: 50%;
37
+ `},e(ue,{id:"brand",name:"brand",label:S,disabled:m,value:h.brand,onChange:K,options:[{value:"",label:"Choose..."},...z.map(n=>({value:n.id,label:n.name}))]})),e("div",{css:P`
39
38
  flex-grow: 1;
40
39
  position: relative;
41
- `},e(Ue,{id:"count",name:"count",type:"number",min:1,step:1,value:f.count,onChange:i=>E(i.target.valueAsNumber),label:"Count"}),e("div",{css:w`
42
- position: absolute;
43
- bottom: var(--spacing-sm);
44
- right: var(--spacing-sm);
45
- display: flex;
46
- gap: var(--spacing-sm);
47
- `},e(Be,{onCountChange:()=>E(f.count-1),countIcon:"decrement",disabled:f.count===1}),e(Be,{onCountChange:()=>E(f.count+1),countIcon:"increment"})))),e("div",{css:w`
40
+ `},e(Be,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:h.keyword,placeholder:"Enter keyword",onChange:n=>C({keyword:n.target.value})}))),e("div",{css:P`
48
41
  display: flex;
49
42
  flex-wrap: wrap;
50
43
  column-gap: var(--spacing-lg);
51
44
  row-gap: var(--spacing-md);
52
- ${re("md")} {
45
+ ${ne("md")} {
53
46
  flex-wrap: nowrap;
54
47
  }
55
- `},e("div",{css:w`
48
+ `},e("div",{css:P`
56
49
  width: 100%;
57
- ${re("md")} {
50
+ ${ne("md")} {
58
51
  width: 33.333333%;
59
52
  }
60
- `},e(Ue,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:f.keyword,placeholder:"Enter keyword",onChange:i=>g({keyword:i.target.value})})),Array.isArray(u)&&u.length>0?e("div",{css:w`
53
+ position: relative;
54
+ `},e(Be,{id:"count",name:"count",type:"number",min:1,step:1,value:h.count,onChange:n=>I(n.target.valueAsNumber),label:"Count"}),e("div",{css:P`
55
+ position: absolute;
56
+ bottom: var(--spacing-sm);
57
+ right: var(--spacing-sm);
58
+ display: flex;
59
+ gap: var(--spacing-sm);
60
+ `},e(He,{onCountChange:()=>I(h.count-1),countIcon:"decrement",disabled:h.count===1}),e(He,{onCountChange:()=>I(h.count+1),countIcon:"increment"}))),Array.isArray(b)&&b.length>0?e("div",{css:P`
61
61
  flex-grow: 1;
62
- ${re("md")} {
62
+ ${ne("md")} {
63
63
  width: 33.333333%;
64
64
  }
65
- `},e(pe,{id:"sort",name:"sort",label:"Sort",value:f.sort,onChange:i=>g({sort:i.target.value}),options:[{value:"",label:"Select a sort"},...u.map(i=>({value:i.sortKey,label:i.name}))]})):null,Array.isArray(s)&&s.length>0?e("div",{css:w`
65
+ `},e(ue,{id:"sort",name:"sort",label:"Sort",value:h.sort,onChange:n=>C({sort:n.target.value}),options:[{value:"",label:"Select a sort"},...b.map(n=>({value:n.sortKey,label:n.name}))]})):null,Array.isArray(i)&&i.length>0?e("div",{css:P`
66
66
  flex-grow: 1;
67
- `},e(pe,{id:"sort-order",name:"sort-order",label:"Sort Order",value:f.sortOrder,onChange:i=>g({sortOrder:i.target.value}),options:s.map(i=>({value:i.sortOrderKey,label:i.name}))})):null),e("div",null,e("h3",{css:w`
67
+ `},e(ue,{id:"sort-order",name:"sort-order",label:"Sort Order",value:h.sortOrder,onChange:n=>C({sortOrder:n.target.value}),options:i.map(n=>({value:n.sortOrderKey,label:n.name}))})):null),e("div",null,e("h3",{css:P`
68
68
  font-size: var(--fs-md);
69
69
  line-height: var(--spacing-md);
70
70
  font-weight: var(--fw-bold);
71
71
  margin-bottom: var(--spacing-xs);
72
- `},"Result Preview"),e($e,{products:(I=H.value)==null?void 0:I.products}))))};function Oe(t,n){var d;let o=[],r=n?`${n.name} > `:"",c={id:t.id.toString(),name:`${r}${t.name}`};return o.push(c),(d=t.children)==null||d.forEach(v=>{let b=Oe(v,c);o.push(...b)}),o}function Be({onCountChange:t,countIcon:n,disabled:o}){return e("button",{css:w`
72
+ `},"Result Preview"),e(Qe,{products:(E=W.value)==null?void 0:E.products}))))};function Fe(t,a){var d;let o=[],r=a?`${a.name} > `:"",s={id:t.id.toString(),name:`${r}${t.name}`};return o.push(s),(d=t.children)==null||d.forEach(m=>{let g=Fe(m,s);o.push(...g)}),o}function He({onCountChange:t,countIcon:a,disabled:o}){return e("button",{css:P`
73
73
  width: 2.25rem;
74
74
  height: 2.25rem;
75
75
  border: 1px solid var(--gray-300);
@@ -81,58 +81,58 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
81
81
  &:hover {
82
82
  background-color: var(--gray-200);
83
83
  }
84
- ${o?w`
84
+ ${o?P`
85
85
  cursor: not-allowed;
86
86
  opacity: 0.3;
87
87
  `:""}
88
- `,onClick:t,disabled:o},n==="increment"?e(ee,{css:w`
88
+ `,onClick:t,disabled:o},a==="increment"?e(re,{css:P`
89
89
  width: 1rem;
90
90
  height: 1rem;
91
- `}):e(te,{css:w`
91
+ `}):e(oe,{css:P`
92
92
  width: 1rem;
93
93
  height: 1rem;
94
- `}))}var He=fr.createContext(void 0),Fe=()=>{let t=vr(He);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function U({src:t,alt:n,className:o}){let r=t&&typeof t!="string"?t:null;return r?e(r,{className:o}):e("img",{src:t,alt:n,className:o})}import{css as C}from"@emotion/react";import{scrollbarStyles as yr}from"@uniformdev/design-system";var $e=({products:t})=>{let{categories:n,logoIcon:o}=Fe();return e(Ke.Fragment,null,e("p",{css:C`
94
+ `}))}var $e=fr.createContext(void 0),Ke=()=>{let t=vr($e);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function A({src:t,alt:a,className:o}){let r=t&&typeof t!="string"?t:null;return r?e(r,{className:o}):e("img",{src:t,alt:a,className:o})}import{css as R}from"@emotion/react";import{scrollbarStyles as yr}from"@uniformdev/design-system";var Qe=({products:t})=>{let{categories:a,logoIcon:o}=Ke();return e(Ne.Fragment,null,e("p",{css:R`
95
95
  margin-bottom: var(--spacing-base);
96
- `},"Matching ",(t==null?void 0:t.length)||0," products"),e("ul",{css:[C`
96
+ `},"Matching ",(t==null?void 0:t.length)||0," products"),e("ul",{css:[R`
97
97
  max-height: 24rem;
98
98
  overflow-x: auto;
99
- `,yr]},t==null?void 0:t.map((r,c)=>{var b;let[d]=(r==null?void 0:r.categories)||[],v=typeof d=="undefined"||!n||(b=n.find(h=>h.id===d.id))==null?void 0:b.name;return e("li",{key:`product-${r.id}`,css:C`
99
+ `,yr]},t==null?void 0:t.map((r,s)=>{var g;let[d]=(r==null?void 0:r.categories)||[],m=typeof d=="undefined"||!a||(g=a.find(f=>f.id===d.id))==null?void 0:g.name;return e("li",{key:`product-${r.id}`,css:R`
100
100
  border: 1px solid var(--gray-300);
101
101
  border-radius: var(--rounded-md);
102
102
  background-color: var(--gray-100);
103
103
  margin: var(--spacing-base) 0;
104
- `},e("div",{css:C`
104
+ `},e("div",{css:R`
105
105
  padding: var(--spacing-sm);
106
106
  display: flex;
107
107
  flex-grow: 1;
108
108
  margin-right: var(--spacing-sm);
109
109
  gap: var(--spacing-base);
110
110
  align-items: center;
111
- `},r.thumbnailUrl?e("img",{src:r.thumbnailUrl,alt:r.name||`Product ${c}`,css:C`
111
+ `},r.thumbnailUrl?e("img",{src:r.thumbnailUrl,alt:r.name||`Product ${s}`,css:R`
112
112
  background-color: var(--gray-200);
113
113
  width: 3.5rem;
114
114
  height: 3.5rem;
115
115
  object-fit: cover;
116
- `}):e("div",{css:C`
116
+ `}):e("div",{css:R`
117
117
  height: 3.5rem;
118
118
  width: 3.5rem;
119
119
  background-color: var(--gray-100);
120
- `}),e("h4",{css:C`
120
+ `}),e("h4",{css:R`
121
121
  font-weight: var(--fw-bold);
122
122
  width: 33.333333%;
123
123
  font-size: var(--fs-sm);
124
- `},r.name,v&&e("span",{css:C`
124
+ `},r.name,m&&e("span",{css:R`
125
125
  display: block;
126
126
  font-weight: var(--fw-regular);
127
- `},v)),r&&e(Ke.Fragment,null,e("p",{css:C`
127
+ `},m)),r&&e(Ne.Fragment,null,e("p",{css:R`
128
128
  margin-right: var(--spacing-lg);
129
129
  font-size: var(--fs-sm);
130
- `},"SKU: ",r.sku," ",r.id,e("br",null)),r.price&&e("p",{css:C`
130
+ `},"SKU: ",r.sku," ",r.id,e("br",null)),r.price&&e("p",{css:R`
131
131
  margin-right: var(--spacing-lg);
132
132
  font-size: var(--fs-sm);
133
- `},r.price&&e("span",{css:C`
133
+ `},r.price&&e("span",{css:R`
134
134
  display: block;
135
- `},"Price: ",r.price)),e("a",{css:C`
135
+ `},"Price: ",r.price)),e("a",{css:R`
136
136
  display: inline-flex;
137
137
  justify-content: space-between;
138
138
  align-items: center;
@@ -144,19 +144,19 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
144
144
  &:hover {
145
145
  background-color: var(--gray-100);
146
146
  }
147
- `,href:r.url,title:`Goto ${r.name}`,target:"__blank",rel:"noopener"},e("span",{css:C`
147
+ `,href:r.url,title:`Goto ${r.name}`,target:"__blank",rel:"noopener"},e("span",{css:R`
148
148
  font-size: var(--fs-sm);
149
149
  margin-right: var(--spacing-sm);
150
- `},"Edit"),o?e(U,{src:o,alt:"Logo",css:C`
150
+ `},"Edit"),o?e(A,{src:o,alt:"Logo",css:R`
151
151
  width: 2.25rem;
152
152
  height: 2.25rem;
153
- `}):null))))})))};import jr,{useContext as eo,useMemo as to,useRef as ro}from"react";import*as L from"react";var me={};or(me,{Caution:()=>Qe,Checkmark:()=>oe,ChevronDown:()=>ne,Close:()=>K,Danger:()=>Ne,ExclamationPoint:()=>_e,Info:()=>Q,Lightbulb:()=>Ze,MagnifyingGlass:()=>qe,MaximizeAlt:()=>We,Minus:()=>te,MoreVerticalAlt:()=>W,Plus:()=>ee});var Sr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),Qe=Sr;var wr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),oe=wr;var Cr=t=>e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},e("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ne=Cr;var Pr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},e("g",{fillRule:"evenodd"},e("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),e("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),K=Pr;var Rr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),Ne=Rr;var kr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),_e=kr;var xr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),e("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),Q=xr;var Lr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),Ze=Lr;var Mr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("g",{clipPath:"url(#magnifying-glass_svg__a)"},e("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),e("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),e("defs",null,e("clipPath",{id:"magnifying-glass_svg__a"},e("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),qe=Mr;var Vr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),We=Vr;var Er=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),W=Er;import{useThrottle as Or}from"react-use";import{v4 as Hr}from"uuid";import Tr,{useState as Dr,useRef as it,useEffect as Gr}from"react";function Je(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}import{format as zr}from"timeago.js";import{css as x}from"@emotion/react";import{mq as Ir}from"@uniformdev/design-system";var Xe=x`
153
+ `}):null))))})))};import jr,{useContext as eo,useMemo as to,useRef as ro}from"react";import*as V from"react";var ge={};or(ge,{Caution:()=>_e,Checkmark:()=>ae,ChevronDown:()=>ie,Close:()=>N,Danger:()=>Ze,ExclamationPoint:()=>We,Info:()=>_,Lightbulb:()=>qe,MagnifyingGlass:()=>Je,MaximizeAlt:()=>Xe,Minus:()=>oe,MoreVerticalAlt:()=>X,Plus:()=>re});var Sr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})),_e=Sr;var wr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 39.2A19.2 19.2 0 1 0 20 .8a19.2 19.2 0 0 0 0 38.4Zm8.897-22.303a2.4 2.4 0 0 0-3.394-3.394L17.6 21.407l-3.103-3.104a2.4 2.4 0 0 0-3.394 3.394l4.8 4.8a2.4 2.4 0 0 0 3.394 0l9.6-9.6Z"})),ae=wr;var Cr=t=>e("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...t},e("path",{d:"M5.293 8.293a1 1 0 0 1 1.414 0L12 13.586l5.293-5.293a1 1 0 1 1 1.414 1.414l-6 6a1 1 0 0 1-1.414 0l-6-6a1 1 0 0 1 0-1.414Z"})),ie=Cr;var Pr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...t},e("g",{fillRule:"evenodd"},e("path",{d:"M16.578 1.636a1.174 1.174 0 0 1 0 1.66L3.296 16.578a1.174 1.174 0 1 1-1.66-1.66L14.918 1.636a1.174 1.174 0 0 1 1.66 0Z"}),e("path",{d:"M1.636 1.636a1.174 1.174 0 0 1 1.66 0l13.282 13.282a1.174 1.174 0 1 1-1.66 1.66L1.636 3.296a1.174 1.174 0 0 1 0-1.66Z"}))),N=Pr;var Rr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})),Ze=Rr;var kr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})),We=kr;var xr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("path",{xmlns:"http://www.w3.org/2000/svg",d:"M11 10.98a1 1 0 1 1 2 0v6a1 1 0 1 1-2 0v-6zm1-4.929a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"}),e("path",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zM4 12a8 8 0 1 0 16 0 8 8 0 0 0-16 0z"})),_=xr;var Lr=t=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...t},e("path",{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})),qe=Lr;var Mr=t=>e("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},e("g",{clipPath:"url(#magnifying-glass_svg__a)"},e("path",{d:"M11.539 0C5.484 0 .559 4.741.559 10.57c0 5.827 4.925 10.568 10.98 10.568 6.055 0 10.98-4.74 10.98-10.569C22.52 4.741 17.595 0 11.54 0Zm0 19.187c-4.937 0-8.954-3.866-8.954-8.618 0-4.752 4.017-8.618 8.954-8.618s8.954 3.866 8.954 8.618c0 4.752-4.017 8.618-8.954 8.618Z"}),e("path",{d:"m25.196 22.334-5.811-5.593a1.041 1.041 0 0 0-1.434 0 .95.95 0 0 0 0 1.38l5.812 5.593c.198.19.457.286.716.286.26 0 .519-.096.717-.286a.95.95 0 0 0 0-1.38Z"})),e("defs",null,e("clipPath",{id:"magnifying-glass_svg__a"},e("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})))),Je=Mr;var Vr=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("path",{xmlns:"http://www.w3.org/2000/svg",d:"M3 3h6v2H6.462l4.843 4.843-1.415 1.414L5 6.367V9H3V3zm0 18h6v-2H6.376l4.929-4.928-1.415-1.414L5 17.548V15H3v6zm12 0h6v-6h-2v2.524l-4.867-4.866-1.414 1.414L17.647 19H15v2zm6-18h-6v2h2.562l-4.843 4.843 1.414 1.414L19 6.39V9h2V3z"})),Xe=Vr;var Er=t=>e("svg",{width:"1em",height:"1em",fill:"currentColor",...t},e("path",{xmlns:"http://www.w3.org/2000/svg",d:"M14 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0zm0 6a2 2 0 1 1-4 0 2 2 0 0 1 4 0z"})),X=Er;import{useThrottle as Or}from"react-use";import{v4 as Hr}from"uuid";import Ir,{useState as Dr,useRef as ct,useEffect as Gr}from"react";function Ye(t,a){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),a())},500)}import{format as zr}from"timeago.js";import{css as M}from"@emotion/react";import{mq as Tr}from"@uniformdev/design-system";var je=M`
154
154
  border: 1px solid var(--gray-200);
155
155
  background: var(--gray-50);
156
156
  border-radius: var(--rounded-base);
157
157
  display: flex;
158
158
  width: 100%;
159
- `,Ye=x`
159
+ `,et=M`
160
160
  align-items: center;
161
161
  display: flex;
162
162
  flex-grow: 1;
@@ -164,24 +164,24 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
164
164
  margin-inline: 0 var(--spacing-sm);
165
165
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
166
166
  position: relative;
167
- `,je=x`
167
+ `,tt=M`
168
168
  flex-grow: 1;
169
- `,et=x`
169
+ `,rt=M`
170
170
  align-items: start;
171
171
  display: inline-flex;
172
172
  position: relative;
173
- `,tt=x`
173
+ `,ot=M`
174
174
  color: var(--brand-secondary-1);
175
175
  font-size: var(--fs-base);
176
176
  font-weight: var(--fw-bold);
177
177
  line-height: 1;
178
- `,rt=x`
178
+ `,nt=M`
179
179
  width: 1.5rem;
180
180
  height: 1.5rem;
181
- `,ot=x`
181
+ `,at=M`
182
182
  width: 1rem;
183
183
  height: 1rem;
184
- `,nt=x`
184
+ `,it=M`
185
185
  background: var(--white);
186
186
  border-radius: var(--rounded-base);
187
187
  border-left: 4px solid var(--brand-secondary-3);
@@ -189,20 +189,20 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
189
189
  padding: var(--spacing-base);
190
190
  z-index: var(--z-10);
191
191
  width: max-content;
192
- `,B=x`
192
+ `,O=M`
193
193
  font-size: var(--fs-sm);
194
- `,ae=x`
194
+ `,se=M`
195
195
  font-weight: var(--fw-bold);
196
196
  margin-right: var(--spacing-sm);
197
- `,at=x`
197
+ `,st=M`
198
198
  display: flex;
199
199
  flex-direction: column;
200
200
  gap: var(--spacing-sm);
201
201
 
202
- ${Ir("md")} {
202
+ ${Tr("md")} {
203
203
  flex-direction: row;
204
204
  }
205
- `,ue=x`
205
+ `,fe=M`
206
206
  align-items: center;
207
207
  background: var(--white);
208
208
  border-radius: var(--rounded-base);
@@ -215,40 +215,40 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
215
215
  &:hover {
216
216
  background: var(--gray-50);
217
217
  }
218
- `;import{css as D}from"@emotion/react";var st=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var u;let c=it(null),d=it(null),[v,b]=Dr(!1);Gr(()=>{let s=f=>{c.current&&!c.current.contains(f.target)&&d.current&&!d.current.contains(f.target)&&b(!1)},g=()=>{b(!1)};return window.addEventListener("resize",g,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",g,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[d]);let h=()=>{var s;if(b(!v),d.current&&c.current){let g=(s=c==null?void 0:c.current)==null?void 0:s.getBoundingClientRect();d.current.style.top=`${g.top+30}px`}};return e("div",{css:Xe,key:t.id},e("div",{css:Ye},e("div",{css:je},e("div",{css:et},e("h4",{css:[tt,t.popoverData?D`
218
+ `;import{css as G}from"@emotion/react";var dt=({selectedItem:t,logoIcon:a,onDeselect:o,onEditClosed:r})=>{var b;let s=ct(null),d=ct(null),[m,g]=Dr(!1);Gr(()=>{let i=S=>{s.current&&!s.current.contains(S.target)&&d.current&&!d.current.contains(S.target)&&g(!1)},v=()=>{g(!1)};return window.addEventListener("resize",v,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",v,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[d]);let f=()=>{var i;if(g(!m),d.current&&s.current){let v=(i=s==null?void 0:s.current)==null?void 0:i.getBoundingClientRect();d.current.style.top=`${v.top+30}px`}};return e("div",{css:je,key:t.id},e("div",{css:et},e("div",{css:tt},e("div",{css:rt},e("h4",{css:[ot,t.popoverData?G`
219
219
  margin-bottom: var(--spacing-sm);
220
- `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?e(Tr.Fragment,null,e("button",{type:"button",ref:c,css:D`
220
+ `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?e(Ir.Fragment,null,e("button",{type:"button",ref:s,css:G`
221
221
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
222
- `,"aria-controls":"path-details","aria-expanded":v,onClick:h},e(Q,{width:24,height:24,css:D`
222
+ `,"aria-controls":"path-details","aria-expanded":m,onClick:f},e(_,{width:24,height:24,css:G`
223
223
  color: var(--gray-400);
224
- `})),e("div",{id:"path-details","aria-hidden":!v,ref:d,css:[nt,v?D`
224
+ `})),e("div",{id:"path-details","aria-hidden":!m,ref:d,css:[it,m?G`
225
225
  visibility: visible;
226
- `:D`
226
+ `:G`
227
227
  visibility: hidden;
228
- `]},Object.entries(t.popoverData).map(([s,g],f)=>e("div",{css:B,key:f},e("span",{css:ae},s,":"),g)))):null),t.createdDate&&e("div",{css:B},e("span",{css:ae},"Created:"),zr((u=t.createdDate)!=null?u:0)),e("div",{css:D`
228
+ `]},Object.entries(t.popoverData).map(([i,v],S)=>e("div",{css:O,key:S},e("span",{css:se},i,":"),v)))):null),t.createdDate&&e("div",{css:O},e("span",{css:se},"Created:"),zr((b=t.createdDate)!=null?b:0)),e("div",{css:G`
229
229
  display: flex;
230
230
  gap: var(--spacing-base);
231
- `},t.metadata?Object.entries(t.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,g])=>e("span",{css:B,key:s},g)):null),t.metadata?Object.entries(t.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,g])=>e("div",{css:[B,D`
231
+ `},t.metadata?Object.entries(t.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,v])=>e("span",{css:O,key:i},v)):null),t.metadata?Object.entries(t.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,v])=>e("div",{css:[O,G`
232
232
  order: 1;
233
- `],key:s},e("span",{css:[ae,D`
233
+ `],key:i},e("span",{css:[se,G`
234
234
  order: 1;
235
- `]},s,":"),g)):null),e("div",{css:at},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:s=>{r&&(Je(s.currentTarget.href,()=>r(t)),s.preventDefault())},css:ue},e("span",{css:B},"Edit"),e(U,{src:n,css:rt,alt:"Logo"})):null,e("button",{type:"button",onClick:s=>{s.preventDefault(),o(t)},css:ue},e("span",{css:B},"Unlink"),e(K,{css:[ot,D`
235
+ `]},i,":"),v)):null),e("div",{css:st},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",onClick:i=>{r&&(Ye(i.currentTarget.href,()=>r(t)),i.preventDefault())},css:fe},e("span",{css:O},"Edit"),e(A,{src:a,css:nt,alt:"Logo"})):null,e("button",{type:"button",onClick:i=>{i.preventDefault(),o(t)},css:fe},e("span",{css:O},"Unlink"),e(N,{css:[at,G`
236
236
  color: var(--brand-secondary-5);
237
- `]})))))};import Ur,{useState as Ar,useRef as mt,useEffect as Br}from"react";import{css as N}from"@emotion/react";var ct=N`
237
+ `]})))))};import Ur,{useState as Ar,useRef as gt,useEffect as Br}from"react";import{css as Z}from"@emotion/react";var lt=Z`
238
238
  cursor: pointer;
239
239
  padding: var(--spacing-sm);
240
240
  position: relative;
241
241
  transition: background-color var(--duration-fast) var(--timing-ease-out),
242
242
  color var(--duration-fast) var(--timing-ease-out);
243
- `,dt=N`
243
+ `,pt=Z`
244
244
  background: var(--brand-secondary-3);
245
245
  color: var(--white);
246
- `,ge=N`
246
+ `,ve=Z`
247
247
  font-size: var(--fs-xs);
248
- `,fe=N`
248
+ `,he=Z`
249
249
  font-weight: var(--fw-bold);
250
250
  margin-right: var(--spacing-sm);
251
- `,lt=N`
251
+ `,mt=Z`
252
252
  background: var(--white);
253
253
  border-left: 4px solid var(--brand-secondary-3);
254
254
  border-radius: var(--rounded-base);
@@ -260,20 +260,20 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
260
260
  right: var(--spacing-xl);
261
261
  z-index: var(--z-10);
262
262
  width: max-content;
263
- `,pt=N`
263
+ `,ut=Z`
264
264
  position: absolute;
265
265
  inset: 0 var(--spacing-sm) 0 auto;
266
- `;import{css as ut}from"@emotion/react";var gt=({result:t,isSelected:n,triggerSelection:o})=>{let r=mt(null),c=mt(null),[d,v]=Ar(!1);Br(()=>{function h(u){r.current&&!r.current.contains(u.target)&&c.current&&!c.current.contains(u.target)&&v(!1)}return document.addEventListener("mousedown",h),()=>{document.removeEventListener("mousedown",h)}},[c]);let b=h=>{h.stopPropagation(),v(!d)};return e("div",{key:t.id,css:[ct,n?dt:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?e(Ur.Fragment,null,e("button",{type:"button",ref:r,css:pt,"aria-controls":"path-details",onClick:h=>b(h),"aria-expanded":d},e(Q,{width:24,height:24})),e("div",{id:"path-details","aria-hidden":!d,ref:c,css:[lt,d?ut`
266
+ `;import{css as ft}from"@emotion/react";var vt=({result:t,isSelected:a,triggerSelection:o})=>{let r=gt(null),s=gt(null),[d,m]=Ar(!1);Br(()=>{function f(b){r.current&&!r.current.contains(b.target)&&s.current&&!s.current.contains(b.target)&&m(!1)}return document.addEventListener("mousedown",f),()=>{document.removeEventListener("mousedown",f)}},[s]);let g=f=>{f.stopPropagation(),m(!d)};return e("div",{key:t.id,css:[lt,a?pt:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&a?e(Ur.Fragment,null,e("button",{type:"button",ref:r,css:ut,"aria-controls":"path-details",onClick:f=>g(f),"aria-expanded":d},e(_,{width:24,height:24})),e("div",{id:"path-details","aria-hidden":!d,ref:s,css:[mt,d?ft`
267
267
  visibility: visible;
268
- `:ut`
268
+ `:ft`
269
269
  visibility: hidden;
270
- `]},t.metadata&&Object.entries(t.metadata).map(([h,u],s)=>e("div",{css:ge,key:s},e("span",{css:fe},h,":"),u)),Object.entries(t.popoverData).map(([h,u],s)=>e("div",{css:ge,key:s},e("span",{css:fe},h,":"),u)))):null)};import{Droppable as Fr,DragDropContext as $r,Draggable as Kr}from"react-beautiful-dnd";import{css as S}from"@emotion/react";var ft=S`
270
+ `]},t.metadata&&Object.entries(t.metadata).map(([f,b],i)=>e("div",{css:ve,key:i},e("span",{css:he},f,":"),b)),Object.entries(t.popoverData).map(([f,b],i)=>e("div",{css:ve,key:i},e("span",{css:he},f,":"),b)))):null)};import{Droppable as Fr,DragDropContext as $r,Draggable as Kr}from"react-beautiful-dnd";import{css as w}from"@emotion/react";var ht=w`
271
271
  background: var(--white);
272
272
  border: 1px solid var(--gray-300);
273
273
  border-radius: var(--rounded-base);
274
274
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
275
275
  margin-bottom: var(--spacing-base);
276
- `,vt=S`
276
+ `,bt=w`
277
277
  align-items: center;
278
278
  display: flex;
279
279
  position: relative;
@@ -281,7 +281,7 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
281
281
  width: 100%;
282
282
  background-color: transparent;
283
283
  border: 0;
284
- `,ht=S`
284
+ `,yt=w`
285
285
  color: var(--brand-secondary-1);
286
286
  display: block;
287
287
  font-weight: var(--fw-bold);
@@ -297,15 +297,15 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
297
297
  background: var(--gray-100);
298
298
  outline: none;
299
299
  }
300
- `,bt=S`
300
+ `,St=w`
301
301
  background: var(--white);
302
302
  border: 1px solid var(--gray-300);
303
303
  border-radius: var(--rounded-base);
304
304
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
305
305
  display: block;
306
- `,yt=S`
306
+ `,wt=w`
307
307
  display: none;
308
- `,St=S`
308
+ `,Ct=w`
309
309
  overflow-y: auto;
310
310
  max-height: 16rem;
311
311
  margin-bottom: var(--spacing-base);
@@ -313,165 +313,164 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
313
313
  & > :not(:last-child) {
314
314
  border-bottom: 1px solid var(--gray-200);
315
315
  }
316
- `,Zn=S`
316
+ `,qn=w`
317
317
  background-color: var(--gray-50);
318
318
  max-width: 33.33%;
319
- `,wt=S`
319
+ `,Pt=w`
320
320
  align-items: center;
321
321
  display: flex;
322
322
  position: absolute;
323
323
  inset: 0 0 0 auto;
324
324
  pointer-events: none;
325
325
  padding-right: var(--spacing-sm);
326
- `,Ct=S`
326
+ `,Rt=w`
327
327
  color: var(--brand-secondary-1);
328
328
  width: 1.25rem;
329
329
  height: 1.25rem;
330
330
  transition: transform var(--duration-fast) var(--timing-ease-out);
331
331
  transform: rotate(0);
332
- `,qn=S`
332
+ `,Jn=w`
333
333
  background: var(--white);
334
334
  color: var(--brand-secondary-1);
335
- `,Pt=S`
335
+ `,kt=w`
336
336
  position: relative;
337
337
  margin-block: var(--spacing-sm) 0;
338
338
 
339
339
  &:hover > span {
340
340
  opacity: 0.3;
341
341
  }
342
- `,Rt=S`
342
+ `,xt=w`
343
343
  align-items: center;
344
344
  display: flex;
345
345
  position: absolute;
346
346
  inset: 0 auto 0 0;
347
347
  margin-block: auto;
348
348
  opacity: 0;
349
- `,ve=S`
349
+ `,be=w`
350
350
  color: var(--brand-secondary-1);
351
- `,kt=S`
351
+ `,Lt=w`
352
352
  position: absolute;
353
353
  left: 0.375rem;
354
- `,he=S`
354
+ `,ye=w`
355
355
  width: calc(var(--spacing-lg) + var(--spacing-xs));
356
356
  height: calc(var(--spacing-lg) + var(--spacing-xs));
357
- `;import{css as V}from"@emotion/react";import{InputSelect as Qr,scrollbarStyles as Nr,Button as be,Callout as _r,InputKeywordSearch as Zr,LoadingIndicator as xt,Menu as qr,MenuItem as Wr}from"@uniformdev/design-system";var Jr=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),e(_r,{type:"info"},o)},Lt=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:c,select:d,multiSelect:v,multiSelectId:b,rowComponent:h,selectedItemComponent:u,totalResults:s,resultsLoading:g,requireContentType:f,onAddNew:H,onEditClosed:M,onCancel:F,noResultsComponent:G,helpComponent:z,onSort:A})=>{var Re,ke,xe;let E=()=>f?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[I,i]=L.useState(""),[m,T]=L.useState(E),[_,ce]=L.useState(!1),[X,Y]=L.useState([]),[Kt,Se]=L.useState(!1),j=Or(I,750);L.useEffect(()=>{t(j,{count:5,offset:0,contentType:m==="any"?void 0:m})},[j,m]);let Qt=a=>{X.includes(a.id)?Y(y=>y.filter($=>$!==a.id)):Y(v?y=>[...y,a==null?void 0:a.id]:[a.id])},Nt=()=>{T(E()),i(""),Y(r!=null&&r.length?r.map(a=>a.id):[])},_t=()=>{ce(a=>!a),_||Nt()},we=a=>{d((r==null?void 0:r.filter(y=>y.id!==a.id).map(y=>y.id))||[],"")},Zt=a=>{a.preventDefault(),d(X,m),ce(!1)},qt=a=>{a.preventDefault(),ce(!1),F&&F()},Wt=a=>{a.preventDefault(),t(j,{count:5,offset:(n==null?void 0:n.length)||0,contentType:m==="any"?void 0:m}),Se(!0);let y=setTimeout(()=>{Se(!1)},750);return()=>clearTimeout(y)},de=L.useRef(Hr()),Jt=!(r==null?void 0:r.length)||v,Xt=h||gt,Ce=u||st,Yt=G||Jr,Pe=c&&typeof c!="string"?c:null,jt=Pe?e(Pe,{css:he}):e("img",{src:c,alt:"CMS logo",css:he}),er=a=>{var y,$;if(a.destination&&a.source.droppableId===((y=a.destination)==null?void 0:y.droppableId)){let R=[...r||[]],[Z]=($=R==null?void 0:R.splice(a.source.index,1))!=null?$:[];return R==null||R.splice(a.destination.index,0,Z),A==null||A(R.map(tr=>tr.id)),R}};return e("div",{css:V`
357
+ `;import{css as T}from"@emotion/react";import{InputSelect as Qr,scrollbarStyles as Nr,Button as Se,Callout as _r,InputKeywordSearch as Zr,LoadingIndicator as Mt,Menu as Wr,MenuItem as qr}from"@uniformdev/design-system";var Jr=({searchText:t,selectedContentType:a})=>{let o="No content found";return a&&(o=`No ${a} content was found`),t&&(o=`${o} for keyword '${t}'.`),e(_r,{type:"info"},o)},Vt=({search:t,results:a,contentTypes:o,selectedItems:r,logoIcon:s,select:d,multiSelect:m,multiSelectId:g,rowComponent:f,selectedItemComponent:b,totalResults:i,resultsLoading:v,requireContentType:S,onAddNew:F,onEditClosed:C,onCancel:h,noResultsComponent:W,helpComponent:$,onSort:B,typeSelectorLabel:z="Content Type Select",typeSelectorAllTypesOptionText:U="All content types"})=>{var xe,Le,Me;let K=()=>S?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[I,E]=V.useState(""),[n,y]=V.useState(K),[D,le]=V.useState(!1),[j,ee]=V.useState([]),[Qt,Ce]=V.useState(!1),te=Or(I,750);V.useEffect(()=>{t(te,{count:5,offset:0,contentType:n==="any"?void 0:n})},[te,n]);let Nt=c=>{j.some(u=>u.id===c.id)?ee(u=>u.filter(Q=>Q.id!==c.id)):ee(m?u=>[...u,c]:[c])},_t=()=>{y(K()),E(""),ee(r!=null&&r.length?r:[])},Zt=()=>{le(c=>!c),D||_t()},Pe=c=>{d((r==null?void 0:r.filter(u=>u.id!==c.id))||[],"")},Wt=c=>{c.preventDefault(),d(j,n),le(!1)},qt=c=>{c.preventDefault(),le(!1),h&&h()},Jt=c=>{c.preventDefault(),t(te,{count:5,offset:(a==null?void 0:a.length)||0,contentType:n==="any"?void 0:n}),Ce(!0);let u=setTimeout(()=>{Ce(!1)},750);return()=>clearTimeout(u)},pe=V.useRef(Hr()),Xt=!(r==null?void 0:r.length)||m,Yt=f||vt,Re=b||dt,jt=W||Jr,ke=s&&typeof s!="string"?s:null,er=ke?e(ke,{css:ye}):e("img",{src:s,alt:"Logo",css:ye}),tr=c=>{var u,Q;if(c.destination&&c.source.droppableId===((u=c.destination)==null?void 0:u.droppableId)){let x=[...r||[]],[q]=(Q=x==null?void 0:x.splice(c.source.index,1))!=null?Q:[];return x==null||x.splice(c.destination.index,0,q),B==null||B(x),x}};return e("div",{css:T`
358
358
  width: 100%;
359
- `},e("div",{css:V`
359
+ `},e("div",{css:T`
360
360
  position: relative;
361
361
  margin-block: var(--spacing-base);
362
- `},Jt&&e(L.Fragment,null,e("div",{css:ft,"data-test-id":"component-search"},e("button",{css:vt,onClick:_t,type:"button","aria-haspopup":!0,"aria-expanded":_,"aria-controls":`entry-search-config-${de.current}`},jt,e("span",{css:V`
362
+ `},Xt&&e(V.Fragment,null,e("div",{css:ht,"data-test-id":"component-search"},e("button",{css:bt,onClick:Zt,type:"button","aria-haspopup":!0,"aria-expanded":D,"aria-controls":`entry-search-config-${pe.current}`},er,e("span",{css:T`
363
363
  margin-left: var(--spacing-base);
364
- `},"Select"),e("span",{css:wt},e(ne,{css:[Ct,_?V`
364
+ `},"Select"),e("span",{css:Pt},e(ie,{css:[Rt,D?T`
365
365
  transform: rotate(180deg);
366
- `:void 0]})))),e("div",{id:`entry-search-config-${de.current}`,"aria-hidden":!_,css:[bt,_?void 0:yt]},z||null,e("div",{css:V`
366
+ `:void 0]})))),e("div",{id:`entry-search-config-${pe.current}`,"aria-hidden":!D,css:[St,D?void 0:wt]},$||null,e("div",{css:T`
367
367
  display: flex;
368
368
  gap: calc(var(--spacing-base) - 0.25rem);
369
369
  margin-bottom: var(--spacing-base);
370
- `},e(Qr,{onChange:a=>T(a.target.value),value:m,label:"Content Type Select",showLabel:!1,options:[...f?[]:[{value:"any",label:"All content types"}],...o?o.map(a=>({value:a.id,label:a.name})):[]]}),e("div",{css:V`
370
+ `},e(Qr,{onChange:c=>y(c.target.value),value:n,label:z,showLabel:!1,options:[...S?[]:[{value:"any",label:U}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),e("div",{css:T`
371
371
  flex-grow: 1;
372
- `},e(Zr,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:i,disabledFieldSubmission:!0,value:I}))),e("div",{css:[St,Nr],id:de.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},!g&&Array.isArray(n)?n.map(a=>e(Xt,{key:a.id,isSelected:X.includes(a.id),result:a,triggerSelection:()=>Qt(a)})):g?null:e(Yt,{searchText:j||I,selectedContentType:(ke=(Re=o==null?void 0:o.find(a=>a.id===m))==null?void 0:Re.name)!=null?ke:m}),!g&&typeof s!="undefined"&&n&&(n==null?void 0:n.length)<s&&e("button",{css:ht,onClick:Wt},Kt?e(xt,null):"Load More"),g&&!(n!=null&&n.length)?e("div",{css:V`
372
+ `},e(Zr,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:E,disabledFieldSubmission:!0,value:I}))),e("div",{css:[Ct,Nr],id:pe.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},!v&&Array.isArray(a)?a.map(c=>e(Yt,{key:c.id,isSelected:j.some(u=>u.id===c.id),result:c,triggerSelection:()=>Nt(c)})):v?null:e(jt,{searchText:te||I,selectedContentType:(Le=(xe=o==null?void 0:o.find(c=>c.id===n))==null?void 0:xe.name)!=null?Le:n}),!v&&typeof i!="undefined"&&a&&(a==null?void 0:a.length)<i&&e("button",{css:yt,onClick:Jt},Qt?e(Mt,null):"Load More"),v&&!(a!=null&&a.length)?e("div",{css:T`
373
373
  padding: var(--spacing-base);
374
374
  text-align: center;
375
375
  width: 100%;
376
- `},e(xt,null)):null),e("div",{css:V`
376
+ `},e(Mt,null)):null),e("div",{css:T`
377
377
  display: flex;
378
378
  justify-content: space-between;
379
- `},e("div",null,H&&((xe=o==null?void 0:o.length)!=null?xe:0)>0?e(qr,{menuLabel:"Add new menu",menuTrigger:e(be,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(a=>e(Wr,{key:a.id,css:V`
379
+ `},e("div",null,F&&((Me=o==null?void 0:o.length)!=null?Me:0)>0?e(Wr,{menuLabel:"Add new menu",menuTrigger:e(Se,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>e(qr,{key:c.id,css:T`
380
380
  background: var(--white);
381
381
  color: var(--brand-secondary-1);
382
- `,onClick:()=>H(a)},a.name))):null),e("div",{css:V`
382
+ `,onClick:()=>F(c)},c.name))):null),e("div",{css:T`
383
383
  display: flex;
384
384
  gap: var(--spacing-base);
385
- `},e(be,{buttonType:"unimportant",onClick:qt},"Cancel"),e(be,{disabled:!X.length,onClick:Zt,"data-test-id":"entry-accept-button"},"Accept"))))),v?e($r,{onDragEnd:a=>er(a)},e(Fr,{droppableId:b||"canvas-multi-select"},a=>e("div",{...a.droppableProps,ref:a.innerRef,css:V`
385
+ `},e(Se,{buttonType:"unimportant",onClick:qt},"Cancel"),e(Se,{disabled:!j.length,onClick:Wt,"data-test-id":"entry-accept-button"},"Accept"))))),m?e($r,{onDragEnd:c=>tr(c)},e(Fr,{droppableId:g||"canvas-multi-select"},c=>e("div",{...c.droppableProps,ref:c.innerRef,css:T`
386
386
  margin-block: var(--spacing-sm) 0;
387
- `},r==null?void 0:r.map((y,$)=>{if(y!=null&&y.id)return e(Kr,{key:y.id,draggableId:y.id,index:$},R=>e("div",{css:Pt,ref:R.innerRef,...R.draggableProps,...R.dragHandleProps},e("span",{css:Rt},e(W,{css:[ve,kt],width:24,height:24}),e(W,{css:ve,width:24,height:24})),e(Ce,{key:`selected-item-${y.id}`,logoIcon:c,selectedItem:y,onDeselect:Z=>we(Z),onEditClosed:M?Z=>M(Z):void 0})))}),a.placeholder))):r==null?void 0:r.map(a=>e(Ce,{key:`selected-item-${a.id}`,logoIcon:c,selectedItem:a,onDeselect:y=>we(y),onEditClosed:M?y=>M(y):void 0}))))};import{css as O}from"@emotion/react";var Mt=O`
387
+ `},r==null?void 0:r.map((u,Q)=>{if(u!=null&&u.id)return e(Kr,{key:u.id,draggableId:u.id,index:Q},x=>e("div",{css:kt,ref:x.innerRef,...x.draggableProps,...x.dragHandleProps},e("span",{css:xt},e(X,{css:[be,Lt],width:24,height:24}),e(X,{css:be,width:24,height:24})),e(Re,{key:`selected-item-${u.id}`,logoIcon:s,selectedItem:u,onDeselect:q=>Pe(q),onEditClosed:C?q=>C(q):void 0})))}),c.placeholder))):r==null?void 0:r.map(c=>e(Re,{key:`selected-item-${c.id}`,logoIcon:s,selectedItem:c,onDeselect:u=>Pe(u),onEditClosed:C?u=>C(u):void 0}))))};import{css as H}from"@emotion/react";var Et=H`
388
388
  cursor: pointer;
389
389
  padding: var(--spacing-sm) 0;
390
390
  margin-right: var(--spacing-sm);
391
391
  position: relative;
392
392
  transition: background-color var(--duration-fast) var(--timing-ease-out),
393
393
  color var(--duration-fast) var(--timing-ease-out);
394
- `,Vt=O`
394
+ `,Tt=H`
395
395
  border: 2px solid transparent;
396
396
  border-radius: var(--rounded-base);
397
397
  display: flex;
398
398
  align-items: center;
399
399
  gap: var(--spacing-base);
400
400
  padding: var(--spacing-sm) var(--spacing-xs);
401
- `,Et=O`
401
+ `,It=H`
402
402
  background-color: var(--green-50);
403
- `,It=O`
403
+ `,Dt=H`
404
404
  font-size: var(--fs-sm);
405
405
  font-weight: var(--fw-bold);
406
406
  width: 50%;
407
- `,Tt=O`
407
+ `,Gt=H`
408
408
  font-weight: var(--fw-normal);
409
409
  display: block;
410
- `,Dt=O`
410
+ `,zt=H`
411
411
  font-size: var(--fs-sm);
412
412
  > * {
413
413
  display: block;
414
414
  }
415
- `,Gt=O`
415
+ `,Ut=H`
416
416
  display: block;
417
417
  height: 1.5rem;
418
418
  width: 1.5rem;
419
419
  color: var(--brand-secondary-3);
420
420
  margin-left: auto;
421
- `;import{css as zt}from"@emotion/react";function Ut({result:t,isSelected:n,triggerSelection:o}){var b;let{categories:r,logoIcon:c}=ie(),[d]=t.categories||[{id:"",name:""}],v=typeof d=="undefined"||!r||(b=r.find(h=>h.id===d.id))==null?void 0:b.name;return e("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Mt]},e("div",{css:[Vt,n?Et:void 0]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:zt`
421
+ `;import{css as At}from"@emotion/react";function Bt({result:t,isSelected:a,triggerSelection:o}){var g;let{categories:r,logoIcon:s}=ce(),[d]=t.categories||[{id:"",name:""}],m=typeof d=="undefined"||!r||(g=r.find(f=>f.id===d.id))==null?void 0:g.name;return e("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Et]},e("div",{css:[Tt,a?It:void 0]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:At`
422
422
  background-color: var(--gray-200);
423
423
  width: 3rem;
424
424
  height: 3rem;
425
425
  object-fit: cover;
426
- `}):e(U,{src:c,alt:"Logo",css:zt`
426
+ `}):e(A,{src:s,alt:"Logo",css:At`
427
427
  height: 2.25rem;
428
428
  width: 2.25rem;
429
- `}),e("h4",{css:[It]},t.title,v?e("span",{css:[Tt]},v):null),e("p",{css:[Dt]},"SKU: ",t.id,t.price&&e("span",null,t.price)),n?e(oe,{css:[Gt]}):null))}import{css as se}from"@emotion/react";import{mq as Xr}from"@uniformdev/design-system";var At=se`
429
+ `}),e("h4",{css:[Dt]},t.title,m?e("span",{css:[Gt]},m):null),e("p",{css:[zt]},"SKU: ",t.id,t.price&&e("span",null,t.price)),a?e(ae,{css:[Ut]}):null))}import{css as de}from"@emotion/react";import{mq as Xr}from"@uniformdev/design-system";var Ot=de`
430
430
  display: flex;
431
431
  width: 100%;
432
432
  border: 1px solid var(--gray-300);
433
433
  border-radius: var(--rounded-base);
434
434
  background-color: var(--gray-100);
435
435
  margin: var(--spacing-base) 0;
436
- `,Bt=se`
436
+ `,Ht=de`
437
437
  padding: var(--spacing-base) 0 var(--spacing-base) var(--spacing-lg);
438
438
  display: flex;
439
439
  flex-grow: 1;
440
440
  align-items: center;
441
441
  margin-right: var(--spacing-sm);
442
442
  gap: var(--spacing-base);
443
- `,Ot=se`
443
+ `,Ft=de`
444
444
  display: flex;
445
445
  align-items: center;
446
446
  gap: var(--spacing-sm);
447
- margin-bottom: var(--spacing-sm);
448
447
  ${Xr("lg")} {
449
448
  width: 50%;
450
449
  margin-bottom: 0;
451
450
  }
452
- `,ye=se`
451
+ `,we=de`
453
452
  background-color: var(--gray-200);
454
453
  width: 3.5rem;
455
454
  height: 3.5rem;
456
455
  object-fit: cover;
457
- `;import{css as P}from"@emotion/react";import{mq as Yr}from"@uniformdev/design-system";function Ht({selectedItem:t,onDeselect:n}){var v;let{categories:o,logoIcon:r}=ie(),[c]=t.categories||[{id:"",name:""}],d=typeof c=="undefined"||!o||(v=o.find(b=>b.id===c.id))==null?void 0:v.name;return e("div",{css:[At],key:t.id},e("article",{css:[Bt]},e("div",{css:[Ot]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:d,css:[ye],loading:"lazy"}):e("div",{css:[ye]}),e("div",{css:P`
456
+ `;import{css as k}from"@emotion/react";import{mq as Yr}from"@uniformdev/design-system";function $t({selectedItem:t,onDeselect:a}){var m;let{categories:o,logoIcon:r}=ce(),[s]=t.categories||[{id:"",name:""}],d=typeof s=="undefined"||!o||(m=o.find(g=>g.id===s.id))==null?void 0:m.name;return e("div",{css:[Ot],key:t.id},e("article",{css:[Ht]},e("div",{css:[Ft]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:d,css:[we],loading:"lazy"}):e("div",{css:[we]}),e("div",{css:k`
458
457
  > :not(:last-child) {
459
458
  margin-bottom: var(--spacing-xs);
460
459
  }
461
- `},e("h4",{css:P`
460
+ `},e("h4",{css:k`
462
461
  font-weight: var(--fw-bold);
463
- `},t.title||t.id||"",d&&e("span",{css:P`
462
+ `},t.title||t.id||"",d&&e("span",{css:k`
464
463
  display: block;
465
464
  font-weight: var(--fw-regular);
466
- `},d)),e("ul",{css:P`
465
+ `},d)),e("ul",{css:k`
467
466
  font-size: var(--fs-sm);
468
467
  display: flex;
469
468
  gap: var(--spacing-base);
470
- `},e("li",null,e("span",{css:P`
469
+ `},e("li",null,e("span",{css:k`
471
470
  margin-right: var(--spacing-xs);
472
- `},"SKU:"),t.id),t.price&&e("li",null,e("span",{css:P`
471
+ `},"SKU:"),t.id),t.price&&e("li",null,e("span",{css:k`
473
472
  margin-right: var(--spacing-xs);
474
- `},"Price:"),e("span",null,t.price))))),e("div",{css:P`
473
+ `},"Price:"),e("span",null,t.price))))),e("div",{css:k`
475
474
  display: flex;
476
475
  flex-wrap: wrap;
477
476
  gap: var(--spacing-sm);
@@ -480,7 +479,7 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
480
479
  ${Yr("md")} {
481
480
  align-items: center;
482
481
  }
483
- `},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",css:P`
482
+ `},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener",target:"__blank",css:k`
484
483
  display: inline-flex;
485
484
  justify-content: space-between;
486
485
  align-items: center;
@@ -491,14 +490,14 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
491
490
  &:hover {
492
491
  background-color: var(--gray-100);
493
492
  }
494
- `},e("span",{css:P`
493
+ `},e("span",{css:k`
495
494
  margin-right: var(--spacing-sm);
496
495
  font-size: var(--fs-sm);
497
- `},"Edit"),e(U,{src:r,alt:"Logo",css:P`
496
+ `},"Edit"),e(A,{src:r,alt:"Logo",css:k`
498
497
  width: 1.75rem;
499
498
  height: 1.75rem;
500
499
  display: block;
501
- `})):null,e("button",{type:"button",onClick:b=>{b.preventDefault(),n==null||n(t)},css:P`
500
+ `})):null,e("button",{type:"button",onClick:g=>{g.preventDefault(),a==null||a(t)},css:k`
502
501
  display: flex;
503
502
  justify-content: space-between;
504
503
  align-items: center;
@@ -507,11 +506,12 @@ var rr=Object.defineProperty;var or=(t,n)=>{for(var o in n)rr(t,o,{get:n[o],enum
507
506
  border: 2px solid var(--gray-400);
508
507
  height: 2.5rem;
509
508
  padding: 0 var(--spacing-base);
509
+ gap: var(--spacing-sm);
510
510
  &:hover {
511
511
  background-color: var(--gray-100);
512
512
  }
513
- `},e("span",{css:P`
513
+ `},e("span",{css:k`
514
514
  font-size: var(--fs-sm);
515
- `},"Unlink"),e(K,{css:P`
515
+ `},"Unlink"),e(N,{css:k`
516
516
  color: var(--brand-secondary-5);
517
- `})))))}import{LoadingIndicator as oo}from"@uniformdev/design-system";import{useAsync as Ft,useAsyncFn as no}from"react-use";function Ua({value:t,setValue:n,onGetSelectedProducts:o,onGetCategories:r,onSearchProducts:c,logoIcon:d,multiSelect:v,multiSelectId:b,selectedItemComponent:h,rowComponent:u}){var E,I;let{value:s,loading:g,error:f}=Ft(async()=>await r(),[r]),{value:H,error:M}=Ft(async()=>{if(!t)return;let i=await o({ids:t});return Array.isArray(i)?i:void 0},[o,t]),F=to(()=>s?s.map(m=>({id:m.id,name:m.name})):void 0,[s]),G=ro(),[z,A]=no(async(i,m)=>{let T=await c({text:i,options:{limit:m==null?void 0:m.count,offset:m==null?void 0:m.offset,categoryId:m==null?void 0:m.contentType}});return(m==null?void 0:m.offset)===0&&(G.current=[]),(G.current=G.current||[]).push(...T.products),T},[c]),J=async i=>{i&&await n(i)};return g?e(oo,null):f||M||z.error?e("div",null,"There was an error:"," ",(f==null?void 0:f.message)||(M==null?void 0:M.message)||((E=z.error)==null?void 0:E.message)):e($t.Provider,{value:{categories:s,logoIcon:d}},e(Lt,{search:A,results:G.current,logoIcon:d,selectedItems:H,select:J,multiSelectId:b||"product-search-multi-select",multiSelect:v,contentTypes:F,selectedItemComponent:h||Ht,rowComponent:u||Ut,totalResults:(I=z.value)==null?void 0:I.total,resultsLoading:z.loading}))}var $t=jr.createContext(void 0),ie=()=>{let t=eo($t);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};export*from"@uniformdev/mesh-sdk";import{Button as Na,Callout as _a,LoadingIndicator as Za,LoadingOverlay as qa,Menu as Wa,MenuItem as Ja,Input as Xa,InputSelect as Ya,InputToggle as ja,Theme as ei,InputKeywordSearch as ti,Heading as ri,ScrollableList as oi,ScrollableListItem as ni,Textarea as ai}from"@uniformdev/design-system";export{Na as Button,_a as Callout,gt as DefaultSearchRow,st as DefaultSelectedItem,Lt as EntrySearch,ri as Heading,me as Icons,Xa as Input,Ya as InputSelect,ja as InputToggle,ti as KeywordSearchInput,Za as LoadingIndicator,qa as LoadingOverlay,Wa as Menu,Ja as MenuItem,$e as ProductPreviewList,Zo as ProductQuery,He as ProductQueryContext,Ua as ProductSearch,$t as ProductSearchContext,Ut as ProductSearchRow,Ht as ProductSelectedItem,Ge as ResolvableLoadingValue,oi as ScrollableList,ni as ScrollableListItem,ze as SelectionField,ai as Textarea,ei as Theme,Le as UniformMeshLocationContext,Me as UniformMeshLocationContextProvider,Ie as UniformMeshSdkContext,ko as UniformMeshSdkContextProvider,he as badgeIcon,Pt as draggableContainer,ve as draggableIcon,kt as draggableIconOffset,Rt as draggableIconWrapper,vt as entrySearchBtn,bt as entrySearchConfig,yt as entrySearchConfigHidden,ht as entrySearchLoadMoreBtn,St as entrySearchResultList,wt as entrySearchSelectIcon,Ct as entrySearchSelectImg,Zn as entrySearchSelectInput,qn as entrySearchSelectOption,ft as entrySearchWrapper,Gt as productSearchRowActiveIcon,Tt as productSearchRowCategory,Mt as productSearchRowContainer,Vt as productSearchRowContent,Et as productSearchRowContentActive,Dt as productSearchRowDetails,It as productSearchRowTitle,At as productSelectedItemContainer,Ot as productSelectedItemContent,Bt as productSelectedItemDetails,ye as productSelectedItemImage,pt as searchRowBtn,ct as searchRowContainer,dt as searchRowContainerActive,lt as searchRowPopover,fe as searchRowText,ge as searchRowTextSmall,ue as selectItemLinkBtn,at as selectItemLinkContainer,nt as selectItemPopover,ae as selectItemPopoverLabel,B as selectItemSmallText,ot as selectedItemCloseIcon,Xe as selectedItemContainer,et as selectedItemCopy,je as selectedItemDetails,rt as selectedItemIcon,Ye as selectedItemInner,tt as selectedItemTitle,yo as useInitializeUniformMeshSdk,Fe as useProductQueryContext,ie as useProductSearchContext,go as useUniformMeshLocation,Ve as useUniformMeshLocationContext,Mo as useUniformMeshSdk,Te as useUniformMeshSdkContext};
517
+ `})))))}import{Callout as oo,LoadingIndicator as no}from"@uniformdev/design-system";import{useAsync as ao,useAsyncFn as io}from"react-use";function Ba({selectedProducts:t,setSelectedProducts:a,onGetCategories:o,onSearchProducts:r,logoIcon:s,multiSelect:d,multiSelectId:m,selectedItemComponent:g,rowComponent:f,errorComponent:b,helpComponent:i,noResultsComponent:v,onSort:S,typeSelectorAllTypesOptionText:F="All categories",typeSelectorLabel:C="Select Category"}){var I;let{value:h,loading:W,error:$}=ao(async()=>await o(),[o]),B=to(()=>h?h.map(n=>({id:n.id,name:n.name})):void 0,[h]),z=ro(),[U,Y]=io(async(E,n)=>{let y=await r({text:E,options:{limit:n==null?void 0:n.count,offset:n==null?void 0:n.offset,categoryId:n==null?void 0:n.contentType}});return(n==null?void 0:n.offset)===0&&(z.current=[]),(z.current=z.current||[]).push(...y.products),y},[r]),K=async E=>{await a(E)};return W?e(no,null):$||U.error?e(b||(({categoriesError:n,searchError:y})=>e(oo,{type:"error"},"There was an error: ",(n==null?void 0:n.message)||(y==null?void 0:y.message))),{categoriesError:$,searchError:U.error}):e(Kt.Provider,{value:{categories:h,logoIcon:s}},e(Vt,{search:Y,results:z.current,logoIcon:s,selectedItems:t,select:K,multiSelectId:m||"product-search-multi-select",multiSelect:d,contentTypes:B,selectedItemComponent:g||$t,rowComponent:f||Bt,totalResults:(I=U.value)==null?void 0:I.total,resultsLoading:U.loading,helpComponent:i,noResultsComponent:v,onSort:S,typeSelectorAllTypesOptionText:F,typeSelectorLabel:C}))}var Kt=jr.createContext(void 0),ce=()=>{let t=eo(Kt);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};export*from"@uniformdev/mesh-sdk";import{Button as Za,Callout as Wa,LoadingIndicator as qa,LoadingOverlay as Ja,Menu as Xa,MenuItem as Ya,Input as ja,InputSelect as ei,InputToggle as ti,Theme as ri,InputKeywordSearch as oi,Heading as ni,ScrollableList as ai,ScrollableListItem as ii,Textarea as si}from"@uniformdev/design-system";export{Za as Button,Wa as Callout,vt as DefaultSearchRow,dt as DefaultSelectedItem,Vt as EntrySearch,ni as Heading,ge as Icons,ja as Input,ei as InputSelect,ti as InputToggle,oi as KeywordSearchInput,qa as LoadingIndicator,Ja as LoadingOverlay,Xa as Menu,Ya as MenuItem,Qe as ProductPreviewList,qo as ProductQuery,$e as ProductQueryContext,Ba as ProductSearch,Kt as ProductSearchContext,Bt as ProductSearchRow,$t as ProductSelectedItem,Ue as ResolvableLoadingValue,ai as ScrollableList,ii as ScrollableListItem,Ae as SelectionField,si as Textarea,ri as Theme,Ve as UniformMeshLocationContext,Ee as UniformMeshLocationContextProvider,De as UniformMeshSdkContext,Lo as UniformMeshSdkContextProvider,ye as badgeIcon,kt as draggableContainer,be as draggableIcon,Lt as draggableIconOffset,xt as draggableIconWrapper,bt as entrySearchBtn,St as entrySearchConfig,wt as entrySearchConfigHidden,yt as entrySearchLoadMoreBtn,Ct as entrySearchResultList,Pt as entrySearchSelectIcon,Rt as entrySearchSelectImg,qn as entrySearchSelectInput,Jn as entrySearchSelectOption,ht as entrySearchWrapper,Ut as productSearchRowActiveIcon,Gt as productSearchRowCategory,Et as productSearchRowContainer,Tt as productSearchRowContent,It as productSearchRowContentActive,zt as productSearchRowDetails,Dt as productSearchRowTitle,Ot as productSelectedItemContainer,Ft as productSelectedItemContent,Ht as productSelectedItemDetails,we as productSelectedItemImage,ut as searchRowBtn,lt as searchRowContainer,pt as searchRowContainerActive,mt as searchRowPopover,he as searchRowText,ve as searchRowTextSmall,fe as selectItemLinkBtn,st as selectItemLinkContainer,it as selectItemPopover,se as selectItemPopoverLabel,O as selectItemSmallText,at as selectedItemCloseIcon,je as selectedItemContainer,rt as selectedItemCopy,tt as selectedItemDetails,nt as selectedItemIcon,et as selectedItemInner,ot as selectedItemTitle,wo as useInitializeUniformMeshSdk,Ke as useProductQueryContext,ce as useProductSearchContext,vo as useUniformMeshLocation,Te as useUniformMeshLocationContext,Eo as useUniformMeshSdk,Ge as useUniformMeshSdkContext};