1(this.webpackJsonpapp=this.webpackJsonpapp||[]).push([[26],{1674:function(e,t,a){"use strict";a.r(t);var l=a(1),n=a(1019),c=a(66),s=a.n(c),r=a(0),o=a.n(r),i=a(9),u=a(2),d=a(124),p=a(4);const m={value:"All",label:"All"};const f=i.b.div` 2 display: flex; 3 flex-direction: column; 4 word-break: break-all; 5 6 .domain { 7 font-size: 0.9em; 8 padding-right: 5px; 9 color: var(--p-interactive, #006fbb); 10 } 11`,h=i.b.div` 12 .choicelist-wrap { 13 margin-top: 1rem; 14 } 15 16 .Polaris-ChoiceList__Choices { 17 max-height: 280px; 18 overflow-y: scroll; 19 padding-left: 2px; 20 } 21`;t.default=function(e){var t;let{options:a,value:c,loading:r,error:i,onChange:b,onSearchChange:v}=e;const[E,g]=o.a.useReducer(u.Hb,{inputVal:"",options:a,deselectedOptions:a,selected:c}),O=Object(d.a)(b),C=JSON.stringify(a),k=o.a.useRef(!1);o.a.useEffect(()=>{let e=JSON.parse(C);var t;t=e||[],e=Object(u.c)(t)?[]:t.map(e=>{const{data:t}=e||{},{id:a,title:l,email:n,domain:c,platform:s}=t||{};let r=(c||"").replace(/https?:\/\//,"");return s&&[p.M.Ebay,p.M.Amazon
21].includes(s)&&(r=n),{value:a,label:o.a.createElement(f,null,o.a.createElement("span",{className:"title"},l),o.a.createElement("span",{className:"domain"},r)),data:t}}),k.current||e.unshift(m),g({deselectedOptions:e,options:e})},[C]);const w=o.a.useRef(c);o.a.useEffect(()=>{s()(c,w.current)||(g({selected:c}),w.current=c)},[c]);const x=o.a.useRef(null),N=o.a.useCallback((e,t)=>{g({[t]:e}),k.current=!!e,x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{v?v({search:e}):(()=>{if(!e)return void g({options:E.deselectedOptions});const t=new RegExp(e,"i"),a=E.deselectedOptions.filter(e=>e.label.match(t));g({options:a})})()},500)},[E.deselectedOptions,v]),R=o.a.useCallback(()=>{N("","inputVal")},[N]),S=o.a.useCallback(e=>{g({selected:e});const t=E.deselectedOptions.filter(t=>{let{value:a}=t;return e.includes(a)});O&&O(t)},[E.deselectedOptions,O]);return o.a.useEffect(()=>()=>{clearTimeout(x.current)},[]),o.a.createElement(h,null,o.a.createElement(l.cb,{value:E.inputVal,onChange:N,id:"inputVal",prefix:o.a.createElement(l.w,{source:n.a,color:"inkLighter"}),autoFocus:!0,placeholder:"Search for store",onClearButtonClick:R,clearButton:!0}),o.a.createElement("div",{className:"mt-4"},r?o.a.createElement(l.X,{size:"small"}):i?o.a.createElement("div",null,"Error: ",Object(u.ib)(i.toString())):(null===(t=E.options)||void 0===t?void 0:t.length)>0?o.a.createElement("div",{className:"choicelist-wrap"},o.a.createElement(l.k,{choices:E.options,selected:E.selected,onChange:S})):o.a.createElement("span",null,"No items found")))}}}]); 22//# sourceMappingURL=26.d712bf38.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.