@uniformdev/mesh-sdk-react 16.1.1-alpha.294 → 16.1.1-alpha.334

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.mjs CHANGED
@@ -1,75 +1,72 @@
1
- var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enumerable:!0})};import{jsx as e}from"@emotion/react";import*as S from"react";import{createContext as Hr,useContext as $r,useState as Fr}from"react";var Ae=Hr(void 0),Be=({children:t})=>{let[n,o]=Fr(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async(i,l)=>{await a.setValue(i,l),o(window.UniformMeshSDK.getCurrentLocation())},setValidationResult:async i=>{await a.setValidationResult(i)}}}}return e(Ae.Provider,{value:r},t)},Oe=()=>{let t=$r(Ae);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function un(){let{location:t}=Oe();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata(),setValidationResult:t==null?void 0:t.setValidationResult}}import{initializeUniformMeshSDK as Kr}from"@uniformdev/mesh-sdk";import{useEffect as Nr,useState as He}from"react";var bn=({autoResizingDisabled:t}={})=>{let[n,o]=He(),[r,a]=He();return Nr(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?Kr({autoResizingDisabled:t}).then(i=>{a(i)}).catch(i=>{o(i)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};import{createContext as Qr,useContext as Wr}from"react";import{Theme as _r}from"@uniformdev/design-system";var $e=Qr(void 0),Ln=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),e($e.Provider,{value:n},e(_r,null),e(Be,null,t))},Fe=()=>{let t=Wr($e);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function kn(){let{sdk:t}=Fe();return t}import Yr,{useMemo as se,useContext as Jr}from"react";import{css as ee}from"@emotion/react";import{InputSelect as Zr}from"@uniformdev/design-system";import Ke from"react";var Ne=({value:t,text:n,loading:o})=>e(Ke.Fragment,null,!!n&&n,!n&&e(Ke.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));var Qe=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:i,onRemove:l})=>{var f;let g=(f=a==null?void 0:a.filter(s=>!(r!=null&&r.includes(s.id.toString()))))!=null?f:[],u=(s,p)=>{s.preventDefault(),l(p)};return e("div",null,e(Zr,{id:t,name:t,label:n,onChange:s=>i(s.target.value),disabled:o,options:[{value:"",label:"Add..."},...g.map(s=>({value:s.id,label:s.name||s.id}))],value:"",css:Array.isArray(r)&&r.length>0?ee`
1
+ var Fr=Object.defineProperty;var $r=(t,n)=>{for(var o in n)Fr(t,o,{get:n[o],enumerable:!0})};import{jsx as e}from"@emotion/react";import*as S from"react";import{createContext as Kr,useContext as Nr,useState as Qr}from"react";var Ae=Kr(void 0),Be=({children:t})=>{let[n,o]=Qr(),r;if(typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"){let a=n||window.UniformMeshSDK.getCurrentLocation();r={location:{getValue:a.getValue,getMetadata:a.getMetadata,setValue:async(i,l)=>{await a.setValue(i,l),o(window.UniformMeshSDK.getCurrentLocation())},setValidationResult:async i=>{await a.setValidationResult(i)}}}}return e(Ae.Provider,{value:r},t)},Oe=()=>{let t=Nr(Ae);if(!t)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return t};function yn(){let{location:t}=Oe();return{value:t==null?void 0:t.getValue(),setValue:t==null?void 0:t.setValue,metadata:t==null?void 0:t.getMetadata(),setValidationResult:t==null?void 0:t.setValidationResult}}import{initializeUniformMeshSDK as Wr}from"@uniformdev/mesh-sdk";import{useEffect as _r,useState as He}from"react";var Ln=({autoResizingDisabled:t}={})=>{let[n,o]=He(),[r,a]=He();return _r(()=>{typeof window=="undefined"||r||(typeof window.UniformMeshSDK=="undefined"?Wr({autoResizingDisabled:t}).then(i=>{a(i)}).catch(i=>{o(i)}):a(window.UniformMeshSDK))},[t]),{initializing:!r&&!n,error:n,sdk:r}};import{createContext as Zr,useContext as Xr}from"react";import{Theme as qr}from"@uniformdev/design-system";var Fe=Zr(void 0),Tn=({children:t})=>{let n;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(n={sdk:window.UniformMeshSDK}),e(Fe.Provider,{value:n},e(qr,null),e(Be,null,t))},$e=()=>{let t=Xr(Fe);if(!t)throw new Error("useUniformMeshSdkContext must be used within a UniformMeshSdkContextProvider");return t};function Dn(){let{sdk:t}=$e();return t}import oo,{useMemo as ie,useContext as no}from"react";import{css as Yr}from"@emotion/react";import{Icon as Jr,InputSelect as jr}from"@uniformdev/design-system";import{CgClose as eo}from"react-icons/cg";import Ke from"react";var Ne=({value:t,text:n,loading:o})=>e(Ke.Fragment,null,!!n&&n,!n&&e(Ke.Fragment,null,o&&`${t} (Loading...)`,!o&&`${t} (Unresolvable)`));import{css as ve}from"@emotion/react";var Qe=ve`
2
+ align-items: center;
3
+ background: var(--gray-100);
4
+ border: 1px solid var(--gray-300);
5
+ display: inline-flex;
6
+ font-size: var(--fs-sm);
7
+ justify-content: space-between;
8
+ margin-bottom: var(--spacing-sm);
9
+ margin-right: var(--spacing-sm);
10
+ `,We=ve`
11
+ color: var(--gray-800);
12
+ padding: var(--spacing-3);
13
+ `,_e=ve`
14
+ border: none;
15
+ border-left: 1px solid var(--gray-300);
16
+ background: var(--gray-100);
17
+ padding: var(--spacing-3);
18
+ `;var Ze=({id:t,label:n,loading:o,selectedValues:r,values:a,onAdd:i,onRemove:l})=>{var f;let g=(f=a==null?void 0:a.filter(s=>!(r!=null&&r.includes(s.id.toString()))))!=null?f:[],u=(s,p)=>{s.preventDefault(),l(p)};return e("div",null,e(jr,{id:t,name:t,label:n,onChange:s=>i(s.target.value),disabled:o,options:[{value:"",label:"Add..."},...g.map(s=>({value:s.id,label:s.name||s.id}))],value:"",css:Array.isArray(r)&&r.length>0?Yr`
2
19
  margin-bottom: var(--spacing-base);
3
- `:""}),r==null?void 0:r.map(s=>{var p;return e("div",{css:ee`
4
- font-size: var(--fs-sm);
5
- display: inline-flex;
6
- align-items: center;
7
- justify-content: space-between;
8
- background-color: var(--gray-100);
9
- border: 1px solid var(--gray-300);
10
- margin-bottom: var(--spacing-sm);
11
- margin-right: var(--spacing-sm);
12
- `,key:s},e("span",{css:ee`
13
- padding: var(--spacing-3);
14
- color: var(--gray-800);
15
- `},e(Ne,{value:s,loading:o,text:(p=a.find(h=>h.id===s))==null?void 0:p.name})),e("button",{css:ee`
16
- padding: var(--spacing-3);
17
- border-left: 1px solid var(--gray-300);
18
- `,title:"remove",onClick:h=>u(h,s)},e("svg",{xmlns:"http://www.w3.org/2000/svg",css:ee`
19
- height: 1.25rem;
20
- width: 1.25rem;
21
- pointer-events: none;
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 Xr=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"})),ae=Xr;var qr=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"})),ie=qr;import{useAsyncFn as jr,useDebounce as eo}from"react-use";import{Input as We,InputSelect as ce,mq as de}from"@uniformdev/design-system";import{css as L}from"@emotion/react";var _e={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},_n=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:i,brandsLoading:l,logoIcon:g,onGetProducts:u,sortOptions:f,sortOrderOptions:s,categoryLabel:p="Product Category",brandLabel:h="Brand",disableBrands:E,restrictToSingleCategory:G=!1})=>{var m,I,U;let w=async d=>{n({..._e,...t||{},...d})},b=se(()=>({..._e,...t||{}}),[t]),[Z,A]=jr(async d=>await u(d),[u]);eo(async()=>{await A({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let N=se(()=>{let d=[];return r==null||r.forEach(y=>{let T=Xe(y,void 0);d.push(...T)}),d},[r]),B=se(()=>[{value:"",label:"All categories"},...N.map(d=>({label:d.name,value:d.id}))],[N]),O=se(()=>(o==null?void 0:o.map(d=>({id:d.id.toString(),name:d.name})))||[],[o]),oe=d=>{if(!d)return;let y=(t==null?void 0:t.categories)||[];w({categories:[...y,d]})},X=d=>{var y;w({categories:(y=t==null?void 0:t.categories)==null?void 0:y.filter(T=>T!==d)})},H=d=>{w({brand:d.target.value})},P=d=>{w({count:d||1})};return a?e("div",null,"Loading..."):e(qe.Provider,{value:{categories:r,logoIcon:g}},e("div",{css:L`
20
+ `:""}),r==null?void 0:r.map(s=>{var p;return e("div",{css:Qe,key:s},e("span",{css:We},e(Ne,{value:s,loading:o,text:(p=a.find(h=>h.id===s))==null?void 0:p.name})),e("button",{css:_e,title:"remove",onClick:h=>u(h,s)},e(Jr,{icon:eo,iconColor:"currentColor",size:20})))}))};var to=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"})),ne=to;var ro=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"})),ae=ro;import{useAsyncFn as ao,useDebounce as io}from"react-use";import{Input as Xe,InputSelect as se,mq as ce}from"@uniformdev/design-system";import{css as L}from"@emotion/react";var qe={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},oa=({value:t,setValue:n,brands:o,categories:r,loading:a,categoriesLoading:i,brandsLoading:l,logoIcon:g,onGetProducts:u,sortOptions:f,sortOrderOptions:s,categoryLabel:p="Product Category",brandLabel:h="Brand",disableBrands:E,restrictToSingleCategory:G=!1})=>{var m,I,U;let w=async d=>{n({...qe,...t||{},...d})},y=ie(()=>({...qe,...t||{}}),[t]),[Z,A]=ao(async d=>await u(d),[u]);io(async()=>{await A({brand:y.brand,categories:y.categories,keyword:y.keyword,sort:y.sort,sortOrder:y.sortOrder,count:y.count})},250,[y]);let N=ie(()=>{let d=[];return r==null||r.forEach(b=>{let T=Je(b,void 0);d.push(...T)}),d},[r]),B=ie(()=>[{value:"",label:"All categories"},...N.map(d=>({label:d.name,value:d.id}))],[N]),O=ie(()=>(o==null?void 0:o.map(d=>({id:d.id.toString(),name:d.name})))||[],[o]),re=d=>{if(!d)return;let b=(t==null?void 0:t.categories)||[];w({categories:[...b,d]})},X=d=>{var b;w({categories:(b=t==null?void 0:t.categories)==null?void 0:b.filter(T=>T!==d)})},H=d=>{w({brand:d.target.value})},P=d=>{w({count:d||1})};return a?e("div",null,"Loading..."):e(je.Provider,{value:{categories:r,logoIcon:g}},e("div",{css:L`
24
21
  > :not(:last-child) {
25
22
  margin-bottom: var(--spacing-md);
26
23
  }
27
- `},G?e(ce,{id:"selection-field-product-category",label:p,disabled:a,value:(I=(m=b.categories)==null?void 0:m[0])!=null?I:"",options:B,onChange:d=>{w({categories:d.target.value===""?[]:[d.target.value]})}}):e(Qe,{loading:i||!1,id:"selection-field-product-category",label:p,onAdd:oe,onRemove:X,selectedValues:b.categories,values:N}),e("div",{css:L`
24
+ `},G?e(se,{id:"selection-field-product-category",label:p,disabled:a,value:(I=(m=y.categories)==null?void 0:m[0])!=null?I:"",options:B,onChange:d=>{w({categories:d.target.value===""?[]:[d.target.value]})}}):e(Ze,{loading:i||!1,id:"selection-field-product-category",label:p,onAdd:re,onRemove:X,selectedValues:y.categories,values:N}),e("div",{css:L`
28
25
  display: flex;
29
26
  flex-wrap: wrap;
30
27
  column-gap: var(--spacing-lg);
31
28
  row-gap: var(--spacing-md);
32
- ${de("md")} {
29
+ ${ce("md")} {
33
30
  flex-wrap: nowrap;
34
31
  }
35
32
  `},E?null:e("div",{css:L`
36
33
  width: 50%;
37
- `},e(ce,{id:"brand",name:"brand",label:h,disabled:l,value:b.brand,onChange:H,options:[{value:"",label:"Choose..."},...O.map(d=>({value:d.id,label:d.name}))]})),e("div",{css:L`
34
+ `},e(se,{id:"brand",name:"brand",label:h,disabled:l,value:y.brand,onChange:H,options:[{value:"",label:"Choose..."},...O.map(d=>({value:d.id,label:d.name}))]})),e("div",{css:L`
38
35
  flex-grow: 1;
39
36
  position: relative;
40
- `},e(We,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:b.keyword,placeholder:"Enter keyword",onChange:d=>w({keyword:d.target.value})}))),e("div",{css:L`
37
+ `},e(Xe,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:y.keyword,placeholder:"Enter keyword",onChange:d=>w({keyword:d.target.value})}))),e("div",{css:L`
41
38
  display: flex;
42
39
  flex-wrap: wrap;
43
40
  column-gap: var(--spacing-lg);
44
41
  row-gap: var(--spacing-md);
45
- ${de("md")} {
42
+ ${ce("md")} {
46
43
  flex-wrap: nowrap;
47
44
  }
48
45
  `},e("div",{css:L`
49
46
  width: 100%;
50
- ${de("md")} {
47
+ ${ce("md")} {
51
48
  width: 33.333333%;
52
49
  }
53
50
  position: relative;
54
- `},e(We,{id:"count",name:"count",type:"number",min:1,step:1,value:b.count,onChange:d=>P(d.target.valueAsNumber),label:"Count"}),e("div",{css:L`
51
+ `},e(Xe,{id:"count",name:"count",type:"number",min:1,step:1,value:y.count,onChange:d=>P(d.target.valueAsNumber),label:"Count"}),e("div",{css:L`
55
52
  position: absolute;
56
53
  bottom: var(--spacing-sm);
57
54
  right: var(--spacing-sm);
58
55
  display: flex;
59
56
  gap: var(--spacing-sm);
60
- `},e(Ze,{onCountChange:()=>P(b.count-1),countIcon:"decrement",disabled:b.count===1}),e(Ze,{onCountChange:()=>P(b.count+1),countIcon:"increment"}))),Array.isArray(f)&&f.length>0?e("div",{css:L`
57
+ `},e(Ye,{onCountChange:()=>P(y.count-1),countIcon:"decrement",disabled:y.count===1}),e(Ye,{onCountChange:()=>P(y.count+1),countIcon:"increment"}))),Array.isArray(f)&&f.length>0?e("div",{css:L`
61
58
  flex-grow: 1;
62
- ${de("md")} {
59
+ ${ce("md")} {
63
60
  width: 33.333333%;
64
61
  }
65
- `},e(ce,{id:"sort",name:"sort",label:"Sort",value:b.sort,onChange:d=>w({sort:d.target.value}),options:[{value:"",label:"Select a sort"},...f.map(d=>({value:d.sortKey,label:d.name}))]})):null,Array.isArray(s)&&s.length>0?e("div",{css:L`
62
+ `},e(se,{id:"sort",name:"sort",label:"Sort",value:y.sort,onChange:d=>w({sort:d.target.value}),options:[{value:"",label:"Select a sort"},...f.map(d=>({value:d.sortKey,label:d.name}))]})):null,Array.isArray(s)&&s.length>0?e("div",{css:L`
66
63
  flex-grow: 1;
67
- `},e(ce,{id:"sort-order",name:"sort-order",label:"Sort Order",value:b.sortOrder,onChange:d=>w({sortOrder:d.target.value}),options:s.map(d=>({value:d.sortOrderKey,label:d.name}))})):null),e("div",null,e("h3",{css:L`
64
+ `},e(se,{id:"sort-order",name:"sort-order",label:"Sort Order",value:y.sortOrder,onChange:d=>w({sortOrder:d.target.value}),options:s.map(d=>({value:d.sortOrderKey,label:d.name}))})):null),e("div",null,e("h3",{css:L`
68
65
  font-size: var(--fs-md);
69
66
  line-height: var(--spacing-md);
70
67
  font-weight: var(--fw-bold);
71
68
  margin-bottom: var(--spacing-xs);
72
- `},"Result Preview"),e(Je,{products:(U=Z.value)==null?void 0:U.products}))))};function Xe(t,n){var i;let o=[],r=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${r}${t.name}`};return o.push(a),(i=t.children)==null||i.forEach(l=>{let g=Xe(l,a);o.push(...g)}),o}function Ze({onCountChange:t,countIcon:n,disabled:o}){return e("button",{css:L`
69
+ `},"Result Preview"),e(tt,{products:(U=Z.value)==null?void 0:U.products}))))};function Je(t,n){var i;let o=[],r=n?`${n.name} > `:"",a={id:t.id.toString(),name:`${r}${t.name}`};return o.push(a),(i=t.children)==null||i.forEach(l=>{let g=Je(l,a);o.push(...g)}),o}function Ye({onCountChange:t,countIcon:n,disabled:o}){return e("button",{css:L`
73
70
  width: 2.25rem;
74
71
  height: 2.25rem;
75
72
  border: 1px solid var(--gray-300);
@@ -85,13 +82,13 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
85
82
  cursor: not-allowed;
86
83
  opacity: 0.3;
87
84
  `:""}
88
- `,onClick:t,disabled:o},n==="increment"?e(ae,{css:L`
85
+ `,onClick:t,disabled:o},n==="increment"?e(ne,{css:L`
89
86
  width: 1rem;
90
87
  height: 1rem;
91
- `}):e(ie,{css:L`
88
+ `}):e(ae,{css:L`
92
89
  width: 1rem;
93
90
  height: 1rem;
94
- `}))}var qe=Yr.createContext(void 0),Ye=()=>{let t=Jr(qe);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function V({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 ct}from"@emotion/react";import{scrollbarStyles as to}from"@uniformdev/design-system";import{css as D}from"@emotion/react";var je=D`
91
+ `}))}var je=oo.createContext(void 0),et=()=>{let t=no(je);if(!t)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return t};function V({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 pt}from"@emotion/react";import{scrollbarStyles as so}from"@uniformdev/design-system";import{css as D}from"@emotion/react";var rt=D`
95
92
  align-items: center;
96
93
  background: var(--white);
97
94
  border-radius: var(--rounded-base);
@@ -99,61 +96,62 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
99
96
  color: currentColor;
100
97
  display: inline-flex;
101
98
  justify-content: space-between;
102
- padding: var(--spacing-xs) var(--spacing-xs) var(--spacing-xs) var(--spacing-base);
99
+ padding: var(--spacing-sm) var(--spacing-base);
103
100
  margin-left: auto;
104
101
  text-decoration: none;
102
+ gap: var(--spacing-base);
105
103
  &:hover {
106
104
  background: var(--gray-50);
107
105
  }
108
- `,et=D`
106
+ `,ot=D`
109
107
  font-size: var(--fs-sm);
110
- `,tt=D`
111
- width: 2.25rem;
112
- height: 2.25rem;
108
+ `,nt=D`
109
+ width: 1rem;
110
+ height: 1rem;
113
111
  `,he=D`
114
112
  margin-right: var(--spacing-lg);
115
113
  font-size: var(--fs-sm);
116
- `,rt=D`
114
+ `,at=D`
117
115
  border: 1px solid var(--gray-200);
118
116
  border-radius: var(--rounded-md);
119
117
  background: var(--gray-50);
120
118
  margin: var(--spacing-base) 0;
121
- `,ot=D`
119
+ `,it=D`
122
120
  align-items: center;
123
121
  display: flex;
124
122
  flex-grow: 1;
125
123
  gap: var(--spacing-base);
126
124
  padding: var(--spacing-sm);
127
125
  margin-right: var(--spacing-sm);
128
- `,nt=D`
126
+ `,st=D`
129
127
  background: var(--gray-200);
130
128
  width: 3.5rem;
131
129
  height: 3.5rem;
132
130
  object-fit: cover;
133
- `,at=D`
131
+ `,ct=D`
134
132
  background: var(--gray-100);
135
133
  height: 3.5rem;
136
134
  width: 3.5rem;
137
- `,it=D`
135
+ `,dt=D`
138
136
  margin-top: 0;
139
137
  font-weight: var(--fw-bold);
140
138
  font-size: var(--fs-sm);
141
139
  width: calc(100% / 3);
142
- `,st=D`
140
+ `,lt=D`
143
141
  display: block;
144
142
  font-weight: var(--fw-regular);
145
- `;var Je=({products:t})=>{let{categories:n,logoIcon:o}=Ye();return e(S.Fragment,null,e("p",{css:ct`
143
+ `;var tt=({products:t})=>{let{categories:n,logoIcon:o}=et();return e(S.Fragment,null,e("p",{css:pt`
146
144
  margin-bottom: var(--spacing-base);
147
- `},"Matching ",(t==null?void 0:t.length)||0," products"),e("ul",{css:[ct`
145
+ `},"Matching ",(t==null?void 0:t.length)||0," products"),e("ul",{css:[pt`
148
146
  max-height: 24rem;
149
147
  overflow-x: auto;
150
- `,to]},t==null?void 0:t.map((r,a)=>{var g,u;let[i]=(r==null?void 0:r.categories)||[],l=typeof i=="undefined"||!n||(g=n.find(f=>f.id===i.id))==null?void 0:g.name;return e("li",{key:`product-${r.id}`,css:rt},e("div",{css:ot},r.thumbnailUrl?e("img",{src:r.thumbnailUrl,alt:typeof r.title=="string"?r.title:r.name||`Product ${a}`,css:nt}):e("div",{css:at}),e("h4",{css:it},r.title||r.name,l&&e("span",{css:st},l)),r&&e(S.Fragment,null,e("p",{css:he},"SKU: ",r.sku||r.id,e("br",null)),r.price!==void 0?e("p",{css:he},"Price: ",r.price):null,r.editLink||r.url?e("a",{css:je,href:(u=r.editLink)!=null?u:r.url,title:`Go to ${r.title||r.name}`,target:"_blank",rel:"noopener noreferrer"},e("span",{css:et},"Edit"),o?e(V,{src:o,alt:"Logo",css:tt}):null):null)))})))};import Ko,{useContext as No,useMemo as Qo,useRef as Wo}from"react";import*as k from"react";var be={};Or(be,{Caution:()=>dt,Checkmark:()=>le,ChevronDown:()=>pe,Close:()=>lt,Danger:()=>pt,ExclamationPoint:()=>mt,Info:()=>me,Lightbulb:()=>ut,MagnifyingGlass:()=>gt,MaximizeAlt:()=>ft,Minus:()=>ie,MoreVerticalAlt:()=>te,Plus:()=>ae});var ro=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"})),dt=ro;var oo=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"})),le=oo;var no=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"})),pe=no;var ao=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"}))),lt=ao;var io=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"})),pt=io;var so=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"})),mt=so;var co=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"})),me=co;var lo=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"})),ut=lo;var po=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"})))),gt=po;var mo=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"})),ft=mo;var uo=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"})),te=uo;import{useThrottle as xo}from"react-use";import{v4 as ko}from"uuid";import fo,{useState as vo,useRef as Lt,useEffect as ho}from"react";function ue(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}import{format as bo}from"timeago.js";import{css as M}from"@emotion/react";import{mq as go}from"@uniformdev/design-system";var vt=M`
148
+ `,so]},t==null?void 0:t.map((r,a)=>{var g,u;let[i]=(r==null?void 0:r.categories)||[],l=typeof i=="undefined"||!n||(g=n.find(f=>f.id===i.id))==null?void 0:g.name;return e("li",{key:`product-${r.id}`,css:at},e("div",{css:it},r.thumbnailUrl?e("img",{src:r.thumbnailUrl,alt:typeof r.title=="string"?r.title:r.name||`Product ${a}`,css:st}):e("div",{css:ct}),e("h4",{css:dt},r.title||r.name,l&&e("span",{css:lt},l)),r&&e(S.Fragment,null,e("p",{css:he},"SKU: ",r.sku||r.id,e("br",null)),r.price!==void 0?e("p",{css:he},"Price: ",r.price):null,r.editLink||r.url?e("a",{css:rt,href:(u=r.editLink)!=null?u:r.url,title:`Go to ${r.title||r.name}`,target:"_blank",rel:"noopener noreferrer"},e("span",{css:ot},"Edit"),o?e(V,{src:o,alt:"Logo",css:nt}):null):null)))})))};import Xo,{useContext as qo,useMemo as Yo,useRef as Jo}from"react";import*as k from"react";var be={};$r(be,{Caution:()=>mt,Checkmark:()=>de,ChevronDown:()=>le,Close:()=>ut,Danger:()=>gt,ExclamationPoint:()=>ft,Info:()=>pe,Lightbulb:()=>vt,MagnifyingGlass:()=>ht,MaximizeAlt:()=>bt,Minus:()=>ae,MoreVerticalAlt:()=>ee,Plus:()=>ne});var co=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"})),mt=co;var lo=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"})),de=lo;var po=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"})),le=po;var mo=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"}))),ut=mo;var uo=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"})),gt=uo;var go=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"})),ft=go;var fo=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"})),pe=fo;var vo=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"})),vt=vo;var ho=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"})))),ht=ho;var bo=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"})),bt=bo;var yo=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"})),ee=yo;import{useThrottle as Vo}from"react-use";import{v4 as Do}from"uuid";import wo,{useState as Co,useRef as kt,useEffect as Po}from"react";function me(t,n){let o=window.open(t,"_blank"),r=setInterval(()=>{o!=null&&o.closed&&(clearInterval(r),n())},500)}import{format as Lo}from"timeago.js";import{css as M}from"@emotion/react";import{mq as So}from"@uniformdev/design-system";var yt=M`
151
149
  border: 1px solid var(--gray-200);
