@uniformdev/mesh-sdk-react 17.4.1-alpha.37 → 17.5.0

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