@uniformdev/mesh-sdk-react 16.2.4 → 17.1.1-alpha.151

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