152
150
  background: var(--gray-50);
153
151
  border-radius: var(--rounded-base);
154
152
  display: flex;
155
153
  width: 100%;
156
- `,ht=M`
154
+ `,St=M`
157
155
  align-items: center;
158
156
  display: flex;
159
157
  flex-grow: 1;
@@ -161,22 +159,22 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
161
159
  margin-inline: 0 var(--spacing-sm);
162
160
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
163
161
  position: relative;
164
- `,bt=M`
162
+ `,wt=M`
165
163
  flex-grow: 1;
166
- `,yt=M`
164
+ `,Ct=M`
167
165
  align-items: start;
168
166
  display: inline-flex;
169
167
  position: relative;
170
- `,St=M`
168
+ `,Pt=M`
171
169
  color: var(--brand-secondary-1);
172
170
  font-size: var(--fs-base);
173
171
  font-weight: var(--fw-bold);
174
172
  line-height: 1;
175
173
  margin: 0;
176
- `,wt=M`
174
+ `,Lt=M`
177
175
  width: 1.5rem;
178
176
  height: 1.5rem;
179
- `,Ct=M`
177
+ `,Rt=M`
180
178
  background: var(--white);
181
179
  border-radius: var(--rounded-base);
182
180
  border-left: 4px solid var(--brand-secondary-3);
