@uniformdev/mesh-sdk-react 17.4.1-alpha.0 → 17.4.1-alpha.230

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,4 +1,4 @@
1
- var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as x from"react";import{createContext as Uo,useContext as Ao,useEffect as Go,useState as Bo}from"react";import{createContext as Mo,useContext as Vo}from"react";import{Theme as Do}from"@uniformdev/design-system";import{jsx as st,jsxs as zo}from"@emotion/react/jsx-runtime";var Se=Mo(void 0),ha=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),zo(Se.Provider,{value:r,children:[st(Do,{}),st(xe,{children:e})]})},ct=()=>{let e=Vo(Se);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function dt(){let{sdk:e}=ct();return e}import{jsx as Oo}from"@emotion/react/jsx-runtime";var lt=Uo(void 0),xe=({children:e})=>{let r=dt(),[o,t]=Bo(r.getCurrentLocation()),n=a=>{t(d=>({...d,value:a.newValue}))};return Go(()=>(r.events.on("onValueChanged",n),()=>{r.events.off("onValueChanged",n)}),[r]),Oo(lt.Provider,{value:{location:o},children:e})},we=()=>{let e=Ao(lt);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function Ma(){let{location:e}=we();return e}import{initializeUniformMeshSDK as Ho}from"@uniformdev/mesh-sdk";import{useEffect as $o,useRef as Fo,useState as pt}from"react";var ut=({autoResizingDisabled:e}={})=>{let[r,o]=pt(),[t,n]=pt(),a=Fo(!1);return $o(()=>{typeof window=="undefined"||t||(typeof window.UniformMeshSDK=="undefined"&&!a.current?(a.current=!0,Ho({autoResizingDisabled:e}).then(d=>{n(d)}).catch(d=>{o(d)}).finally(()=>{a.current=!1})):n(window.UniformMeshSDK))},[e]),{initializing:!t&&!r,error:r,sdk:t}};function Ha(e){let{location:r}=we();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import Xo,{useMemo as Le,useContext as qo}from"react";import{css as Ko}from"@emotion/react";import{Icon as No,InputSelect as Qo}from"@uniformdev/design-system";import{CgClose as Wo}from"react-icons/cg";import{Fragment as mt,jsxs as gt}from"@emotion/react/jsx-runtime";var ft=({value:e,text:r,loading:o})=>gt(mt,{children:[!!r&&r,!r&&gt(mt,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ge}from"@emotion/react";var vt=Ge`
1
+ var Co=Object.defineProperty;var Ro=(e,r)=>{for(var o in r)Co(e,o,{get:r[o],enumerable:!0})};import{jsx as l}from"@emotion/react";import*as b from"react";import{createContext as _o,useContext as Io,useEffect as Vo,useState as Eo}from"react";import{createContext as Po,useContext as To}from"react";import{Theme as ko}from"@uniformdev/design-system";import{jsx as kt,jsxs as Lo}from"@emotion/react/jsx-runtime";var Ie=Po(void 0),Oi=({children:e})=>{let r;return typeof window!="undefined"&&typeof window.UniformMeshSDK!="undefined"&&(r={sdk:window.UniformMeshSDK}),Lo(Ie.Provider,{value:r,children:[kt(ko,{}),kt(Ve,{children:e})]})},Lt=()=>{let e=To(Ie);if(!e)throw new Error("useUniformMeshSdkContext must be used within <MeshApp /> or <UniformMeshSdkContext />");return e};function _t(){let{sdk:e}=Lt();return e}import{jsx as Do}from"@emotion/react/jsx-runtime";var It=_o(void 0),Ve=({children:e})=>{let r=_t(),[o,a]=Eo(r.getCurrentLocation()),t=n=>{a(i=>({...i,value:n.newValue}))};return Vo(()=>(r.events.on("onValueChanged",t),()=>{r.events.off("onValueChanged",t)}),[r]),Do(It.Provider,{value:{location:o},children:e})},Ee=()=>{let e=Io(It);if(!e)throw new Error("useUniformMeshLocationContext must be used within a UniformMeshLocationContextProvider");return e};function ts(){let{location:e}=Ee();return e}import{initializeUniformMeshSDK as Mo}from"@uniformdev/mesh-sdk";import{useEffect as Uo,useRef as zo,useState as Vt}from"react";var Et=({autoResizingDisabled:e}={})=>{let[r,o]=Vt(),[a,t]=Vt(),n=zo(!1);return Uo(()=>{typeof window=="undefined"||a||(typeof window.UniformMeshSDK=="undefined"&&!n.current?(n.current=!0,Mo({autoResizingDisabled:e}).then(i=>{t(i)}).catch(i=>{o(i)}).finally(()=>{n.current=!1})):t(window.UniformMeshSDK))},[e]),{initializing:!a&&!r,error:r,sdk:a}};function cs(e){let{location:r}=Ee();if(e&&r.type!==e)throw new Error(`Expected location type ${e} but got ${r.type}`);return r}import $o,{useMemo as Ue,useContext as Fo}from"react";import{css as Bo}from"@emotion/react";import{Icon as Ao,InputSelect as Ho}from"@uniformdev/design-system";import{CgClose as Go}from"react-icons/cg";import{Fragment as Dt,jsxs as Mt}from"@emotion/react/jsx-runtime";var Ut=({value:e,text:r,loading:o})=>Mt(Dt,{children:[!!r&&r,!r&&Mt(Dt,{children:[o&&`${e} (Loading...)`,!o&&`${e} (Unresolvable)`]})]});import{css as Ye}from"@emotion/react";var zt=Ye`
2
2
  align-items: center;
3
3
  background: var(--gray-100);
4
4
  border: 1px solid var(--gray-300);
@@ -7,66 +7,66 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
7
7
  justify-content: space-between;
8
8
  margin-bottom: var(--spacing-sm);
9
9
  margin-right: var(--spacing-sm);
10
- `,ht=Ge`
10
+ `,Bt=Ye`
11
11
  color: var(--gray-800);
12
12
  padding: var(--spacing-3);
13
- `,yt=Ge`
13
+ `,At=Ye`
14
14
  border: none;
15
15
  border-left: 1px solid var(--gray-300);
16
16
  background: var(--gray-100);
17
17
  padding: var(--spacing-3);
18
- `;import{jsx as ge,jsxs as bt}from"@emotion/react/jsx-runtime";var St=({id:e,label:r,loading:o,selectedValues:t,values:n,onAdd:a,onRemove:d})=>{var v;let f=(v=n==null?void 0:n.filter(i=>!(t!=null&&t.includes(i.id.toString()))))!=null?v:[],m=(i,p)=>{i.preventDefault(),d(p)};return bt("div",{children:[ge(Qo,{id:e,name:e,label:r,onChange:i=>a(i.target.value),disabled:o,options:[{value:"",label:"Add..."},...f.map(i=>({value:i.id,label:i.name||i.id}))],value:"",css:Array.isArray(t)&&t.length>0?Ko`
18
+ `;import{jsx as Re,jsxs as Ht}from"@emotion/react/jsx-runtime";var Gt=({id:e,label:r,loading:o,selectedValues:a,values:t,onAdd:n,onRemove:i})=>{var f;let g=(f=t==null?void 0:t.filter(s=>!(a!=null&&a.includes(s.id.toString()))))!=null?f:[],d=(s,m)=>{s.preventDefault(),i(m)};return Ht("div",{children:[Re(Ho,{id:e,name:e,label:r,onChange:s=>n(s.target.value),disabled:o,options:[{value:"",label:"Add..."},...g.map(s=>({value:s.id,label:s.name||s.id}))],value:"",css:Array.isArray(a)&&a.length>0?Bo`
19
19
  margin-bottom: var(--spacing-base);
20
- `:""}),t==null?void 0:t.map(i=>{var p;return bt("div",{css:vt,children:[ge("span",{css:ht,children:ge(ft,{value:i,loading:o,text:(p=n.find(h=>h.id===i))==null?void 0:p.name})}),ge("button",{css:yt,title:"remove",onClick:h=>m(h,i),children:ge(No,{icon:Wo,iconColor:"currentColor",size:20})})]},i)})]})};import{jsx as xt}from"@emotion/react/jsx-runtime";var _o=e=>xt("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:xt("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"})}),Ce=_o;import{jsx as wt}from"@emotion/react/jsx-runtime";var Zo=e=>wt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:wt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Pe=Zo;import{useAsyncFn as Yo,useDebounce as Jo}from"react-use";import{Input as Ct,InputSelect as Re,mq as ke}from"@uniformdev/design-system";import{css as L}from"@emotion/react";import{jsx as w,jsxs as se}from"@emotion/react/jsx-runtime";var Pt={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},bi=({value:e,setValue:r,brands:o,categories:t,loading:n,categoriesLoading:a,brandsLoading:d,logoIcon:f,onGetProducts:m,sortOptions:v,sortOrderOptions:i,categoryLabel:p="Product Category",brandLabel:h="Brand",disableBrands:z,restrictToSingleCategory:ae=!1})=>{var M,u,D;let S=async s=>{r({...Pt,...e||{},...s})},b=Le(()=>({...Pt,...e||{}}),[e]),[ie,ue]=Yo(async s=>await m(s),[m]);Jo(async()=>{await ue({brand:b.brand,categories:b.categories,keyword:b.keyword,sort:b.sort,sortOrder:b.sortOrder,count:b.count})},250,[b]);let O=Le(()=>{let s=[];return t==null||t.forEach(U=>{let C=Rt(U,void 0);s.push(...C)}),s},[t]),_=Le(()=>[{value:"",label:"All categories"},...O.map(s=>({label:s.name,value:s.id}))],[O]),W=Le(()=>(o==null?void 0:o.map(s=>({id:s.id.toString(),name:s.name})))||[],[o]),me=s=>{if(!s)return;let U=(e==null?void 0:e.categories)||[];S({categories:[...U,s]})},be=s=>{var U;S({categories:(U=e==null?void 0:e.categories)==null?void 0:U.filter(C=>C!==s)})},j=s=>{S({brand:s.target.value})},E=s=>{S({count:s||1})};return n?w("div",{children:"Loading..."}):w(kt.Provider,{value:{categories:t,logoIcon:f},children:se("div",{css:L`
20
+ `:""}),a==null?void 0:a.map(s=>{var m;return Ht("div",{css:zt,children:[Re("span",{css:Bt,children:Re(Ut,{value:s,loading:o,text:(m=t.find(c=>c.id===s))==null?void 0:m.name})}),Re("button",{css:At,title:"remove",onClick:c=>d(c,s),children:Re(Ao,{icon:Go,iconColor:"currentColor",size:20})})]},s)})]})};import{jsx as Ot}from"@emotion/react/jsx-runtime";var Oo=e=>Ot("svg",{width:"1em",height:"1em",viewBox:"0 0 46 46",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:Ot("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"})}),De=Oo;import{jsx as qt}from"@emotion/react/jsx-runtime";var qo=e=>qt("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:qt("path",{d:"M4 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Z",fill:"currentColor"})}),Me=qo;import{useAsyncFn as No,useDebounce as Wo}from"react-use";import{Input as $t,InputSelect as ze,mq as Be}from"@uniformdev/design-system";import{css as k}from"@emotion/react";import{jsx as C,jsxs as ge}from"@emotion/react/jsx-runtime";var Ft={count:1,categories:[],brand:"",keyword:"",sort:"date_modified",sortOrder:"desc"},$s=({value:e,setValue:r,brands:o,categories:a,loading:t,categoriesLoading:n,brandsLoading:i,logoIcon:g,onGetProducts:d,sortOptions:f,sortOrderOptions:s,categoryLabel:m="Product Category",brandLabel:c="Brand",disableBrands:y,restrictToSingleCategory:P=!1})=>{var D,v,z;let w=async p=>{r({...Ft,...e||{},...p})},S=Ue(()=>({...Ft,...e||{}}),[e]),[ue,Se]=No(async p=>await d(p),[d]);Wo(async()=>{await Se({brand:S.brand,categories:S.categories,keyword:S.keyword,sort:S.sort,sortOrder:S.sortOrder,count:S.count})},250,[S]);let q=Ue(()=>{let p=[];return a==null||a.forEach(A=>{let R=Wt(A,void 0);p.push(...R)}),p},[a]),ee=Ue(()=>[{value:"",label:"All categories"},...q.map(p=>({label:p.name,value:p.id}))],[q]),Z=Ue(()=>(o==null?void 0:o.map(p=>({id:p.id.toString(),name:p.name})))||[],[o]),Ce=p=>{if(!p)return;let A=(e==null?void 0:e.categories)||[];w({categories:[...A,p]})},_e=p=>{var A;w({categories:(A=e==null?void 0:e.categories)==null?void 0:A.filter(R=>R!==p)})},ie=p=>{w({brand:p.target.value})},E=p=>{w({count:p||1})};return t?C("div",{children:"Loading..."}):C(Kt.Provider,{value:{categories:a,logoIcon:g},children:ge("div",{css:k`
21
21
  > :not(:last-child) {
22
22
  margin-bottom: var(--spacing-md);
23
23
  }
24
- `,children:[ae?w(Re,{id:"selection-field-product-category",label:p,disabled:n,value:(u=(M=b.categories)==null?void 0:M[0])!=null?u:"",options:_,onChange:s=>{S({categories:s.target.value===""?[]:[s.target.value]})}}):w(St,{loading:a||!1,id:"selection-field-product-category",label:p,onAdd:me,onRemove:be,selectedValues:b.categories,values:O}),se("div",{css:L`
24
+ `,children:[P?C(ze,{id:"selection-field-product-category",label:m,disabled:t,value:(v=(D=S.categories)==null?void 0:D[0])!=null?v:"",options:ee,onChange:p=>{w({categories:p.target.value===""?[]:[p.target.value]})}}):C(Gt,{loading:n||!1,id:"selection-field-product-category",label:m,onAdd:Ce,onRemove:_e,selectedValues:S.categories,values:q}),ge("div",{css:k`
25
25
  display: flex;
26
26
  flex-wrap: wrap;
27
27
  column-gap: var(--spacing-lg);
28
28
  row-gap: var(--spacing-md);
29
- ${ke("md")} {
29
+ ${Be("md")} {
30
30
  flex-wrap: nowrap;
31
31
  }
32
- `,children:[z?null:w("div",{css:L`
32
+ `,children:[y?null:C("div",{css:k`
33
33
  width: 50%;
34
- `,children:w(Re,{id:"brand",name:"brand",label:h,disabled:d,value:b.brand,onChange:j,options:[{value:"",label:"Choose..."},...W.map(s=>({value:s.id,label:s.name}))]})}),w("div",{css:L`
34
+ `,children:C(ze,{id:"brand",name:"brand",label:c,disabled:i,value:S.brand,onChange:ie,options:[{value:"",label:"Choose..."},...Z.map(p=>({value:p.id,label:p.name}))]})}),C("div",{css:k`
35
35
  flex-grow: 1;
36
36
  position: relative;
37
- `,children:w(Ct,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:b.keyword,placeholder:"Enter keyword",onChange:s=>S({keyword:s.target.value})})})]}),se("div",{css:L`
37
+ `,children:C($t,{id:"keyword-search",name:"keyword-search",label:"Keyword",value:S.keyword,placeholder:"Enter keyword",onChange:p=>w({keyword:p.target.value})})})]}),ge("div",{css:k`
38
38
  display: flex;
39
39
  flex-wrap: wrap;
40
40
  column-gap: var(--spacing-lg);
41
41
  row-gap: var(--spacing-md);
42
- ${ke("md")} {
42
+ ${Be("md")} {
43
43
  flex-wrap: nowrap;
44
44
  }
45
- `,children:[se("div",{css:L`
45
+ `,children:[ge("div",{css:k`
46
46
  width: 100%;
47
- ${ke("md")} {
47
+ ${Be("md")} {
48
48
  width: 33.333333%;
49
49
  }
50
50
  position: relative;
51
- `,children:[w(Ct,{id:"count",name:"count",type:"number",min:1,step:1,value:b.count,onChange:s=>E(s.target.valueAsNumber),label:"Count"}),se("div",{css:L`
51
+ `,children:[C($t,{id:"count",name:"count",type:"number",min:1,step:1,value:S.count,onChange:p=>E(p.target.valueAsNumber),label:"Count"}),ge("div",{css:k`
52
52
  position: absolute;
53
53
  bottom: var(--spacing-sm);
54
54
  right: var(--spacing-sm);
55
55
  display: flex;
56
56
  gap: var(--spacing-sm);
57
- `,children:[w(Lt,{onCountChange:()=>E(b.count-1),countIcon:"decrement",disabled:b.count===1}),w(Lt,{onCountChange:()=>E(b.count+1),countIcon:"increment"})]})]}),Array.isArray(v)&&v.length>0?w("div",{css:L`
57
+ `,children:[C(Nt,{onCountChange:()=>E(S.count-1),countIcon:"decrement",disabled:S.count===1}),C(Nt,{onCountChange:()=>E(S.count+1),countIcon:"increment"})]})]}),Array.isArray(f)&&f.length>0?C("div",{css:k`
58
58
  flex-grow: 1;
59
- ${ke("md")} {
59
+ ${Be("md")} {
60
60
  width: 33.333333%;
61
61
  }
62
- `,children:w(Re,{id:"sort",name:"sort",label:"Sort",value:b.sort,onChange:s=>S({sort:s.target.value}),options:[{value:"",label:"Select a sort"},...v.map(s=>({value:s.sortKey,label:s.name}))]})}):null,Array.isArray(i)&&i.length>0?w("div",{css:L`
62
+ `,children:C(ze,{id:"sort",name:"sort",label:"Sort",value:S.sort,onChange:p=>w({sort:p.target.value}),options:[{value:"",label:"Select a sort"},...f.map(p=>({value:p.sortKey,label:p.name}))]})}):null,Array.isArray(s)&&s.length>0?C("div",{css:k`
63
63
  flex-grow: 1;
64
- `,children:w(Re,{id:"sort-order",name:"sort-order",label:"Sort Order",value:b.sortOrder,onChange:s=>S({sortOrder:s.target.value}),options:i.map(s=>({value:s.sortOrderKey,label:s.name}))})}):null]}),se("div",{children:[w("h3",{css:L`
64
+ `,children:C(ze,{id:"sort-order",name:"sort-order",label:"Sort Order",value:S.sortOrder,onChange:p=>w({sortOrder:p.target.value}),options:s.map(p=>({value:p.sortOrderKey,label:p.name}))})}):null]}),ge("div",{children:[C("h3",{css:k`
65
65
  font-size: var(--fs-md);
66
66
  line-height: var(--spacing-md);
67
67
  font-weight: var(--fw-bold);
68
68
  margin-bottom: var(--spacing-xs);
69
- `,children:"Result Preview"}),w(Tt,{products:(D=ie.value)==null?void 0:D.products})]})]})})};function Rt(e,r){var a;let o=[],t=r?`${r.name} > `:"",n={id:e.id.toString(),name:`${t}${e.name}`};return o.push(n),(a=e.children)==null||a.forEach(d=>{let f=Rt(d,n);o.push(...f)}),o}function Lt({onCountChange:e,countIcon:r,disabled:o}){return w("button",{css:L`
69
+ `,children:"Result Preview"}),C(Yt,{products:(z=ue.value)==null?void 0:z.products})]})]})})};function Wt(e,r){var n;let o=[],a=r?`${r.name} > `:"",t={id:e.id.toString(),name:`${a}${e.name}`};return o.push(t),(n=e.children)==null||n.forEach(i=>{let g=Wt(i,t);o.push(...g)}),o}function Nt({onCountChange:e,countIcon:r,disabled:o}){return C("button",{css:k`
70
70
  width: 2.25rem;
71
71
  height: 2.25rem;
72
72
  border: 1px solid var(--gray-300);
@@ -78,17 +78,17 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
78
78
  &:hover {
79
79
  background-color: var(--gray-200);
80
80
  }
81
- ${o?L`
81
+ ${o?k`
82
82
  cursor: not-allowed;
83
83
  opacity: 0.3;
84
84
  `:""}
85
- `,onClick:e,disabled:o,children:r==="increment"?w(Ce,{css:L`
85
+ `,onClick:e,disabled:o,children:r==="increment"?C(De,{css:k`
86
86
  width: 1rem;
87
87
  height: 1rem;
88
- `}):w(Pe,{css:L`
88
+ `}):C(Me,{css:k`
89
89
  width: 1rem;
90
90
  height: 1rem;
91
- `})})}var kt=Xo.createContext(void 0),It=()=>{let e=qo(kt);if(!e)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return e};import{jsx as Et}from"@emotion/react/jsx-runtime";function H({src:e,alt:r,className:o}){let t=e&&typeof e!="string"?e:null;return t?Et(t,{className:o}):Et("img",{src:e,alt:r,className:o})}import{css as Ht}from"@emotion/react";import{scrollbarStyles as jo}from"@uniformdev/design-system";import{css as $}from"@emotion/react";var Mt=$`
91
+ `})})}var Kt=$o.createContext(void 0),Qt=()=>{let e=Fo(Kt);if(!e)throw new Error("useProductQueryContext must be used within a <ProductQueryContext> provider");return e};import{jsx as Zt}from"@emotion/react/jsx-runtime";function $({src:e,alt:r,className:o}){let a=e&&typeof e!="string"?e:null;return a?Zt(a,{className:o}):Zt("img",{src:e,alt:r,className:o})}import{css as ir}from"@emotion/react";import{scrollbarStyles as Ko}from"@uniformdev/design-system";import{css as F}from"@emotion/react";var Xt=F`
92
92
  align-items: center;
93
93
  background: var(--white);
94
94
  border-radius: var(--rounded-base);
@@ -103,55 +103,55 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
103
103
  &:hover {
104
104
  background: var(--gray-50);
105
105
  }
106
- `,Vt=$`
106
+ `,Jt=F`
107
107
  font-size: var(--fs-sm);
108
- `,Dt=$`
108
+ `,jt=F`
109
109
  width: 1rem;
110
110
  height: 1rem;
111
- `,Be=$`
111
+ `,Ze=F`
112
112
  margin-right: var(--spacing-lg);
113
113
  font-size: var(--fs-sm);
114
- `,zt=$`
114
+ `,er=F`
115
115
  border: 1px solid var(--gray-200);
116
116
  border-radius: var(--rounded-md);
117
117
  background: var(--gray-50);
118
118
  margin: var(--spacing-base) 0;
119
- `,Ut=$`
119
+ `,tr=F`
120
120
  align-items: center;
121
121
  display: flex;
122
122
  flex-grow: 1;
123
123
  gap: var(--spacing-base);
124
124
  padding: var(--spacing-sm);
125
125
  margin-right: var(--spacing-sm);
126
- `,At=$`
126
+ `,rr=F`
127
127
  background: var(--gray-200);
128
128
  width: 3.5rem;
129
129
  height: 3.5rem;
130
130
  object-fit: cover;
131
- `,Gt=$`
131
+ `,ar=F`
132
132
  background: var(--gray-100);
133
133
  height: 3.5rem;
134
134
  width: 3.5rem;
135
- `,Bt=$`
135
+ `,or=F`
136
136
  margin-top: 0;
137
137
  font-weight: var(--fw-bold);
138
138
  font-size: var(--fs-sm);
139
139
  width: calc(100% / 3);
140
- `,Ot=$`
140
+ `,nr=F`
141
141
  display: block;
142
142
  font-weight: var(--fw-regular);
143
- `;import{Fragment as $t,jsx as q,jsxs as X}from"@emotion/react/jsx-runtime";var Tt=({products:e})=>{let{categories:r,logoIcon:o}=It();return X($t,{children:[X("p",{css:Ht`
143
+ `;import{Fragment as sr,jsx as ae,jsxs as re}from"@emotion/react/jsx-runtime";var Yt=({products:e})=>{let{categories:r,logoIcon:o}=Qt();return re(sr,{children:[re("p",{css:ir`
144
144
  margin-bottom: var(--spacing-base);
145
- `,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),q("ul",{css:[Ht`
145
+ `,children:["Matching ",(e==null?void 0:e.length)||0," products"]}),ae("ul",{css:[ir`
146
146
  max-height: 24rem;
147
147
  overflow-x: auto;
148
- `,jo],children:e==null?void 0:e.map((t,n)=>{var f,m;let[a]=(t==null?void 0:t.categories)||[],d=typeof a=="undefined"||!r||(f=r.find(v=>v.id===a.id))==null?void 0:f.name;return q("li",{css:zt,children:X("div",{css:Ut,"data-test-id":`product-item-${t.sku||t.id}`,children:[t.thumbnailUrl?q("img",{src:t.thumbnailUrl,alt:typeof t.title=="string"?t.title:t.name||`Product ${n}`,css:At,"data-test-id":"product-image"}):q("div",{css:Gt}),X("h4",{css:Bt,"data-test-id":"product-name",children:[t.title||t.name,d&&q("span",{css:Ot,children:d})]}),t&&X($t,{children:[X("p",{css:Be,"data-test-id":"product-sku",children:["SKU: ",t.sku||t.id,q("br",{})]}),t.price!==void 0?X("p",{css:Be,"data-test-id":"product-price",children:["Price: ",t.price]}):null,t.editLink||t.url?X("a",{css:Mt,href:(m=t.editLink)!=null?m:t.url,title:`Go to ${t.title||t.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[q("span",{css:Vt,children:"Edit"}),o?q(H,{src:o,alt:"Logo",css:Dt}):null]}):null]})]})},`product-${t.id}`)})})]})};import Nn,{useContext as Qn,useMemo as Wn,useRef as _n}from"react";import*as N from"react";var He={};Eo(He,{Caution:()=>Kt,Checkmark:()=>Ie,ChevronDown:()=>Te,Close:()=>Wt,Danger:()=>Zt,ExclamationPoint:()=>qt,Info:()=>Ee,Lightbulb:()=>jt,MagnifyingGlass:()=>tr,MaximizeAlt:()=>or,Minus:()=>Pe,MoreVerticalAlt:()=>ve,Plus:()=>Ce});import{jsx as Ft}from"@emotion/react/jsx-runtime";var en=e=>Ft("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:Ft("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"})}),Kt=en;import{jsx as Nt}from"@emotion/react/jsx-runtime";var tn=e=>Nt("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:Nt("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"})}),Ie=tn;import{jsx as Qt}from"@emotion/react/jsx-runtime";var rn=e=>Qt("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:Qt("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"})}),Te=rn;import{jsx as Oe,jsxs as nn}from"@emotion/react/jsx-runtime";var on=e=>Oe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:nn("g",{fillRule:"evenodd",children:[Oe("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"}),Oe("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"})]})}),Wt=on;import{jsx as _t}from"@emotion/react/jsx-runtime";var an=e=>_t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:_t("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"})}),Zt=an;import{jsx as Xt}from"@emotion/react/jsx-runtime";var sn=e=>Xt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:Xt("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"})}),qt=sn;import{jsx as Yt,jsxs as dn}from"@emotion/react/jsx-runtime";var cn=e=>dn("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[Yt("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"}),Yt("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"})]}),Ee=cn;import{jsx as Jt}from"@emotion/react/jsx-runtime";var ln=e=>Jt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:Jt("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"})}),jt=ln;import{jsx as fe,jsxs as er}from"@emotion/react/jsx-runtime";var pn=e=>er("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[er("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[fe("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"}),fe("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"})]}),fe("defs",{children:fe("clipPath",{id:"magnifying-glass_svg__a",children:fe("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),tr=pn;import{jsx as rr}from"@emotion/react/jsx-runtime";var un=e=>rr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:rr("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"})}),or=un;import{jsx as nr}from"@emotion/react/jsx-runtime";var mn=e=>nr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:nr("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"})}),ve=mn;import{useDebounce as Rn}from"react-use";import{v4 as kn}from"uuid";import{useState as fn,useRef as mr,useEffect as vn}from"react";function Me(e,r){let o=window.open(e,"_blank"),t=setInterval(()=>{o!=null&&o.closed&&(clearInterval(t),r())},500)}import{format as hn}from"timeago.js";import{css as A}from"@emotion/react";import{mq as gn}from"@uniformdev/design-system";var ar=A`
148
+ `,Ko],children:e==null?void 0:e.map((a,t)=>{var g,d;let[n]=(a==null?void 0:a.categories)||[],i=typeof n=="undefined"||!r||(g=r.find(f=>f.id===n.id))==null?void 0:g.name;return ae("li",{css:er,children:re("div",{css:tr,"data-test-id":`product-item-${a.sku||a.id}`,children:[a.thumbnailUrl?ae("img",{src:a.thumbnailUrl,alt:typeof a.title=="string"?a.title:a.name||`Product ${t}`,css:rr,"data-test-id":"product-image"}):ae("div",{css:ar}),re("h4",{css:or,"data-test-id":"product-name",children:[a.title||a.name,i&&ae("span",{css:nr,children:i})]}),a&&re(sr,{children:[re("p",{css:Ze,"data-test-id":"product-sku",children:["SKU: ",a.sku||a.id,ae("br",{})]}),a.price!==void 0?re("p",{css:Ze,"data-test-id":"product-price",children:["Price: ",a.price]}):null,a.editLink||a.url?re("a",{css:Xt,href:(d=a.editLink)!=null?d:a.url,title:`Go to ${a.title||a.name}`,target:"_blank",rel:"noopener noreferrer","data-test-id":"edit-product-button",children:[ae("span",{css:Jt,children:"Edit"}),o?ae($,{src:o,alt:"Logo",css:jt}):null]}):null]})]})},`product-${a.id}`)})})]})};import An,{useContext as Hn,useMemo as Gn,useRef as On}from"react";import*as K from"react";var Je={};Ro(Je,{Caution:()=>dr,Checkmark:()=>Ae,ChevronDown:()=>He,Close:()=>ur,Danger:()=>mr,ExclamationPoint:()=>vr,Info:()=>Ge,Lightbulb:()=>br,MagnifyingGlass:()=>wr,MaximizeAlt:()=>Cr,Minus:()=>Me,MoreVerticalAlt:()=>Te,Plus:()=>De});import{jsx as lr}from"@emotion/react/jsx-runtime";var Qo=e=>lr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",...e,children:lr("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"})}),dr=Qo;import{jsx as cr}from"@emotion/react/jsx-runtime";var Yo=e=>cr("svg",{width:"1em",height:"1em",viewBox:"0 0 40 40",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:cr("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=Yo;import{jsx as pr}from"@emotion/react/jsx-runtime";var Zo=e=>pr("svg",{viewBox:"0 0 24 24",width:"1em",height:"1em",...e,children:pr("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"})}),He=Zo;import{jsx as Xe,jsxs as Jo}from"@emotion/react/jsx-runtime";var Xo=e=>Xe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 19 19",fill:"currentColor",...e,children:Jo("g",{fillRule:"evenodd",children:[Xe("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"}),Xe("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"})]})}),ur=Xo;import{jsx as gr}from"@emotion/react/jsx-runtime";var jo=e=>gr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:gr("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"})}),mr=jo;import{jsx as fr}from"@emotion/react/jsx-runtime";var en=e=>fr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 14 16",fill:"currentColor",...e,children:fr("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"})}),vr=en;import{jsx as hr,jsxs as rn}from"@emotion/react/jsx-runtime";var tn=e=>rn("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:[hr("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"}),hr("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"})]}),Ge=tn;import{jsx as yr}from"@emotion/react/jsx-runtime";var an=e=>yr("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",...e,children:yr("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"})}),br=an;import{jsx as Pe,jsxs as xr}from"@emotion/react/jsx-runtime";var on=e=>xr("svg",{width:"1em",height:"1em",viewBox:"0 0 26 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:[xr("g",{clipPath:"url(#magnifying-glass_svg__a)",children:[Pe("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"}),Pe("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"})]}),Pe("defs",{children:Pe("clipPath",{id:"magnifying-glass_svg__a",children:Pe("path",{fill:"#fff",transform:"translate(.558)",d:"M0 0h24.935v24H0z"})})})]}),wr=on;import{jsx as Sr}from"@emotion/react/jsx-runtime";var nn=e=>Sr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:Sr("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"})}),Cr=nn;import{jsx as Rr}from"@emotion/react/jsx-runtime";var sn=e=>Rr("svg",{width:"1em",height:"1em",fill:"currentColor",...e,children:Rr("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=sn;import{useDebounce as xn}from"react-use";import{v4 as wn}from"uuid";import{useState as dn,useRef as Dr,useEffect as cn}from"react";function Oe(e,r){let o=window.open(e,"_blank"),a=setInterval(()=>{o!=null&&o.closed&&(clearInterval(a),r())},500)}import{format as pn}from"timeago.js";import{css as H}from"@emotion/react";import{mq as ln}from"@uniformdev/design-system";var Pr=H`
149
149
  border: 1px solid var(--gray-200);
150
150
  background: var(--gray-50);
151
151
  border-radius: var(--rounded-base);
152
152
  display: flex;
153
153
  width: 100%;
154
- `,ir=A`
154
+ `,Tr=H`
155
155
  align-items: center;
156
156
  display: flex;
157
157
  flex-grow: 1;
@@ -159,22 +159,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
159
159
  margin-inline: 0 var(--spacing-sm);
160
160
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
161
161
  position: relative;
162
- `,sr=A`
162
+ `,kr=H`
163
163
  flex-grow: 1;
164
- `,cr=A`
164
+ `,Lr=H`
165
165
  align-items: start;
166
166
  display: inline-flex;
167
167
  position: relative;
168
- `,dr=A`
168
+ `,_r=H`
169
169
  color: var(--brand-secondary-1);
170
170
  font-size: var(--fs-base);
171
171
  font-weight: var(--fw-bold);
172
172
  line-height: 1;
173
173
  margin: 0;
174
- `,lr=A`
174
+ `,Ir=H`
175
175
  width: 1.5rem;
176
176
  height: 1.5rem;
177
- `,pr=A`
177
+ `,Vr=H`
178
178
  background: var(--white);
179
179
  border-radius: var(--rounded-base);
180
180
  border-left: 4px solid var(--brand-secondary-3);
@@ -183,22 +183,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
183
183
  padding: var(--spacing-base);
184
184
  z-index: var(--z-10);
185
185
  width: max-content;
186
- `,te=A`
186
+ `,le=H`
187
187
  font-size: var(--fs-sm);
188
- `,he=A`
188
+ `,ke=H`
189
189
  font-weight: var(--fw-bold);
190
190
  margin-right: var(--spacing-sm);
191
- `,ur=A`
191
+ `,Er=H`
192
192
  display: flex;
193
193
  flex-direction: column;
194
194
  gap: var(--spacing-sm);
195
195
 
196
- ${gn("md")} {
196
+ ${ln("md")} {
197
197
  flex-direction: row;
198
198
  min-width: 200px;
199
199
  justify-content: end;
200
200
  }
201
- `,$e=A`
201
+ `,je=H`
202
202
  align-items: center;
203
203
  background: var(--white);
204
204
  border-radius: var(--rounded-base);
@@ -213,39 +213,39 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
213
213
  &:hover {
214
214
  background: var(--gray-50);
215
215
  }
216
- `;import{css as Y}from"@emotion/react";import{Icon as gr}from"@uniformdev/design-system";import{CgClose as yn,CgInfo as bn}from"react-icons/cg";import{Fragment as Sn,jsx as F,jsxs as R}from"@emotion/react/jsx-runtime";var fr=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:t})=>{var v;let n=mr(null),a=mr(null),[d,f]=fn(!1);vn(()=>{let i=h=>{n.current&&!n.current.contains(h.target)&&a.current&&!a.current.contains(h.target)&&f(!1)},p=()=>{f(!1)};return window.addEventListener("resize",p,!0),document.addEventListener("scroll",i,!0),document.addEventListener("mousedown",i),()=>{window.removeEventListener("resize",p,!0),document.removeEventListener("scroll",i,!0),document.removeEventListener("mousedown",i)}},[a]);let m=()=>{var i;if(f(!d),a.current&&n.current){let p=(i=n==null?void 0:n.current)==null?void 0:i.getBoundingClientRect(),h=a.current.offsetWidth;a.current.style.top=`${p.top+30}px`,a.current.style.left=`${p.left-h+30}px`}};return F("div",{css:ar,children:R("div",{css:ir,children:[R("div",{css:sr,children:[R("div",{css:cr,children:[F("h4",{css:[dr,e.popoverData?Y`
216
+ `;import{css as oe}from"@emotion/react";import{Icon as Mr}from"@uniformdev/design-system";import{CgClose as un,CgInfo as gn}from"react-icons/cg";import{Fragment as mn,jsx as N,jsxs as L}from"@emotion/react/jsx-runtime";var Ur=({selectedItem:e,logoIcon:r,onDeselect:o,onEditClosed:a})=>{var f;let t=Dr(null),n=Dr(null),[i,g]=dn(!1);cn(()=>{let s=c=>{t.current&&!t.current.contains(c.target)&&n.current&&!n.current.contains(c.target)&&g(!1)},m=()=>{g(!1)};return window.addEventListener("resize",m,!0),document.addEventListener("scroll",s,!0),document.addEventListener("mousedown",s),()=>{window.removeEventListener("resize",m,!0),document.removeEventListener("scroll",s,!0),document.removeEventListener("mousedown",s)}},[n]);let d=()=>{var s;if(g(!i),n.current&&t.current){let m=(s=t==null?void 0:t.current)==null?void 0:s.getBoundingClientRect(),c=n.current.offsetWidth;n.current.style.top=`${m.top+30}px`,n.current.style.left=`${m.left-c+30}px`}};return N("div",{css:Pr,children:L("div",{css:Tr,children:[L("div",{css:kr,children:[L("div",{css:Lr,children:[N("h4",{css:[_r,e.popoverData?oe`
217
217
  margin-bottom: var(--spacing-sm);
218
- `:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?R(Sn,{children:[F("button",{type:"button",ref:n,css:Y`
218
+ `:""],title:`ID: ${e.id}`,"data-test-id":"entry-id",children:e.title||e.id||""}),e.popoverData?L(mn,{children:[N("button",{type:"button",ref:t,css:oe`
219
219
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
220
- `,"aria-controls":"path-details","aria-expanded":d,onClick:m,children:F(gr,{icon:bn,iconColor:"gray",size:24,css:Y`
220
+ `,"aria-controls":"path-details","aria-expanded":i,onClick:d,children:N(Mr,{icon:gn,iconColor:"gray",size:24,css:oe`
221
221
  opacity: var(--opacity-75);
222
- `})}),F("div",{id:"path-details","aria-hidden":!d,ref:a,css:[pr,d?Y`
222
+ `})}),N("div",{id:"path-details","aria-hidden":!i,ref:n,css:[Vr,i?oe`
223
223
  visibility: visible;
224
- `:Y`
224
+ `:oe`
225
225
  visibility: hidden;
226
- `],children:Object.entries(e.popoverData).map(([i,p],h)=>R("div",{css:te,children:[R("span",{css:he,children:[i,":"]}),p]},h))})]}):null]}),e.createdDate&&R("div",{css:te,children:[F("span",{css:he,children:"Created:"}),hn((v=e.createdDate)!=null?v:0)]}),e.metadata?Object.entries(e.metadata).filter(([i])=>["type","status"].includes(i.toLocaleLowerCase())).map(([i,p])=>R("div",{css:[te,Y`
226
+ `],children:Object.entries(e.popoverData).map(([s,m],c)=>L("div",{css:le,children:[L("span",{css:ke,children:[s,":"]}),m]},c))})]}):null]}),e.createdDate&&L("div",{css:le,children:[N("span",{css:ke,children:"Created:"}),pn((f=e.createdDate)!=null?f:0)]}),e.metadata?Object.entries(e.metadata).filter(([s])=>["type","status"].includes(s.toLocaleLowerCase())).map(([s,m])=>L("div",{css:[le,oe`
227
227
  order: 1;
228
- `],children:[R("span",{css:he,children:[i,":"]}),p]},i)):null,e.metadata?Object.entries(e.metadata).filter(([i])=>!["type","status"].includes(i.toLocaleLowerCase())).map(([i,p])=>R("div",{css:[te,Y`
228
+ `],children:[L("span",{css:ke,children:[s,":"]}),m]},s)):null,e.metadata?Object.entries(e.metadata).filter(([s])=>!["type","status"].includes(s.toLocaleLowerCase())).map(([s,m])=>L("div",{css:[le,oe`
229
229
  order: 1;
230
- `],children:[R("span",{css:[he,Y`
230
+ `],children:[L("span",{css:[ke,oe`
231
231
  order: 1;
232
- `],children:[i,":"]}),p]},i)):null]}),R("div",{css:ur,children:[e.editLink?R("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:i=>{t&&(Me(i.currentTarget.href,()=>t(e)),i.preventDefault())},css:$e,children:[F("span",{css:te,children:"Edit"}),F(H,{src:r,css:lr,alt:"Logo"})]}):null,R("button",{type:"button",onClick:()=>{o(e)},css:$e,children:[F("span",{css:te,children:"Unlink"}),F(gr,{icon:yn,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as xn,useRef as xr,useEffect as wn}from"react";import{css as re}from"@emotion/react";var vr=re`
232
+ `],children:[s,":"]}),m]},s)):null]}),L("div",{css:Er,children:[e.editLink?L("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:s=>{a&&(Oe(s.currentTarget.href,()=>a(e)),s.preventDefault())},css:je,children:[N("span",{css:le,children:"Edit"}),N($,{src:r,css:Ir,alt:"Logo"})]}):null,L("button",{type:"button",onClick:()=>{o(e)},css:je,children:[N("span",{css:le,children:"Unlink"}),N(Mr,{icon:un,iconColor:"red",size:16})]})]})]})},e.id)};import{useState as fn,useRef as Or,useEffect as vn}from"react";import{css as de}from"@emotion/react";var zr=de`
233
233
  cursor: pointer;
234
234
  padding: var(--spacing-sm);
235
235
  position: relative;
236
236
  transition: background-color var(--duration-fast) var(--timing-ease-out),
237
237
  color var(--duration-fast) var(--timing-ease-out);
238
- `,hr=re`
238
+ `,Br=de`
239
239
  padding-right: var(--spacing-lg);
240
- `,yr=re`
240
+ `,Ar=de`
241
241
  background: var(--brand-secondary-3);
242
242
  color: var(--white);
243
- `,Fe=re`
243
+ `,et=de`
244
244
  font-size: var(--fs-xs);
245
- `,Ke=re`
245
+ `,tt=de`
246
246
  font-weight: var(--fw-bold);
247
247
  margin-right: var(--spacing-sm);
248
- `,br=re`
248
+ `,Hr=de`
249
249
  background: var(--white);
250
250
  border-left: 4px solid var(--brand-secondary-3);
251
251
  border-radius: var(--rounded-base);
@@ -257,20 +257,20 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
257
257
  right: var(--spacing-xl);
258
258
  z-index: var(--z-10);
259
259
  width: max-content;
260
- `,Sr=re`
260
+ `,Gr=de`
261
261
  position: absolute;
262
262
  inset: 0 var(--spacing-sm) 0 auto;
263
- `;import{css as wr}from"@emotion/react";import{Fragment as Cn,jsx as Cr,jsxs as oe}from"@emotion/react/jsx-runtime";var Pr=({result:e,isSelected:r,triggerSelection:o})=>{let t=xr(null),n=xr(null),[a,d]=xn(!1);wn(()=>{function m(v){t.current&&!t.current.contains(v.target)&&n.current&&!n.current.contains(v.target)&&d(!1)}return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[n]);let f=m=>{m.stopPropagation(),d(!a)};return oe("div",{css:[vr,r?yr:void 0,e.popoverData?hr:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?oe(Cn,{children:[Cr("button",{type:"button",ref:t,css:Sr,"aria-controls":"path-details",onClick:m=>f(m),"aria-expanded":a,children:Cr(Ee,{width:24,height:24})}),oe("div",{id:"path-details","aria-hidden":!a,ref:n,css:[br,a?wr`
263
+ `;import{css as qr}from"@emotion/react";import{Fragment as hn,jsx as $r,jsxs as ce}from"@emotion/react/jsx-runtime";var Fr=({result:e,isSelected:r,triggerSelection:o})=>{let a=Or(null),t=Or(null),[n,i]=fn(!1);vn(()=>{function d(f){a.current&&!a.current.contains(f.target)&&t.current&&!t.current.contains(f.target)&&i(!1)}return document.addEventListener("mousedown",d),()=>{document.removeEventListener("mousedown",d)}},[t]);let g=d=>{d.stopPropagation(),i(!n)};return ce("div",{css:[zr,r?Ar:void 0,e.popoverData?Br:void 0],"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),children:[e.title,e.popoverData&&r?ce(hn,{children:[$r("button",{type:"button",ref:a,css:Gr,"aria-controls":"path-details",onClick:d=>g(d),"aria-expanded":n,children:$r(Ge,{width:24,height:24})}),ce("div",{id:"path-details","aria-hidden":!n,ref:t,css:[Hr,n?qr`
264
264
  visibility: visible;
265
- `:wr`
265
+ `:qr`
266
266
  visibility: hidden;
267
- `],children:[e.metadata&&Object.entries(e.metadata).map(([m,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[m,":"]}),v]},i)),Object.entries(e.popoverData).map(([m,v],i)=>oe("div",{css:Fe,children:[oe("span",{css:Ke,children:[m,":"]}),v]},i))]})]}):null]},e.id)};import{Droppable as In,DragDropContext as Tn,Draggable as En}from"react-beautiful-dnd";import{css as P}from"@emotion/react";var Lr=P`
267
+ `],children:[e.metadata&&Object.entries(e.metadata).map(([d,f],s)=>ce("div",{css:et,children:[ce("span",{css:tt,children:[d,":"]}),f]},s)),Object.entries(e.popoverData).map(([d,f],s)=>ce("div",{css:et,children:[ce("span",{css:tt,children:[d,":"]}),f]},s))]})]}):null]},e.id)};import{Droppable as Sn,DragDropContext as Cn,Draggable as Rn}from"react-beautiful-dnd";import{css as T}from"@emotion/react";var Nr=T`
268
268
  background: var(--white);
269
269
  border: 1px solid var(--gray-300);
270
270
  border-radius: var(--rounded-base);
271
271
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-sm);
272
272
  margin-bottom: var(--spacing-base);
273
- `,Rr=P`
273
+ `,Wr=T`
274
274
  align-items: center;
275
275
  display: flex;
276
276
  position: relative;
@@ -278,7 +278,7 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
278
278
  width: 100%;
279
279
  background-color: transparent;
280
280
  border: 0;
281
- `,kr=P`
281
+ `,Kr=T`
282
282
  color: var(--brand-secondary-1);
283
283
  display: block;
284
284
  font-weight: var(--fw-bold);
@@ -294,15 +294,15 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
294
294
  background: var(--gray-100);
295
295
  outline: none;
296
296
  }
297
- `,Ir=P`
297
+ `,Qr=T`
298
298
  background: var(--white);
299
299
  border: 1px solid var(--gray-300);
300
300
  border-radius: var(--rounded-base);
301
301
  padding: calc(var(--spacing-base) - 0.25rem) var(--spacing-base);
302
302
  display: block;
303
- `,Tr=P`
303
+ `,Yr=T`
304
304
  display: none;
305
- `,Er=P`
305
+ `,Zr=T`
306
306
  overflow-y: auto;
307
307
  height: 16rem;
308
308
  margin-bottom: var(--spacing-base);
@@ -311,26 +311,26 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
311
311
  & > :not(:last-child) {
312
312
  border-bottom: 1px solid var(--gray-200);
313
313
  }
314
- `,ic=P`
314
+ `,Id=T`
315
315
  background-color: var(--gray-50);
316
316
  max-width: 33.33%;
317
- `,Mr=P`
317
+ `,Xr=T`
318
318
  align-items: center;
319
319
  display: flex;
320
320
  position: absolute;
321
321
  inset: 0 0 0 auto;
322
322
  pointer-events: none;
323
323
  padding-right: var(--spacing-sm);
324
- `,Vr=P`
324
+ `,Jr=T`
325
325
  color: var(--brand-secondary-1);
326
326
  width: 1.25rem;
327
327
  height: 1.25rem;
328
328
  transition: transform var(--duration-fast) var(--timing-ease-out);
329
329
  transform: rotate(0);
330
- `,sc=P`
330
+ `,Vd=T`
331
331
  background: var(--white);
332
332
  color: var(--brand-secondary-1);
333
- `,Dr=P`
333
+ `,jr=T`
334
334
  position: relative;
335
335
  margin-block: var(--spacing-sm) 0;
336
336
 
@@ -342,96 +342,96 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
342
342
  left: auto !important;
343
343
  top: auto !important;
344
344
  }
345
- `,zr=P`
345
+ `,ea=T`
346
346
  align-items: center;
347
347
  display: flex;
348
348
  position: absolute;
349
349
  inset: 0 auto 0 0;
350
350
  margin-block: auto;
351
351
  opacity: 0;
352
- `,Ne=P`
352
+ `,rt=T`
353
353
  color: var(--brand-secondary-1);
354
- `,Ur=P`
354
+ `,ta=T`
355
355
  position: absolute;
356
356
  left: 0.375rem;
357
- `,Qe=P`
357
+ `,at=T`
358
358
  width: calc(var(--spacing-lg) + var(--spacing-xs));
359
359
  height: calc(var(--spacing-lg) + var(--spacing-xs));
360
- `;import{css as K}from"@emotion/react";import{InputSelect as Mn,scrollbarStyles as Vn,Button as We,Callout as Dn,InputKeywordSearch as zn,LoadingIndicator as Un,Menu as An,MenuItem as Gn,LoadingOverlay as Bn}from"@uniformdev/design-system";import{useState as Pn,useEffect as Ar,useRef as Ln}from"react";function Gr(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[t,n]=Pn("IDLE"),a=Ln(void 0);return Ar(()=>{e&&t==="IDLE"&&(clearTimeout(a.current),a.current=setTimeout(()=>{if(!e)return n("IDLE");a.current=setTimeout(()=>{n("EXPIRE")},o),n("DISPLAY")},r),n("DELAY")),!e&&t!=="DISPLAY"&&(clearTimeout(a.current),n("IDLE"))},[e,t,r,o]),Ar(()=>()=>clearTimeout(a.current),[]),t==="DISPLAY"||t==="EXPIRE"}import{Fragment as Hn,jsx as g,jsxs as G}from"@emotion/react/jsx-runtime";var On=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),g(Dn,{type:"info",children:o})},Br=({search:e,results:r,contentTypes:o,selectedItems:t,logoIcon:n,select:a,multiSelect:d,multiSelectId:f,rowComponent:m,selectedItemComponent:v,totalResults:i,cursor:p,resultsLoading:h,requireContentType:z,onAddNew:ae,onEditClosed:S,onCancel:b,noResultsComponent:ie,helpComponent:ue,onSort:O,typeSelectorLabel:_="Content Type Select",typeSelectorAllTypesOptionText:W="All content types",loadingIndicatorDelay:me=1e3})=>{var nt,at,it;let j=()=>z?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[E,M]=N.useState(""),[u,D]=N.useState(j),[s,U]=N.useState(!1),[C,ee]=N.useState([]),[fo,et]=N.useState(!1),ze=N.useRef(`x${kn()}`);Rn(()=>{e(E,{count:5,offset:0,contentType:u==="any"?void 0:u})},300,[E,u]);let vo=Gr(h,{delay:me}),ho=c=>{C.some(y=>y.id===c.id)?ee(y=>y.filter(Z=>Z.id!==c.id)):ee(d?y=>[...y,c]:[c])},yo=t==null?void 0:t.map(c=>c.id+c.title).join(",");N.useEffect(()=>{Array.isArray(t)&&ee(t)},[yo]);let bo=()=>{D(j()),M(""),ee(t!=null&&t.length?t:[])},So=()=>{U(c=>!c),s||bo()},tt=c=>{let y=(C==null?void 0:C.filter(Z=>Z.id!==c.id))||[];ee(y),a(y,"")},xo=c=>{c.preventDefault(),a(C,u),U(!1)},wo=c=>{c.preventDefault(),U(!1),b&&b()},Co=()=>{e(E,{count:5,offset:(r==null?void 0:r.length)||0,contentType:u==="any"?void 0:u,cursor:p}),et(!0);let c=setTimeout(()=>{et(!1)},750);return()=>clearTimeout(c)},Po=!(t==null?void 0:t.length)||d,Lo=m||Pr,rt=v||fr,Ro=ie||On,ot=n&&typeof n!="string"?n:null,ko=ot?g(ot,{css:Qe}):g("img",{src:n,alt:"Logo",css:Qe}),Io=c=>{var y,Z;if(c.destination&&c.source.droppableId===((y=c.destination)==null?void 0:y.droppableId)){let V=[...t||[]],[Ue]=(Z=V==null?void 0:V.splice(c.source.index,1))!=null?Z:[];return V==null||V.splice(c.destination.index,0,Ue),O&&(ee(V),O==null||O(V)),V}};return g("div",{css:K`
360
+ `;import{css as W}from"@emotion/react";import{InputSelect as Pn,scrollbarStyles as Tn,Button as ot,Callout as kn,InputKeywordSearch as Ln,LoadingIndicator as _n,Menu as In,MenuItem as Vn,LoadingOverlay as En}from"@uniformdev/design-system";import{useState as yn,useEffect as ra,useRef as bn}from"react";function aa(e,{delay:r=500,minDuration:o=200}={delay:500,minDuration:200}){let[a,t]=yn("IDLE"),n=bn(void 0);return ra(()=>{e&&a==="IDLE"&&(clearTimeout(n.current),n.current=setTimeout(()=>{if(!e)return t("IDLE");n.current=setTimeout(()=>{t("EXPIRE")},o),t("DISPLAY")},r),t("DELAY")),!e&&a!=="DISPLAY"&&(clearTimeout(n.current),t("IDLE"))},[e,a,r,o]),ra(()=>()=>clearTimeout(n.current),[]),a==="DISPLAY"||a==="EXPIRE"}import{Fragment as Mn,jsx as h,jsxs as G}from"@emotion/react/jsx-runtime";var Dn=({searchText:e,selectedContentType:r})=>{let o="No content found";return r&&r!=="any"&&(o=`No ${r} content was found`),e&&(o=`${o} for keyword '${e}'.`),h(kn,{type:"info",children:o})},oa=({search:e,results:r,contentTypes:o,selectedItems:a,logoIcon:t,select:n,multiSelect:i,multiSelectId:g,rowComponent:d,selectedItemComponent:f,totalResults:s,cursor:m,resultsLoading:c,requireContentType:y,onAddNew:P,onEditClosed:w,onCancel:S,noResultsComponent:ue,helpComponent:Se,onSort:q,typeSelectorLabel:ee="Content Type Select",typeSelectorAllTypesOptionText:Z="All content types",loadingIndicatorDelay:Ce=1e3})=>{var Rt,Pt,Tt;let ie=()=>y?Array.isArray(o)&&o.length>0?o[0].id:"":"any",[E,D]=K.useState(""),[v,z]=K.useState(ie),[p,A]=K.useState(!1),[R,se]=K.useState([]),[lo,xt]=K.useState(!1),We=K.useRef(`x${wn()}`);xn(()=>{e(E,{count:5,offset:0,contentType:v==="any"?void 0:v})},300,[E,v]);let co=aa(c,{delay:Ce}),po=u=>{R.some(x=>x.id===u.id)?se(x=>x.filter(te=>te.id!==u.id)):se(i?x=>[...x,u]:[u])},uo=a==null?void 0:a.map(u=>u.id+u.title).join(",");K.useEffect(()=>{Array.isArray(a)&&se(a)},[uo]);let go=()=>{z(ie()),D(""),se(a!=null&&a.length?a:[])},mo=()=>{A(u=>!u),p||go()},wt=u=>{let x=(R==null?void 0:R.filter(te=>te.id!==u.id))||[];se(x),n(x,"")},fo=u=>{u.preventDefault(),n(R,v),A(!1)},vo=u=>{u.preventDefault(),A(!1),S&&S()},ho=()=>{e(E,{count:5,offset:(r==null?void 0:r.length)||0,contentType:v==="any"?void 0:v,cursor:m}),xt(!0);let u=setTimeout(()=>{xt(!1)},750);return()=>clearTimeout(u)},yo=!(a==null?void 0:a.length)||i,bo=d||Fr,St=f||Ur,xo=ue||Dn,Ct=t&&typeof t!="string"?t:null,wo=Ct?h(Ct,{css:at}):h("img",{src:t,alt:"Logo",css:at}),So=u=>{var x,te;if(u.destination&&u.source.droppableId===((x=u.destination)==null?void 0:x.droppableId)){let M=[...a||[]],[Ke]=(te=M==null?void 0:M.splice(u.source.index,1))!=null?te:[];return M==null||M.splice(u.destination.index,0,Ke),q&&(se(M),q==null||q(M)),M}};return h("div",{css:W`
361
361
  width: 100%;
362
- `,children:G("div",{css:K`
362
+ `,children:G("div",{css:W`
363
363
  position: relative;
364
364
  margin-block: var(--spacing-base);
365
- `,children:[Po?G(Hn,{children:[g("div",{css:Lr,"data-test-id":"component-search",children:G("button",{css:Rr,onClick:So,type:"button","aria-haspopup":!0,"aria-expanded":s,"aria-controls":`entry-search-config-${ze.current}`,children:[ko,g("span",{css:K`
365
+ `,children:[yo?G(Mn,{children:[h("div",{css:Nr,"data-test-id":"component-search",children:G("button",{css:Wr,onClick:mo,type:"button","aria-haspopup":!0,"aria-expanded":p,"aria-controls":`entry-search-config-${We.current}`,children:[wo,h("span",{css:W`
366
366
  margin-left: var(--spacing-base);
367
- `,children:"Select"}),g("span",{css:Mr,children:g(Te,{css:[Vr,s?K`
367
+ `,children:"Select"}),h("span",{css:Xr,children:h(He,{css:[Jr,p?W`
368
368
  transform: rotate(180deg);
369
- `:void 0]})})]})}),G("div",{id:`entry-search-config-${ze.current}`,"aria-hidden":!s,css:[Ir,s?void 0:Tr],children:[ue||null,G("div",{css:K`
369
+ `:void 0]})})]})}),G("div",{id:`entry-search-config-${We.current}`,"aria-hidden":!p,css:[Qr,p?void 0:Yr],children:[Se||null,G("div",{css:W`
370
370
  display: flex;
371
371
  gap: calc(var(--spacing-base) - 0.25rem);
372
372
  margin-bottom: var(--spacing-base);
373
- `,children:[g(Mn,{onChange:c=>D(c.target.value),value:u,label:_,showLabel:!1,options:[...z?[]:[{value:"any",label:W}],...o?o.map(c=>({value:c.id,label:c.name})):[]]}),g("div",{css:K`
373
+ `,children:[h(Pn,{onChange:u=>z(u.target.value),value:v,label:ee,showLabel:!1,options:[...y?[]:[{value:"any",label:Z}],...o?o.map(u=>({value:u.id,label:u.name})):[]]}),h("div",{css:W`
374
374
  flex-grow: 1;
375
- `,children:g(zn,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:M,disabledFieldSubmission:!0,value:E})})]}),G("div",{css:[Er,Vn],id:ze.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[g(Bn,{isActive:vo}),Array.isArray(r)&&r.length>0?r.map(c=>g(Lo,{isSelected:C.some(y=>y.id===c.id),result:c,triggerSelection:()=>ho(c)},c.id)):h?null:g(Ro,{searchText:E||E,selectedContentType:(at=(nt=o==null?void 0:o.find(c=>c.id===u))==null?void 0:nt.name)!=null?at:u}),!h&&typeof i!="undefined"&&r&&(r==null?void 0:r.length)<i&&g("button",{type:"button",css:kr,onClick:Co,children:fo?g(Un,{}):"Load More"})]}),G("div",{css:K`
375
+ `,children:h(Ln,{inputFieldName:"searchText",placeholder:"Enter keyword to narrow your results",onSearchTextChanged:D,disabledFieldSubmission:!0,value:E})})]}),G("div",{css:[Zr,Tn],id:We.current,role:"listbox",tabIndex:0,"data-test-id":"entry-list",children:[h(En,{isActive:co}),Array.isArray(r)&&r.length>0?r.map(u=>h(bo,{isSelected:R.some(x=>x.id===u.id),result:u,triggerSelection:()=>po(u)},u.id)):c?null:h(xo,{searchText:E||E,selectedContentType:(Pt=(Rt=o==null?void 0:o.find(u=>u.id===v))==null?void 0:Rt.name)!=null?Pt:v}),!c&&typeof s!="undefined"&&r&&(r==null?void 0:r.length)<s&&h("button",{type:"button",css:Kr,onClick:ho,children:lo?h(_n,{}):"Load More"})]}),G("div",{css:W`
376
376
  display: flex;
377
377
  justify-content: space-between;
378
- `,children:[g("div",{children:ae&&((it=o==null?void 0:o.length)!=null?it:0)>0?g(An,{menuLabel:"Add new menu",menuTrigger:g(We,{buttonType:"secondary",children:"Add New"}),children:o==null?void 0:o.map(c=>g(Gn,{css:K`
378
+ `,children:[h("div",{children:P&&((Tt=o==null?void 0:o.length)!=null?Tt:0)>0?h(In,{menuLabel:"Add new menu",menuTrigger:h(ot,{buttonType:"secondary",children:"Add New"}),children:o==null?void 0:o.map(u=>h(Vn,{css:W`
379
379
  background: var(--white);
380
380
  color: var(--brand-secondary-1);
381
- `,onClick:()=>ae(c),children:c.name},c.id))}):null}),G("div",{css:K`
381
+ `,onClick:()=>P(u),children:u.name},u.id))}):null}),G("div",{css:W`
382
382
  display: flex;
383
383
  gap: var(--spacing-base);
384
- `,children:[g(We,{buttonType:"unimportant",onClick:wo,children:"Cancel"}),g(We,{disabled:!C.length,onClick:xo,"data-test-id":"entry-accept-button",children:"Accept"})]})]})]})]}):null,s?null:d&&C.length>1?g(Tn,{onDragEnd:c=>Io(c),children:g(In,{droppableId:f||"canvas-multi-select",children:c=>G("div",{...c.droppableProps,ref:c.innerRef,css:K`
384
+ `,children:[h(ot,{buttonType:"unimportant",onClick:vo,children:"Cancel"}),h(ot,{disabled:!R.length,onClick:fo,"data-test-id":"entry-accept-button",children:"Accept"})]})]})]})]}):null,p?null:i&&R.length>1?h(Cn,{onDragEnd:u=>So(u),children:h(Sn,{droppableId:g||"canvas-multi-select",children:u=>G("div",{...u.droppableProps,ref:u.innerRef,css:W`
385
385
  margin-block: var(--spacing-sm) 0;
386
- `,children:[C==null?void 0:C.map((y,Z)=>{if(y!=null&&y.id)return g(En,{draggableId:y.id,index:Z,children:(V,Ue)=>G("div",{css:Dr,ref:V.innerRef,"data-dragging":Ue.isDragging,...V.draggableProps,...V.dragHandleProps,children:[G("span",{css:zr,children:[g(ve,{css:[Ne,Ur],width:24,height:24}),g(ve,{css:Ne,width:24,height:24})]}),g(rt,{logoIcon:n,selectedItem:y,onDeselect:Ae=>tt(Ae),onEditClosed:S?Ae=>S(Ae):void 0},`selected-item-${y.id}`)]})},y.id)}),c.placeholder]})})}):C==null?void 0:C.map(c=>g(rt,{logoIcon:n,selectedItem:c,onDeselect:y=>tt(y),onEditClosed:S?y=>S(y):void 0},`selected-item-${c.id}`))]})})};import{css as ne}from"@emotion/react";var Or=ne`
386
+ `,children:[R==null?void 0:R.map((x,te)=>{if(x!=null&&x.id)return h(Rn,{draggableId:x.id,index:te,children:(M,Ke)=>G("div",{css:jr,ref:M.innerRef,"data-dragging":Ke.isDragging,...M.draggableProps,...M.dragHandleProps,children:[G("span",{css:ea,children:[h(Te,{css:[rt,ta],width:24,height:24}),h(Te,{css:rt,width:24,height:24})]}),h(St,{logoIcon:t,selectedItem:x,onDeselect:Qe=>wt(Qe),onEditClosed:w?Qe=>w(Qe):void 0},`selected-item-${x.id}`)]})},x.id)}),u.placeholder]})})}):R==null?void 0:R.map(u=>h(St,{logoIcon:t,selectedItem:u,onDeselect:x=>wt(x),onEditClosed:w?x=>w(x):void 0},`selected-item-${u.id}`))]})})};import{css as pe}from"@emotion/react";var na=pe`
387
387
  cursor: pointer;
388
388
  padding: var(--spacing-sm) 0;
389
389
  margin-right: var(--spacing-sm);
390
390
  position: relative;
391
391
  transition: background-color var(--duration-fast) var(--timing-ease-out),
392
392
  color var(--duration-fast) var(--timing-ease-out);
393
- `,Hr=ne`
393
+ `,ia=pe`
394
394
  border: 2px solid transparent;
395
395
  border-radius: var(--rounded-base);
396
396
  display: flex;
397
397
  align-items: center;
398
398
  gap: var(--spacing-base);
399
399
  padding: var(--spacing-sm) var(--spacing-xs);
400
- `,$r=ne`
400
+ `,sa=pe`
401
401
  background-color: var(--green-50);
402
- `,Fr=ne`
402
+ `,la=pe`
403
403
  font-size: var(--fs-sm);
404
404
  font-weight: var(--fw-bold);
405
405
  width: 50%;
406
- `,Kr=ne`
406
+ `,da=pe`
407
407
  font-weight: var(--fw-normal);
408
408
  display: block;
409
- `,Nr=ne`
409
+ `,ca=pe`
410
410
  font-size: var(--fs-sm);
411
411
  > * {
412
412
  display: block;
413
413
  }
414
- `,Qr=ne`
414
+ `,pa=pe`
415
415
  display: block;
416
416
  height: 1.5rem;
417
417
  width: 1.5rem;
418
418
  color: var(--brand-secondary-3);
419
419
  margin-left: auto;
420
- `;import{css as Wr}from"@emotion/react";import{jsx as ce,jsxs as _e}from"@emotion/react/jsx-runtime";function _r({result:e,isSelected:r,triggerSelection:o}){var f;let{categories:t,logoIcon:n}=Ve(),[a]=e.categories||[{id:"",name:""}],d=typeof a=="undefined"||!t||(f=t.find(m=>m.id===a.id))==null?void 0:f.name;return ce("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[Or],children:_e("div",{css:[Hr,r?$r:void 0],children:[e.thumbnailUrl?ce("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:Wr`
420
+ `;import{css as ua}from"@emotion/react";import{jsx as me,jsxs as nt}from"@emotion/react/jsx-runtime";function ga({result:e,isSelected:r,triggerSelection:o}){var g;let{categories:a,logoIcon:t}=qe(),[n]=e.categories||[{id:"",name:""}],i=typeof n=="undefined"||!a||(g=a.find(d=>d.id===n.id))==null?void 0:g.name;return me("div",{"data-value":e.id,role:"option",tabIndex:-1,onClick:()=>o(),css:[na],children:nt("div",{css:[ia,r?sa:void 0],children:[e.thumbnailUrl?me("img",{src:e.thumbnailUrl,alt:`Thumbnail for ${e.title}`,css:ua`
421
421
  background-color: var(--gray-200);
422
422
  width: 3rem;
423
423
  height: 3rem;
424
424
  object-fit: cover;
425
- `}):ce(H,{src:n,alt:"Logo",css:Wr`
425
+ `}):me($,{src:t,alt:"Logo",css:ua`
426
426
  height: 2.25rem;
427
427
  width: 2.25rem;
428
- `}),_e("h4",{css:[Fr],children:[e.title,d?ce("span",{css:[Kr],children:d}):null]}),_e("p",{css:[Nr],children:["SKU: ",e.sku||e.id,e.price!==void 0?ce("span",{children:e.price}):null]}),r?ce(Ie,{css:[Qr]}):null]})},e.id)}import{css as J}from"@emotion/react";import{mq as Zr}from"@uniformdev/design-system";var Xr=J`
428
+ `}),nt("h4",{css:[la],children:[e.title,i?me("span",{css:[da],children:i}):null]}),nt("p",{css:[ca],children:["SKU: ",e.sku||e.id,e.price!==void 0?me("span",{children:e.price}):null]}),r?me(Ae,{css:[pa]}):null]})},e.id)}import{css as ne}from"@emotion/react";import{mq as ma}from"@uniformdev/design-system";var fa=ne`
429
429
  border: 1px solid var(--gray-200);
430
430
  border-radius: var(--rounded-base);
431
431
  background: var(--gray-50);
432
432
  display: flex;
433
433
  width: 100%;
434
- `,qr=J`
434
+ `,va=ne`
435
435
  align-items: center;
436
436
  display: flex;
437
437
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
@@ -439,22 +439,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
439
439
  flex-grow: 1;
440
440
  gap: var(--spacing-sm);
441
441
  margin-inline: 0 var(--spacing-sm);
442
- `,Yr=J`
442
+ `,ha=ne`
443
443
  display: flex;
444
444
  align-items: center;
445
445
  gap: var(--spacing-sm);
446
446
  flex-grow: 1;
447
447
 
448
- ${Zr("lg")} {
448
+ ${ma("lg")} {
449
449
  width: 50%;
450
450
  margin-bottom: 0;
451
451
  }
452
- `,Ze=J`
452
+ `,it=ne`
453
453
  background-color: var(--gray-200);
454
454
  width: 3.5rem;
455
455
  height: 3.5rem;
456
456
  object-fit: cover;
457
- `,Xe=J`
457
+ `,st=ne`
458
458
  align-items: center;
459
459
  background: var(--white);
460
460
  border-radius: var(--rounded-base);
@@ -469,50 +469,50 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
469
469
  &:hover {
470
470
  background: var(--gray-50);
471
471
  }
472
- `,qe=J`
472
+ `,lt=ne`
473
473
  font-size: var(--fs-sm);
474
- `,Jr=J`
474
+ `,ya=ne`
475
475
  display: block;
476
476
  width: 1rem;
477
477
  height: 1rem;
478
- `,jr=J`
478
+ `,ba=ne`
479
479
  display: flex;
480
480
  flex-direction: column;
481
481
  gap: var(--spacing-sm);
482
482
 
483
- ${Zr("md")} {
483
+ ${ma("md")} {
484
484
  flex-direction: row;
485
485
  min-width: 200px;
486
486
  justify-content: end;
487
487
  }
488
- `;import{css as de}from"@emotion/react";import{Icon as $n,mq as Fn}from"@uniformdev/design-system";import{CgClose as Kn}from"react-icons/cg";import{jsx as B,jsxs as Q}from"@emotion/react/jsx-runtime";function eo({selectedItem:e,onDeselect:r}){var d;let{categories:o,logoIcon:t}=Ve(),[n]=e.categories||[{id:"",name:""}],a=typeof n=="undefined"||!o||(d=o.find(f=>f.id===n.id))==null?void 0:d.name;return B("div",{css:[Xr],children:Q("article",{css:[qr],children:[Q("div",{css:[Yr],children:[e.thumbnailUrl?B("img",{src:e.thumbnailUrl,alt:a,css:[Ze],loading:"lazy"}):B("div",{css:[Ze]}),Q("div",{css:de`
488
+ `;import{css as fe}from"@emotion/react";import{Icon as Un,mq as zn}from"@uniformdev/design-system";import{CgClose as Bn}from"react-icons/cg";import{jsx as O,jsxs as Q}from"@emotion/react/jsx-runtime";function xa({selectedItem:e,onDeselect:r}){var i;let{categories:o,logoIcon:a}=qe(),[t]=e.categories||[{id:"",name:""}],n=typeof t=="undefined"||!o||(i=o.find(g=>g.id===t.id))==null?void 0:i.name;return O("div",{css:[fa],children:Q("article",{css:[va],children:[Q("div",{css:[ha],children:[e.thumbnailUrl?O("img",{src:e.thumbnailUrl,alt:n,css:[it],loading:"lazy"}):O("div",{css:[it]}),Q("div",{css:fe`
489
489
  > :not(:last-child) {
490
490
  margin-bottom: var(--spacing-xs);
491
491
  }
492
- `,children:[Q("h4",{css:de`
492
+ `,children:[Q("h4",{css:fe`
493
493
  margin-top: 0px;
494
494
  font-weight: var(--fw-bold);
495
- `,children:[e.title||e.id||"",a&&B("span",{css:de`
495
+ `,children:[e.title||e.id||"",n&&O("span",{css:fe`
496
496
  display: block;
497
497
  font-weight: var(--fw-regular);
498
- `,children:a})]}),Q("ul",{css:de`
498
+ `,children:n})]}),Q("ul",{css:fe`
499
499
  font-size: var(--fs-sm);
500
500
 
501
- ${Fn("sm")} {
501
+ ${zn("sm")} {
502
502
  display: flex;
503
503
  gap: var(--spacing-base);
504
504
  }
505
- `,children:[Q("li",{children:[B("span",{css:de`
505
+ `,children:[Q("li",{children:[O("span",{css:fe`
506
506
  margin-right: var(--spacing-xs);
507
- `,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?Q("li",{children:[B("span",{css:de`
507
+ `,children:"SKU:"}),e.sku||e.id]}),e.price!==void 0?Q("li",{children:[O("span",{css:fe`
508
508
  margin-right: var(--spacing-xs);
509
- `,children:"Price:"}),B("span",{children:e.price})]}):null]})]})]}),Q("div",{css:jr,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:Xe,children:[B("span",{css:qe,children:"Edit"}),B(H,{src:t,alt:"Logo",css:Jr})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:Xe,children:[B("span",{css:qe,children:"Unlink"}),B($n,{icon:Kn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as Zn}from"@uniformdev/design-system";import{useAsync as Xn,useAsyncFn as qn}from"react-use";import{jsx as Ye,jsxs as Yn}from"@emotion/react/jsx-runtime";function cd({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:t,logoIcon:n,multiSelect:a,multiSelectId:d,selectedItemComponent:f,rowComponent:m,errorComponent:v,helpComponent:i,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:z="All categories",typeSelectorLabel:ae="Select Category"}){var j,E;let{value:S,loading:b,error:ie}=Xn(async()=>await o(),[o]),ue=S==null?void 0:S.map(M=>M.id).join(","),O=Wn(()=>S?S.map(u=>({id:u.id,name:u.name})):void 0,[ue]),_=_n(),[W,me]=qn(async(M,u)=>{let D=await t({text:M,options:{limit:u==null?void 0:u.count,offset:u==null?void 0:u.offset,categoryId:u==null?void 0:u.contentType,cursor:u==null?void 0:u.cursor}});return(u==null?void 0:u.offset)===0&&(_.current=[]),(_.current=_.current||[]).push(...D.products),D},[t]),be=async M=>{await r(M)};return ie||W.error?Ye(v||(({categoriesError:u,searchError:D})=>Yn(Zn,{type:"error",children:["There was an error: ",(u==null?void 0:u.message)||(D==null?void 0:D.message)]})),{categoriesError:ie,searchError:W.error}):Ye(to.Provider,{value:{categories:S,logoIcon:n},children:Ye(Br,{search:me,results:_.current,logoIcon:n,selectedItems:e,select:be,multiSelectId:d||"product-search-multi-select",multiSelect:a,contentTypes:O,selectedItemComponent:f||eo,rowComponent:m||_r,totalResults:(j=W.value)==null?void 0:j.total,cursor:(E=W.value)==null?void 0:E.cursor,resultsLoading:W.loading||b,helpComponent:i,noResultsComponent:p,onSort:h,typeSelectorAllTypesOptionText:z,typeSelectorLabel:ae})})}var to=Nn.createContext(void 0),Ve=()=>{let e=Qn(to);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as k}from"@emotion/react";import{mq as Jn}from"@uniformdev/design-system";var ro=k`
509
+ `,children:"Price:"}),O("span",{children:e.price})]}):null]})]})]}),Q("div",{css:ba,children:[e.editLink?Q("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",css:st,children:[O("span",{css:lt,children:"Edit"}),O($,{src:a,alt:"Logo",css:ya})]}):null,Q("button",{type:"button",onClick:()=>{r==null||r(e)},css:st,children:[O("span",{css:lt,children:"Unlink"}),O(Un,{icon:Bn,iconColor:"red",size:16})]})]})]})},e.id)}import{Callout as qn}from"@uniformdev/design-system";import{useAsync as $n,useAsyncFn as Fn}from"react-use";import{jsx as dt,jsxs as Nn}from"@emotion/react/jsx-runtime";function Ec({selectedProducts:e,setSelectedProducts:r,onGetCategories:o,onSearchProducts:a,logoIcon:t,multiSelect:n,multiSelectId:i,selectedItemComponent:g,rowComponent:d,errorComponent:f,helpComponent:s,noResultsComponent:m,onSort:c,typeSelectorAllTypesOptionText:y="All categories",typeSelectorLabel:P="Select Category"}){var ie,E;let{value:w,loading:S,error:ue}=$n(async()=>await o(),[o]),Se=w==null?void 0:w.map(D=>D.id).join(","),q=Gn(()=>w?w.map(v=>({id:v.id,name:v.name})):void 0,[Se]),ee=On(),[Z,Ce]=Fn(async(D,v)=>{let z=await a({text:D,options:{limit:v==null?void 0:v.count,offset:v==null?void 0:v.offset,categoryId:v==null?void 0:v.contentType,cursor:v==null?void 0:v.cursor}});return(v==null?void 0:v.offset)===0&&(ee.current=[]),(ee.current=ee.current||[]).push(...z.products),z},[a]),_e=async D=>{await r(D)};return ue||Z.error?dt(f||(({categoriesError:v,searchError:z})=>Nn(qn,{type:"error",children:["There was an error: ",(v==null?void 0:v.message)||(z==null?void 0:z.message)]})),{categoriesError:ue,searchError:Z.error}):dt(wa.Provider,{value:{categories:w,logoIcon:t},children:dt(oa,{search:Ce,results:ee.current,logoIcon:t,selectedItems:e,select:_e,multiSelectId:i||"product-search-multi-select",multiSelect:n,contentTypes:q,selectedItemComponent:g||xa,rowComponent:d||ga,totalResults:(ie=Z.value)==null?void 0:ie.total,cursor:(E=Z.value)==null?void 0:E.cursor,resultsLoading:Z.loading||S,helpComponent:s,noResultsComponent:m,onSort:c,typeSelectorAllTypesOptionText:y,typeSelectorLabel:P})})}var wa=An.createContext(void 0),qe=()=>{let e=Hn(wa);if(!e)throw new Error("useProductSearchContext must be used within a <ProductSearchContext> provider");return e};import{css as _}from"@emotion/react";import{mq as Wn}from"@uniformdev/design-system";var Sa=_`
510
510
  border: 1px solid var(--gray-200);
511
511
  background: var(--gray-50);
512
512
  border-radius: var(--rounded-base);
513
513
  display: flex;
514
514
  width: 100%;
515
- `,oo=k`
515
+ `,Ca=_`
516
516
  align-items: center;
517
517
  display: flex;
518
518
  flex-grow: 1;
@@ -520,23 +520,23 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
520
520
  margin-inline: 0 var(--spacing-sm);
521
521
  padding: var(--spacing-base) var(--spacing-base) var(--spacing-base) var(--spacing-lg);
522
522
  position: relative;
523
- `,no=k`
523
+ `,Ra=_`
524
524
  flex-grow: 1;
525
- `,ao=k`
525
+ `,Pa=_`
526
526
  align-items: center;
527
527
  display: flex;
528
528
  position: relative;
529
- `,io=k`
529
+ `,Ta=_`
530
530
  color: var(--brand-secondary-1);
531
531
  font-size: var(--fs-base);
532
532
  font-weight: var(--fw-bold);
533
533
  line-height: 1;
534
534
  margin: 0;
535
535
  word-break: break-word;
536
- `,so=k`
536
+ `,ka=_`
537
537
  width: 1.5rem;
538
538
  height: 1.5rem;
539
- `,co=k`
539
+ `,La=_`
540
540
  background: var(--white);
541
541
  border-radius: var(--rounded-base);
542
542
  border-left: 4px solid var(--brand-secondary-3);
@@ -545,22 +545,22 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
545
545
  padding: var(--spacing-base);
546
546
  z-index: var(--z-10);
547
547
  width: max-content;
548
- `,le=k`
548
+ `,ve=_`
549
549
  font-size: var(--fs-sm);
550
- `,De=k`
550
+ `,$e=_`
551
551
  font-weight: var(--fw-bold);
552
552
  margin-right: var(--spacing-sm);
553
- `,lo=k`
553
+ `,_a=_`
554
554
  display: flex;
555
555
  flex-direction: column;
556
556
  gap: var(--spacing-sm);
557
557
 
558
- ${Jn("md")} {
558
+ ${Wn("md")} {
559
559
  flex-direction: row;
560
560
  justify-content: end;
561
561
  min-width: 200px;
562
562
  }
563
- `,Je=k`
563
+ `,ct=_`
564
564
  align-items: center;
565
565
  background: var(--white);
566
566
  border-radius: var(--rounded-base);
@@ -575,30 +575,553 @@ var To=Object.defineProperty;var Eo=(e,r)=>{for(var o in r)To(e,o,{get:r[o],enum
575
575
  &:hover {
576
576
  background: var(--gray-50);
577
577
  }
578
- `,po=k`
578
+ `,Ia=_`
579
579
  display: flex;
580
580
  margin-top: var(--spacing-sm);
581
581
  gap: var(--spacing-sm);
582
- `,uo=k`
582
+ `,Va=_`
583
583
  background: none;
584
584
  outline: none;
585
585
  border: none;
586
586
  margin: calc(var(--spacing-xs) * -1) 0 calc(var(--spacing-xs) * -1) var(--spacing-sm);
587
- `,je=k`
587
+ `,pt=_`
588
588
  display: block;
589
589
  max-width: 100%;
590
590
  min-width: 100px;
591
591
  height: auto;
592
- `;import{useState as jn,useRef as mo,useEffect as ea}from"react";import{CgInfo as ta,CgClose as ra}from"react-icons/cg";import{format as oa}from"timeago.js";import{css as pe}from"@emotion/react";import{Icon as go}from"@uniformdev/design-system";import{Fragment as aa,jsx as I,jsxs as T}from"@emotion/react/jsx-runtime";function Ld({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:t,itemDetailsRendererComponent:n}){let a=mo(null),d=mo(null),[f,m]=jn(!1);ea(()=>{let p=z=>{a.current&&!a.current.contains(z.target)&&d.current&&!d.current.contains(z.target)&&m(!1)},h=()=>{m(!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)}},[d]);let v=()=>{var p;if(m(!f),d.current&&a.current){let h=(p=a==null?void 0:a.current)==null?void 0:p.getBoundingClientRect();d.current.style.top=`${h.top+30}px`}},i=n!=null?n:na;return I("div",{css:[ro,pe`
592
+ `;import{useState as Kn,useRef as Ea,useEffect as Qn}from"react";import{CgInfo as Yn,CgClose as Zn}from"react-icons/cg";import{format as Xn}from"timeago.js";import{css as he}from"@emotion/react";import{Icon as Da}from"@uniformdev/design-system";import{Fragment as jn,jsx as I,jsxs as V}from"@emotion/react/jsx-runtime";function Yc({selectedItem:e,onDeselect:r,onEditClosed:o,logoIcon:a,itemDetailsRendererComponent:t}){let n=Ea(null),i=Ea(null),[g,d]=Kn(!1);Qn(()=>{let m=y=>{n.current&&!n.current.contains(y.target)&&i.current&&!i.current.contains(y.target)&&d(!1)},c=()=>{d(!1)};return window.addEventListener("resize",c,!0),document.addEventListener("scroll",m,!0),document.addEventListener("mousedown",m),()=>{window.removeEventListener("resize",c,!0),document.removeEventListener("scroll",m,!0),document.removeEventListener("mousedown",m)}},[i]);let f=()=>{var m;if(d(!g),i.current&&n.current){let c=(m=n==null?void 0:n.current)==null?void 0:m.getBoundingClientRect();i.current.style.top=`${c.top+30}px`}},s=t!=null?t:Jn;return I("div",{css:[Sa,he`
593
593
  margin: 0 0 1rem 0;
594
- `],children:T("div",{css:oo,children:[T("div",{css:no,children:[T("div",{css:ao,children:[I("h4",{css:[io],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?T(aa,{children:[I("button",{type:"button",ref:a,css:uo,"aria-controls":"path-details","aria-expanded":f,onClick:v,children:I(go,{icon:ta,iconColor:"gray",size:24,css:pe`
594
+ `],children:V("div",{css:Ca,children:[V("div",{css:Ra,children:[V("div",{css:Pa,children:[I("h4",{css:[Ta],title:`ID: ${e.id}`,"data-test-id":"dam-selected-item",children:e.title||e.id||""}),e.popoverData?V(jn,{children:[I("button",{type:"button",ref:n,css:Va,"aria-controls":"path-details","aria-expanded":g,onClick:f,children:I(Da,{icon:Yn,iconColor:"gray",size:24,css:he`
595
595
  opacity: var(--opacity-75);
596
- `})}),I("div",{id:"path-details","aria-hidden":!f,ref:d,css:[co,f?pe`
596
+ `})}),I("div",{id:"path-details","aria-hidden":!g,ref:i,css:[La,g?he`
597
597
  visibility: visible;
598
- `:pe`
598
+ `:he`
599
599
  visibility: hidden;
600
- `],children:Object.entries(e.popoverData).map(([p,h],z)=>T("div",{css:le,children:[T("span",{css:De,children:[p,":"]}),h]},z))})]}):null]}),I(i,{item:e})]}),T("div",{css:lo,children:[e.editLink?typeof e.editLink=="string"?T("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:p=>{o&&(Me(p.currentTarget.href,()=>o(e)),p.preventDefault())},css:Je,children:[I("span",{css:le,children:"Edit"}),t?I(H,{src:t,css:so,alt:"Logo"}):null]}):e.editLink:null,T("button",{type:"button",onClick:()=>{r(e)},css:Je,children:[I("span",{css:le,children:"Unlink"}),I(go,{icon:ra,iconColor:"red",size:16})]})]})]})},e.id)}function na({item:e}){let r=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?r=I("img",{src:e.previewUrl,alt:e.id,width:"200",css:je}):e.type==="video"&&(r=I("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:je})):e.previewUrl&&typeof e.previewUrl!="string"&&(r=e.previewUrl),r||e.metadata?T("div",{css:po,children:[r?I("div",{children:r}):null,T("ul",{children:[e.metadata?Object.entries(e.metadata).map(([o,t])=>T("li",{css:[le,pe`
600
+ `],children:Object.entries(e.popoverData).map(([m,c],y)=>V("div",{css:ve,children:[V("span",{css:$e,children:[m,":"]}),c]},y))})]}):null]}),I(s,{item:e})]}),V("div",{css:_a,children:[e.editLink?typeof e.editLink=="string"?V("a",{href:e.editLink,title:"edit",rel:"noopener noreferrer",target:"_blank",onClick:m=>{o&&(Oe(m.currentTarget.href,()=>o(e)),m.preventDefault())},css:ct,children:[I("span",{css:ve,children:"Edit"}),a?I($,{src:a,css:ka,alt:"Logo"}):null]}):e.editLink:null,V("button",{type:"button",onClick:()=>{r(e)},css:ct,children:[I("span",{css:ve,children:"Unlink"}),I(Da,{icon:Zn,iconColor:"red",size:16})]})]})]})},e.id)}function Jn({item:e}){let r=null;return e.previewUrl&&typeof e.previewUrl=="string"?e.type==="image"?r=I("img",{src:e.previewUrl,alt:e.id,width:"200",css:pt}):e.type==="video"&&(r=I("video",{src:e.previewUrl,title:e.id,width:"200",controls:!0,css:pt})):e.previewUrl&&typeof e.previewUrl!="string"&&(r=e.previewUrl),r||e.metadata?V("div",{css:Ia,children:[r?I("div",{children:r}):null,V("ul",{children:[e.metadata?Object.entries(e.metadata).map(([o,a])=>V("li",{css:[ve,he`
601
601
  order: 1;
602
- `],children:[T("span",{css:[De,pe`
602
+ `],children:[V("span",{css:[$e,he`
603
603
  order: 1;
604
- `],children:[o,":"]}),t]},o)):null,e.createdDate?T("li",{css:le,children:[I("span",{css:De,children:"Date:"}),oa(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as ia,Theme as sa}from"@uniformdev/design-system";import{jsx as ye,jsxs as ca}from"@emotion/react/jsx-runtime";var Dd=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:t,error:n,sdk:a}=ut();if(t||!a){let d=r;return d?ye(d,{}):ye(ia,{})}if(n){let d=o;if(d)return ye(d,{error:n});throw n}return ca(Se.Provider,{value:{sdk:a},children:[ye(sa,{}),ye(xe,{children:e})]})};export*from"@uniformdev/mesh-sdk";import{Button as Wd,Callout as _d,LoadingIndicator as Zd,LoadingOverlay as Xd,Menu as qd,MenuItem as Yd,Input as Jd,InputSelect as jd,InputToggle as el,Theme as tl,InputKeywordSearch as rl,Heading as ol,ScrollableList as nl,ScrollableListItem as al,Textarea as il,Switch as sl,Label as cl,AddListButton as dl}from"@uniformdev/design-system";export{dl as AddListButton,Wd as Button,_d as Callout,Ld as DamSelectedItem,Pr as DefaultSearchRow,fr as DefaultSelectedItem,Br as EntrySearch,ol as Heading,He as Icons,Jd as Input,jd as InputSelect,el as InputToggle,rl as KeywordSearchInput,cl as Label,Zd as LoadingIndicator,Xd as LoadingOverlay,qd as Menu,Yd as MenuItem,Dd as MeshApp,Tt as ProductPreviewList,bi as ProductQuery,kt as ProductQueryContext,cd as ProductSearch,to as ProductSearchContext,_r as ProductSearchRow,eo as ProductSelectedItem,ft as ResolvableLoadingValue,nl as ScrollableList,al as ScrollableListItem,St as SelectionField,sl as Switch,il as Textarea,tl as Theme,lt as UniformMeshLocationContext,xe as UniformMeshLocationContextProvider,Se as UniformMeshSdkContext,ha as UniformMeshSdkContextProvider,Qe as badgeIcon,je as damSelectItemImage,ro as damSelectedItemContainer,ao as damSelectedItemCopy,no as damSelectedItemDetails,so as damSelectedItemIcon,uo as damSelectedItemInfoBtn,oo as damSelectedItemInner,Je as damSelectedItemLinkBtn,lo as damSelectedItemLinkContainer,po as damSelectedItemMediaContainer,co as damSelectedItemPopover,De as damSelectedItemPopoverLabel,le as damSelectedItemSmallText,io as damSelectedItemTitle,Dr as draggableContainer,Ne as draggableIcon,Ur as draggableIconOffset,zr as draggableIconWrapper,Rr as entrySearchBtn,Ir as entrySearchConfig,Tr as entrySearchConfigHidden,kr as entrySearchLoadMoreBtn,Er as entrySearchResultList,Mr as entrySearchSelectIcon,Vr as entrySearchSelectImg,ic as entrySearchSelectInput,sc as entrySearchSelectOption,Lr as entrySearchWrapper,Qr as productSearchRowActiveIcon,Kr as productSearchRowCategory,Or as productSearchRowContainer,Hr as productSearchRowContent,$r as productSearchRowContentActive,Nr as productSearchRowDetails,Fr as productSearchRowTitle,Xr as productSelectedItemContainer,Yr as productSelectedItemContent,qr as productSelectedItemDetails,Jr as productSelectedItemIcon,Ze as productSelectedItemImage,jr as productSelectedItemLinkContainer,Xe as productedSelectedItemLinkBtn,qe as productedSelectedItemSmallText,Sr as searchRowBtn,vr as searchRowContainer,yr as searchRowContainerActive,hr as searchRowContainerWithPopover,br as searchRowPopover,Ke as searchRowText,Fe as searchRowTextSmall,$e as selectItemLinkBtn,ur as selectItemLinkContainer,pr as selectItemPopover,he as selectItemPopoverLabel,te as selectItemSmallText,ar as selectedItemContainer,cr as selectedItemCopy,sr as selectedItemDetails,lr as selectedItemIcon,ir as selectedItemInner,dr as selectedItemTitle,ut as useInitializeUniformMeshSdk,Ha as useMeshLocation,It as useProductQueryContext,Ve as useProductSearchContext,Ma as useUniformMeshLocation,we as useUniformMeshLocationContext,dt as useUniformMeshSdk,ct as useUniformMeshSdkContext};
604
+ `],children:[o,":"]}),a]},o)):null,e.createdDate?V("li",{css:ve,children:[I("span",{css:$e,children:"Date:"}),Xn(e.createdDate)]}):null]})]}):null}import{LoadingIndicator as ei,Theme as ti}from"@uniformdev/design-system";import{jsx as Le,jsxs as ri}from"@emotion/react/jsx-runtime";var ap=({children:e,loadingComponent:r,errorComponent:o})=>{let{initializing:a,error:t,sdk:n}=Et();if(a||!n){let i=r;return i?Le(i,{}):Le(ei,{})}if(t){let i=o;if(i)return Le(i,{error:t});throw t}return ri(Ie.Provider,{value:{sdk:n},children:[Le(ti,{}),Le(Ve,{children:e})]})};function Ma(e){return Object.entries(e||{}).sort(([r,o],[a,t])=>{var n,i;return o.order&&t.order?o.order-t.order:o.order?1:t.order?-1:((n=o.displayName)!=null?n:r).localeCompare((i=t.displayName)!=null?i:a)}).map(([r,o])=>({name:r,...o}))}import*as xe from"react";import{Button as Ha,Input as gt}from"@uniformdev/design-system";import{Form as ai,Formik as oi}from"formik";import{css as ut}from"@emotion/react";var Ua=ut`
605
+ > * {
606
+ margin: var(--spacing-base) 0 0;
607
+ }
608
+ `,za=ut`
609
+ display: flex;
610
+ gap: var(--spacing-sm);
611
+ `,Ba=ut`
612
+ :root {
613
+ --tagify-dd-color-primary: rgb(53, 149, 246);
614
+ --tagify-dd-bg-color: var(--white);
615
+ --tagify-dd-item-pad: var(--spacing-xs) var(--spacing-sm);
616
+ }
617
+
618
+ .tagify {
619
+ --tags-disabled-bg: #f1f1f1;
620
+ --tags-border-color: var(--gray-400);
621
+ --tags-hover-border-color: var(--gray-300);
622
+ --tags-focus-border-color: var(--brand-secondary-1);
623
+ --tag-border-radius: var(--rounded-md);
624
+ --tag-bg: var(--gray-100);
625
+ --tag-hover: var(--gray-200);
626
+ --tag-text-color: var(--brand-secondary-1);
627
+ --tag-text-color--edit: var(--brand-secondary-1);
628
+ --tag-pad: var(--spacing-2xs) var(--spacing-sm);
629
+ --tag-inset-shadow-size: 1rem;
630
+ --tag-invalid-color: #d39494;
631
+ --tag-invalid-bg: rgba(211, 148, 148, 0.5);
632
+ --tag-remove-bg: rgba(211, 148, 148, 0.3);
633
+ --tag-remove-btn-color: black;
634
+ --tag-remove-btn-bg: none;
635
+ --tag-remove-btn-bg--hover: #c77777;
636
+ --input-color: inherit;
637
+ --tag--min-width: 1ch;
638
+ --tag--max-width: auto;
639
+ --tag-hide-transition: 0.3s;
640
+ --placeholder-color: rgba(0, 0, 0, 0.4);
641
+ --placeholder-color-focus: rgba(0, 0, 0, 0.25);
642
+ --loader-size: 0.8em;
643
+ --readonly-striped: 1;
644
+
645
+ background: var(--white);
646
+ display: inline-flex;
647
+ align-items: flex-start;
648
+ flex-wrap: wrap;
649
+ border-radius: var(--rounded-md);
650
+ outline: 1px solid var(--gray-400);
651
+ padding: 0;
652
+ line-height: 0;
653
+ cursor: text;
654
+ position: relative;
655
+ box-sizing: border-box;
656
+ transition: 0.1s;
657
+ }
658
+ .tagify:hover:not(.tagify--focus):not(.tagify--invalid) {
659
+ --tags-border-color: var(--tags-hover-border-color);
660
+ }
661
+ .tagify[disabled] {
662
+ background: var(--tags-disabled-bg);
663
+ filter: saturate(0);
664
+ opacity: 0.5;
665
+ pointer-events: none;
666
+ }
667
+ .tagify[disabled].tagify--select,
668
+ .tagify[readonly].tagify--select {
669
+ pointer-events: none;
670
+ }
671
+ .tagify[disabled]:not(.tagify--mix):not(.tagify--select),
672
+ .tagify[readonly]:not(.tagify--mix):not(.tagify--select) {
673
+ cursor: default;
674
+ }
675
+ .tagify[disabled]:not(.tagify--mix):not(.tagify--select) > .tagify__input,
676
+ .tagify[readonly]:not(.tagify--mix):not(.tagify--select) > .tagify__input {
677
+ visibility: hidden;
678
+ width: 0;
679
+ margin: 5px 0;
680
+ }
681
+ .tagify[disabled]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div,
682
+ .tagify[readonly]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div {
683
+ padding: var(--tag-pad);
684
+ }
685
+ .tagify[disabled]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div::before,
686
+ .tagify[readonly]:not(.tagify--mix):not(.tagify--select) .tagify__tag > div::before {
687
+ animation: readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused;
688
+ }
689
+
690
+ .tagify[disabled] .tagify__tag__removeBtn,
691
+ .tagify[readonly] .tagify__tag__removeBtn {
692
+ display: none;
693
+ }
694
+ .tagify--loading .tagify__input > br:last-child {
695
+ display: none;
696
+ }
697
+ .tagify--loading .tagify__input::before {
698
+ content: none;
699
+ }
700
+ .tagify--loading .tagify__input::after {
701
+ content: '';
702
+ vertical-align: middle;
703
+ opacity: 1;
704
+ width: 0.7em;
705
+ height: 0.7em;
706
+ width: var(--loader-size);
707
+ height: var(--loader-size);
708
+ min-width: 0;
709
+ border: 3px solid;
710
+ border-color: #eee #bbb #888 transparent;
711
+ border-radius: 50%;
712
+ animation: rotateLoader 0.4s infinite linear;
713
+ content: '' !important;
714
+ margin: -2px 0 -2px 0.5em;
715
+ }
716
+ .tagify--loading .tagify__input:empty::after {
717
+ margin-left: 0;
718
+ }
719
+ .tagify + input,
720
+ .tagify + textarea {
721
+ position: absolute !important;
722
+ left: -9999em !important;
723
+ transform: scale(0) !important;
724
+ }
725
+ .tagify__tag {
726
+ display: inline-flex;
727
+ align-items: center;
728
+ margin: 5px 0 5px 5px;
729
+ position: relative;
730
+ z-index: 1;
731
+ outline: 0;
732
+ line-height: normal;
733
+ cursor: default;
734
+ transition: 0.13s ease-out;
735
+ }
736
+ .tagify__tag > div {
737
+ vertical-align: top;
738
+ box-sizing: border-box;
739
+ max-width: 100%;
740
+ padding: var(--tag-pad);
741
+ color: var(--tag-text-color);
742
+ line-height: inherit;
743
+ border-radius: var(--tag-border-radius);
744
+ white-space: nowrap;
745
+ transition: 0.13s ease-out;
746
+ }
747
+ .tagify__tag > div > * {
748
+ white-space: pre-wrap;
749
+ overflow: hidden;
750
+ text-overflow: ellipsis;
751
+ display: inline-block;
752
+ vertical-align: top;
753
+ min-width: var(--tag--min-width);
754
+ max-width: var(--tag--max-width);
755
+ transition: 0.8s ease, 0.1s color;
756
+ }
757
+ .tagify__tag > div > [contenteditable] {
758
+ outline: 0;
759
+ -webkit-user-select: text;
760
+ user-select: text;
761
+ cursor: text;
762
+ margin: -2px;
763
+ padding: 2px;
764
+ max-width: 350px;
765
+ }
766
+ .tagify__tag > div::before {
767
+ content: '';
768
+ position: absolute;
769
+ border-radius: inherit;
770
+ inset: var(--tag-bg-inset, 0);
771
+ z-index: -1;
772
+ pointer-events: none;
773
+ transition: 120ms ease;
774
+ animation: tags--bump 0.3s ease-out 1;
775
+ box-shadow: 0 0 0 var(--tag-inset-shadow-size) var(--tag-bg) inset;
776
+ }
777
+ .tagify__tag:focus div::before,
778
+ .tagify__tag:hover:not([readonly]) div::before {
779
+ --tag-bg-inset: -2.5px;
780
+ --tag-bg: var(--tag-hover);
781
+ }
782
+ .tagify__tag--loading {
783
+ pointer-events: none;
784
+ }
785
+ .tagify__tag--loading .tagify__tag__removeBtn {
786
+ display: none;
787
+ }
788
+ .tagify__tag--loading::after {
789
+ --loader-size: 0.4em;
790
+ content: '';
791
+ vertical-align: middle;
792
+ opacity: 1;
793
+ width: 0.7em;
794
+ height: 0.7em;
795
+ width: var(--loader-size);
796
+ height: var(--loader-size);
797
+ min-width: 0;
798
+ border: 3px solid;
799
+ border-color: #eee #bbb #888 transparent;
800
+ border-radius: 50%;
801
+ animation: rotateLoader 0.4s infinite linear;
802
+ margin: 0 0.5em 0 -0.1em;
803
+ }
804
+ .tagify__tag--flash div::before {
805
+ animation: none;
806
+ }
807
+ .tagify__tag--hide {
808
+ width: 0 !important;
809
+ padding-left: 0;
810
+ padding-right: 0;
811
+ margin-left: 0;
812
+ margin-right: 0;
813
+ opacity: 0;
814
+ transform: scale(0);
815
+ transition: var(--tag-hide-transition);
816
+ pointer-events: none;
817
+ }
818
+ .tagify__tag--hide > div > * {
819
+ white-space: nowrap;
820
+ }
821
+ .tagify__tag.tagify--noAnim > div::before {
822
+ animation: none;
823
+ }
824
+ .tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div > span {
825
+ opacity: 0.5;
826
+ }
827
+ .tagify__tag.tagify--notAllowed:not(.tagify__tag--editable) div::before {
828
+ --tag-bg: var(--tag-invalid-bg);
829
+ transition: 0.2s;
830
+ }
831
+ .tagify__tag[readonly] .tagify__tag__removeBtn {
832
+ display: none;
833
+ }
834
+ .tagify__tag[readonly] > div::before {
835
+ animation: readonlyStyles 1s calc(-1s * (var(--readonly-striped) - 1)) paused;
836
+ }
837
+
838
+ .tagify__tag--editable > div {
839
+ color: var(--tag-text-color--edit);
840
+ }
841
+ .tagify__tag--editable > div::before {
842
+ box-shadow: 0 0 0 2px var(--tag-hover) inset !important;
843
+ }
844
+ .tagify__tag--editable > .tagify__tag__removeBtn {
845
+ pointer-events: none;
846
+ }
847
+ .tagify__tag--editable > .tagify__tag__removeBtn::after {
848
+ opacity: 0;
849
+ transform: translateX(100%) translateX(5px);
850
+ }
851
+ .tagify__tag--editable.tagify--invalid > div::before {
852
+ box-shadow: 0 0 0 2px var(--tag-invalid-color) inset !important;
853
+ }
854
+ .tagify__tag__removeBtn {
855
+ order: 5;
856
+ display: inline-flex;
857
+ align-items: center;
858
+ justify-content: center;
859
+ border-radius: 50px;
860
+ cursor: pointer;
861
+ font: 14px/1 Arial;
862
+ background: var(--tag-remove-btn-bg);
863
+ color: var(--tag-remove-btn-color);
864
+ width: 14px;
865
+ height: 14px;
866
+ margin-right: 4.6666666667px;
867
+ margin-left: auto;
868
+ overflow: hidden;
869
+ transition: 0.2s ease-out;
870
+ }
871
+ .tagify__tag__removeBtn::after {
872
+ content: '×';
873
+ transition: 0.3s, color 0s;
874
+ }
875
+ .tagify__tag__removeBtn:hover {
876
+ color: var(--white);
877
+ background: var(--tag-remove-btn-bg--hover);
878
+ }
879
+ .tagify__tag__removeBtn:hover + div > span {
880
+ opacity: 0.5;
881
+ }
882
+ .tagify__tag__removeBtn:hover + div::before {
883
+ box-shadow: 0 0 0 var(--tag-inset-shadow-size) var(--tag-remove-bg, rgba(211, 148, 148, 0.3)) inset !important;
884
+ transition: box-shadow 0.2s;
885
+ }
886
+ .tagify:not(.tagify--mix) .tagify__input br {
887
+ display: none;
888
+ }
889
+ .tagify:not(.tagify--mix) .tagify__input * {
890
+ display: inline;
891
+ white-space: nowrap;
892
+ }
893
+ .tagify__input {
894
+ border-radius: var(--rounded-md);
895
+ flex-grow: 1;
896
+ display: inline-block;
897
+ min-width: 110px;
898
+ margin: 5px;
899
+ padding: var(--spacing-base) var(--spacing-md) var(--spacing-base) var(--spacing-base);
900
+ line-height: normal;
901
+ position: relative;
902
+ white-space: pre-wrap;
903
+ color: var(--input-color);
904
+ box-sizing: inherit;
905
+ }
906
+ .tagify__input:empty::before {
907
+ position: static;
908
+ }
909
+ .tagify__input:focus {
910
+ outline: 0;
911
+ }
912
+ .tagify__input:focus::before {
913
+ transition: 0.2s ease-out;
914
+ opacity: 0;
915
+ transform: translatex(6px);
916
+ }
917
+ .tagify__input:focus:empty::before {
918
+ transition: 0.2s ease-out;
919
+ opacity: 1;
920
+ transform: none;
921
+ color: rgba(0, 0, 0, 0.25);
922
+ color: var(--placeholder-color-focus);
923
+ }
924
+ .tagify__input::before {
925
+ content: attr(data-placeholder);
926
+ height: 1em;
927
+ line-height: 1em;
928
+ margin: auto 0;
929
+ z-index: 1;
930
+ color: var(--placeholder-color);
931
+ white-space: nowrap;
932
+ pointer-events: none;
933
+ opacity: 0;
934
+ position: absolute;
935
+ }
936
+ .tagify__input::after {
937
+ content: attr(data-suggest);
938
+ display: inline-block;
939
+ vertical-align: middle;
940
+ position: absolute;
941
+ min-width: calc(100% - 1.5em);
942
+ text-overflow: ellipsis;
943
+ overflow: hidden;
944
+ white-space: pre;
945
+ color: var(--tag-text-color);
946
+ opacity: 0.3;
947
+ pointer-events: none;
948
+ max-width: 100px;
949
+ }
950
+ .tagify__input .tagify__tag {
951
+ margin: 0 1px;
952
+ }
953
+ .tagify--mix {
954
+ display: block;
955
+ }
956
+ .tagify--mix .tagify__input {
957
+ background-image: url("data:image/svg+xml,%3Csvg width='18' height='10' viewBox='0 0 18 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 6C13.5523 6 14 5.55228 14 5C14 4.44772 13.5523 4 13 4L5 4C4.44771 4 4 4.44772 4 5C4 5.55228 4.44772 6 5 6L13 6Z' fill='%23D1D5DB'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M18 5C18 7.76142 15.7614 10 13 10L5 10C2.23858 10 0 7.76142 0 5C0 2.23858 2.23858 0 5 0L13 0C15.7614 0 18 2.23858 18 5ZM13 8L5 8C3.34315 8 2 6.65685 2 5C2 3.34315 3.34315 2 5 2L13 2C14.6569 2 16 3.34315 16 5C16 6.65685 14.6569 8 13 8Z' fill='%23D1D5DB'/%3E%3C/svg%3E%0A");
958
+ background-repeat: no-repeat;
959
+ background-position: right var(--spacing-sm) center;
960
+ padding: var(--spacing-base) var(--spacing-xl) var(--spacing-base) var(--spacing-base);
961
+ margin: 0;
962
+ width: 100%;
963
+ height: 100%;
964
+ display: block;
965
+ min-height: 54px;
966
+ }
967
+ .tagify--mix .tagify__input::before {
968
+ height: auto;
969
+ display: none;
970
+ line-height: inherit;
971
+ }
972
+ .tagify--mix .tagify__input::after {
973
+ content: none;
974
+ }
975
+ .tagify--select::after {
976
+ content: '>';
977
+ opacity: 0.5;
978
+ position: absolute;
979
+ top: 50%;
980
+ right: 0;
981
+ bottom: 0;
982
+ font: 16px monospace;
983
+ line-height: 8px;
984
+ height: 8px;
985
+ pointer-events: none;
986
+ transform: translate(-150%, -50%) scaleX(1.2) rotate(90deg);
987
+ transition: 0.2s ease-in-out;
988
+ }
989
+ .tagify--select[aria-expanded='true']::after {
990
+ transform: translate(-150%, -50%) rotate(270deg) scaleY(1.2);
991
+ }
992
+ .tagify--select .tagify__tag {
993
+ position: absolute;
994
+ top: 0;
995
+ right: 1.8em;
996
+ bottom: 0;
997
+ }
998
+ .tagify--select .tagify__tag div {
999
+ display: none;
1000
+ }
1001
+ .tagify--select .tagify__input {
1002
+ width: 100%;
1003
+ }
1004
+ .tagify--empty .tagify__input::before {
1005
+ transition: 0.2s ease-out;
1006
+ opacity: 1;
1007
+ transform: none;
1008
+ display: inline-block;
1009
+ width: auto;
1010
+ }
1011
+ .tagify--mix .tagify--empty .tagify__input::before {
1012
+ display: inline-block;
1013
+ }
1014
+ .tagify--focus {
1015
+ --tags-border-color: var(--tags-focus-border-color);
1016
+ transition: 0s;
1017
+ }
1018
+ .tagify--invalid {
1019
+ --tags-border-color: #d39494;
1020
+ }
1021
+ .tagify__dropdown {
1022
+ position: absolute;
1023
+ z-index: 9999;
1024
+ transform: translateY(1px);
1025
+ overflow: hidden;
1026
+ }
1027
+ .tagify__dropdown[placement='top'] {
1028
+ margin-top: 0;
1029
+ transform: translateY(-100%);
1030
+ }
1031
+ .tagify__dropdown[placement='top'] .tagify__dropdown__wrapper {
1032
+ border-top-width: 1.1px;
1033
+ border-bottom-width: 0;
1034
+ }
1035
+ .tagify__dropdown[position='text'] {
1036
+ box-shadow: 0 0 0 3px rgba(var(--tagify-dd-color-primary), 0.1);
1037
+ font-size: 0.9em;
1038
+ }
1039
+ .tagify__dropdown[position='text'] .tagify__dropdown__wrapper {
1040
+ border-width: 1px;
1041
+ }
1042
+ .tagify__dropdown__wrapper {
1043
+ max-height: 300px;
1044
+ overflow: auto;
1045
+ overflow-x: hidden;
1046
+ background: var(--tagify-dd-bg-color);
1047
+ border: 1px solid;
1048
+ border-color: var(--tagify-dd-color-primary);
1049
+ border-bottom-width: 1.5px;
1050
+ border-top-width: 0;
1051
+ box-shadow: 0 2px 4px -2px rgba(0, 0, 0, 0.2);
1052
+ transition: 0.25s cubic-bezier(0, 1, 0.5, 1);
1053
+ }
1054
+ .tagify__dropdown__header:empty {
1055
+ display: none;
1056
+ }
1057
+ .tagify__dropdown__footer {
1058
+ display: inline-block;
1059
+ margin-top: 0.5em;
1060
+ padding: var(--tagify-dd-item-pad);
1061
+ font-size: 0.7em;
1062
+ font-style: italic;
1063
+ opacity: 0.5;
1064
+ }
1065
+ .tagify__dropdown__footer:empty {
1066
+ display: none;
1067
+ }
1068
+ .tagify__dropdown--initial .tagify__dropdown__wrapper {
1069
+ max-height: 20px;
1070
+ transform: translateY(-1em);
1071
+ }
1072
+ .tagify__dropdown--initial[placement='top'] .tagify__dropdown__wrapper {
1073
+ transform: translateY(2em);
1074
+ }
1075
+ .tagify__dropdown__item {
1076
+ box-sizing: border-box;
1077
+ padding: var(--tagify-dd-item-pad);
1078
+ margin: 1px;
1079
+ cursor: pointer;
1080
+ border-radius: 2px;
1081
+ position: relative;
1082
+ outline: 0;
1083
+ max-height: 60px;
1084
+ max-width: 100%;
1085
+ }
1086
+ .tagify__dropdown__item--active {
1087
+ background: var(--tagify-dd-color-primary);
1088
+ color: #fff;
1089
+ }
1090
+ .tagify__dropdown__item:active {
1091
+ filter: brightness(105%);
1092
+ }
1093
+ .tagify__dropdown__item--hidden {
1094
+ padding-top: 0;
1095
+ padding-bottom: 0;
1096
+ margin: 0 1px;
1097
+ pointer-events: none;
1098
+ overflow: hidden;
1099
+ max-height: 0;
1100
+ transition: var(--tagify-dd-item--hidden-duration, 0.3s) !important;
1101
+ }
1102
+ .tagify__dropdown__item--hidden > * {
1103
+ transform: translateY(-100%);
1104
+ opacity: 0;
1105
+ transition: inherit;
1106
+ }
1107
+ `;import{jsx as ye,jsxs as Ga}from"@emotion/react/jsx-runtime";function Oa({variable:e,onSubmit:r,onCancel:o}){var t,n,i,g,d,f,s,m,c;let{variables:a}=be();return ye(oi,{initialValues:{name:e,default:(n=(t=a[e])==null?void 0:t.default)!=null?n:"",displayName:(g=(i=a[e])==null?void 0:i.displayName)!=null?g:"",helpText:(f=(d=a[e])==null?void 0:d.helpText)!=null?f:"",order:(s=a[e])==null?void 0:s.order,type:(c=(m=a[e])==null?void 0:m.type)!=null?c:""},onSubmit:y=>{let P={...y,helpText:y.helpText||void 0,type:y.type||void 0,displayName:y.displayName||void 0};return r(P)},children:({getFieldProps:y})=>Ga(ai,{css:Ua,children:[ye(gt,{...y("name"),label:"Name"}),ye(gt,{...y("helpText"),label:"Help Text",caption:"Appears in the composition data resource when entering a value for this variable.",autoComplete:"off"}),ye(gt,{...y("default"),label:"Default Value",autoComplete:"off"}),Ga("div",{css:za,children:[ye(Ha,{type:"submit",children:"Save"}),ye(Ha,{type:"button",buttonType:"ghost",onClick:o,children:"cancel"})]})]})})}import{jsx as ni,jsxs as ii}from"@emotion/react/jsx-runtime";var qa=xe.createContext(null);function bp({value:e,onChange:r,editVariableComponent:o,children:a}){let[t,n]=xe.useState(),i=o!=null?o:Oa,g={dispatch:d=>{if(d.type==="set"){let{name:f,...s}=d.variable;r({...g.variables,[d.variable.name]:s}),d.openEditor&&n(d.variable.name)}else if(d.type==="edit")n(d.variable);else if(d.type==="remove"){let f={...e};delete f[d.variable],r(f)}else throw new Error(`Unknown event ${JSON.stringify(d)}`)},variables:e};return ii(qa.Provider,{value:g,children:[a,typeof t!="undefined"?ni(i,{onSubmit:d=>{n(void 0);let{name:f,...s}=d;r({...e,[f]:s})},onCancel:()=>n(void 0),variable:t}):null]})}function be(){let e=xe.useContext(qa);if(!e)throw new Error("No VariablesProvider present");return e}import{AddListButton as si,button as li,Icon as di,Table as ci,TableBody as pi,TableCellData as mt,TableCellHead as ft,TableHead as ui,TableRow as $a}from"@uniformdev/design-system";import{css as Fa}from"@emotion/react";import{Fragment as gi,jsx as B,jsxs as Fe}from"@emotion/react/jsx-runtime";function kp(){let{variables:e,dispatch:r}=be(),o=Ma(e);return Fe(gi,{children:[Fe(ci,{children:[B(ui,{children:Fe($a,{children:[B(ft,{children:"Name"}),B(ft,{children:"Default Value"}),B(ft,{})]})}),B(pi,{children:o.map(({name:a,displayName:t,default:n})=>{let i=t!=null?t:a;return Fe($a,{id:i,children:[B(mt,{children:B("button",{css:Fa`
1108
+ border: none;
1109
+ color: var(--brand-secondary-5);
1110
+ font-weight: var(--fw-medium);
1111
+ padding: 0;
1112
+ background: none;
1113
+ `,type:"button",onClick:g=>{g.preventDefault(),r({type:"edit",variable:a})},children:i})}),B(mt,{children:n}),B(mt,{align:"right",children:B("button",{type:"button",title:`delete ${i}`,css:[li,Fa`
1114
+ background: transparent;
1115
+ `],"aria-controls":i,onClick:()=>r({type:"remove",variable:a}),children:B(di,{icon:"trash",iconColor:"red"})})})]},a)})})]}),B(si,{onButtonClick:()=>r({type:"edit",variable:""}),"aria-label":"Add variable",buttonText:"add variable",icon:"math-plus",css:{marginLeft:"var(--spacing-md)"}})]})}import*as U from"react";import mi from"@yaireo/tagify/dist/react.tagify";import{Global as fi}from"@emotion/react";import{Fragment as vi,jsx as Wa,jsxs as hi}from"@emotion/react/jsx-runtime";function Na(e){return e.replace(/\${{.*?"value":"([^"]+)".*?}}/g,"${$1}").replace(/[\r\n]+/g,"")}function Ka({label:e,value:r,disableVariables:o,onChange:a}){let{variables:t,dispatch:n}=be(),i=U.useRef(t),g=U.useRef(n),d=U.useRef(a),f=U.useRef();U.useEffect(()=>{i.current=t},[t]),U.useEffect(()=>{g.current=n},[n]),U.useEffect(()=>{d.current=a},[a]),U.useEffect(()=>{var y,P,w;let c=Na((P=(y=f.current)==null?void 0:y.getInputValue())!=null?P:"");r!==c&&((w=f.current)==null||w.loadOriginalValues(r))},[r]);let s=U.useCallback(c=>{d.current(Na(c))},[]),m=U.useCallback(c=>{i.current[c]||g.current({type:"set",variable:{name:c,default:""},openEditor:!0})},[]);return hi(vi,{children:[Wa(fi,{styles:Ba}),Wa(mi,{tagifyRef:f,"aria-label":e,defaultValue:r,autoFocus:!1,whitelist:Object.entries(t).map(([c,y])=>{var P;return{name:(P=y.displayName)!=null?P:c,value:c}}),settings:{pattern:o?null:/\$/,enforceWhitelist:o,mixTagsInterpolator:["${","}"],duplicates:!0,tagTextProp:"name",dropdown:{position:"text",enabled:0,mapValueTo:c=>c.name,includeSelectedTags:!0,searchKeys:["name","value"],highlightFirst:!0}},InputMode:"textarea",onAdd:c=>{var P;let y=(P=c.detail.data)==null?void 0:P.value;y&&m(y)},onRemove:c=>{s(c.detail.tagify.getInputValue())},onChange:c=>{s(c.detail.value)},onInput:c=>{s(c.detail.tagify.getInputValue())}})]})}import xi from"@monaco-editor/react";import{InputSelect as wi}from"@uniformdev/design-system";import{useState as Si}from"react";import*as we from"react";import{jsx as yi}from"@emotion/react/jsx-runtime";var Ya=we.createContext(null);function Bp({value:e,onChange:r,children:o}){let a=we.useMemo(()=>({dispatch:t=>{if(t.type==="setRelativeUrl")r({...e,relativeUrl:t.relativeUrl,parameters:X(t.relativeUrl)});else if(t.type==="updateParameter"){let n=Qa(e.relativeUrl,i=>{let g=`${t.parameter.key}=${t.parameter.value}`;typeof t.index!="undefined"?i[t.index]=g:i.push(g)});r({...e,relativeUrl:n,parameters:X(n)})}else if(t.type==="removeParameter"){let n=Qa(e.relativeUrl,i=>{i.splice(t.index,1)});r({...e,relativeUrl:n,parameters:X(n)})}else if(t.type==="updateHeader"){let n=[...e.headers];typeof t.index!="undefined"?n[t.index]=t.header:n.push(t.header),r({...e,headers:n,parameters:X(e.relativeUrl)})}else if(t.type==="removeHeader"){let n=[...e.headers];n.splice(t.index,1),r({...e,headers:n,parameters:X(e.relativeUrl)})}else if(t.type==="setMethod")r({...e,method:t.method,parameters:X(e.relativeUrl)});else if(t.type==="setBody")r({...e,body:t.body,parameters:X(e.relativeUrl)});else throw new Error(`Unknown event ${JSON.stringify(t)}`)},request:{...e,parameters:X(e.relativeUrl)}}),[r,e]);return yi(Ya.Provider,{value:a,children:o})}function Y(){let e=we.useContext(Ya);if(!e)throw new Error("No RequestProvider present");return e}function Qa(e,r){let[o,a]=e.split("?"),t=o,n=(a!=null?a:"").split("&");return r(n),t+=`?${n.join("&")}`,t}function X(e){var r,o;return((o=(r=e.split("?")[1])==null?void 0:r.split("&").map(a=>{let[t,n]=a.split("=");return{key:t,value:n!=null?n:""}}))!=null?o:[]).filter(a=>a.key)}function Ap(e){let[r]=e.split("?");return[r,X(e)]}import{css as Za}from"@emotion/react";var Ne=Za`
1116
+ background: var(--white);
1117
+ `,Xa=e=>Za`
1118
+ align-items: end;
1119
+ background: ${e};
1120
+ display: grid;
1121
+ grid-template-columns: 12ch 1fr;
1122
+ gap: var(--spacing-sm);
1123
+ `;import{jsx as bi}from"@emotion/react/jsx-runtime";var Ja=({bgColor:e="transparent",children:r,...o})=>bi("div",{css:Xa(e),...o,children:r});import{css as ja}from"@emotion/react";import{jsx as ht,jsxs as Ci}from"@emotion/react/jsx-runtime";function jp(){let{request:e,dispatch:r}=Y(),[o,a]=Si("json");return Ci("div",{css:ja`
1124
+ background: var(--white);
1125
+ `,children:[ht(Ja,{bgColor:"var(--gray-100)",css:ja`
1126
+ padding: var(--spacing-sm) var(--spacing-base);
1127
+ `,children:ht(wi,{label:"Language",showLabel:!1,options:[{label:"Text",value:"plaintext"},{label:"JSON",value:"json"},{label:"YAML",value:"yaml"},{label:"JavaScript",value:"javascript"},{label:"XML",value:"xml"},{label:"HTML",value:"html"}],value:o,onChange:t=>{a(t.currentTarget.value)}})}),ht(xi,{height:200,value:e.body,language:o,options:{language:o,minimap:{enabled:!1},folding:!1},onChange:t=>{!t||r({type:"setBody",body:t})}})]})}import{Table as Ri,TableHead as Pi,TableRow as eo,TableCellHead as to,TableBody as Ti,TableCellData as ro,Input as ao}from"@uniformdev/design-system";import{jsx as J,jsxs as yt}from"@emotion/react/jsx-runtime";function nu({disableVariables:e}){let{dispatch:r,request:o}=Y(),a=[...o.headers,{key:"",value:""}];return J("div",{css:Ne,children:yt(Ri,{children:[J(Pi,{children:yt(eo,{children:[J(to,{children:"Name"}),J(to,{children:"Value"})]})}),J(Ti,{children:a.map((t,n)=>yt(eo,{children:[J(ro,{width:"50%",children:J(ao,{label:t.key,value:t.key,showLabel:!1,onChange:i=>{i.currentTarget.value?r({type:"updateHeader",header:{key:i.currentTarget.value,value:t.value},index:n}):r({type:"removeHeader",index:n})}})}),J(ro,{width:"50%",children:t.key?J(ao,{showLabel:!1,label:t.value,value:t.value,onChange:i=>r({type:"updateHeader",header:{key:t.key,value:i.currentTarget.value},index:n})}):null})]},n))})]})})}import{InputSelect as ki}from"@uniformdev/design-system";import{jsx as Li}from"@emotion/react/jsx-runtime";function uu(e){var a;let{request:r,dispatch:o}=Y();return Li(ki,{...e,options:[{label:"GET",value:"GET"},{label:"POST",value:"POST"},{label:"HEAD",value:"HEAD"}],value:(a=r.method)!=null?a:"GET",onChange:t=>o({type:"setMethod",method:t.currentTarget.value})})}import{Table as _i,TableHead as Ii,TableRow as oo,TableCellHead as no,TableBody as Vi,TableCellData as io,Input as so}from"@uniformdev/design-system";import{jsx as j,jsxs as bt}from"@emotion/react/jsx-runtime";function yu({disableVariables:e}){let{dispatch:r,request:o}=Y(),a=[...o.parameters,{key:"",value:""}];return j("div",{css:Ne,children:bt(_i,{children:[j(Ii,{children:bt(oo,{children:[j(no,{children:"Name"}),j(no,{children:"Value"})]})}),j(Vi,{children:a.map((t,n)=>bt(oo,{children:[j(io,{width:"50%",children:j(so,{label:t.key,value:t.key,showLabel:!1,onChange:i=>{i.currentTarget.value?r({type:"updateParameter",parameter:{key:i.currentTarget.value,value:t.value},index:n}):r({type:"removeParameter",index:n})}})}),j(io,{width:"50%",children:t.key?j(so,{showLabel:!1,label:t.value,value:t.value,onChange:i=>r({type:"updateParameter",parameter:{key:t.key,value:i.currentTarget.value},index:n})}):null})]},n))})]})})}import{jsx as Ei}from"@emotion/react/jsx-runtime";function Pu(e){let{request:r,dispatch:o}=Y();return Ei(Ka,{...e,value:r.relativeUrl,onChange:a=>{let t=a;r.baseUrl&&t.startsWith(r.baseUrl)&&(t=t.substring(r.baseUrl.length)),o({type:"setRelativeUrl",relativeUrl:t})}})}export*from"@uniformdev/mesh-sdk";import{Button as Au,Callout as Hu,LoadingIndicator as Gu,LoadingOverlay as Ou,Menu as qu,MenuItem as $u,Input as Fu,InputSelect as Nu,InputToggle as Wu,Theme as Ku,InputKeywordSearch as Qu,Heading as Yu,ScrollableList as Zu,ScrollableListItem as Xu,Textarea as Ju,Switch as ju,Label as eg,AddListButton as tg}from"@uniformdev/design-system";export{tg as AddListButton,Au as Button,Hu as Callout,Yc as DamSelectedItem,Fr as DefaultSearchRow,Ur as DefaultSelectedItem,oa as EntrySearch,Yu as Heading,Je as Icons,Fu as Input,Nu as InputSelect,Wu as InputToggle,Ka as InputVariables,Qu as KeywordSearchInput,eg as Label,Gu as LoadingIndicator,Ou as LoadingOverlay,qu as Menu,$u as MenuItem,ap as MeshApp,Yt as ProductPreviewList,$s as ProductQuery,Kt as ProductQueryContext,Ec as ProductSearch,wa as ProductSearchContext,ga as ProductSearchRow,xa as ProductSelectedItem,jp as RequestBody,nu as RequestHeaders,uu as RequestMethodSelect,yu as RequestParameters,Bp as RequestProvider,Ja as RequestTypeContainer,Pu as RequestUrlInput,Ut as ResolvableLoadingValue,Zu as ScrollableList,Xu as ScrollableListItem,Gt as SelectionField,ju as Switch,Ju as Textarea,Ku as Theme,It as UniformMeshLocationContext,Ve as UniformMeshLocationContextProvider,Ie as UniformMeshSdkContext,Oi as UniformMeshSdkContextProvider,Oa as VariableEditor,kp as VariablesList,bp as VariablesProvider,at as badgeIcon,pt as damSelectItemImage,Sa as damSelectedItemContainer,Pa as damSelectedItemCopy,Ra as damSelectedItemDetails,ka as damSelectedItemIcon,Va as damSelectedItemInfoBtn,Ca as damSelectedItemInner,ct as damSelectedItemLinkBtn,_a as damSelectedItemLinkContainer,Ia as damSelectedItemMediaContainer,La as damSelectedItemPopover,$e as damSelectedItemPopoverLabel,ve as damSelectedItemSmallText,Ta as damSelectedItemTitle,Ap as decomposeRelativeUrl,jr as draggableContainer,rt as draggableIcon,ta as draggableIconOffset,ea as draggableIconWrapper,Wr as entrySearchBtn,Qr as entrySearchConfig,Yr as entrySearchConfigHidden,Kr as entrySearchLoadMoreBtn,Zr as entrySearchResultList,Xr as entrySearchSelectIcon,Jr as entrySearchSelectImg,Id as entrySearchSelectInput,Vd as entrySearchSelectOption,Nr as entrySearchWrapper,pa as productSearchRowActiveIcon,da as productSearchRowCategory,na as productSearchRowContainer,ia as productSearchRowContent,sa as productSearchRowContentActive,ca as productSearchRowDetails,la as productSearchRowTitle,fa as productSelectedItemContainer,ha as productSelectedItemContent,va as productSelectedItemDetails,ya as productSelectedItemIcon,it as productSelectedItemImage,ba as productSelectedItemLinkContainer,st as productedSelectedItemLinkBtn,lt as productedSelectedItemSmallText,Gr as searchRowBtn,zr as searchRowContainer,Ar as searchRowContainerActive,Br as searchRowContainerWithPopover,Hr as searchRowPopover,tt as searchRowText,et as searchRowTextSmall,je as selectItemLinkBtn,Er as selectItemLinkContainer,Vr as selectItemPopover,ke as selectItemPopoverLabel,le as selectItemSmallText,Pr as selectedItemContainer,Lr as selectedItemCopy,kr as selectedItemDetails,Ir as selectedItemIcon,Tr as selectedItemInner,_r as selectedItemTitle,Et as useInitializeUniformMeshSdk,cs as useMeshLocation,Qt as useProductQueryContext,qe as useProductSearchContext,Y as useRequest,ts as useUniformMeshLocation,Ee as useUniformMeshLocationContext,_t as useUniformMeshSdk,Lt as useUniformMeshSdkContext,be as useVariables,Ma as variablesToList};