PageSourceSearch

https://wix-tripadvisor-reviews.microapps-2e4.workers.dev/_next/st…/app/(app)/reviews/page-93f10460aafc0a7f.js

js wix-tripadvisor-reviews.microapps-2e4.workers.dev collected 2026-10-03 08:12:57 UTC 49,844 bytes, 94 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6345],{777:(e,t,r)=>{Promise.resolve().then(r.bind(r,9922))},1907:(e,t,r)=>{"use strict";r.d(t,{h:()=>i,t:()=>o});var s=r(9918);function i(){!function(){if("u"<typeof customElements||customElements.get("rate-popup"))return;let e=(0,s.G)();class t extends HTMLElement{static get observedAttributes(){return["open","review-url"]}constructor(){super(),this._rendered=!1,this._lastFocused=null,this._portalHost=null,this._root=null,this.$overlay=null,this.$dialog=null,this.$close=null,this.$iframe=null,this._onKeyDown=e=>{this._isOpen()&&("Escape"===e.key&&(e.preventDefault(),this._close()),"Tab"===e.key&&this._trapFocus(e))}}connectedCallback(){this._portalHost||this._mountPortal(),this.hasAttribute("open")&&this._syncFromAttrsAndOpen()}disconnectedCallback(){document.removeEventListener("keydown",this._onKeyDown,!0)}attributeChangedCallback(e){this._rendered&&("open"===e?this._syncFromAttrsAndOpen():"review-url"===e&&this.hasAttribute("open")&&this._syncFromAttrsAndOpen())}_mountPortal(){this._portalHost=document.createElement("div"),this._portalHost.setAttribute("data-rate-popup-portal","true"),Object.assign(this._portalHost.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(this._portalHost),this._root=this._portalHost.attachShadow({mode:"open"}),this._renderIntoPortal(),this._rendered=!0}_renderIntoPortal(){this._root&&(this._root.innerHTML=`
2      <style>
3        :host { all: initial; }
4
5        .overlay {
6          position: fixed;
7          inset: 0;
8          background: rgba(0,0,0,0.55);
9          display: none;
10          align-items: center;
11          justify-content: center;
12          padding: 24px;
13          box-sizing: border-box;
14          pointer-events: auto;
15          font-family: var(--wix-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
16        }
17        .overlay[data-open="true"] { display: flex; }
18
19        .dialog {
20          width: min(770px, calc(100vw - 48px));
21          height: min(650px, calc(100vh - 48px));
22          background: #fff;
23          border: 1px solid rgba(0,0,0,0.12);
24          border-radius: 16px;
25          box-shadow: 0 18px 60px rgba(0,0,0,0.25);
26          overflow: hidden;
27          display: grid;
28          grid-template-rows: auto 1fr;
29        }
30
31        .header {
32          background: #fff;
33          display: flex;
34          align-items: center;
35          justify-content: space-between;
36          padding: 14px 14px 12px 16px;
37          border-bottom: 1px solid rgba(0,0,0,0.12);
38          color: #111;
39          gap: 12px;
40        }
41
42        .title {
43          font-size: 14px;
44          font-weight: 600;
45          white-space: nowrap;
46          overflow: hidden;
47          text-overflow: ellipsis;
48          min-width: 0;
49        }
50
51        button.icon {
52          appearance: none;
53          border: 1px solid rgba(0,0,0,0.12);
54          background: transparent;
55          color: #111;
56          width: 34px;
57          height: 34px;
58          border-radius: 10px;
59          display: grid;
60          place-items: center;
61          cursor: pointer;
62        }
63        button.icon:hover { background: rgba(0,0,0,0.04); }
64        button.icon:focus { outline: none; box-shadow: 0 0 0 3px rgba(0,0,0,0.10); }
65
66        .body { position: relative; }
67        iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
68
69        @media (max-width: 520px) {
70          .overlay { padding: 12px; }
71          .dialog {
72            width: calc(100vw - 24px);
73            height: calc(100vh - 24px);
74            border-radius: 14px;
75          }
76        }
77      </style>
78
79      <div class="overlay" aria-hidden="true">
80        <div class="dialog" role="dialog" aria-modal="true" aria-label="Review">
81          <div class="header">
82            <div class="title">How are you liking our app?</div>
83            <button class="icon" type="button" aria-label="Close">
84              <svg width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
85                <path d="M4 4l8 8M12 4L4 12" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>
86              </svg>
87            </button>
88          </div>
89          <div class="body">
90            <iframe referrerpolicy="no-referrer-when-downgrade"></iframe>
91          </div>
92        </div>
93      </div>
94    `,this.$overlay=this._root.querySelector(".overlay"),this.$dialog=this._root.querySelector(".dialog"),this.$close=this._root.querySelector("button.icon"),this.$iframe=this._root.querySelector("iframe"),this.$close?.addEventListener("click",()=>this._close()),this.$overlay?.addEventListener("mousedown",e=>{e.target===this.$overlay&&this._close()}),this.$dialog?.addEventListener("mousedown",e=>e.stopPropagation()))}_syncFromAttrsAndOpen(){let t=this.getAttribute("review-url")||e;if(!t){this._close(),this.$iframe?.removeAttribute("src");return}
94this.$iframe&&(this.$iframe.src=t),this._open()}_open(){this._isOpen()||(this._lastFocused=document.activeElement,this._portalHost&&(this._portalHost.style.pointerEvents="auto"),this.$overlay&&(this.$overlay.dataset.open="true",this.$overlay.setAttribute("aria-hidden","false")),document.addEventListener("keydown",this._onKeyDown,!0),queueMicrotask(()=>{this.$close?.focus?.()}))}_close(){this._isOpen()&&(this.$overlay&&(this.$overlay.dataset.open="false",this.$overlay.setAttribute("aria-hidden","true")),document.removeEventListener("keydown",this._onKeyDown,!0),this.$iframe?.removeAttribute("src"),this._portalHost&&(this._portalHost.style.pointerEvents="none"),queueMicrotask(()=>{this._lastFocused?.focus?.(),this._lastFocused=null}))}_isOpen(){return this.$overlay?.dataset.open==="true"}_getFocusable(){return this._root?Array.from(this._root.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute?.("disabled")):[]}_trapFocus(e){let t=this._getFocusable();if(!t.length)return;let r=t[0],s=t[t.length-1],i=this._root.activeElement||document.activeElement;e.shiftKey&&i===r?(e.preventDefault(),s.focus()):e.shiftKey||i!==s||(e.preventDefault(),r.focus())}}customElements.define("rate-popup",t)}()}function o(e){if("u"<typeof document)return;i();let t=document.querySelector("rate-popup");t||(t=document.createElement("rate-popup"),document.body.appendChild(t)),e&&t.setAttribute("review-url",e),t.setAttribute("open",String(Date.now()))}},2889:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var s=r(4794),i=r(4568);let o=(0,s.A)((0,i.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore")},6384:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u,y:()=>x});var s=r(4568),i=r(7620),o=r(434),a=r(7177),l=r(9794),n=r(7514),d=r(6888);async function c(e){await new Promise(t=>setTimeout(t,e))}let p=i.createContext(null);function x({children:e}){let{data:t,importLatest:r,refresh:u}=(0,a.R)(),{planCode:m}=(0,l.j)(),[h,f]=i.useState(!1),[v,b]=i.useState(0),[g,w]=i.useState(0),y=i.useRef(!1),j=i.useCallback(()=>{y.current=!0},[]),N=i.useCallback(async e=>{let s,i=t.listing;if(!i)return null;let a=e?.mode??"initial",l=(0,n.U9)(m);y.current=!1;let p=t.reviews.length,x=i.source_review_count??i.raw_payload_json?.sourceReviewCount??p,h=(0,n.Zn)(x,l);f(!0),b(p),w(x);let v=d.oR.loading("Importing reviews..."),g=p,j=x,N=!0,_=0,C=0,A=!1;try{for(;N&&!y.current;){let e,t;if(!(0,n.I$)(l)&&g>=l)break;for(let i=1;i<=3;i+=1)try{e=await r({...null!=s?{backfillOffset:s}:{},silent:!0}),t=void 0;break}catch(e){if(t=e,!function(e){let t=(0,o.Pt)(e).toLowerCase();return t.includes("tripadvisor")||t.includes("502")||t.includes("503")||t.includes("429")||t.includes("fetch")}(e)||i>=3||y.current)throw e;await c(2e3*i)}if(t)throw t;if(!e)break;g=e.totalImportedCount??g,j=e.sourceReviewCount??j,N=e.hasMore??!1,s=e.backfillOffset;let i=e.importedCount??0;if(_+=i,b(g),w(j),"initial"===a&&g>=h&&g<j){N=!1,A=!0;break}if(!(0,n.I$)(l)&&g>=l){N=!1;break}if(0===i&&N){if((C+=1)>=3){N=!1,d.oR.warning(`Import paused after 3 batches with no new reviews. ${g.toLocaleString()} of ${j.toLocaleString()} imported.`,{id:v});break}}else C=0;N&&!y.current&&await new Promise(e=>setTimeout(e,1500))}return y.current?d.oR.success(`Import paused. ${g.toLocaleString()} of ${j.toLocaleString()} reviews imported.`,{id:v}):A?d.oR.success(`Imported ${g.toLocaleString()} reviews so far. Use Import more to continue pulling older reviews.`,{id:v}):C<3&&(_>0?d.oR.success(`Imported ${_.toLocaleString()} new reviews. You now have ${g.toLocaleString()} of ${j.toLocaleString()}.`,{id:v}):d.oR.success("Your reviews are already up to date.",{id:v})),{batchImported:_,totalImported:g,sourceTotal:j,cancelled:y.current,stoppedAtInitialCap:A}}catch(e){return d.oR.error(`${(0,o.Pt)(e)} ${g.toLocaleString()} reviews imported so far.`,{id:v}),{batchImported:_,totalImported:g,sourceTotal:j,cancelled:y.current,stoppedAtInitialCap:A}}finally{await u(),window.dispatchEvent(new Event("purple-app-status-refresh")),f(!1)}},[t.listing,t.reviews.length,r,m,u]),_=i.useMemo(()=>({active:h,imported:v,total:g,startImportAll:N,cancelImport:j}),[h,v,g,N,j]);return(0,s.jsx)(p.Provider,{value:_,children:e})}function u(){let e=i.useContext(p);if(!e)throw Error("useImportAllReviews must be used within ImportAllProvider");return e}},7077:(e,t,r)=>{"use strict";r.d(t,{L:()=>c});var s=r(4568),i=r(5587),o=r.n(i),a=r(7402),l=r(266),n=r(5724),d=r(7514);function c({count:e,className:t,compact:r=!1,currentPlanCode:i,surface:p="dashboard"}){let x=(0,n.j)(),u=(0,d.Wt)(i),m=d.Jh[u].isFree,h=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("span",{className:"whitespace-nowrap",children:[e," found"]}
94),m&&(0,s.jsx)(l.p,{noLink:!0,size:r?12:14})]});return m?(0,s.jsxs)("div",{className:"group relative inline-flex shrink-0 self-start sm:self-auto",children:[(0,s.jsx)(o(),{href:"/plans",className:(0,a.cn)("inline-flex shrink-0 cursor-pointer items-center justify-center gap-1.5 rounded-full border border-[#d6deed] bg-white font-semibold whitespace-nowrap text-[#344054] shadow-[0_1px_2px_rgba(16,24,40,0.04)] transition-colors hover:border-[#9ad9bc] hover:bg-[#f0faf5]",r?"h-[24px] px-2.5 text-[11px]":"h-[32px] px-3 text-[12px]",t),"aria-label":`${e} reviews found on TripAdvisor. Upgrade to import more.`,title:"Premium — upgrade to import more reviews",onClick:()=>(0,n.p)(x,p),children:h}),(0,s.jsxs)("div",{className:"pointer-events-none absolute bottom-full left-1/2 z-30 mb-1.5 hidden -translate-x-1/2 rounded-[6px] bg-[#101828] px-2.5 py-1 text-[11px] whitespace-nowrap text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 lg:block",children:["Premium",(0,s.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-[#101828]"})]})]}):(0,s.jsx)("span",{className:(0,a.cn)("inline-flex shrink-0 items-center justify-center rounded-full border border-[#d6deed] bg-white font-semibold whitespace-nowrap text-[#344054] shadow-[0_1px_2px_rgba(16,24,40,0.04)]",r?"h-[24px] px-2.5 text-[11px]":"h-[32px] px-3 text-[12px]",t),"aria-label":`${e} reviews found on TripAdvisor.`,children:h})}},9918:(e,t,r)=>{"use strict";r.d(t,{G:()=>o,a:()=>i});let s="";function i(e){s=e}function o(){return s}},9922:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>E});var s=r(4568),i=r(7620),o=r(7402),a=r(4794);let l=(0,a.A)((0,s.jsx)("path",{d:"M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8m0 14c-3.31 0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4z"}),"Sync"),n=(0,a.A)((0,s.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search"),d=(0,a.A)((0,s.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"MoreVert");var c=r(2889),p=r(1907),x=r(9918);let u="tripadvisor_app_rate_prompt_consumed_v1";function m(){if("u"<typeof localStorage)return;let e=(0,x.G)();if(e)try{if("1"===localStorage.getItem(u))return;localStorage.setItem(u,"1"),setTimeout(()=>(0,p.t)(e),2e3)}catch{}}var h=r(7077),f=r(434),v=r(7177),b=r(6384);function g(){let{active:e,imported:t,total:r,cancelImport:i}=(0,b.Z)();if(!e)return null;let o=r>0?Math.min(100,Math.round(t/r*100)):0;return(0,s.jsx)("div",{className:"mt-4 rounded-[14px] border border-[#c8ead9] bg-[#f8fffb] px-4 py-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-full bg-[#e6f9f1] text-[#00AA6C]",children:(0,s.jsx)(l,{sx:{fontSize:18},className:"animate-spin"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-[14px] font-semibold text-[#101828]",children:["Importing reviews… ",t.toLocaleString()," / ",r.toLocaleString()]}),(0,s.jsx)("div",{className:"mt-3 h-2 overflow-hidden rounded-full bg-[#e6f9f1]",children:(0,s.jsx)("div",{className:"h-full rounded-full bg-[#00AA6C] transition-all duration-300",style:{width:`${o}%`}})}),(0,s.jsx)("p",{className:"mt-2 text-[12px] leading-[18px] text-[#667085]",children:"Keep this tab open while reviews import. You can browse the page, but don't close the tab."}),(0,s.jsx)("button",{type:"button",onClick:i,className:"mt-3 inline-flex h-[34px] cursor-pointer items-center rounded-[17px] border border-[#d6deed] bg-white px-4 text-[12px] font-semibold text-[#344054] transition-colors hover:bg-gray-50",children:"Cancel import"})]})]})})}var w=r(4241),y=r(9794),j=r(7514),N=r(1694),_=r(6888),C=r(1912),A=r(8536);let k=[{value:"all",label:"All imported reviews"},{value:"5",label:"5 star reviews"},{value:"4",label:"4 star reviews"},{value:"3",label:"3 star reviews"},{value:"<2",label:"<2 star reviews"}];function S({label:e,children:t}){return(0,s.jsxs)("div",{className:"group relative",title:e,children:[t,(0,s.jsxs)("div",{className:"pointer-events-none absolute bottom-full left-1/2 z-30 mb-1.5 hidden -translate-x-1/2 roun
94ded-[6px] bg-[#101828] px-2.5 py-1 text-[11px] whitespace-nowrap text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 lg:block",children:[e,(0,s.jsx)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 border-4 border-transparent border-t-[#101828]"})]})]})}function R({status:e}){return"approved"===e?(0,s.jsx)("span",{className:"inline-block rounded-full bg-[#ECFDF3] px-3 py-1 text-[12px] font-semibold text-[#027A48]",children:"Approved"}):"rejected"===e?(0,s.jsx)("span",{className:"inline-block rounded-full bg-[#fff0f2] px-3 py-1 text-[12px] font-semibold text-[#f13f6d]",children:"Rejected"}):(0,s.jsx)("span",{className:"inline-block rounded-full bg-[#e6f9f1] px-3 py-1 text-[12px] font-semibold text-[#00AA6C]",children:"Imported"})}function $({review:e,openRowMenu:t,setOpenRowMenu:r,rowMenuRef:i,onApprove:o,onReject:a,onDelete:l}){return(0,s.jsxs)("div",{className:"relative",ref:t===e.id?i:void 0,children:[(0,s.jsx)("button",{onClick:()=>r(t===e.id?null:e.id),className:"flex size-[36px] cursor-pointer items-center justify-center rounded-lg text-[#667085] transition-colors hover:bg-gray-50",children:(0,s.jsx)(d,{sx:{fontSize:18}})}),t===e.id&&(0,s.jsxs)("div",{className:"absolute top-full right-0 z-20 mt-1 w-[186px] rounded-[16px] border border-[#c8ead9] bg-white py-2 shadow-[0_4px_8px_rgba(0,0,0,0.06)]",children:["approved"!==e.status?(0,s.jsx)("button",{onClick:()=>void o(e.id),className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] text-[#027A48] hover:bg-gray-50",children:"Approve review"}):null,"rejected"!==e.status?(0,s.jsx)("button",{onClick:()=>void a(e.id),className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] text-[#344054] hover:bg-gray-50",children:"Reject review"}):null,(0,s.jsx)("div",{className:"mx-3 my-1 h-px bg-[rgba(0,170,108,0.2)]"}),(0,s.jsx)("button",{onClick:()=>{l(e.id),r(null)},className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] font-semibold text-[#f13f6d] hover:bg-gray-50",children:"Delete review"})]})]})}function L({label:e}){return(0,s.jsx)(S,{label:e,children:(0,s.jsx)("div",{className:"flex size-[18px] cursor-help items-center justify-center rounded-full border border-[#d6deed] text-[10px] font-semibold text-[#344054]",children:"i"})})}function z(e,t){i.useEffect(()=>{function r(r){e.current&&!e.current.contains(r.target)&&t()}return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[e,t])}function P({open:e,onClose:t,title:r,lead:i,body:a,cancelLabel:l,confirmLabel:n,onConfirm:d,confirmClassName:c}){return e?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex cursor-pointer items-center justify-center",onClick:t,children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-[#121724]/[0.24]"}),(0,s.jsxs)("div",{className:"relative w-[min(420px,calc(100vw-40px))] cursor-default rounded-[22px] border border-[#c8ead9] bg-white shadow-[0_12px_36px_rgba(0,0,0,0.12)]",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("div",{className:"flex justify-center px-6 pt-5",children:(0,s.jsx)("img",{src:"/assets/purple-logo.png",alt:"Purple",className:"h-8 w-auto object-contain"})}),(0,s.jsx)("div",{className:"px-8 pt-4 pb-0 text-center",children:(0,s.jsx)("h3",{className:"text-[20px] font-semibold text-[#101828]",children:r})}),(0,s.jsx)("div",{className:"mx-8 mt-3.5 h-px bg-[#b3f0d7]"}),(0,s.jsxs)("div",{className:"px-8 pt-5 pb-7 text-center",children:[(0,s.jsx)("p",{className:"text-[16px] font-semibold text-[#101828]",children:i}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-[310px] text-[13px] leading-[20px] text-[#667085]",children:a}),(0,s.jsxs)("div",{className:"mt-7 grid grid-cols-2 items-center gap-3",children:[(0,s.jsx)("button",{onClick:t,className:"flex h-[40px] w-full cursor-pointer items-center justify-center rounded-[20px] border border-[#b3f0d7] bg-[#e6f9f1] px-5 text-[13px] font-semibold text-[#00AA6C] transition-colors hover:bg-[#e6f9f1]",children:l}),(0,s.jsx)("button",{onClick:d,className:(0,o.cn)("flex h-[40px] w-full cursor-pointer items-center justify-center rounded-[20px] px-5 text-[13px] font-semibold transition-colors",c??"border border-[#fac7d4] bg-[#fff0f2] text-[#f13f6d] hover:bg-[#ffe4e8]"),children:n})]})]})]})]}):null}function I({state:e,importedCount:t,totalImportedCount:r,sourceReviewCount:i,hasMore:o,onClose:a}){if(!e)return null;let n="syncing"===e,d="success"===e,c=!!i&&(r??0)<(i??0),p=d?t&&t>0?`Added ${t} new review${1===t?"":"s"}. You now have ${r??0}
94 imported${c?` of ${i?.toLocaleString()} on TripAdvisor. Sync again or use Import all remaining to pull more.`:"."}`:c&&!1!==o?`No new reviews in this batch. You have ${r??0} of ${i?.toLocaleString()} imported. Use Import all remaining to continue.`:c?`You have ${r??0} of ${i?.toLocaleString()} imported on TripAdvisor. Sync again to pull more.`:`Your reviews are up to date (${r??0} imported).`:"We could not sync reviews just now. Please try again in a moment.";return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex cursor-pointer items-center justify-center",onClick:n?void 0:a,children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-[#121724]/[0.28]"}),(0,s.jsxs)("div",{className:"relative w-[min(420px,calc(100vw-40px))] cursor-default rounded-[22px] border border-[#c8ead9] bg-white p-8 text-center shadow-[0_12px_36px_rgba(0,0,0,0.12)]",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("div",{className:"mx-auto flex size-12 items-center justify-center rounded-full bg-[#e6f9f1] text-[#00AA6C]",children:(0,s.jsx)(l,{sx:{fontSize:24},className:n?"animate-spin":""})}),(0,s.jsx)("h3",{className:"mt-5 text-[20px] font-semibold text-[#101828]",children:n?"Syncing reviews":d?"Reviews synced":"Sync failed"}),(0,s.jsx)("p",{className:"mx-auto mt-2 max-w-[310px] text-[13px] leading-[20px] text-[#667085]",children:n?"We are checking TripAdvisor for the latest reviews. This can take a little while, especially for busy listings.":p}),!n&&(0,s.jsx)("button",{type:"button",onClick:a,className:"mt-6 inline-flex h-[40px] cursor-pointer items-center justify-center rounded-[20px] border border-[#00AA6C] bg-gradient-to-r from-[rgba(0,102,68,0.93)] to-[rgba(0,170,108,0.82)] px-6 text-[13px] font-semibold text-white transition-colors hover:from-[rgba(0,90,61,0.95)] hover:to-[rgba(0,150,106,0.85)]",children:"Done"})]})]})}function E(){let{wixInstanceToken:e}=(0,w.T)(),{appInstance:t,data:r,loading:a,error:p,refresh:x,moderateReview:u,bulkApprove:S,importLatest:E,deleteReview:M,disconnectListing:F}=(0,v.R)(),{config:D,save:T,saving:U}=(0,N.a)(),{planCode:Y}=(0,y.j)(),{active:W,startImportAll:H}=(0,b.Z)(),O=r.reviews.map(e=>({id:e.id,reviewer:e.reviewer_name,avatarUrl:e.raw_payload_json?.avatarUrl??"",rating:e.rating,review:e.review_text,date:new Date(e.reviewed_at).toLocaleDateString(),status:"accepted"===e.approval_status?"approved":"rejected"===e.approval_status?"rejected":"imported"})),q=a&&0===O.length,B=r.listing?{name:r.listing.property_name??"Connected TripAdvisor listing",propertyId:r.listing.tripadvisor_location_id,avatarUrl:r.listing.property_image_url??r.listing.raw_payload_json?.propertyImageUrl??"",found:r.listing.source_review_count??r.listing.raw_payload_json?.sourceReviewCount??O.length,imported:O.length,approved:O.filter(e=>"approved"===e.status).length}:null,[K,Z]=i.useState(1),[G,V]=i.useState(!1),[J,Q]=i.useState(null),[X,ee]=i.useState(!1),[et,er]=i.useState(!1),[es,ei]=i.useState("all"),[eo,ea]=i.useState(""),[el,en]=i.useState(null),[ed,ec]=i.useState(!1),[ep,ex]=i.useState(null),[eu,em]=i.useState(!1),[eh,ef]=i.useState(!1),[ev,eb]=i.useState(!1),[eg,ew]=i.useState(!1),[ey,ej]=i.useState(null),[eN,e_]=i.useState(null),[eC,eA]=i.useState([]),[ek,eS]=i.useState("home_page"),[eR,e$]=i.useState(""),eL=i.useRef(null),ez=i.useRef(null),eP=i.useRef(null);z(eL,()=>ee(!1)),z(ez,()=>er(!1)),z(eP,()=>Q(null)),i.useEffect(()=>{"1"===new URLSearchParams(window.location.search).get("approvalFlow")&&x()},[x]);let eI=i.useMemo(()=>{let e="all"===es?O:"<2"===es?O.filter(e=>e.rating<2):O.filter(e=>e.rating===Number(es)),t=eo.trim().toLowerCase();return t?e.filter(e=>e.reviewer.toLowerCase().includes(t)||e.review.toLowerCase().includes(t)):e},[O,es,eo]),eE=i.useMemo(()=>O.filter(e=>"imported"===e.status).length,[O]),eM=i.useMemo(()=>O.filter(e=>eC.includes(e.id)),[O,eC]),eF=i.useMemo(()=>eM.filter(e=>"imported"===e.status).length,[eM]),eD=i.useMemo(()=>eM.filter(e=>"rejected"!==e.status).length,[eM]),eT=Math.max(1,Math.ceil(eI.length/10)),eU=i.useMemo(()=>(function(e,t,r=1){if(t<=1)return[];if(t<=7)return Array.from({length:t},(e,t)=>t+1);let s=[1],i=Math.max(2,e-r),o=Math.min(t-1,e+r);i>2&&s.push("ellipsis");for(let e=i;e<=o;e+=1)s.push(e);return o<t-1&&s.push("ellipsis"),s.push(t),s})(K,eT),[K,eT]),eY=eI.slice((K-1)*10,10*K),eW=eY.length>0&&eY.every(e=>eC.includes(e.id));i.useEffect(()=>{K>eT&&Z(eT)},[K,eT]),i.useEffect(()=>{D&&(eS(D.visibility.scope),e$(D.visibility.pageIds?.[0]??""))},[D]);let eH=i.useCallback(()=>{let e=new URL(window.location.href);e.searchParams.delete("approvalFlow"),window.history.replaceState(null,"",`${e.pathname}${e.search}${e.hash}`)},[]);i.useEffect(()=>{"1"!==new URLSearchParams(window.location.search).get("approvalFlow")?eb(!1):!a&&B&&eE>0?eb(!0):a||(eb(!1),eH())},[eH,B,a,eE]);let eO=async e=>{try{await u(e,"approve"),_.oR.success("Review approved."),Q(null),m()}catch{_.oR.error("We couldn't approve that review. Please try again.")}},eq=async e=>{try{await u(e,"reject"),_.oR.success("Review rejected."),Q(null)}catch{_.oR.error("We couldn't reject that review. Please try again.")}},eB=async()=>{ew(!0),ej("syncing"),e_(null);let e=_.oR.loading("Syncing reviews from TripAdvisor...");try{let t=await E();e_({importedCount:t?.importedCount??0,totalImportedCount:t?.totalImportedCount??0,sourceReviewCount:t?.sourceReviewCount,hasMore:t?.hasMore}),ej("success"),_.oR.success("Reviews synced.",{id:e}),(t?.pendingCount??0)>0&&(t?.importedCount??0)>0&&eb(!0)}catch(t){ej("error"),_.oR.error((0,f.Pt)(t),{id:e})}finally{ew(!1)}},eK=i.useRef("idle");i.useEffect(()=>{if(a||!B||W)return;let e=new URLSearchParams(window.location.search);if("1"!==e.get("importAll")||"started"===eK.current)return;eK.current="started";let t="1"===e.get("approvalFlow");e.delete("importAll");let r=e.toString();window.history.replaceState(null,"",`${window.location.pathname}${r?`?${r}`:""}${window.location.hash}`),H({mode:"initial"}).then(e=>{if(e?.cancelled){eK.current="cancelled";return}(t||(e?.batchImported??0)>0)&&eb(!0)})},[a,B,W,H]);let eZ=(0,j.U9)(Y),eG=null!=B&&!W&&B.imported<B.found&&((0,j.I$)(eZ)||B.imported<eZ),eV=async()=>{let r;if(!D)return;if("specific_pages"===ek){let e=eR.trim();if(e)try{r=new URL(e).pathname||e}catch{r=e.startsWith("/")?e:`/${e}`}}let s=_.oR.loading("Saving review settings...");try{if(!await T({...D,visibility:{...D.visibility,scope:ek,pageIds:"specific_pages"===ek&&r?[r]:void 0}}))throw Error("Widget config save failed");t?.id&&await (0,f.mu)("/api/reviews/settings",{appInstanceId:t.id,syncMode:"manual"},{headers:(0,f.ls)(e)}),_.oR.success("Review settings saved.",{id:s})}catch{_.oR.error("We couldn't save review settings. Please try again.",{id:s})}},eJ=async e=>{try{await M(e),_.oR.success("Review deleted."),en(null),Q(null),eA(t=>t.filter(t=>t!==e))}catch{_.oR.error("We couldn't delete that review. Please try again.")}},eQ=async()=>{let e=_.oR.loading("Deleting reviews...");try{for(let e of O)await M(e.id);_.oR.success("All reviews deleted.",{id:e}),ec(!1),eA([])}catch{_.oR.error("We couldn't delete all reviews. Please try again.",{id:e})}},eX=async()=>
94{if(!ep)return;let e="all"===ep?O:"<2"===ep?O.filter(e=>e.rating<2):O.filter(e=>e.rating===Number(ep)),t=_.oR.loading("Deleting reviews...");try{for(let t of e)await M(t.id);_.oR.success("Selected reviews deleted.",{id:t}),ex(null),eA([])}catch{_.oR.error("We couldn't delete those reviews. Please try again.",{id:t})}},e0=async()=>{let e=_.oR.loading("Disconnecting listing...");try{await F(),_.oR.success("Listing disconnected. You can start again.",{id:e}),em(!1),V(!1)}catch{_.oR.error("We couldn't disconnect the listing. Please try again.",{id:e})}},e1=async()=>{let e=_.oR.loading("Approving reviews...");try{await S(),_.oR.success("All pending reviews approved.",{id:e}),ef(!1),m()}catch{_.oR.error("We couldn't approve reviews. Please try again.",{id:e})}},e4=async()=>{let e=_.oR.loading("Approving imported reviews...");try{await S(),_.oR.success("Imported reviews approved.",{id:e}),eb(!1),eH(),m()}catch{_.oR.error("We couldn't approve imported reviews. Please try again.",{id:e})}},e2=async()=>{let e=_.oR.loading("Approving selected reviews...");try{let t=!1;for(let e of eM)"imported"===e.status&&(await u(e.id,"approve"),t=!0);_.oR.success("Selected reviews approved.",{id:e}),eA([]),t&&m()}catch{_.oR.error("We couldn't approve selected reviews. Please try again.",{id:e})}},e6=async()=>{let e=_.oR.loading("Rejecting selected reviews...");try{for(let e of eM)"rejected"!==e.status&&await u(e.id,"reject");_.oR.success("Selected reviews rejected.",{id:e}),eA([])}catch{_.oR.error("We couldn't reject selected reviews. Please try again.",{id:e})}},e3=async()=>{let e=_.oR.loading("Deleting selected reviews...");try{for(let e of eM)await M(e.id);_.oR.success("Selected reviews deleted.",{id:e}),eA([])}catch{_.oR.error("We couldn't delete selected reviews. Please try again.",{id:e})}},e8=k.find(e=>e.value===es)?.label??"All imported reviews";return(0,s.jsxs)("div",{children:[p&&(0,s.jsx)("div",{className:"mb-4 rounded-[18px] border border-[#fac7d4] bg-[#fff0f2] px-6 py-4 text-sm text-[#f13f6d]",children:p}),(0,s.jsxs)("div",{className:"rounded-[18px] border border-[#d6deed] bg-white p-4 md:p-6",children:[B?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-4",children:[(0,s.jsx)(C.o,{name:B.name,imageUrl:B.avatarUrl||void 0,size:68}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-[16px] font-semibold text-[#101828]",children:B.name}),(0,s.jsxs)("p",{className:"text-[12px] text-[#667085]",children:["Property ID ",B.propertyId]}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,s.jsx)(h.L,{count:B.found,compact:!0,currentPlanCode:Y,surface:"reviews"}),(0,s.jsxs)("span",{className:"rounded-full bg-[#ECFDF3] px-3 py-0.5 text-[12px] font-semibold text-[#027A48]",children:[B.imported.toLocaleString(),B.found>B.imported?` / ${B.found.toLocaleString()}`:""," ","imported"]}),(0,s.jsxs)("span",{className:"rounded-full bg-[#ECFDF3] px-3 py-0.5 text-[12px] font-semibold text-[#027A48]",children:[B.approved," approved"]})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>V(!G),className:"flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#d6deed] bg-white px-4 text-[13px] font-semibold text-[#344054] transition-colors hover:bg-gray-50",children:G?"Hide Settings":"Show Settings"}),eG&&(0,s.jsx)("button",{onClick:()=>{H({mode:"full"}).then(e=>{(e?.batchImported??0)>0&&eb(!0)})},disabled:eg,title:"Pull more existing reviews from TripAdvisor up to your plan limit",className:"flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#d6deed] bg-white px-4 text-[13px] font-semibold text-[#344054] transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70",children:"Import more"}),(0,s.jsxs)("button",{onClick:()=>void eB(),disabled:eg||W,title:"Refresh to pick up the newest reviews only",className:"flex h-[40px] cursor-pointer items-center gap-2 rounded-[20px] border border-[#00AA6C] bg-[#00AA6C] px-4 text-[13px] font-semibold text-white shadow-[0_1px_2px_rgba(0,0,0,0.05)] transition-colors hover:bg-[#00966A] disabled:cursor-not-allowed disabled:opacity-70",children:[(0,s.jsx)(l,{sx:{fontSize:14}}),eg?"Syncing...":"Sync"]})]}),(0,s.jsx)("p",{className:"max-w-[340px] text-right text-[11px] leading-[15px] text-[#98a2b3]",children:eG?"Import more pulls older reviews from TripAdvisor. Sync only checks for new ones.":"Sync checks TripAdvisor for new reviews. It does not re-download your full history."})]})]}),(0,s.jsx)(g,{})]}):(0,s.jsx)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-[16px] font-semibold text-[#101828]",children:"No TripAdvisor listing connected yet"}),(0,s.jsx)("p",{className:"mt-1 text-[13px] text-[#667085]",children:"Connect a listing from the dashboard page to start importing reviews."})]})}),G&&(0,s.jsxs)("div",{className:"mt-5 border-t border-[#b3f0d7] pt-5",children:[(0,s.jsxs)("p",{className:"text-[14px] text-[#344054]",children:[(0,s.jsx)("strong",{children:"Import more"})," continues pulling existing reviews from TripAdvisor (up to your plan). ",(0,s.jsx)("strong",{children:"Sync"})," only refreshes for newly posted reviews."]}),(0,s.jsxs)("div",{className:"mt-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("p",{className:"text-[13px] font-semibold text-[#101828]",children:"Widget placement"}),(0,s.jsx)(L,{label:"Control where the live widget should appear on your Wix site."})]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center gap-3 rounded-full border border-[#d6deed] bg-white px-4 py-2 text-[13px] text-[#344054]",children:[(0,s.jsx)("input",{type:"radio",name:"visibility-scope",checked:"home_page"===ek,onChange:()=>eS("home_page"),className:"size-4 cursor-pointer accent-[#00AA6C]"}),"Show on homepage only"]}),(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center gap-3 rounded-full border border-[#d6deed] bg-white px-4 py-2 text-[13px] text-[#344054]",children:[(0,s.jsx)("input",{type:"radio",name:"visibility-scope",checked:"all_pages"===ek,onChange:()=>eS("all_pages"),className:"size-4 cursor-pointer accent-[#00AA6C]"}),"Show on all pages"]}),(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center gap-3 rounded-full border border-[#d6deed] bg-white px-4 py-2 text-[13px] text-[#344054]",children:[(0,s.jsx)("input",{type:"radio",name:"visibility-scope",checked:"specific_pages"===ek,onChange:()=>eS("specific_pages"),className:"size-4 cursor-pointer accent-[#00AA6C]"}),"Show on a specific URL"]}),"specific_pages"===ek&&(0,s.jsx)("input",{value:eR,onChange:e=>e$(e.target.value),placeholder:"https://your-site.com/page or /page",className:"h-10 w-full rounded-[12px] border border-[#d6deed] px-3 text-[13px] text-[#344054] outline-none placeholder:text-[#98A2B3]"}),(0,s.jsx)("button",{onClick:()=>void eV(),disabled:U,className:"mt-2 inline-flex h-[36px] cursor-pointer items-center rounded-[18px] border border-[#00AA6C] bg-gradient-to-r from-[rgba(0,102,68,0.93)] to-[rgba(0,170,108,0.82)] px-4 text-[13px] font-semibold text-white shadow-[0_1px_2px_rgba(0,0,0,0.05)] transition-colors hover:from-[rgba(0,90,61,0.95)] hover:to-[rgba(0,150,106,0.85)] disabled:cursor-not-allowed disabled:opacity-70",children:U?"Saving...":"Save placement"})]})]}),(0,s.jsx)("button",{onClick:()=>em(!0),className:"mt-5 flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#fac7d4] bg-white px-5 text-[13px] font-semibold text-[#f13f6d] transition-colors hover:bg-[#fff0f2]",children:"Disconnect"})]})]}),(0,s.jsxs)("div",{className:"mt-5 rounded-[18px] border border-[#d6deed] bg-white",children:[(0,s.jsx)("div",{className:"px-4 py-5 md:px-6",children:(0,s.jsx)("h3",{className:"text-[16px] font-semibold text-[#101828]",children:"Imported reviews"})}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 px-4 pb-4 md:flex-row md:items-center md:px-6",children:[(0,s.jsxs)("div",{className:"relative w-full md:w-auto",ref:ez,children:[(0,s.jsxs)("button",{onClick:()=>er(!et),className:"flex h-[40px] cursor-pointer items-center gap-2 rounded-[14px] border border-[#d6deed] bg-white px-4 text-[13px] text-[#667085]",children:[e8,(0,s.jsx)(c.A,{sx:{fontSize:16},className:"text-[#98A2B3]"})]}),et&&(0,s.jsx)("div",{className:"absolute top-full left-0 z-20 mt-1 w-[212px] rounded-[16px] border border-[#d6deed] bg-white py-2 shadow-[0_4px_8px_rgba(0,0,0,0.06)]",children:k.map(e=>{let t=es===e.value;return(0,s.jsxs)("button",{onClick:()=>{ei(e.value),er(!1),Z(1)},className:(0,o.cn)("flex w-full cursor-pointer items-center justify-between px-3 py-1.5 text-[13px]",t?"mx-2 w-[calc(100%-16px)] rounded-[10px] bg-[#e
946f9f1] font-semibold text-[#006644]":"text-[#344054] hover:bg-gray-50"),children:[e.label,t&&(0,s.jsx)("div",{className:"size-2 shrink-0 rounded-full bg-[#3373ed]"})]},e.value)})})]}),(0,s.jsxs)("div",{className:"relative flex h-[40px] w-full flex-1 items-center rounded-[14px] border border-[#d6deed] bg-white md:min-w-0",children:[(0,s.jsx)(n,{sx:{fontSize:16},className:"ml-3 text-[#98A2B3]"}),(0,s.jsx)("input",{type:"text",placeholder:"Search reviews",value:eo,onChange:e=>{ea(e.target.value),Z(1)},className:"h-full flex-1 bg-transparent px-3 text-[13px] text-[#101828] outline-none placeholder:text-[#98A2B3]"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[eC.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>void e2(),disabled:0===eF,className:"flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#d6deed] bg-white px-4 text-[13px] font-semibold text-[#027A48] transition-colors hover:bg-[#ECFDF3] disabled:cursor-not-allowed disabled:opacity-50",children:"Approve selected"}),(0,s.jsx)("button",{onClick:()=>void e6(),disabled:0===eD,className:"flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#d6deed] bg-white px-4 text-[13px] font-semibold text-[#344054] transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-50",children:"Reject selected"}),(0,s.jsx)("button",{onClick:()=>void e3(),className:"flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#fac7d4] bg-white px-4 text-[13px] font-semibold text-[#f13f6d] transition-colors hover:bg-[#fff0f2]",children:"Delete selected"})]}),(0,s.jsx)("button",{onClick:()=>ef(!0),disabled:0===eE,className:"flex h-[40px] cursor-pointer items-center rounded-[20px] border border-[#d6deed] bg-white px-4 text-[13px] font-semibold text-[#027A48] transition-colors hover:bg-[#ECFDF3] disabled:cursor-not-allowed disabled:opacity-50",children:"Approve all reviews"})]}),(0,s.jsxs)("div",{className:"relative",ref:eL,children:[(0,s.jsx)("button",{onClick:()=>ee(!X),className:"flex size-[36px] cursor-pointer items-center justify-center rounded-lg text-[#667085] transition-colors hover:bg-gray-50",children:(0,s.jsx)(d,{sx:{fontSize:18}})}),X&&(0,s.jsxs)("div",{className:"absolute top-full right-0 z-20 mt-1 w-[236px] rounded-[16px] border border-[#d6deed] bg-white py-2 shadow-[0_4px_8px_rgba(0,0,0,0.06)]",children:[(0,s.jsx)("button",{onClick:()=>{ee(!1),ec(!0)},className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] font-semibold text-[#f13f6d] hover:bg-gray-50",children:"Delete all reviews"}),(0,s.jsx)("button",{onClick:()=>{ee(!1),ex("5")},className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] text-[#344054] hover:bg-gray-50",children:"Delete all 5 star reviews"}),(0,s.jsx)("button",{onClick:()=>{ee(!1),ex("4")},className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] text-[#344054] hover:bg-gray-50",children:"Delete all 4 star reviews"}),(0,s.jsx)("button",{onClick:()=>{ee(!1),ex("3")},className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] text-[#344054] hover:bg-gray-50",children:"Delete all 3 star reviews"}),(0,s.jsx)("button",{onClick:()=>{ee(!1),ex("<2")},className:"w-full cursor-pointer px-4 py-2 text-left text-[13px] text-[#344054] hover:bg-gray-50",children:"Delete all <2 star reviews"})]})]})]}),q?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"space-y-3 px-4 pb-6 md:hidden",children:Array.from({length:5}).map((e,t)=>(0,s.jsx)("div",{className:"rounded-[16px] border border-[#c8ead9] p-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"h-4 w-4 animate-pulse rounded bg-[#c8ead9]"}),(0,s.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-[#c8ead9]"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"h-4 w-24 animate-pulse rounded bg-[#e0f5ea]"}),(0,s.jsx)("div",{className:"h-4 w-16 animate-pulse rounded bg-[#e0f5ea]"}),(0,s.jsx)("div",{className:"h-4 w-full animate-pulse rounded bg-[#e6f9f1]"}),(0,s.jsx)("div",{className:"h-4 w-[80%] animate-pulse rounded bg-[#e6f9f1]"})]})]})},t))}),(0,s.jsx)("div",{className:"hidden px-6 pb-6 md:block",children:(0,s.jsxs)("div",{className:"overflow-hidden rounded-[16px] border border-[#e7deef]",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[48px_160px_1fr_120px_120px_120px_80px] border-b border-[#c8ead9] bg-[#e6f9f1] px-4 py-3 text-[12px] font-medium text-[#3a7a5a]",children:[(0,s.jsx)("div",{}),(0,s.jsx)("div",{children:"Reviewer"}),(0,s.jsx)("div",{children:"Review"}),(0,s.jsx)("div",{children:"Rating"}),(0,s.jsx)("div",{children:"Date"}),(0,s.jsx)("div",{children:"Status"}),(0,s.jsx)("div",{children:"Actions"})]}),Array.from({length:5}).map((e,t)=>(0,s.jsxs)("div",{className:"grid grid-cols-[48px_160px_1fr_120px_120px_120px_80px] items-center border-b border-[#c8ead9] px-4 py-4 last:border-0",children:[(0,s.jsx)("div",{className:"h-4 w-4 animate-pulse rounded bg-[#c8ead9]"}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"size-8 animate-pulse rounded-full bg-[#c8ead9]"}),(0,s.jsx)("div",{className:"h-4 w-20 animate-pulse rounded bg-[#e0f5ea]"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"h-4 w-[90%] animate-pulse rounded bg-[#e0f5ea]"}),(0,s.jsx)("div",{className:"h-4 w-[70%] animate-pulse rounded bg-[#e6f9f1]"})]}),(0,s.jsx)("div",{className:"h-4 w-16 animate-pulse rounded bg-[#e0f5ea]"}),(0,s.jsx)("div",{className:"h-4 w-20 animate-pulse rounded bg-[#e0f5ea]"}),(0,s.jsx)("div",{className:"h-7 w-20 animate-pulse rounded-full bg-[#eef9f1]"}),(0,s.jsx)("div",{className:"h-8 w-8 animate-pulse rounded bg-[#e0f5ea]"})]},t))]})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"divide-y divide-[#d6deed] border-t border-[#d6deed] md:hidden",children:0===eY.length?(0,s.jsx)("div",{className:"px-4 py-12",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-[430px] flex-col items-center justify-center rounded-[18px] border border-dashed border-[#d6deed] bg-white px-6 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex size-11 items-center justify-center rounded-full bg-[#e6f9f1] text-[#00AA6C]",children:(0,s.jsx)(n,{sx:{fontSize:20}})}),(0,s.jsx)("h4",{className:"mt-4 text-[15px] font-semibold text-[#101828]",children:0===O.length?"No reviews imported yet":"No reviews match your filters"}),(0,s.jsx)("p",{className:"mt-2 text-[13px] leading-[20px] text-[#667085]",children:0===O.length?"Connect a TripAdvisor listing and import reviews to start moderating what appears in your widget.":"Try changing the selected filter or search term to see more imported reviews."})]})}):eY.map(e=>(0,s.jsx)("div",{className:"px-4 py-4",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:eC.includes(e.id),onChange:t=>{eA(r=>t.target.checked?[...r,e.id]:r.filter(t=>t!==e.id))},className:"mt-1 size-4 shrink-0 cursor-pointer accent-[#00AA6C]"}),(0,s.jsx)(C.h,{name:e.reviewer,avatarUrl:e.avatarUrl,size:32}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-[14px] font-medium text-[#101828]",children:e.reviewer}),(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(A.F,{rating:e.rating,size:14})})]}),(0,s.jsx)($,{review:e,openRowMenu:J,setOpenRowMenu:Q,rowMenuRef
94:eP,onApprove:e=>void eO(e),onReject:e=>void eq(e),onDelete:en})]}),(0,s.jsx)("p",{className:"mt-2 text-[13px] leading-[20px] text-[#344054]",children:e.review}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[13px] text-[#667085]",children:e.date}),(0,s.jsx)(R,{status:e.status})]})]})]})},e.id))}),(0,s.jsx)("div",{className:"hidden overflow-x-auto md:block",children:(0,s.jsxs)("table",{className:"w-full min-w-[900px]",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{className:"border-y border-[#d6deed] text-[12px] font-medium text-[#667085]",children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:(0,s.jsx)("input",{type:"checkbox",checked:eW,onChange:e=>{eA(t=>{let r=eY.map(e=>e.id);return e.target.checked?Array.from(new Set([...t,...r])):t.filter(e=>!r.includes(e))})},className:"size-4 cursor-pointer accent-[#00AA6C]"})}),(0,s.jsx)("th",{className:"px-6 py-3 text-left",children:"Reviewer"}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:"Review"}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:"Rating"}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:"Date"}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:"Status"}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:"Actions"})]})}),(0,s.jsxs)("tbody",{children:[0===eY.length&&(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:7,className:"px-6 py-12",children:(0,s.jsxs)("div",{className:"mx-auto flex max-w-[430px] flex-col items-center justify-center rounded-[18px] border border-dashed border-[#d6deed] bg-white px-6 py-8 text-center",children:[(0,s.jsx)("div",{className:"flex size-11 items-center justify-center rounded-full bg-[#e6f9f1] text-[#00AA6C]",children:(0,s.jsx)(n,{sx:{fontSize:20}})}),(0,s.jsx)("h4",{className:"mt-4 text-[15px] font-semibold text-[#101828]",children:0===O.length?"No reviews imported yet":"No reviews match your filters"}),(0,s.jsx)("p",{className:"mt-2 text-[13px] leading-[20px] text-[#667085]",children:0===O.length?"Connect a TripAdvisor listing and import reviews to start moderating what appears in your widget.":"Try changing the selected filter or search term to see more imported reviews."})]})})}),eY.map(e=>(0,s.jsxs)("tr",{className:"border-b border-[rgba(214,222,237,0.8)] last:border-0",children:[(0,s.jsx)("td",{className:"px-4 py-4",children:(0,s.jsx)("input",{type:"checkbox",checked:eC.includes(e.id),onChange:t=>{eA(r=>t.target.checked?[...r,e.id]:r.filter(t=>t!==e.id))},className:"size-4 cursor-pointer accent-[#00AA6C]"})}),(0,s.jsx)("td",{className:"px-6 py-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(C.h,{name:e.reviewer,avatarUrl:e.avatarUrl,size:32}),(0,s.jsx)("span",{className:"text-[14px] font-medium text-[#101828]",children:e.reviewer})]})}),(0,s.jsx)("td",{className:"max-w-[430px] px-4 py-4 text-[13px] leading-[20px] text-[#344054]",children:e.review}),(0,s.jsx)("td",{className:"px-4 py-4",children:(0,s.jsx)(A.F,{rating:e.rating,size:14})}),(0,s.jsx)("td",{className:"px-4 py-4 text-[13px] whitespace-nowrap text-[#667085]",children:e.date}),(0,s.jsx)("td",{className:"px-4 py-4",children:(0,s.jsx)(R,{status:e.status})}),(0,s.jsx)("td",{className:"px-4 py-4",children:(0,s.jsx)($,{review:e,openRowMenu:J,setOpenRowMenu:Q,rowMenuRef:eP,onApprove:e=>void eO(e),onReject:e=>void eq(e),onDelete:en})})]},e.id))]})]})}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 border-t border-[#d6deed] px-4 py-3 sm:flex-row sm:items-center sm:justify-between md:px-6",children:[(0,s.jsxs)("p",{className:"shrink-0 text-[13px] text-[#667085]",children:["Showing ",eY.length," of ",eI.length," imported reviews",eT>1?` \xb7 Page ${K} of ${eT}`:""]}),eT>1&&(0,s.jsxs)("nav",{"aria-label":"Review pages",className:"flex min-w-0 flex-wrap items-center justify-end gap-1",children:[(0,s.jsx)("button",{type:"button",onClick:()=>Z(e=>Math.max(1,e-1)),disabled:K<=1,className:"inline-flex h-7 cursor-pointer items-center rounded-[8px] px-2 text-[13px] text-[#344054] transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-40",children:"Prev"}),eU.map((e,t)=>"ellipsis"===e?(0,s.jsx)("span",{className:"flex size-7 items-center justify-center text-[13px] text-[#98A2B3]","aria-hidden":!0,
94children:"…"},`ellipsis-${t}`):(0,s.jsx)("button",{type:"button",onClick:()=>Z(e),"aria-current":K===e?"page":void 0,className:(0,o.cn)("flex size-7 cursor-pointer items-center justify-center rounded-[8px] text-[13px] transition-colors",K===e?"bg-[#e6f9f1] font-semibold text-[#101828]":"text-[#344054] hover:bg-gray-100"),children:e},e)),(0,s.jsx)("button",{type:"button",onClick:()=>Z(e=>Math.min(eT,e+1)),disabled:K>=eT,className:"inline-flex h-7 cursor-pointer items-center rounded-[8px] px-2 text-[13px] text-[#344054] transition-colors hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-40",children:"Next"})]})]})]})]}),(0,s.jsx)(P,{open:ev,onClose:()=>{eb(!1),eH()},title:"Reviews imported",lead:"Choose how to moderate them",body:`Your latest reviews are now imported and waiting for approval. You can approve them one by one on this page, or approve all ${eE} pending reviews now.`,cancelLabel:"Approve manually",confirmLabel:"Approve all",onConfirm:()=>void e4(),confirmClassName:"border border-[#00AA6C] bg-gradient-to-r from-[rgba(0,102,68,0.93)] to-[rgba(0,170,108,0.82)] text-white hover:from-[rgba(0,90,61,0.95)] hover:to-[rgba(0,150,106,0.85)]"}),(0,s.jsx)(P,{open:eh,onClose:()=>ef(!1),title:"Approve all reviews?",lead:"Bulk approval",body:"This will approve all currently imported reviews. You can still reject individual reviews later.",cancelLabel:"Cancel",confirmLabel:"Yes, approve all",onConfirm:()=>void e1(),confirmClassName:"border border-[#a6f4c5] bg-[#ECFDF3] text-[#027A48] hover:bg-[#d1fadf]"}),(0,s.jsx)(P,{open:ed,onClose:()=>ec(!1),title:"Are you sure?",lead:"You're going to delete all reviews",body:"Please decide carefully. This permanently removes the selected reviews and cannot be undone.",cancelLabel:"No, go back",confirmLabel:"Yes, delete",onConfirm:()=>void eQ()}),(0,s.jsx)(P,{open:null!==ep,onClose:()=>ex(null),title:"Are you sure?",lead:"<2"===ep?"You're going to delete all reviews below 2 stars":ep?`You're going to delete all ${ep} star reviews`:"You're going to delete selected reviews",body:"Please decide carefully. This permanently removes the selected reviews and cannot be undone.",cancelLabel:"No, go back",confirmLabel:"Yes, delete",onConfirm:()=>void eX()}),(0,s.jsx)(P,{open:null!==el,onClose:()=>en(null),title:"Are you sure?",lead:"You're going to delete the selected review",body:"Please decide carefully. This permanently removes the selected review and cannot be undone.",cancelLabel:"No, go back",confirmLabel:"Yes, delete",onConfirm:()=>{el&&eJ(el)}}),(0,s.jsx)(P,{open:eu,onClose:()=>em(!1),title:"Are you sure?",lead:"Disconnect this listing?",body:"Disconnecting will completely remove the current listing and delete all imported reviews so you can start over from scratch.",cancelLabel:"Cancel",confirmLabel:"Yes, disconnect",onConfirm:e0}),(0,s.jsx)(I,{state:ey,importedCount:eN?.importedCount,totalImportedCount:eN?.totalImportedCount,sourceReviewCount:eN?.sourceReviewCount,hasMore:eN?.hasMore,onClose:()=>ej(null)})]})}}},e=>{e.O(0,[6888,9950,2175,5587,2654,4529,587,1968,7358],()=>e(e.s=777)),_N_E=e.O()}]);

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.