@@ -187,15 +185,15 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
187
185
  width: max-content;
188
186
  `,Q=M`
189
187
  font-size: var(--fs-sm);
190
- `,re=M`
188
+ `,te=M`
191
189
  font-weight: var(--fw-bold);
192
190
  margin-right: var(--spacing-sm);
193
- `,Pt=M`
191
+ `,xt=M`
194
192
  display: flex;
195
193
  flex-direction: column;
196
194
  gap: var(--spacing-sm);
197
195
 
198
- ${go("md")} {
196
+ ${So("md")} {
199
197
  flex-direction: row;
200
198
  min-width: 200px;
201
199
  justify-content: end;
@@ -215,31 +213,31 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
215
213
  &:hover {
216
214
  background: var(--gray-50);
217
215
  }
218
- `;import{css as F}from"@emotion/react";import{Icon as Rt}from"@uniformdev/design-system";import{CgClose as yo,CgInfo as So}from"react-icons/cg";var xt=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var f;let a=Lt(null),i=Lt(null),[l,g]=vo(!1);ho(()=>{let s=h=>{a.current&&!a.current.contains(h.target)&&i.current&&!i.current.contains(h.target)&&g(!1)},p=()=>{g(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[i]);let u=()=>{var s;if(g(!l),i.current&&a.current){let p=(s=a==null?void 0:a.current)==null?void 0:s.getBoundingClientRect(),h=i.current.offsetWidth;i.current.style.top=`${p.top+30}px`,i.current.style.left=`${p.left-h+30}px`}};return e("div",{css:vt,key:t.id},e("div",{css:ht},e("div",{css:bt},e("div",{css:yt},e("h4",{css:[St,t.popoverData?F`
216
+ `;import{css as $}from"@emotion/react";import{Icon as It}from"@uniformdev/design-system";import{CgClose as Ro,CgInfo as xo}from"react-icons/cg";var Et=({selectedItem:t,logoIcon:n,onDeselect:o,onEditClosed:r})=>{var f;let a=kt(null),i=kt(null),[l,g]=Co(!1);Po(()=>{let s=h=>{a.current&&!a.current.contains(h.target)&&i.current&&!i.current.contains(h.target)&&g(!1)},p=()=>{g(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[i]);let u=()=>{var s;if(g(!l),i.current&&a.current){let p=(s=a==null?void 0:a.current)==null?void 0:s.getBoundingClientRect(),h=i.current.offsetWidth;i.current.style.top=`${p.top+30}px`,i.current.style.left=`${p.left-h+30}px`}};return e("div",{css:yt,key:t.id},e("div",{css:St},e("div",{css:wt},e("div",{css:Ct},e("h4",{css:[Pt,t.popoverData?$`
219
217
  margin-bottom: var(--spacing-sm);
220
- `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?e(fo.Fragment,null,e("button",{type:"button",ref:a,css:F`
218
+ `:""],title:`ID: ${t.id}`,"data-test-id":"entry-id"},t.title||t.id||""),t.popoverData?e(wo.Fragment,null,e("button",{type:"button",ref:a,css:$`
221
219
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
222
- `,"aria-controls":"path-details","aria-expanded":l,onClick:u},e(Rt,{icon:So,iconColor:"gray",size:24,css:F`
220
+ `,"aria-controls":"path-details","aria-expanded":l,onClick:u},e(It,{icon:xo,iconColor:"gray",size:24,css:$`
223
221
  opacity: var(--opacity-75);
224
- `})),e("div",{id:"path-details","aria-hidden":!l,ref:i,css:[Ct,l?F`
222
+ `})),e("div",{id:"path-details","aria-hidden":!l,ref:i,css:[Rt,l?$`
225
223
  visibility: visible;
226
- `:F`
224
+ `:$`
227
225
  visibility: hidden;
228
- `]},Object.entries(t.popoverData).map(([s,p],h)=>e("div",{css:Q,key:h},e("span",{css:re},s,":"),p)))):null),t.createdDate&&e("div",{css:Q},e("span",{css:re},"Created:"),bo((f=t.createdDate)!=null?f:0)),t.metadata?Object.entries(t.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,p])=>e("div",{css:[Q,F`
226
+ `]},Object.entries(t.popoverData).map(([s,p],h)=>e("div",{css:Q,key:h},e("span",{css:te},s,":"),p)))):null),t.createdDate&&e("div",{css:Q},e("span",{css:te},"Created:"),Lo((f=t.createdDate)!=null?f:0)),t.metadata?Object.entries(t.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,p])=>e("div",{css:[Q,$`
229
227
  order: 1;
230
- `],key:s},e("span",{css:re},s,":"),p)):null,t.metadata?Object.entries(t.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,p])=>e("div",{css:[Q,F`
228
+ `],key:s},e("span",{css:te},s,":"),p)):null,t.metadata?Object.entries(t.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,p])=>e("div",{css:[Q,$`
231
229
  order: 1;
232
- `],key:s},e("span",{css:[re,F`
230
+ `],key:s},e("span",{css:[te,$`
233
231
  order: 1;
234
- `]},s,":"),p)):null),e("div",{css:Pt},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:s=>{r&&(ue(s.currentTarget.href,()=>r(t)),s.preventDefault())},css:ye},e("span",{css:Q},"Edit"),e(V,{src:n,css:wt,alt:"Logo"})):null,e("button",{type:"button",onClick:()=>{o(t)},css:ye},e("span",{css:Q},"Unlink"),e(Rt,{icon:yo,iconColor:"red",size:16})))))};import wo,{useState as Co,useRef as Vt,useEffect as Po}from"react";import{css as W}from"@emotion/react";var kt=W`
232
+ `]},s,":"),p)):null),e("div",{css:xt},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:s=>{r&&(me(s.currentTarget.href,()=>r(t)),s.preventDefault())},css:ye},e("span",{css:Q},"Edit"),e(V,{src:n,css:Lt,alt:"Logo"})):null,e("button",{type:"button",onClick:()=>{o(t)},css:ye},e("span",{css:Q},"Unlink"),e(It,{icon:Ro,iconColor:"red",size:16})))))};import ko,{useState as Io,useRef as Ut,useEffect as Eo}from"react";import{css as W}from"@emotion/react";var Tt=W`
235
233
  cursor: pointer;
236
234
  padding: var(--spacing-sm);
237
235
  position: relative;
238
236
  transition: background-color var(--duration-fast) var(--timing-ease-out),
239
237
  color var(--duration-fast) var(--timing-ease-out);
240
- `,It=W`
238
+ `,Mt=W`
241
239
  padding-right: var(--spacing-lg);
242
- `,Et=W`
240
+ `,Vt=W`
243
241
  background: var(--brand-secondary-3);
244
242
  color: var(--white);
245
243
  `,Se=W`
@@ -247,7 +245,7 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
247
245
  `,we=W`
248
246
  font-weight: var(--fw-bold);
249
247
  margin-right: var(--spacing-sm);
250
- `,Tt=W`
248
+ `,Dt=W`
251
249
  background: var(--white);
252
250
  border-left: 4px solid var(--brand-secondary-3);
253
251
  border-radius: var(--rounded-base);
@@ -259,20 +257,20 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
259
257
  right: var(--spacing-xl);
260
258
  z-index: var(--z-10);
261
259
  width: max-content;
262
- `,Mt=W`
260
+ `,zt=W`
263
261
  position: absolute;
264
262
  inset: 0 var(--spacing-sm) 0 auto;
265
- `;import{css as Dt}from"@emotion/react";var zt=({result:t,isSelected:n,triggerSelection:o})=>{let r=Vt(null),a=Vt(null),[i,l]=Co(!1);Po(()=>{function u(f){r.current&&!r.current.contains(f.target)&&a.current&&!a.current.contains(f.target)&&l(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[a]);let g=u=>{u.stopPropagation(),l(!i)};return e("div",{key:t.id,css:[kt,n?Et:void 0,t.popoverData?It:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?e(wo.Fragment,null,e("button",{type:"button",ref:r,css:Mt,"aria-controls":"path-details",onClick:u=>g(u),"aria-expanded":i},e(me,{width:24,height:24})),e("div",{id:"path-details","aria-hidden":!i,ref:a,css:[Tt,i?Dt`
263
+ `;import{css as Gt}from"@emotion/react";var At=({result:t,isSelected:n,triggerSelection:o})=>{let r=Ut(null),a=Ut(null),[i,l]=Io(!1);Eo(()=>{function u(f){r.current&&!r.current.contains(f.target)&&a.current&&!a.current.contains(f.target)&&l(!1)}return document.addEventListener("mousedown",u),()=>{document.removeEventListener("mousedown",u)}},[a]);let g=u=>{u.stopPropagation(),l(!i)};return e("div",{key:t.id,css:[Tt,n?Vt:void 0,t.popoverData?Mt:void 0],"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o()},t.title,t.popoverData&&n?e(ko.Fragment,null,e("button",{type:"button",ref:r,css:zt,"aria-controls":"path-details",onClick:u=>g(u),"aria-expanded":i},e(pe,{width:24,height:24})),e("div",{id:"path-details","aria-hidden":!i,ref:a,css:[Dt,i?Gt`
266
264
  visibility: visible;
267
- `:Dt`
265
+ `:Gt`
268
266
  visibility: hidden;
269
- `]},t.metadata&&Object.entries(t.metadata).map(([u,f],s)=>e("div",{css:Se,key:s},e("span",{css:we},u,":"),f)),Object.entries(t.popoverData).map(([u,f],s)=>e("div",{css:Se,key:s},e("span",{css:we},u,":"),f)))):null)};import{Droppable as Io,DragDropContext as Eo,Draggable as To}from"react-beautiful-dnd";import{css as C}from"@emotion/react";var Ut=C`
267
+ `]},t.metadata&&Object.entries(t.metadata).map(([u,f],s)=>e("div",{css:Se,key:s},e("span",{css:we},u,":"),f)),Object.entries(t.popoverData).map(([u,f],s)=>e("div",{css:Se,key:s},e("span",{css:we},u,":"),f)))):null)};import{Droppable as zo,DragDropContext as Uo,Draggable as Go}from"react-beautiful-dnd";import{css as C}from"@emotion/react";var Bt=C`
270
268
  background: var(--white);
271
269
  border: 1px solid var(--gray-300);
272
270
  border-radius: var(--rounded-base);
273
271
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
274
272
  margin-bottom: var(--spacing-base);
275
- `,Gt=C`
273
+ `,Ot=C`
276
274
  align-items: center;
277
275
  display: flex;
278
276
  position: relative;
@@ -280,7 +278,7 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
280
278
  width: 100%;
281
279
  background-color: transparent;
282
280
  border: 0;
283
- `,At=C`
281
+ `,Ht=C`
284
282
  color: var(--brand-secondary-1);
285
283
  display: block;
286
284
  font-weight: var(--fw-bold);
@@ -296,15 +294,15 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
296
294
  background: var(--gray-100);
297
295
  outline: none;
298
296
  }
299
- `,Bt=C`
297
+ `,Ft=C`
300
298
  background: var(--white);
301
299
  border: 1px solid var(--gray-300);
302
300
  border-radius: var(--rounded-base);
303
301
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
304
302
  display: block;
305
- `,Ot=C`
303
+ `,$t=C`
306
304
  display: none;
307
- `,Ht=C`
305
+ `,Kt=C`
308
306
  overflow-y: auto;
309
307
  height: 16rem;
310
308
  margin-bottom: var(--spacing-base);
@@ -313,33 +311,33 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
313
311
  & > :not(:last-child) {
314
312
  border-bottom: 1px solid var(--gray-200);
315
313
  }
316
- `,Xa=C`
314
+ `,ai=C`
317
315
  background-color: var(--gray-50);
318
316
  max-width: 33.33%;
319
- `,$t=C`
317
+ `,Nt=C`
320
318
  align-items: center;
321
319
  display: flex;
322
320
  position: absolute;
323
321
  inset: 0 0 0 auto;
324
322
  pointer-events: none;
325
323
  padding-right: var(--spacing-sm);
326
- `,Ft=C`
324
+ `,Qt=C`
327
325
  color: var(--brand-secondary-1);
328
326
  width: 1.25rem;
329
327
  height: 1.25rem;
330
328
  transition: transform var(--duration-fast) var(--timing-ease-out);
331
329
  transform: rotate(0);
332
- `,qa=C`
330
+ `,ii=C`
333
331
  background: var(--white);
334
332
  color: var(--brand-secondary-1);
335
- `,Kt=C`
333
+ `,Wt=C`
336
334
  position: relative;
337
335
  margin-block: var(--spacing-sm) 0;
338
336
 
339
337
  &:hover > span {
340
338
  opacity: 0.3;
341
339
  }
342
- `,Nt=C`
340
+ `,_t=C`
343
341
  align-items: center;
344
342
  display: flex;
345
343
  position: absolute;
@@ -348,88 +346,87 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
348
346
  opacity: 0;
349
347
  `,Ce=C`
350
348
  color: var(--brand-secondary-1);
351
- `,Qt=C`
349
+ `,Zt=C`
352
350
  position: absolute;
353
351
  left: 0.375rem;
354
352
  `,Pe=C`
355
353
  width: calc(var(--spacing-lg) + var(--spacing-xs));
356
354
  height: calc(var(--spacing-lg) + var(--spacing-xs));
357
- `;import{css as z}from"@emotion/react";import{InputSelect as Mo,scrollbarStyles as Vo,Button as Le,Callout as Do,InputKeywordSearch as zo,LoadingIndicator as Uo,Menu as Go,MenuItem as Ao,LoadingOverlay as Bo}from"@uniformdev/design-system";import{useState as Lo,useEffect as Wt,useRef as Ro}from"react";function _t(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=Lo("IDLE"),i=Ro(void 0);return Wt(()=>{t&&r==="IDLE"&&(clearTimeout(i.current),i.current=setTimeout(()=>{if(!t)return a("IDLE");i.current=setTimeout(()=>{a("EXPIRE")},o),a("DISPLAY")},n),a("DELAY")),!t&&r!=="DISPLAY"&&(clearTimeout(i.current),a("IDLE"))},[t,r,n,o]),Wt(()=>()=>clearTimeout(i.current),[]),r==="DISPLAY"||r==="EXPIRE"}var Oo=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&n!=="any"&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),e(Do,{type:"info"},o)},Zt=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:i,multiSelect:l,multiSelectId:g,rowComponent:u,selectedItemComponent:f,totalResults:s,resultsLoading:p,requireContentType:h,onAddNew:E,onEditClosed:G,onCancel:w,noResultsComponent:b,helpComponent:Z,onSort:A,typeSelectorLabel:N="Content Type Select",typeSelectorAllTypesOptionText:B="All content types",loadingIndicatorDelay:O=1e3})=>{var ze,Ue,Ge;let X=()=>h?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[H,P]=k.useState(""),[m,I]=k.useState(X),[U,d]=k.useState(!1),[y,T]=k.useState([]),[Lr,Te]=k.useState(!1),ve=k.useRef(`x${ko()}`),ne=xo(H,750);k.useEffect(()=>{t(ne,{count:5,offset:0,contentType:m==="any"?void 0:m})},[ne,m]);let Rr=_t(p,{delay:O}),xr=c=>{y.some(v=>v.id===c.id)?T(v=>v.filter($=>$.id!==c.id)):T(l?v=>[...v,c]:[c])},kr=r==null?void 0:r.map(c=>c.id+c.title).join(",");k.useEffect(()=>{Array.isArray(r)&&T(r)},[kr]);let Ir=()=>{I(X()),P(""),T(r!=null&&r.length?r:[])},Er=()=>{d(c=>!c),U||Ir()},Me=c=>{let v=(y==null?void 0:y.filter($=>$.id!==c.id))||[];T(v),i(v,"")},Tr=c=>{c.preventDefault(),i(y,m),d(!1)},Mr=c=>{c.preventDefault(),d(!1),w&&w()},Vr=()=>{t(ne,{count:5,offset:(n==null?void 0:n.length)||0,contentType:m==="any"?void 0:m}),Te(!0);let c=setTimeout(()=>{Te(!1)},750);return()=>clearTimeout(c)},Dr=!(r==null?void 0:r.length)||l,zr=u||zt,Ve=f||xt,Ur=b||Oo,De=a&&typeof a!="string"?a:null,Gr=De?e(De,{css:Pe}):e("img",{src:a,alt:"Logo",css:Pe}),Ar=c=>{var v,$;if(c.destination&&c.source.droppableId===((v=c.destination)==null?void 0:v.droppableId)){let x=[...r||[]],[j]=($=x==null?void 0:x.splice(c.source.index,1))!=null?$:[];return x==null||x.splice(c.destination.index,0,j),A&&(T(x),A==null||A(x)),x}};return e("div",{css:z`
355
+ `;import{css as z}from"@emotion/react";import{InputSelect as Ao,scrollbarStyles as Bo,Button as Le,Callout as Oo,InputKeywordSearch as Ho,LoadingIndicator as Fo,Menu as $o,MenuItem as Ko,LoadingOverlay as No}from"@uniformdev/design-system";import{useState as To,useEffect as Xt,useRef as Mo}from"react";function qt(t,{delay:n=500,minDuration:o=200}={delay:500,minDuration:200}){let[r,a]=To("IDLE"),i=Mo(void 0);return Xt(()=>{t&&r==="IDLE"&&(clearTimeout(i.current),i.current=setTimeout(()=>{if(!t)return a("IDLE");i.current=setTimeout(()=>{a("EXPIRE")},o),a("DISPLAY")},n),a("DELAY")),!t&&r!=="DISPLAY"&&(clearTimeout(i.current),a("IDLE"))},[t,r,n,o]),Xt(()=>()=>clearTimeout(i.current),[]),r==="DISPLAY"||r==="EXPIRE"}var Qo=({searchText:t,selectedContentType:n})=>{let o="No content found";return n&&n!=="any"&&(o=`No ${n} content was found`),t&&(o=`${o} for keyword '${t}'.`),e(Oo,{type:"info"},o)},Yt=({search:t,results:n,contentTypes:o,selectedItems:r,logoIcon:a,select:i,multiSelect:l,multiSelectId:g,rowComponent:u,selectedItemComponent:f,totalResults:s,resultsLoading:p,requireContentType:h,onAddNew:E,onEditClosed:G,onCancel:w,noResultsComponent:y,helpComponent:Z,onSort:A,typeSelectorLabel:N="Content Type Select",typeSelectorAllTypesOptionText:B="All content types",loadingIndicatorDelay:O=1e3})=>{var ze,Ue,Ge;let X=()=>h?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[H,P]=k.useState(""),[m,I]=k.useState(X),[U,d]=k.useState(!1),[b,T]=k.useState([]),[kr,Te]=k.useState(!1),fe=k.useRef(`x${Do()}`),oe=Vo(H,750);k.useEffect(()=>{t(oe,{count:5,offset:0,contentType:m==="any"?void 0:m})},[oe,m]);let Ir=qt(p,{delay:O}),Er=c=>{b.some(v=>v.id===c.id)?T(v=>v.filter(F=>F.id!==c.id)):T(l?v=>[...v,c]:[c])},Tr=r==null?void 0:r.map(c=>c.id+c.title).join(",");k.useEffect(()=>{Array.isArray(r)&&T(r)},[Tr]);let Mr=()=>{I(X()),P(""),T(r!=null&&r.length?r:[])},Vr=()=>{d(c=>!c),U||Mr()},Me=c=>{let v=(b==null?void 0:b.filter(F=>F.id!==c.id))||[];T(v),i(v,"")},Dr=c=>{c.preventDefault(),i(b,m),d(!1)},zr=c=>{c.preventDefault(),d(!1),w&&w()},Ur=()=>{t(oe,{count:5,offset:(n==null?void 0:n.length)||0,contentType:m==="any"?void 0:m}),Te(!0);let c=setTimeout(()=>{Te(!1)},750);return()=>clearTimeout(c)},Gr=!(r==null?void 0:r.length)||l,Ar=u||At,Ve=f||Et,Br=y||Qo,De=a&&typeof a!="string"?a:null,Or=De?e(De,{css:Pe}):e("img",{src:a,alt:"Logo",css:Pe}),Hr=c=>{var v,F;if(c.destination&&c.source.droppableId===((v=c.destination)==null?void 0:v.droppableId)){let x=[...r||[]],[j]=(F=x==null?void 0:x.splice(c.source.index,1))!=null?F:[];return x==null||x.splice(c.destination.index,0,j),A&&(T(x),A==null||A(x)),x}};return e("div",{css:z`
358
356
  width: 100%;
359
357
  `},e("div",{css:z`
360
358
  position: relative;
361
359
  margin-block: var(--spacing-base);
362
- `},Dr?e(k.Fragment,null,e("div",{css:Ut,"data-test-id":"component-search"},e("button",{css:Gt,onClick:Er,type:"button","aria-haspopup":!0,"aria-expanded":U,"aria-controls":`entry-search-config-${ve.current}`},Gr,e("span",{css:z`
360
+ `},Gr?e(k.Fragment,null,e("div",{css:Bt,"data-test-id":"component-search"},e("button",{css:Ot,onClick:Vr,type:"button","aria-haspopup":!0,"aria-expanded":U,"aria-controls":`entry-search-config-${fe.current}`},Or,e("span",{css:z`
363
361
  margin-left: var(--spacing-base);
364
- `},"Select"),e("span",{css:$t},e(pe,{css:[Ft,U?z`
362
+ `},"Select"),e("span",{css:Nt},e(le,{css:[Qt,U?z`
365
363
  transform: rotate(180deg);
366
- `:void 0]})))),e("div",{id:`entry-search-config-${ve.current}`,"aria-hidden":!U,css:[Bt,U?void 0:Ot]},Z||null,e("div",{css:z`
364
+ `:void 0]})))),e("div",{id:`entry-search-config-${fe.current}`,"aria-hidden":!U,css:[Ft,U?void 0:$t]},Z||null,e("div",{css:z`
367
365
  display: flex;
368
366
  gap: calc(var(--spacing-base) - 0.25rem);
369
367
  margin-bottom: var(--spacing-base);
370
- `},e(Mo,{onChange:c=>I(c.target.value),value:m,label:N,showLabel:!1,options:[...h?[]:[{value:"any",label:B}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),e("div",{css:z`
368
+ `},e(Ao,{onChange:c=>I(c.target.value),value:m,label:N,showLabel:!1,options:[...h?[]:[{value:"any",label:B}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),e("div",{css:z`
371
369
  flex-grow: 1;
372
- `},e(zo,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:P,disabledFieldSubmission:!0,value:H}))),e("div",{css:[Ht,Vo],id:ve.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},e(Bo,{isActive:Rr}),Array.isArray(n)&&n.length>0?n.map(c=>e(zr,{key:c.id,isSelected:y.some(v=>v.id===c.id),result:c,triggerSelection:()=>xr(c)})):e(Ur,{searchText:ne||H,selectedContentType:(Ue=(ze=o==null?void 0:o.find(c=>c.id===m))==null?void 0:ze.name)!=null?Ue:m}),!p&&typeof s!="undefined"&&n&&(n==null?void 0:n.length)<s&&e("button",{type:"button",css:At,onClick:Vr},Lr?e(Uo,null):"Load More")),e("div",{css:z`
370
+ `},e(Ho,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:P,disabledFieldSubmission:!0,value:H}))),e("div",{css:[Kt,Bo],id:fe.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list"},e(No,{isActive:Ir}),Array.isArray(n)&&n.length>0?n.map(c=>e(Ar,{key:c.id,isSelected:b.some(v=>v.id===c.id),result:c,triggerSelection:()=>Er(c)})):e(Br,{searchText:oe||H,selectedContentType:(Ue=(ze=o==null?void 0:o.find(c=>c.id===m))==null?void 0:ze.name)!=null?Ue:m}),!p&&typeof s!="undefined"&&n&&(n==null?void 0:n.length)<s&&e("button",{type:"button",css:Ht,onClick:Ur},kr?e(Fo,null):"Load More")),e("div",{css:z`
373
371
  display: flex;
374
372
  justify-content: space-between;
375
- `},e("div",null,E&&((Ge=o==null?void 0:o.length)!=null?Ge:0)>0?e(Go,{menuLabel:"Add new menu",menuTrigger:e(Le,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>e(Ao,{key:c.id,css:z`
373
+ `},e("div",null,E&&((Ge=o==null?void 0:o.length)!=null?Ge:0)>0?e($o,{menuLabel:"Add new menu",menuTrigger:e(Le,{buttonType:"secondary"},"Add New")},o==null?void 0:o.map(c=>e(Ko,{key:c.id,css:z`
376
374
  background: var(--white);
377
375
  color: var(--brand-secondary-1);
378
376
  `,onClick:()=>E(c)},c.name))):null),e("div",{css:z`
379
377
  display: flex;
380
378
  gap: var(--spacing-base);
381
- `},e(Le,{buttonType:"unimportant",onClick:Mr},"Cancel"),e(Le,{disabled:!y.length,onClick:Tr,"data-test-id":"entry-accept-button"},"Accept"))))):null,U?null:l?e(Eo,{onDragEnd:c=>Ar(c)},e(Io,{droppableId:g||"canvas-multi-select"},c=>e("div",{...c.droppableProps,ref:c.innerRef,css:z`
379
+ `},e(Le,{buttonType:"unimportant",onClick:zr},"Cancel"),e(Le,{disabled:!b.length,onClick:Dr,"data-test-id":"entry-accept-button"},"Accept"))))):null,U?null:l&&b.length>1?e(Uo,{onDragEnd:c=>Hr(c)},e(zo,{droppableId:g||"canvas-multi-select"},c=>e("div",{...c.droppableProps,ref:c.innerRef,css:z`
382
380
  margin-block: var(--spacing-sm) 0;
383
- `},y==null?void 0:y.map((v,$)=>{if(v!=null&&v.id)return e(To,{key:v.id,draggableId:v.id,index:$},x=>e("div",{css:Kt,ref:x.innerRef,...x.draggableProps,...x.dragHandleProps},e("span",{css:Nt},e(te,{css:[Ce,Qt],width:24,height:24}),e(te,{css:Ce,width:24,height:24})),e(Ve,{key:`selected-item-${v.id}`,logoIcon:a,selectedItem:v,onDeselect:j=>Me(j),onEditClosed:G?j=>G(j):void 0})))}),c.placeholder))):y==null?void 0:y.map(c=>e(Ve,{key:`selected-item-${c.id}`,logoIcon:a,selectedItem:c,onDeselect:v=>Me(v),onEditClosed:G?v=>G(v):void 0}))))};import{css as _}from"@emotion/react";var Xt=_`
381
+ `},b==null?void 0:b.map((v,F)=>{if(v!=null&&v.id)return e(Go,{key:v.id,draggableId:v.id,index:F},x=>e("div",{css:Wt,ref:x.innerRef,...x.draggableProps,...x.dragHandleProps},e("span",{css:_t},e(ee,{css:[Ce,Zt],width:24,height:24}),e(ee,{css:Ce,width:24,height:24})),e(Ve,{key:`selected-item-${v.id}`,logoIcon:a,selectedItem:v,onDeselect:j=>Me(j),onEditClosed:G?j=>G(j):void 0})))}),c.placeholder))):b==null?void 0:b.map(c=>e(Ve,{key:`selected-item-${c.id}`,logoIcon:a,selectedItem:c,onDeselect:v=>Me(v),onEditClosed:G?v=>G(v):void 0}))))};import{css as _}from"@emotion/react";var Jt=_`
384
382
  cursor: pointer;
385
383
  padding: var(--spacing-sm) 0;
386
384
  margin-right: var(--spacing-sm);
387
385
  position: relative;
388
386
  transition: background-color var(--duration-fast) var(--timing-ease-out),
389
387
  color var(--duration-fast) var(--timing-ease-out);
390
- `,qt=_`
388
+ `,jt=_`
391
389
  border: 2px solid transparent;
392
390
  border-radius: var(--rounded-base);
393
391
  display: flex;
394
392
  align-items: center;
395
393
  gap: var(--spacing-base);
396
394
  padding: var(--spacing-sm) var(--spacing-xs);
397
- `,Yt=_`
395
+ `,er=_`
398
396
  background-color: var(--green-50);
399
- `,Jt=_`
397
+ `,tr=_`
400
398
  font-size: var(--fs-sm);
401
399
  font-weight: var(--fw-bold);
402
400
  width: 50%;
403
- `,jt=_`
401
+ `,rr=_`
404
402
  font-weight: var(--fw-normal);
405
403
  display: block;
406
- `,er=_`
404
+ `,or=_`
407
405
  font-size: var(--fs-sm);
408
406
  > * {
409
407
  display: block;
410
408
  }
411
- `,tr=_`
409
+ `,nr=_`
412
410
  display: block;
413
411
  height: 1.5rem;
414
412
  width: 1.5rem;
415
413
  color: var(--brand-secondary-3);
416
414
  margin-left: auto;
417
- `;import{css as rr}from"@emotion/react";function or({result:t,isSelected:n,triggerSelection:o}){var g;let{categories:r,logoIcon:a}=ge(),[i]=t.categories||[{id:"",name:""}],l=typeof i=="undefined"||!r||(g=r.find(u=>u.id===i.id))==null?void 0:g.name;return e("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Xt]},e("div",{css:[qt,n?Yt:void 0]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:rr`
415
+ `;import{css as ar}from"@emotion/react";function ir({result:t,isSelected:n,triggerSelection:o}){var g;let{categories:r,logoIcon:a}=ue(),[i]=t.categories||[{id:"",name:""}],l=typeof i=="undefined"||!r||(g=r.find(u=>u.id===i.id))==null?void 0:g.name;return e("div",{key:t.id,"data-value":t.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Jt]},e("div",{css:[jt,n?er:void 0]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:`Thumbnail for ${t.title}`,css:ar`
418
416
  background-color: var(--gray-200);
419
417
  width: 3rem;
420
418
  height: 3rem;
421
419
  object-fit: cover;
422
- `}):e(V,{src:a,alt:"Logo",css:rr`
420
+ `}):e(V,{src:a,alt:"Logo",css:ar`
423
421
  height: 2.25rem;
424
422
  width: 2.25rem;
425
- `}),e("h4",{css:[Jt]},t.title,l?e("span",{css:[jt]},l):null),e("p",{css:[er]},"SKU: ",t.sku||t.id,t.price!==void 0?e("span",null,t.price):null),n?e(le,{css:[tr]}):null))}import{css as K}from"@emotion/react";import{mq as nr}from"@uniformdev/design-system";var ar=K`
423
+ `}),e("h4",{css:[tr]},t.title,l?e("span",{css:[rr]},l):null),e("p",{css:[or]},"SKU: ",t.sku||t.id,t.price!==void 0?e("span",null,t.price):null),n?e(de,{css:[nr]}):null))}import{css as K}from"@emotion/react";import{mq as sr}from"@uniformdev/design-system";var cr=K`
426
424
  border: 1px solid var(--gray-200);
427
425
  border-radius: var(--rounded-base);
428
426
  background: var(--gray-50);
429
427
  display: flex;
430
428
  width: 100%;
431
- margin-block: var(--spacing-base) 0;
432
- `,ir=K`
429
+ `,dr=K`
433
430
  align-items: center;
434
431
  display: flex;
435
432
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
@@ -437,13 +434,13 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
437
434
  flex-grow: 1;
438
435
  gap: var(--spacing-sm);
439
436
  margin-inline: 0 var(--spacing-sm);
440
- `,sr=K`
437
+ `,lr=K`
441
438
  display: flex;
442
439
  align-items: center;
443
440
  gap: var(--spacing-sm);
444
441
  flex-grow: 1;
445
442
 
446
- ${nr("lg")} {
443
+ ${sr("lg")} {
447
444
  width: 50%;
448
445
  margin-bottom: 0;
449
446
  }
@@ -469,21 +466,21 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
469
466
  }
470
467
  `,ke=K`
471
468
  font-size: var(--fs-sm);
472
- `,cr=K`
469
+ `,pr=K`
473
470
  display: block;
474
471
  width: 1rem;
475
472
  height: 1rem;
476
- `,dr=K`
473
+ `,mr=K`
477
474
  display: flex;
478
475
  flex-direction: column;
479
476
  gap: var(--spacing-sm);
480
477
 
481
- ${nr("md")} {
478
+ ${sr("md")} {
482
479
  flex-direction: row;
483
480
  min-width: 200px;
484
481
  justify-content: end;
485
482
  }
486
- `;import{css as q}from"@emotion/react";import{Icon as Ho,mq as $o}from"@uniformdev/design-system";import{CgClose as Fo}from"react-icons/cg";function lr({selectedItem:t,onDeselect:n}){var l;let{categories:o,logoIcon:r}=ge(),[a]=t.categories||[{id:"",name:""}],i=typeof a=="undefined"||!o||(l=o.find(g=>g.id===a.id))==null?void 0:l.name;return e("div",{css:[ar],key:t.id},e("article",{css:[ir]},e("div",{css:[sr]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:i,css:[Re],loading:"lazy"}):e("div",{css:[Re]}),e("div",{css:q`
483
+ `;import{css as q}from"@emotion/react";import{Icon as Wo,mq as _o}from"@uniformdev/design-system";import{CgClose as Zo}from"react-icons/cg";function ur({selectedItem:t,onDeselect:n}){var l;let{categories:o,logoIcon:r}=ue(),[a]=t.categories||[{id:"",name:""}],i=typeof a=="undefined"||!o||(l=o.find(g=>g.id===a.id))==null?void 0:l.name;return e("div",{css:[cr],key:t.id},e("article",{css:[dr]},e("div",{css:[lr]},t.thumbnailUrl?e("img",{src:t.thumbnailUrl,alt:i,css:[Re],loading:"lazy"}):e("div",{css:[Re]}),e("div",{css:q`
487
484
  > :not(:last-child) {
488
485
  margin-bottom: var(--spacing-xs);
489
486
  }
@@ -496,7 +493,7 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
496
493
  `},i)),e("ul",{css:q`
497
494
  font-size: var(--fs-sm);
498
495
 
499
- ${$o("sm")} {
496
+ ${_o("sm")} {
500
497
  display: flex;
501
498
  gap: var(--spacing-base);
502
499
  }
@@ -504,13 +501,13 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
504
501
  margin-right: var(--spacing-xs);
505
502
  `},"SKU:"),t.sku||t.id),t.price!==void 0?e("li",null,e("span",{css:q`
506
503
  margin-right: var(--spacing-xs);
507
- `},"Price:"),e("span",null,t.price)):null))),e("div",{css:dr},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:xe},e("span",{css:ke},"Edit"),e(V,{src:r,alt:"Logo",css:cr})):null,e("button",{type:"button",onClick:()=>{n==null||n(t)},css:xe},e("span",{css:ke},"Unlink"),e(Ho,{icon:Fo,iconColor:"red",size:16})))))}import{Callout as _o}from"@uniformdev/design-system";import{useAsync as Zo,useAsyncFn as Xo}from"react-use";function $i({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:i,multiSelectId:l,selectedItemComponent:g,rowComponent:u,errorComponent:f,helpComponent:s,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:E="All categories",typeSelectorLabel:G="Select Category"}){var H;let{value:w,loading:b,error:Z}=Zo(async()=>await o(),[o]),A=w==null?void 0:w.map(P=>P.id).join(","),N=Qo(()=>w?w.map(m=>({id:m.id,name:m.name})):void 0,[A]),B=Wo(),[O,oe]=Xo(async(P,m)=>{let I=await r({text:P,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&&(B.current=[]),(B.current=B.current||[]).push(...I.products),I},[r]),X=async P=>{await n(P)};return Z||O.error?e(f||(({categoriesError:m,searchError:I})=>e(_o,{type:"error"},"There was an error: ",(m==null?void 0:m.message)||(I==null?void 0:I.message))),{categoriesError:Z,searchError:O.error}):e(pr.Provider,{value:{categories:w,logoIcon:a}},e(Zt,{search:oe,results:B.current,logoIcon:a,selectedItems:t,select:X,multiSelectId:l||"product-search-multi-select",multiSelect:i,contentTypes:N,selectedItemComponent:g||lr,rowComponent:u||or,totalResults:(H=O.value)==null?void 0:H.total,resultsLoading:O.loading||b,helpComponent:s,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:E,typeSelectorLabel:G}))}var pr=Ko.createContext(void 0),ge=()=>{let t=No(pr);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};import{css as R}from"@emotion/react";import{mq as qo}from"@uniformdev/design-system";var mr=R`
504
+ `},"Price:"),e("span",null,t.price)):null))),e("div",{css:mr},t.editLink?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:xe},e("span",{css:ke},"Edit"),e(V,{src:r,alt:"Logo",css:pr})):null,e("button",{type:"button",onClick:()=>{n==null||n(t)},css:xe},e("span",{css:ke},"Unlink"),e(Wo,{icon:Zo,iconColor:"red",size:16})))))}import{Callout as jo}from"@uniformdev/design-system";import{useAsync as en,useAsyncFn as tn}from"react-use";function Yi({selectedProducts:t,setSelectedProducts:n,onGetCategories:o,onSearchProducts:r,logoIcon:a,multiSelect:i,multiSelectId:l,selectedItemComponent:g,rowComponent:u,errorComponent:f,helpComponent:s,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:E="All categories",typeSelectorLabel:G="Select Category"}){var H;let{value:w,loading:y,error:Z}=en(async()=>await o(),[o]),A=w==null?void 0:w.map(P=>P.id).join(","),N=Yo(()=>w?w.map(m=>({id:m.id,name:m.name})):void 0,[A]),B=Jo(),[O,re]=tn(async(P,m)=>{let I=await r({text:P,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&&(B.current=[]),(B.current=B.current||[]).push(...I.products),I},[r]),X=async P=>{await n(P)};return Z||O.error?e(f||(({categoriesError:m,searchError:I})=>e(jo,{type:"error"},"There was an error: ",(m==null?void 0:m.message)||(I==null?void 0:I.message))),{categoriesError:Z,searchError:O.error}):e(gr.Provider,{value:{categories:w,logoIcon:a}},e(Yt,{search:re,results:B.current,logoIcon:a,selectedItems:t,select:X,multiSelectId:l||"product-search-multi-select",multiSelect:i,contentTypes:N,selectedItemComponent:g||ur,rowComponent:u||ir,totalResults:(H=O.value)==null?void 0:H.total,resultsLoading:O.loading||y,helpComponent:s,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:E,typeSelectorLabel:G}))}var gr=Xo.createContext(void 0),ue=()=>{let t=qo(gr);if(!t)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return t};import{css as R}from"@emotion/react";import{mq as rn}from"@uniformdev/design-system";var fr=R`
508
505
  border: 1px solid var(--gray-200);
509
506
  background: var(--gray-50);
510
507
  border-radius: var(--rounded-base);
511
508
  display: flex;
512
509
  width: 100%;
513
- `,ur=R`
510
+ `,vr=R`
514
511
  align-items: center;
515
512
  display: flex;
516
513
  flex-grow: 1;
@@ -518,22 +515,23 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
518
515
  margin-inline: 0 var(--spacing-sm);
519
516
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
520
517
  position: relative;
521
- `,gr=R`
518
+ `,hr=R`
522
519
  flex-grow: 1;
523
- `,fr=R`
520
+ `,br=R`
524
521
  align-items: center;
525
522
  display: flex;
526
523
  position: relative;
527
- `,vr=R`
524
+ `,yr=R`
528
525
  color: var(--brand-secondary-1);
529
526
  font-size: var(--fs-base);
530
527
  font-weight: var(--fw-bold);
531
528
  line-height: 1;
532
529
  margin: 0;
533
- `,hr=R`
530
+ word-break: break-word;
531
+ `,Sr=R`
534
532
  width: 1.5rem;
535
533
  height: 1.5rem;
536
- `,br=R`
534
+ `,wr=R`
537
535
  background: var(--white);
538
536
  border-radius: var(--rounded-base);
539
537
  border-left: 4px solid var(--brand-secondary-3);
@@ -544,15 +542,15 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
544
542
  width: max-content;
545
543
  `,Y=R`
546
544
  font-size: var(--fs-sm);
547
- `,fe=R`
545
+ `,ge=R`
548
546
  font-weight: var(--fw-bold);
549
547
  margin-right: var(--spacing-sm);
550
- `,yr=R`
548
+ `,Cr=R`
551
549
  display: flex;
552
550
  flex-direction: column;
553
551
  gap: var(--spacing-sm);
554
552
 
555
- ${qo("md")} {
553
+ ${rn("md")} {
556
554
  flex-direction: row;
557
555
  justify-content: end;
558
556
  min-width: 200px;
@@ -572,11 +570,11 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
572
570
  &:hover {
573
571
  background: var(--gray-50);
574
572
  }
575
- `,Sr=R`
573
+ `,Pr=R`
576
574
  display: flex;
577
575
  margin-top: var(--spacing-sm);
578
576
  gap: var(--spacing-sm);
579
- `,wr=R`
577
+ `,Lr=R`
580
578
  background: none;
581
579
  outline: none;
582
580
  border: none;
@@ -586,16 +584,16 @@ var Br=Object.defineProperty;var Or=(t,n)=>{for(var o in n)Br(t,o,{get:n[o],enum
586
584
  max-width: 100%;
587
585
  min-width: 100px;
588
586
  height: auto;
589
- `;import Yo,{useState as Jo,useRef as Cr,useEffect as jo}from"react";import{CgInfo as en,CgClose as tn}from"react-icons/cg";import{format as rn}from"timeago.js";import{css as J}from"@emotion/react";import{Icon as Pr}from"@uniformdev/design-system";function es({selectedItem:t,onDeselect:n,onEditClosed:o,logoIcon:r,itemDetailsRendererComponent:a}){let i=Cr(null),l=Cr(null),[g,u]=Jo(!1);jo(()=>{let p=E=>{i.current&&!i.current.contains(E.target)&&l.current&&!l.current.contains(E.target)&&u(!1)},h=()=>{u(!1)};return window.addEventListener("resize",h,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",h,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[l]);let f=()=>{var p;if(u(!g),l.current&&i.current){let h=(p=i==null?void 0:i.current)==null?void 0:p.getBoundingClientRect();l.current.style.top=`${h.top+30}px`}},s=a!=null?a:on;return e("div",{css:[mr,J`
587
+ `;import on,{useState as nn,useRef as Rr,useEffect as an}from"react";import{CgInfo as sn,CgClose as cn}from"react-icons/cg";import{format as dn}from"timeago.js";import{css as J}from"@emotion/react";import{Icon as xr}from"@uniformdev/design-system";function ls({selectedItem:t,onDeselect:n,onEditClosed:o,logoIcon:r,itemDetailsRendererComponent:a}){let i=Rr(null),l=Rr(null),[g,u]=nn(!1);an(()=>{let p=E=>{i.current&&!i.current.contains(E.target)&&l.current&&!l.current.contains(E.target)&&u(!1)},h=()=>{u(!1)};return window.addEventListener("resize",h,!0),document.addEventListener("scroll",p,!0),document.addEventListener("mousedown",p),()=>{window.removeEventListener("resize",h,!0),document.removeEventListener("scroll",p,!0),document.removeEventListener("mousedown",p)}},[l]);let f=()=>{var p;if(u(!g),l.current&&i.current){let h=(p=i==null?void 0:i.current)==null?void 0:p.getBoundingClientRect();l.current.style.top=`${h.top+30}px`}},s=a!=null?a:ln;return e("div",{css:[fr,J`
590
588
  margin: 0 0 1rem 0;
591
- `],key:t.id},e("div",{css:ur},e("div",{css:gr},e("div",{css:fr},e("h4",{css:[vr],title:`ID: ${t.id}`,"data-test-id":"dam-selected-item"},t.title||t.id||""),t.popoverData?e(Yo.Fragment,null,e("button",{type:"button",ref:i,css:wr,"aria-controls":"path-details","aria-expanded":g,onClick:f},e(Pr,{icon:en,iconColor:"gray",size:24,css:J`
589
+ `],key:t.id},e("div",{css:vr},e("div",{css:hr},e("div",{css:br},e("h4",{css:[yr],title:`ID: ${t.id}`,"data-test-id":"dam-selected-item"},t.title||t.id||""),t.popoverData?e(on.Fragment,null,e("button",{type:"button",ref:i,css:Lr,"aria-controls":"path-details","aria-expanded":g,onClick:f},e(xr,{icon:sn,iconColor:"gray",size:24,css:J`
592
590
  opacity: var(--opacity-75);
593
- `})),e("div",{id:"path-details","aria-hidden":!g,ref:l,css:[br,g?J`
591
+ `})),e("div",{id:"path-details","aria-hidden":!g,ref:l,css:[wr,g?J`
594
592
  visibility: visible;
595
593
  `:J`
596
594
  visibility: hidden;
597
- `]},Object.entries(t.popoverData).map(([p,h],E)=>e("div",{css:Y,key:E},e("span",{css:fe},p,":"),h)))):null),e(s,{item:t})),e("div",{css:yr},t.editLink?typeof t.editLink=="string"?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:p=>{o&&(ue(p.currentTarget.href,()=>o(t)),p.preventDefault())},css:Ie},e("span",{css:Y},"Edit"),r?e(V,{src:r,css:hr,alt:"Logo"}):null):t.editLink:null,e("button",{type:"button",onClick:()=>{n(t)},css:Ie},e("span",{css:Y},"Unlink"),e(Pr,{icon:tn,iconColor:"red",size:16})))))}function on({item:t}){let n=null;return t.previewUrl&&typeof t.previewUrl=="string"?t.type==="image"?n=e("img",{src:t.previewUrl,alt:t.id,width:"200",css:Ee}):t.type==="video"&&(n=e("video",{src:t.previewUrl,title:t.id,width:"200",controls:!0,css:Ee})):t.previewUrl&&typeof t.previewUrl!="string"&&(n=t.previewUrl),n||t.metadata?e("div",{css:Sr},n?e("div",null,n):null,e("ul",null,t.metadata?Object.entries(t.metadata).map(([o,r])=>e("li",{css:[Y,J`
595
+ `]},Object.entries(t.popoverData).map(([p,h],E)=>e("div",{css:Y,key:E},e("span",{css:ge},p,":"),h)))):null),e(s,{item:t})),e("div",{css:Cr},t.editLink?typeof t.editLink=="string"?e("a",{href:t.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:p=>{o&&(me(p.currentTarget.href,()=>o(t)),p.preventDefault())},css:Ie},e("span",{css:Y},"Edit"),r?e(V,{src:r,css:Sr,alt:"Logo"}):null):t.editLink:null,e("button",{type:"button",onClick:()=>{n(t)},css:Ie},e("span",{css:Y},"Unlink"),e(xr,{icon:cn,iconColor:"red",size:16})))))}function ln({item:t}){let n=null;return t.previewUrl&&typeof t.previewUrl=="string"?t.type==="image"?n=e("img",{src:t.previewUrl,alt:t.id,width:"200",css:Ee}):t.type==="video"&&(n=e("video",{src:t.previewUrl,title:t.id,width:"200",controls:!0,css:Ee})):t.previewUrl&&typeof t.previewUrl!="string"&&(n=t.previewUrl),n||t.metadata?e("div",{css:Pr},n?e("div",null,n):null,e("ul",null,t.metadata?Object.entries(t.metadata).map(([o,r])=>e("li",{css:[Y,J`
598
596
  order: 1;
599
- `],key:o},e("span",{css:[fe,J`
597
+ `],key:o},e("span",{css:[ge,J`
600
598
  order: 1;
601
- `]},o,":"),r)):null,t.createdDate?e("li",{css:Y},e("span",{css:fe},"Date:"),rn(t.createdDate)):null)):null}export*from"@uniformdev/mesh-sdk";import{Button as ds,Callout as ls,LoadingIndicator as ps,LoadingOverlay as ms,Menu as us,MenuItem as gs,Input as fs,InputSelect as vs,InputToggle as hs,Theme as bs,InputKeywordSearch as ys,Heading as Ss,ScrollableList as ws,ScrollableListItem as Cs,Textarea as Ps,Switch as Ls,Label as Rs,AddListButton as xs}from"@uniformdev/design-system";export{xs as AddListButton,ds as Button,ls as Callout,es as DamSelectedItem,zt as DefaultSearchRow,xt as DefaultSelectedItem,Zt as EntrySearch,Ss as Heading,be as Icons,fs as Input,vs as InputSelect,hs as InputToggle,ys as KeywordSearchInput,Rs as Label,ps as LoadingIndicator,ms as LoadingOverlay,us as Menu,gs as MenuItem,Je as ProductPreviewList,_n as ProductQuery,qe as ProductQueryContext,$i as ProductSearch,pr as ProductSearchContext,or as ProductSearchRow,lr as ProductSelectedItem,Ne as ResolvableLoadingValue,ws as ScrollableList,Cs as ScrollableListItem,Qe as SelectionField,Ls as Switch,Ps as Textarea,bs as Theme,Ae as UniformMeshLocationContext,Be as UniformMeshLocationContextProvider,$e as UniformMeshSdkContext,Ln as UniformMeshSdkContextProvider,Pe as badgeIcon,Ee as damSelectItemImage,mr as damSelectedItemContainer,fr as damSelectedItemCopy,gr as damSelectedItemDetails,hr as damSelectedItemIcon,wr as damSelectedItemInfoBtn,ur as damSelectedItemInner,Ie as damSelectedItemLinkBtn,yr as damSelectedItemLinkContainer,Sr as damSelectedItemMediaContainer,br as damSelectedItemPopover,fe as damSelectedItemPopoverLabel,Y as damSelectedItemSmallText,vr as damSelectedItemTitle,Kt as draggableContainer,Ce as draggableIcon,Qt as draggableIconOffset,Nt as draggableIconWrapper,Gt as entrySearchBtn,Bt as entrySearchConfig,Ot as entrySearchConfigHidden,At as entrySearchLoadMoreBtn,Ht as entrySearchResultList,$t as entrySearchSelectIcon,Ft as entrySearchSelectImg,Xa as entrySearchSelectInput,qa as entrySearchSelectOption,Ut as entrySearchWrapper,tr as productSearchRowActiveIcon,jt as productSearchRowCategory,Xt as productSearchRowContainer,qt as productSearchRowContent,Yt as productSearchRowContentActive,er as productSearchRowDetails,Jt as productSearchRowTitle,ar as productSelectedItemContainer,sr as productSelectedItemContent,ir as productSelectedItemDetails,cr as productSelectedItemIcon,Re as productSelectedItemImage,dr as productSelectedItemLinkContainer,xe as productedSelectedItemLinkBtn,ke as productedSelectedItemSmallText,Mt as searchRowBtn,kt as searchRowContainer,Et as searchRowContainerActive,It as searchRowContainerWithPopover,Tt as searchRowPopover,we as searchRowText,Se as searchRowTextSmall,ye as selectItemLinkBtn,Pt as selectItemLinkContainer,Ct as selectItemPopover,re as selectItemPopoverLabel,Q as selectItemSmallText,vt as selectedItemContainer,yt as selectedItemCopy,bt as selectedItemDetails,wt as selectedItemIcon,ht as selectedItemInner,St as selectedItemTitle,bn as useInitializeUniformMeshSdk,Ye as useProductQueryContext,ge as useProductSearchContext,un as useUniformMeshLocation,Oe as useUniformMeshLocationContext,kn as useUniformMeshSdk,Fe as useUniformMeshSdkContext};
599
+ `]},o,":"),r)):null,t.createdDate?e("li",{css:Y},e("span",{css:ge},"Date:"),dn(t.createdDate)):null)):null}export*from"@uniformdev/mesh-sdk";import{Button as ys,Callout as Ss,LoadingIndicator as ws,LoadingOverlay as Cs,Menu as Ps,MenuItem as Ls,Input as Rs,InputSelect as xs,InputToggle as ks,Theme as Is,InputKeywordSearch as Es,Heading as Ts,ScrollableList as Ms,ScrollableListItem as Vs,Textarea as Ds,Switch as zs,Label as Us,AddListButton as Gs}from"@uniformdev/design-system";export{Gs as AddListButton,ys as Button,Ss as Callout,ls as DamSelectedItem,At as DefaultSearchRow,Et as DefaultSelectedItem,Yt as EntrySearch,Ts as Heading,be as Icons,Rs as Input,xs as InputSelect,ks as InputToggle,Es as KeywordSearchInput,Us as Label,ws as LoadingIndicator,Cs as LoadingOverlay,Ps as Menu,Ls as MenuItem,tt as ProductPreviewList,oa as ProductQuery,je as ProductQueryContext,Yi as ProductSearch,gr as ProductSearchContext,ir as ProductSearchRow,ur as ProductSelectedItem,Ne as ResolvableLoadingValue,Ms as ScrollableList,Vs as ScrollableListItem,Ze as SelectionField,zs as Switch,Ds as Textarea,Is as Theme,Ae as UniformMeshLocationContext,Be as UniformMeshLocationContextProvider,Fe as UniformMeshSdkContext,Tn as UniformMeshSdkContextProvider,Pe as badgeIcon,Ee as damSelectItemImage,fr as damSelectedItemContainer,br as damSelectedItemCopy,hr as damSelectedItemDetails,Sr as damSelectedItemIcon,Lr as damSelectedItemInfoBtn,vr as damSelectedItemInner,Ie as damSelectedItemLinkBtn,Cr as damSelectedItemLinkContainer,Pr as damSelectedItemMediaContainer,wr as damSelectedItemPopover,ge as damSelectedItemPopoverLabel,Y as damSelectedItemSmallText,yr as damSelectedItemTitle,Wt as draggableContainer,Ce as draggableIcon,Zt as draggableIconOffset,_t as draggableIconWrapper,Ot as entrySearchBtn,Ft as entrySearchConfig,$t as entrySearchConfigHidden,Ht as entrySearchLoadMoreBtn,Kt as entrySearchResultList,Nt as entrySearchSelectIcon,Qt as entrySearchSelectImg,ai as entrySearchSelectInput,ii as entrySearchSelectOption,Bt as entrySearchWrapper,nr as productSearchRowActiveIcon,rr as productSearchRowCategory,Jt as productSearchRowContainer,jt as productSearchRowContent,er as productSearchRowContentActive,or as productSearchRowDetails,tr as productSearchRowTitle,cr as productSelectedItemContainer,lr as productSelectedItemContent,dr as productSelectedItemDetails,pr as productSelectedItemIcon,Re as productSelectedItemImage,mr as productSelectedItemLinkContainer,xe as productedSelectedItemLinkBtn,ke as productedSelectedItemSmallText,zt as searchRowBtn,Tt as searchRowContainer,Vt as searchRowContainerActive,Mt as searchRowContainerWithPopover,Dt as searchRowPopover,we as searchRowText,Se as searchRowTextSmall,ye as selectItemLinkBtn,xt as selectItemLinkContainer,Rt as selectItemPopover,te as selectItemPopoverLabel,Q as selectItemSmallText,yt as selectedItemContainer,Ct as selectedItemCopy,wt as selectedItemDetails,Lt as selectedItemIcon,St as selectedItemInner,Pt as selectedItemTitle,Ln as useInitializeUniformMeshSdk,et as useProductQueryContext,ue as useProductSearchContext,yn as useUniformMeshLocation,Oe as useUniformMeshLocationContext,Dn as useUniformMeshSdk,$e as useUniformMeshSdkContext};