Files
004_comission/_utils/_comment_backup/louis coding's Reviews on Carousell Hong Kong_files/cbef593823b95071.min.js.download
louiscklaw 6c60a73f30 update,
2025-01-31 19:15:17 +08:00

6 lines
8.2 KiB
Plaintext

"use strict";
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a8d636ab-5234-59a2-8a16-95a7e57c7ac9")}catch(e){}}();
(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[18],{746:(e,t,n)=>{n.d(t,{Z:()=>h});var s=n(9),o=n.n(s),i=n(0),r=n(74),a=n(100),l=n(1);const c={},d=({children:e,className:t,container:n,customStyles:s=c,horizontalAlign:d="center",keepOpenOnTargetClick:p=false,onHide:g,onMouseLeave:h,onMouseOver:y,show:m,target:f,useTargetWidth:_=false,verticalAlign:w="bottom",customPosition:v},S)=>{const[A,C]=(0,i.useState)(0),[O,M]=(0,i.useState)(0),[R,T]=(0,i.useState)(void 0),x=(0,i.useRef)(null);i.useImperativeHandle(S,(()=>x.current));const z=(0,i.useRef)(null),[j,L]=(0,i.useState)(m),E=(0,i.useCallback)((()=>{const e=x.current;let t,s;try{t=r.findDOMNode(f),s=r.findDOMNode(n)}catch(e){}if(t instanceof HTMLElement&&s instanceof HTMLElement&&e instanceof HTMLElement){const n=u(e,t,s,d,w);C(n.positionLeft),M(n.positionTop),T(n.width)}else C(0),M(0),T(void 0)}),[n,d,f,w]),b=(0,i.useCallback)((e=>{const{target:t}=e;if(t instanceof Element){const n=r.findDOMNode(f),s=n instanceof Element&&n.contains(t),o=x.current&&x.current.contains(t);if(!g||p&&s||o)return;g(e)}}),[p,g,f]);(0,i.useEffect)((()=>(j!==m&&(z.current=setTimeout((()=>L(m)))),()=>{z.current&&clearTimeout(z.current)})),[j,m]),(0,a.LI)((()=>(j&&(E(),document.addEventListener("click",b)),()=>{document.removeEventListener("click",b)})),[b,j,E]);const I=o()("D_CE",t);return j?(0,l.jsx)("div",{className:I,onMouseLeave:h,onMouseOver:y,ref:x,style:{left:v?.left??A,position:"absolute",top:v?.top??O,width:_?R:void 0,...s},children:e}):null},u=(e,t,n,s,o)=>{const i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),{height:a,width:l}=e.getBoundingClientRect(),c={height:i.height,left:i.left-r.left,top:i.top-r.top,width:i.width},d="top"===o?c.top-a:c.top+c.height;let u;return"left"===s?u=c.left:"right"===s?u=c.left+c.width-l:(u=c.left+(c.width-l)/2,u+=p(u,l,n)),{positionLeft:u,positionTop:d,width:c.width}},p=(e,t,n)=>{const{width:s}=n.getBoundingClientRect(),o=e+t;return e<0?-e:o>s?s-o:0},g=(0,i.forwardRef)(d);g.displayName="Popover";const h=g},859:(e,t,n)=>{n.d(t,{Z:()=>l}),n(0);var s=n(10),o=n(99),i=n(21),r=n(18),a=n(1);const l=function(e){const t=(0,o._x)(),{className:n,size:l=24,theme:c="red"}=e;let d,u;const p=(0,s.v9)(i.l$);return"white"===c?(d=t.white,u=t.urbanGrey90):(d=t.carouRed50,u=t.white),(0,a.jsx)("svg",{"aria-label":p(r.ZP`Carousell logo`),className:n,height:l,viewBox:"0 0 80 80",width:l,xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsxs)("g",{fill:"none",fillRule:"evenodd",children:[(0,a.jsx)("path",{d:"M69.57 6.55V3.69A3.69 3.69 0 0065.87 0h-9.3a3.69 3.69 0 00-3.7 3.7v2.04H15.05C10.21 5.74 3 8.94 3 17.79v49.83c0 4.85 3.21 12.06 12.05 12.06H64.9c4.85 0 12.05-3.21 12.05-12.06V17.8c0-3.87-2.05-9.23-7.37-11.24",fill:d}),(0,a.jsx)("path",{d:"M63.64 40.5h-6.1a2.2 2.2 0 100 4.42h6.1a2.21 2.21 0 100-4.42m-9.63-4.04a2.2 2.2 0 002.91 1.12l5.57-2.48a2.2 2.2 0 10-1.8-4.04l-5.56 2.48A2.2 2.2 0 0054 36.46m-.64-5.33l4.08-4.53a2.2 2.2 0 10-3.28-2.96l-4.08 4.53a2.2 2.2 0 00.16 3.12 2.2 2.2 0 003.12-.16",fill:u}),(0,a.jsx)("path",{d:"M47.5 58.74a2.2 2.2 0 00-2.78-1.42 15.37 15.37 0 11-4.75-29.97 15.37 15.37 0 014.75.75 2.21 2.21 0 002.78-1.42l1.89-5.8a2.21 2.21 0 00-1.42-2.78 25.87 25.87 0 00-8-1.27 25.88 25.88 0 108 50.5 2.2 2.2 0 001.42-2.8l-1.89-5.8",fill:u}),(0,a.jsx)("path",{d:"M53.37 54.29a2.21 2.21 0 00-3.28 2.96l4.08 4.53a2.21 2.21 0 003.28-2.96l-4.08-4.53m9.13-3.97l-5.58-2.48a2.21 2.21 0 00-1.8 4.03l5.58 2.49a2.21 2.21 0 001.8-4.04",fill:u})]})})}},737:(e,t,n)=>{n.d(t,{Z:()=>a});var s=n(0),o=n(10),i=n(21),r=n(1);const a=({id:e,options:t})=>{const n=(0,o.v9)(i.l$),a=(e,n)=>{if(0===n.length)return[e];const[s,...o]=n,[i,r]=e.split(s);return[i,t[s.slice(2,-1)]||s,...a(r,o)]},l=n(e),c=l.match(/%\{.*?\}/g);return c?(0,r.jsx)(r.Fragment,{children:a(l,c).map(((e,t)=>(0,r.jsx)(s.Fragment,{children:e},t)))}):(0,r.jsx)(r.Fragment,{children:l})}},2441:(e,t,n)=>{function s(e,t,n){const s={name:e,type:t};return n&&(s.properties=n),{payload:{track:s},type:"Track/trackBatchedEvent"}}function o(e){return s("client_impression_sa_search","screen",e)}function i(e){return s("related_keyword_loaded","action",e)}function r(e){return s("related_keyword_tapped","action",e)}function a(e){return s("sa_listing_row_visible","screen",e)}function l(e){return s("sa_prompt_suggestion_tapped","action",e)}function c(e){return s("search_bar_tapped","action",e)}n.d(t,{Jg:()=>i,bS:()=>a,rx:()=>l,sp:()=>r,tO:()=>o,tW:()=>c})},1204:(e,t,n)=>{n.d(t,{_l:()=>x,ib:()=>T,hN:()=>j,yH:()=>k,ZU:()=>b,TY:()=>L,gq:()=>I,FM:()=>E,MB:()=>R});var s=n(6),o=n(4),i=n(24),r=n(5),a=n(406),l=n(7),c=n(102),d=n(2426);function u(e){return function(e,t,n){const s={name:e,type:t};return n&&(s.properties=n),{payload:{track:s},type:"Track/trackBatchedEvent"}}("page_load_failure","action",e)}var p=n(2441),g=n(103),h=n(73),y=n(409),m=n(106),f=n(110);const _="ShoppingAssistant";var w=n(411);const v=(0,s.oM)({initialState:{journeyId:"",requestId:"",searchResults:{},suggestions:[]},name:_,reducers:{setAssistantSearchResults(e,t){const{prompt:n,results:s}=t.payload;e.searchResults[n.toLowerCase()]=s},setHasSAOpenedOnSearchTap(e){e.hasSAOpenedOnSearchTap=!0},setJourneyIdForSAPrompt(e,t){e.journeyId=t.payload},setRequestIdForSAPrompt(e,t){e.requestId=t.payload},setSuggestions(e,t){e.suggestions=t.payload}}}),{reducer:S,actions:{setSuggestions:A,setAssistantSearchResults:C,setJourneyIdForSAPrompt:O,setRequestIdForSAPrompt:M,setHasSAOpenedOnSearchTap:R}}=v,T=(0,s.PH)(`${v.name}/fetchPageShoppingAssistantResults`);function*x(e){try{yield(0,o.gz)(e.pending());const{suggestions:t}=yield(0,o.RE)(g.S,(0,c.d5)());yield(0,o.gz)(A(t)),yield(0,o.gz)(e.success())}catch(t){yield(0,o.gz)(e.error(t))}}function*z(e){const{prompt:t}=e.payload,n=yield(0,o.Ys)(i.S$),s=(0,a.Kh)("shoppingAssistantResults"),r=yield(0,o.Ys)((e=>E(e,t)));try{if(yield(0,o.gz)(s.pending()),r)return yield(0,o.gw)(200),void(yield(0,o.gz)(s.success()));const e=yield(0,o.RE)(g.B,(0,c.r$)(),{count:null,countryId:{value:Number(n.country_id)},prompt:t}),{metaData:{"x-request-id":i},body:a}=e,l=[];yield(0,o.gz)(M(i||""));const h=(0,w.Zs)();yield(0,o.gz)(O(h)),yield(0,o.gz)((0,d.H6)({browse_type:"sa_search_results",context:a.listingsForKeyword.map((({keyword:e})=>e)).join(","),initial_query:a.originalKeywords.length?a.originalKeywords.join(","):"",journey_id:h,page_type:"shopping_assistant_search",request_id:i||"",search_query:t,search_query_source:"direct_sa_search"})),a.additionalKeywordsToSearch.length&&(yield(0,o.gz)((0,p.Jg)({context:a.listingsForKeyword.length?"little_results":"empty",no_suggestions:a.additionalKeywordsToSearch.length,search_query:t}))),a.resultInfo?.primaryMessage.includes("illegal")&&!a.listingsForKeyword.length&&(yield(0,o.gz)(u({context:"invalid_prompt",journey_id:h,page:"shopping_assistant_search"}))),yield(0,o.gz)(C({prompt:t,results:{additionalKeywordsToSearch:a.additionalKeywordsToSearch,description:a.description,listingsForKeyword:a.listingsForKeyword.map((e=>{const t=e.listingCards;return l.push(...t),{...e,listingCards:t.map((e=>{const t=(0,f.Bg)(e);return{...t,aboveFold:t.aboveFold.map((e=>{const t=e;return t.timestampContent?{...t,timestampContent:{...t.timestampContent,seconds:{high:0,low:t.timestampContent.seconds,unsigned:!1}}}:e}))}})),total:e.total}})),resultInfo:a.resultInfo,suggestion:a.suggestion}})),yield(0,o.gz)((0,m.gq)({listingCards:l})),yield(0,o.gz)(s.success())}catch(e){yield(0,o.gz)(s.error(e));const t=(0,w.Zs)();yield(0,o.gz)(O(t)),yield(0,o.gz)(u({context:"general_error",journey_id:t,page:"shopping_assistant_search"}))}}function*j(){const{country_code:e}=yield(0,o.Ys)(i.S$);yield(0,o.rM)(h.e,e),yield(0,o.rM)(y.OJ,e)}l.Z.register(_,(function*(){yield(0,o.ib)(T.type,z)})),r.Z.register(v.name,S);const L=e=>e[v.name].suggestions,E=(e,t)=>e[v.name].searchResults[t.toLowerCase()]||null,b=e=>e[v.name].journeyId,I=e=>e[v.name].requestId,k=e=>e[v.name].hasSAOpenedOnSearchTap}}]);
//# sourceMappingURL=https://mdev.llesuorac.com/01857052a1fbff6c7926249973b6164fd2b19d8b/cbef593823b95071.min.js.map
//# debugId=a8d636ab-5234-59a2-8a16-95a7e57c7ac9