PageSourceSearch

https://mindtrip.ai/_next/static/chunks/7540-1e6a8a4bdf5740dc.js

js mindtrip.ai collected 2026-10-02 02:35:30 UTC 36,940 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7540],{9125:(e,t,n)=>{n.d(t,{E:()=>o,S:()=>c});var r=n(89921);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l={top:function(e,t){return Math.abs(t.y-e.top)},right:function(e,t){return Math.abs(e.right-t.x)},bottom:function(e,t){return Math.abs(e.bottom-t.y)},left:function(e,t){return Math.abs(t.x-e.left)}},s=Symbol("closestEdge");function o(e,t){var n,a,o=t.element,c=t.input,d=t.allowedEdges,u={x:c.clientX,y:c.clientY},p=o.getBoundingClientRect(),m=null!=(n=null==(a=d.map(function(e){return{edge:e,value:l[e](p,u)}}).sort(function(e,t){return e.value-t.value})[0])?void 0:a.edge)?n:null;return i(i({},e),{},(0,r.A)({},s,m))}function c(e){var t;return null!=(t=e[s])?t:null}},46710:(e,t,n)=>{n.d(t,{L:()=>u});var r=n(27964),a=n(14232),i=n(57447),l=n(41946),s=n.n(l),o=n(69483),c=n(86141),d=n(10830);function u(e){let t,n,l,u,p=(0,r.c)(12),{markers:m,location:f}=e,h=(0,i.ko)(),{initialIdleComplete:x,padding:g}=(0,d.bc)(),y=(0,a.useRef)(null),j=(0,a.useRef)(null);return p[0]!==f||p[1]!==h||p[2]!==g?(t=()=>{h&&f&&(s()(y.current,f.entity_ref)||(y.current=f.entity_ref,(0,o.Cw)({map:h,location:f,padding:g})))},n=[h,f,g],p[0]=f,p[1]=h,p[2]=g,p[3]=t,p[4]=n):(t=p[3],n=p[4]),(0,a.useEffect)(t,n),p[5]!==x||p[6]!==f||p[7]!==h||p[8]!==m||p[9]!==g?(l=()=>{if(!h||!x||f||!m)return;let e=[];
1if(m.forEach(t=>{null!=t.latitude&&null!=t.longitude&&e.push({entity_ref:(0,c._X)(t),latitude:t.latitude,longitude:t.longitude})}),0===e.length)return;let t=j.current||new Set,n=new Set,r=t.size!==e.length;for(let a of e)n.add(a.entity_ref),t.has(a.entity_ref)||(r=!0);j.current=n,(r||!h.getBounds())&&(0,o._t)({map:h,markers:e,padding:g})},u=[h,x,g,m,f],p[5]=x,p[6]=f,p[7]=h,p[8]=m,p[9]=g,p[10]=l,p[11]=u):(l=p[10],u=p[11]),(0,a.useEffect)(l,u),null}},47540:(e,t,n)=>{n.r(t),n.d(t,{Collection:()=>tn,CollectionInviteDropdown:()=>ta});var r=n(37876),a=n(27964),i=n(14232),l=n(95003),s=n(77076),o=n(91783),c=n(40864),d=n(96479),u=n(56118),p=n(74302),m=n(25702),f=n.n(m),h=n(97778),x=n(75784),g=n(59727),y=n.n(g),j=n(40625),v=n(13474),b=n(26579),_=n(4294),N=n(37146),w=n(31965),C=n(32617),k=n(55280),R=n(86141),L=n(67747),P=n(42512),S=n(64267),A=n(32516),O=n(97642),E=n(80663),F=n(26360),G=n(25834),D=n(7377),V=n(32506),I=n(95826),M=n(32084),z=n(54100),$=n(43923),T=n(21628),B=n(46710),J=n(11896),H=n(2692),Q=n(94516),U=n(27408),Y=n(20128),W=n(82510),K=n(85919),q=n(13245),X=n(8796),Z=n(55922),ee=n(18564),et=n(26506),en=n(19115),er=n(52810),ea=n(69165),ei=n(66811),el=n(10944),es=n(13161),eo=n(41028),ec=n(29656),ed=n(96854),eu=n(90886),ep=n(73273),em=n(77725),ef=n(62400),eh=n(20658);function ex(e){let{collection:t,addPlaceInView:n,onAddPlace:a}=e,l=(0,ee.Bd)(),s=(0,ei.r)(),o=(0,A.jL)(),{openAddToMedia:d}=(0,U.E)(),u=(0,i.useMemo)(()=>new en.F((0,_.Q)()),[]),p=(0,A.GV)(F.W5),m=t.accepted_collaborator_refs?.includes(p),f=t.collaboration?.permissions.can_add_remove_places??!1,g=t.collaboration?.permissions.can_edit_collection_properties??!1,y=t.favorites_count||0,{showDeleteDialog:j,showLeaveDialog:v}=(0,Y.g)(),N=(0,A.GV)((0,el.Cs)(t.ref)),w=(0,i.useRef)(null),[k,R]=(0,i.useState)(!1),O="true"===(0,C._K)("NEXT_PUBLIC_ALLOW_GOOGLE_MAPS_LIST_IMPORT"),V=(0,A.GV)(P.tB),M=t?.collaboration?.permissions.can_manage_collaborators??!1,z=async()=>{try{let e=await o(L.m3.endpoints.refreshFromLink.initiate({collectionRef:t.ref})).unwrap();e.success?(o((0,el.bc)(t.ref)),G.J.add({type:"success",description:e.message})):G.J.add({type:"error",description:e.message})}catch(e){console.error("Failed to refresh collection:",e),G.J.add({type:"error",description:"Failed to refresh collection. Please try again."})}},$=async e=>{try{G.J.add({type:"info",description:"Creating your guide — this can take a few minutes."});let n=await u.generateInspirationFromCollection(t.ref,e);if(n){G.J.add({type:"info",description:`Your new guide ${n.title} is now ready.`}),(0,b.$)({name:"CollectionPublish",properties:{inspiration:(0,Z.qR)(n)}});let e=`/collection/n/${t.ref}`,r=`?callbackUrl=${encodeURIComponent(e)}`;await s.push(`${(0,et.wo)(n)}${r}`)}}catch(t){let e="Unable to create guide.";console.log(e,t),G.J.add({type:"error",description:e})}},{openCollectionToInspirationDialog:T,CollectionToInspirationDialog:B}=(0,K.N)({onCreate:async e=>{await $(e)}}),J=async e=>{try{if(R(!0),e&&e.length>0){let n=[];if(e.forEach(e=>{let t=c.Lj.includes(e.type)?e.size>c.No?`File: ${e.name} must be ${c.No/1048576}MB or less`:void 0:`File: ${e.name} must be ${c.C9.join(", ")}`;t&&n.push(t)}),(0,D.Eb)(n))G.J.add({type:"error",description:n.join(", ")});else{for(let n=0;n<e.length;n++){let r=e[n];await o(L.m3.endpoints.createFromFile.initiate({file:r,collectionRef:t.ref,isPublic:!1})).unwrap()}o((0,el.bc)(t.ref)),(0,b.$)({name:"CollectionCreate",properties:{trigger:"import",public:!1}})}}}catch(e){return G.J.add({type:"error",description:"Unable to upload file. Please try again later."}),console.log("Unable to upload file",e),!1}finally{R(!1)}return!0},Q=(0,i.useCallback)(()=>{o(S.Ay.actions.setCollaborationDialogOpen(!0))},[o]);return(0,r.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[(0,r.jsx)(x.N,{children:y>0&&f&&!n&&(0,r.jsx)(h.PY1.div,{initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-4},children:(0,r.jsx)(eh.$,{variant:"outline",size:"sm",onClick:a,iconBefore:{name:"plus"},children:"Place"})})}),!f&&(0,r.jsx)(em.r,{variant:"text",size:"sm",dest:t,overlay:!1,trackingContext:"CollectionHeader"}),!V&&(M?(0,r.jsx)(ta,{collectionRef:t.ref,collaboratorRefs:t.accepted_collaborator_refs,onManageCollaborators:Q}):f&&t.accepted_collaborator_refs&&t.accepted_collaborator_refs.length>0?(0,r.jsx)(I.u,{userRefs:t.accepted_collaborator_refs,size:"xs",tooltip:!0}):null),!V&&(0,r.jsx)(ey,{collection:t}),(g||f||t.public||m)&&(0,r.jsxs)(ep.rI,{children:[(0,r.jsx)(ep.ty,{render:(0,r.jsx)(H.K,{label:"Actions",variant:"outline",size:"sm",icon:{name:"ellipsis"}})}),(0,r.jsxs)(ep.SQ,{children:[g&&(0,r.jsx)(ep._2,{onClick:()=>{o((0,E.jN)({editCollection:t}))},iconName:"pencil",children:"Edit"}),f&&(0,r.jsxs)(ep.lv,{children:[(0,r.jsx)(ep.nV,{disabled:k,iconName:"download",children:k?"Importing…":"Import"}),(0,r.jsxs)(ep.M5,{children:[(0,r.jsx)(ep._2,{onClick:()=>{w.current?.click(),(0,b.$)({name:"ImportCollectionClick",properties:{type:"file"}})},iconName:"image",children:"From a file"}),(0,r.jsx)(ep._2,{iconName:"link",onClick:()=>void o((0,E.st)("link")),children:"From a link"}),O&&(t.refreshable?(0,r.jsx)(ep._2,{onClick:z,iconName:"google",disabled:N,children:(0,r.jsx)("span",{children:N?"Refreshing…":"Refresh Google pins"})}):(0,r.jsx)(ep._2,{iconName:"google",onClick:()=>void o((0,E.st)("google")),children:"From Google"}))]})]}),(0,r.jsx)(ep.mB,{}),(0,r.jsx)(ep._2,{onClick:()=>(()=>{try{d(t)}catch(e){(0,es.y)()}})(),iconName:"addTrip",children:"Add to trip"}),(0,r.jsx)(ep._2,{onClick:()=>
1T(t),iconName:"compass",disabled:0===y,children:"Create guide"}),(0,r.jsx)(ep.mB,{}),g&&(0,r.jsx)(ep._2,{onClick:()=>j(t),iconName:"trash",className:"text-red-10",children:"Delete"}),!g&&m&&(0,r.jsx)(ep._2,{onClick:()=>v(t),iconName:"leave",variant:"destructive",children:"Leave"})]})]}),B,f&&(0,r.jsx)("input",{ref:w,type:"file","aria-label":l("uploadFiles"),className:"absolute left-[-100vw] size-px opacity-0",onChange:e=>{e.target.files&&e.target.files.length>0&&J(Array.from(e.target.files))},accept:c.AC,multiple:!0})]})}let eg={variant:"outline",label:"Share",tooltip:{side:"bottom",sideOffset:0},icon:{name:"share"}};function ey(e){let{collection:t}=e,n=(0,A.GV)(F.W5),a=(0,q.A)(),i=(0,A.GV)(F.Qr),l=t.collaboration?.permissions.can_edit_collection_properties??!1,s=(0,A.GV)(P.Ee),o=t.accepted_collaborator_refs?.includes(n),c=a&&(0,eo.CI)(),{handleCopyLink:d,fetchViewLinkUrl:u,buttonText:p}=(0,W.R)(t),m=t.canonical_url;i&&t.owner.user_ref===n&&(m=(0,ed.$B)(m,"refId",n)),m=(0,ec.yz)()&&(0,er.B)()&&!s?(0,ed.B3)(ea.T.href,m):m;let f=async()=>{try{let e=await (0,eu.$o)(m);("shared"===e||"copied"===e)&&(0,b.$)({name:"CollectionShare",properties:{target:"shared"===e?"native":"clipboard"}}),"copied"===e?G.J.add({type:"success",description:"Link copied!"}):"copy-failed"===e&&G.J.add({type:"error",description:"Failed to copy link"})}catch(e){X.j.notify(e instanceof Error?e:String(e),{context:{source:"web-share",action:"sharePublicCollection",collectionRef:t.ref}}),console.error("Error sharing content:",e)}};return l||o||t.public?c&&t.public?(0,r.jsx)(H.K,{...eg,size:"sm",onClick:()=>void f()}):(0,r.jsxs)(ep.rI,{onOpenChange:async e=>{e&&await u()},children:[(0,r.jsx)(ep.ty,{render:(0,r.jsx)(H.K,{...eg,size:"sm"})}),(0,r.jsxs)(ep.SQ,{children:[!!i&&t.owner.user_ref===n&&(0,r.jsx)(r.Fragment,{children:(0,ef.r)()}),(0,r.jsx)(ep._2,{onClick:d,iconName:"link",children:p})]})]}):null}var ej=n(27300),ev=n(26073),eb=n(54160),e_=n(76270);function eN(e){let t,n,l,s,o,c,d,u,p,m,f,h,x,g,y,j,v,b,_,N,w=(0,a.c)(53),{isPublic:C,collectionRef:k}=e,R=(0,A.jL)(),L=(0,A.GV)(S.wm),[P,O]=(0,i.useState)(""),F=(0,i.useRef)(null);w[0]!==L.currentNote||w[1]!==L.isOpen?(t=()=>{L.isOpen&&O(L.currentNote||"")},n=[L.isOpen,L.currentNote],w[0]=L.currentNote,w[1]=L.isOpen,w[2]=t,w[3]=n):(t=w[2],n=w[3]),(0,i.useEffect)(t,n),w[4]!==k||w[5]!==R||w[6]!==L.placeRef||w[7]!==P?(l=async()=>{L.placeRef&&(R(S.Ay.actions.setNoteDialogLoading(!0)),await R((0,E.hr)({placeRef:L.placeRef,collectionRef:k,note:P.trim()||void 0})),R(S.Ay.actions.closeNoteDialog()))},w[4]=k,w[5]=R,w[6]=L.placeRef,w[7]=P,w[8]=l):l=w[8];let G=l;w[9]!==k||w[10]!==R||w[11]!==L.placeRef?(s=async()=>(0,ej.G)({title:"Delete this note?",message:"You can add a new note later.",cancelLabel:"Cancel",okLabel:"Delete",okAction:()=>{L.placeRef&&R((0,E.hr)({placeRef:L.placeRef,collectionRef:k,note:void 0})).then(()=>{R(S.Ay.actions.closeNoteDialog())})}}),w[9]=k,w[10]=R,w[11]=L.placeRef,w[12]=s):s=w[12];let D=s;w[13]!==R?(o=()=>{R(S.Ay.actions.closeNoteDialog())},w[13]=R,w[14]=o):o=w[14];let V=o;w[15]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{O("")},w[15]=c):c=w[15];let I=c;w[16]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{(function(e){e&&(e.style.height="auto",e.style.height=e.scrollHeight+2+"px",e.scrollTop=e.scrollHeight)})(F.current)},w[16]=d):d=w[16],w[17]!==P?(u=[P],w[17]=P,w[18]=u):u=w[18],(0,i.useEffect)(d,u);let M=L.currentNote?"Edit note":"Add note";w[19]!==M?(p=(0,r.jsx)(eb.L3,{children:M}),w[19]=M,w[20]=p):p=w[20];let z=C?"globe":"lock";return w[21]!==z?(m=(0,r.jsx)(ev.I,{name:z,size:16,className:"mr-1 inline-block align-text-bottom"}),w[21]=z,w[22]=m):m=w[22],w[23]!==C?(f=C?(0,r.jsxs)(r.Fragment,{children:["Notes in ",(0,r.jsx)("span",{className:"italic",children:"public"})," collections are visible to everyone on Mindtrip."]}):(0,r.jsxs)(r.Fragment,{children:["Notes in ",(0,r.jsx)("span",{className:"italic",children:"private"})," collections are only visible to collaborators."]}),w[23]=C,w[24]=f):f=w[24],w[25]!==m||w[26]!==f?(h=(0,r.jsxs)(eb.rr,{className:"text-foreground",children:[m,f]}),w[25]=m,w[26]=f,w[27]=h):h=w[27],w[28]!==p||w[29]!==h?(x=(0,r.jsxs)(eb.c7,{separator:!1,children:[p,h]}),w[28]=p,w[29]=h,w[30]=x):x=w[30],w[31]===Symbol.for("react.memo_cache_sentinel")?(g=e=>O(e.target.value),w[31]=g):g=w[31],w[32]!==L.isLoading||w[33]!==P?(y=(0,r.jsx)(eb.R4,{className:"pb-0",children:(0,r.jsx)(e_.T,{ref:F,autoFocus:!0,placeholder:"Add a note about this place…",rows:3,size:"lg",value:P,onChange:g,maxLength:4e3,disabled:L.isLoading})}),w[32]=L.isLoading,w[33]=P,w[34]=y):y=w[34],w[35]!==D||w[36]!==L.currentNote||w[37]!==L.isLoading||w[38]!==P?(j=L.currentNote?(0,r.jsx)(eh.$,{variant:"ghost",size:"md",onClick:D,disabled:L.isLoading,iconBefore:{name:"trash",className:"text-[1.125em] mr-0.5"},children:"Delete"}):(0,r.jsx)(eh.$,{variant:"ghost",size:"md",onClick:I,disabled:L.isLoading||!P,children:"Clear"}),w[35]=D,w[36]=L.currentNote,w[37]=L.isLoading,w[38]=P,w[39]=j):j=w[39],w[40]!==G?(v=(0,r.jsx)(eh.$,{wide:!0,variant:"primary",size:"md",onPerform:G,children:"Save"}),w[40]=G,w[41]=v):v=w[41],w[42]!==j||w[43]!==v?(b=(0,r.jsxs)(eb.Es,{children:[j,v]}),w[42]=j,w[43]=v,w[44]=b):b=w[44],w[45]!==x||w[46]!==y||w[47]!==b?(_=(0,r.jsxs)(eb.Cf,{children:[x,y,b]}),w[45]=x,w[46]=y,w[47]=b,w[48]=_):_=w[48],w[49]!==V||w[50]!==L.isOpen||w[51]!==_?(N=(0,r.jsx)(eb.lG,{open:L.isOpen,onOpenChange:V,summonKeyboard:!0,children:_}),w[49]=V,w[50]=L.isOpen,w[51]=_,w[52]=N):N=w[52],N}var ew=n(33084),eC=n(86212),ek=n(41039),eR=n(63749),eL=n(85108),eP=n(19838),eS=n(78115),eA=n(25099),eO=n(98312),eE=n(25622),eF=n(16276),eG=n(64503),eD=n(92993),eV=n(9125),eI=n(18010),eM=n(50567),ez=n(88285);let e$="collection-sort-draggable",eT=["left","right"],eB=ez.Ik({type:ez.eu(e$),placeRef:ez.Yj().refine(e=>(0,eG.xQ)(e)),index:ez.ai()});function eJ(e){return eB.safeParse(e).success}function eH(e){return"left"===e||"right"===e?e:null}function eQ(e,t,n){return e.index===t.index||"left"===n&&e.index===t.index-1||"right"===n&&e.index===t.index+1}function eU(e){let t,n,l,s,o,c=(0,a.c)(15),{placeRef:d,index:u,children:m,sortable:f}=e,h=(0,i.useRef)(null),[x,g]=(0,i.useState)(null),[y,j]=(0,i.useState)(!1);if(c[0]!==u||c[1]!==d||c[2]!==f?(t=()=>{if(!f)return;let e=h.current;if(e)return(0,eI.k)((0,eM.kZ)({element:e,getInitialData:()=>({type:e$,placeRef:d,index:u}),onGenerateDragPreview:()=>{e.classList.add("z-overlay","bg-surface-2","text-foreground"),(0,eo.nr)()&&e.classList.add("photos-slider-fix-drag-preview")},onDragStart:()=>j(!0),onDrop:()=>{j(!1),e.classList.remove("z-overlay","bg-surface-2","text-foreground"),(0,eo.nr)()&&e.classList.remove("photos-slider-fix-drag-preview")}}),(0,eM.tO)({element:e,canDrop:e=>{let{source:t}=e;return eJ(t.data)&&t.data.placeRef!==d},getData:e=>
1{let{input:t,element:n}=e;return(0,eV.E)({type:e$,placeRef:d,index:u},{element:n,input:t,allowedEdges:eT})},getIsSticky:eY,onDrag:e=>{let{self:t,source:n}=e;if(!eJ(t.data)||!eJ(n.data))return;let r=eH((0,eV.S)(t.data));g(r&&!eQ(n.data,t.data,r)?r:null)},onDragLeave:()=>g(null),onDrop:()=>g(null)}))},n=[d,u,f],c[0]=u,c[1]=d,c[2]=f,c[3]=t,c[4]=n):(t=c[3],n=c[4]),(0,i.useEffect)(t,n),!f){let e;return c[5]!==m?(e=(0,r.jsx)("li",{className:"row-span-2",children:m}),c[5]=m,c[6]=e):e=c[6],e}let v=y&&"opacity-50";return c[7]!==v?(l=(0,p.cn)("js-draggable-place relative row-span-2 -mx-2 rounded-2xl px-2 **:data-[slot=photo]:pointer-events-none",v),c[7]=v,c[8]=l):l=c[8],c[9]!==x?(s=x&&(0,r.jsx)(eW,{edge:x}),c[9]=x,c[10]=s):s=c[10],c[11]!==m||c[12]!==l||c[13]!==s?(o=(0,r.jsxs)("li",{ref:h,className:l,children:[m,s]}),c[11]=m,c[12]=l,c[13]=s,c[14]=o):o=c[14],o}function eY(e){let{input:t,element:n}=e,r=n.getBoundingClientRect();return t.clientY>=r.top&&t.clientY<=r.bottom}function eW(e){let t,n,i=(0,a.c)(4),{edge:l}=e,s="left"===l?"left-2 -translate-x-[calc(50%+var(--card-gap-x)/2)]":"right-2 translate-x-[calc(50%+var(--card-gap-x)/2)]";return i[0]!==s?(t=(0,p.cn)("pointer-events-none absolute inset-y-2 z-10 w-0.75 rounded-full bg-primary",s),i[0]=s,i[1]=t):t=i[1],i[2]!==t?(n=(0,r.jsx)("div",{"aria-hidden":!0,className:t}),i[2]=t,i[3]=n):n=i[3],n}function eK(e){let{source:t}=e;return eJ(t.data)}function eq(e){let{source:t}=e;return eJ(t.data)}let eX=(0,i.memo)(function(e){let t,n,l,s,o,u,m,f,h,x,g,y,j,v=(0,a.c)(61),{saves:_,collectionUrl:N,canManagePlaces:w,canEditProperties:C,scrollRef:k,currentPage:R,maxPage:O,onPageChange:E,isLoading:F,onAddPlace:G}=e,D=(0,A.jL)(),V=(0,A.GV)(P.Qi),I=(0,A.GV)(S.f6),M=(0,A.GV)(S.NF),z=(0,A.GV)(S.Xx);v[0]!==M?(t=M?(0,el.Cs)(M):e2,v[0]=M,v[1]=t):t=v[1];let $=(0,A.GV)(t),T=!!C,B=!!T;v[2]!==M||v[3]!==k||v[4]!==B?(n={enabled:B,collectionRef:M,scrollRef:k},v[2]=M,v[3]=k,v[4]=B,v[5]=n):n=v[5],function(e){let t,n,r=(0,a.c)(6),{enabled:l,collectionRef:s,scrollRef:o}=e,c=(0,A.jL)();r[0]!==s||r[1]!==c||r[2]!==l||r[3]!==o?(t=()=>{if(!l||!s)return;let e=o?.current?(0,eD.V)({element:o.current,canScroll:eq}):(0,eD.v)({canScroll:eq});return(0,eI.k)((0,eM.$p)({canMonitor:eK,onDrop:e=>{let{source:t,location:n}=e;if(!eJ(t.data))return;let r=n.current.dropTargets[0];if(!r||!eJ(r.data))return;let a=eH((0,eV.S)(r.data));!a||eQ(t.data,r.data,a)||(c(L.m3.endpoints.reorderPlaceInCollection.initiate({collectionRef:s,placeRef:t.data.placeRef,targetPlaceRef:r.data.placeRef,position:"left"===a?"before":"after"})),(0,b.$)("CollectionReorderPlace"),setTimeout(()=>{t.element.animate([{backgroundColor:"var(--color-amber-5)"},{}],{duration:1e3,easing:"cubic-bezier(0.25, 0.1, 0.25, 1.0)",iterations:1}),t.element.scrollIntoView({block:"nearest",inline:"nearest"})},100))}}),e)},n=[l,s,o,c],r[0]=s,r[1]=c,r[2]=l,r[3]=o,r[4]=t,r[5]=n):(t=r[4],n=r[5]),(0,i.useEffect)(t,n)}(n),v[6]!==R||v[7]!==E?(l=e=>{e.preventDefault(),R>1&&E(R-1)},v[6]=R,v[7]=E,v[8]=l):l=v[8];let J=l;v[9]!==R||v[10]!==O||v[11]!==E?(s=e=>{e.preventDefault(),R<O&&E(R+1)},v[9]=R,v[10]=O,v[11]=E,v[12]=s):s=v[12];let H=s;v[13]!==D?(o=function(e,t){e.preventDefault(),D((0,ew.jR)({entity:t,entitySheetTrackingContext:"CollectionSaves"}))},v[13]=D,v[14]=o):o=v[14];let U=o;if(!M)return null;let Y=F&&"cursor-wait";if(v[15]!==Y?(u=(0,p.cn)(Y),v[15]=Y,v[16]=u):u=v[16],v[17]!==$?(m=$&&(0,r.jsx)("li",{className:"row-span-2",children:(0,r.jsx)(eA.S,{skeletonContent:(0,r.jsxs)("div",{className:"absolute inset-0 my-auto h-fit text-center",children:[(0,r.jsx)(eF.a,{name:"pin",width:80,height:80,className:"mx-auto mb-2.5"}),(0,r.jsx)("span",{className:"text-gray-11",children:"Importing…"})]}),trackingContext:"CardGrid"})}),v[17]=$,v[18]=m):m=v[18],v[19]!==w||v[20]!==M||v[21]!==I||v[22]!==U||v[23]!==F||v[24]!==V||v[25]!==_||v[26]!==z||v[27]!==T){let e;v[29]!==w||v[30]!==M||v[31]!==I||v[32]!==U||v[33]!==F||v[34]!==V||v[35]!==z||v[36]!==T?(e=(e,t)=>(0,r.jsxs)(eU,{placeRef:e.entity.entity_ref,index:t,sortable:T,children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(eA.S,{place:F?void 0:e.entity,onClick:t=>U(t,e.entity),trackHoveredPlace:!F&&V&&"map"===I,trackingContext:"CardGrid",creditSource:function(e){if(e?.kind===c.MZ)return{name:e.inspiration.title,url:e.inspiration.canonical_url};if(e?.kind===c.gH||e?.kind===c.gO){let t=(0,d.j8)(e.attachment.url,!!e.attachment.metadata?.description);if(!t)return;return{name:t.name,url:e.attachment.url}}}(e.medias?.[0]),showMentions:!1}),e.created_by_user_ref&&(0,r.jsx)("div",{className:"absolute top-5 left-4",children:(0,r.jsx)(Q.H,{userRef:e.created_by_user_ref,size:"2xs",tooltip:!0,className:"**:data-[slot=avatar]:shadow-md"})})]}),z&&(0,r.jsxs)("div",{className:(0,p.cn)("mt-2.5 flex flex-col gap-1 empty:hidden",F&&"invisible"),children:[e.notes&&e.notes.length>0&&(0,r.jsx)(e0,{save:e,collectionRef:M}),w&&(0,r.jsx)(e1,{save:e,collectionRef:M})]})]},e.entity.entity_ref),v[29]=w,v[30]=M,v[31]=I,v[32]=U,v[33]=F,v[34]=V,v[35]=z,v[36]=T,v[37]=e):e=v[37],f=_.map(e),v[19]=w,v[20]=M,v[21]=I,v[22]=U,v[23]=F,v[24]=V,v[25]=_,v[26]=z,v[27]=T,v[28]=f}else f=v[28];return v[38]!==w||v[39]!==G?(h=w?(0,r.jsx)("li",{className:"row-span-2",children:(0,r.jsx)("div",{children:(0,r.jsxs)(eO.S,{as:"div",onClick:()=>{G()},className:"group flex aspect-almost-square flex-col items-center justify-center rounded-2xl bg-gray-3 py-4",children:[(0,r.jsx)(ek.A,{className:"my-auto size-5/12"}),(0,r.jsx)("span",{className:"-mt-4 font-semibold text-gray-10 transition-colors group-hover:text-gray-11",children:"Add a place"})]})})}):void 0,v[38]=w,v[39]=G,v[40]=h):h=v[40],v[41]!==f||v[42]!==h||v[43]!==u||v[44]!==m?(x=(0,r.jsxs)(eP.p,{className:u,children:[m,f,h]}),v[41]=f,v[42]=h,v[43]=u,v[44]=m,v[45]=x):x=v[45],v[46]!==N||v[47]!==R||v[48]!==H||v[49]!==J||v[50]!==F||v[51]!==O?(g=O>1&&(0,r.jsx)("div",{className:"mt-12",children:(0,r.jsx)(eS.d,{currPage:R,maxPage:O,loading:F,handlePrevPage:J,handleNextPage:H,prevPageHref:R>2?`${N}?page=${R-1}`:N,nextPageHref:`${N}?page=${R+1}`})}),v[46]=N,v[47]=R,v[48]=H,v[49]=J,v[50]=F,v[51]=O,v[52]=g):g=v[52],v[53]!==I||v[54]!==V||v[55]!==_.length?(y=_.length>0&&(!V||!I)&&(0,r.jsx)(eZ,{}),v[53]=I,v[54]=V,v[55]=_.length,v[56]=y):y=v[56],v[57]!==x||v[58]!==g||v[59]!==y?(j=(0,r.jsxs)(r.Fragment,{children:[x,g,y]}),v[57]=x,v[58]=g,v[59]=y,v[60]=j):j=v[60],j});function eZ(){let e,t,n,i=(0,a.c)(10),l=(0,A.jL)(),s=(0,A.GV)(S.f6),o=(0,A.GV)(P.Qi)?"lg":"md",c="map"===s?"layoutSquare":"map";i[0]!==c?(e={name:c},i[0]=c,i[1]=e):e=i[1],i[2]!==s||i[3]!==l?(t=()=>{let e="map"===s?void 0:"map";l(S.Ay.actions.setCurrentView(e))},i[2]=s,i[3]=l,i[4]=t):t=i[4];let d="map"===s?"List":"Map";return i[5]!==o||i[6]!==e||i[7]!==t||i[8]!==d?(n=(0,r.jsx)(eC.o,{children:(0,r.jsx)(eh.$,{variant:"primary",size:o,iconBefore:e,onClick:t,className:"pointer-events-auto",children:d})}),i[5]=o,i[6]=e,i[7]=t,i[8]=d,i[9]=n):n=i[9],n}function e0(e){let t,n,l,s,o=(0,a.c)(18),{save:c,collectionRef:d}=e,u=(0,A.jL)(),m=(0,A.GV)(F.W5);o[0]!==u||o[1]!==c.entity?(t=e=>{u(S.Ay.actions.openNoteDialog({placeRef:c.entity.entity_ref,currentNote:e}))},o[0]=u,o[1]=c.entity,o[2]=t):t=o[2];let f=t;o[3]!==d||o[4]!==u||o[5]!==c.entity?(n=()=>{(0,ej.G)({title:"Delete note?",message:"This will remove Mindtr
1ip’s summary note for this place.",okLabel:"Delete",okAction:()=>{u((0,E.dO)({placeRef:c.entity.entity_ref,collectionRef:d}))},cancelLabel:"Cancel"})},o[3]=d,o[4]=u,o[5]=c.entity,o[6]=n):n=o[6];let h=n;if(!c.notes)return null;if(o[7]!==m||o[8]!==h||o[9]!==f||o[10]!==c.notes){let e;o[12]!==m||o[13]!==h||o[14]!==f?(e=(e,t)=>{let n=e.user_ref===m,a=!!e.note,l=!!e.source_summary,s=(0,p.cn)("group flex items-start gap-1.5 rounded-lg border border-gray-3 bg-gray-2 p-2 text-xs sm:text-sm",n&&"hover:border-gray-4");return(0,r.jsxs)(i.Fragment,{children:[a&&(0,r.jsxs)(eO.S,{as:"div",onClick:n?()=>f(e.note):void 0,className:s,children:[(0,r.jsx)(Q.H,{userRef:e.user_ref,size:"2xs",tooltip:!0}),(0,r.jsx)("div",{className:"min-w-0 flex-1 self-center",children:(0,r.jsxs)("p",{className:"no-translate leading-tight wrap-anywhere whitespace-pre-wrap",children:[e.note,n&&(0,r.jsxs)("span",{className:"ml-[.25em] whitespace-nowrap",children:[(0,r.jsx)("span",{children:"\uFEFF"}),(0,r.jsx)(eR.A,{className:"relative top-[-.125em] inline-block"})]})]})})]}),l&&(0,r.jsxs)(eO.S,{as:"div",onClick:n?h:void 0,className:s,children:[(0,r.jsx)(eE.pn,{size:"2xs"}),(0,r.jsx)("div",{className:"min-w-0 flex-1 self-center",children:(0,r.jsxs)("p",{className:"leading-tight wrap-anywhere whitespace-pre-wrap",children:[e.source_summary,n&&(0,r.jsxs)("span",{className:"ml-[.25em] whitespace-nowrap",children:[(0,r.jsx)("span",{children:"\uFEFF"}),(0,r.jsx)(eL.A,{className:"relative top-[-.0625em] inline-block transition-opacity group-hover:opacity-100 can-hover:opacity-0"})]})]})})]})]},`${e.collection_ref}-${e.user_ref}-${t}`)},o[12]=m,o[13]=h,o[14]=f,o[15]=e):e=o[15],l=c.notes.map(e),o[7]=m,o[8]=h,o[9]=f,o[10]=c.notes,o[11]=l}else l=o[11];return o[16]!==l?(s=(0,r.jsx)("div",{className:"relative flex flex-col gap-1",children:l}),o[16]=l,o[17]=s):s=o[17],s}function e1(e){let t,n,i,l=(0,a.c)(6),{save:s,collectionRef:o}=e,c=(0,A.jL)(),d=(0,A.GV)(F.W5);if(s.notes?.find(e=>e.user_ref===d&&e.collection_ref===o&&e.note))return null;l[0]!==c||l[1]!==s.entity.entity_ref?(t=()=>{c(S.Ay.actions.openNoteDialog({placeRef:s.entity.entity_ref}))},l[0]=c,l[1]=s.entity.entity_ref,l[2]=t):t=l[2];let u=t;return l[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,r.jsx)(eR.A,{}),l[3]=n):n=l[3],l[4]!==u?(i=(0,r.jsxs)(eO.S,{as:"div",onClick:u,className:"relative flex items-center gap-1.5 rounded-lg border border-gray-3 bg-gray-2 px-3 py-2 text-sm text-gray-11 transition-colors hover:border-gray-4 hover:text-gray-12",children:[n,"Add note"]}),l[4]=u,l[5]=i):i=l[5],i}function e2(){return!1}var e5=n(57778),e4=n(61055),e3=n(28104),e6=n(50436),e7=n(49320),e8=n(14776);function e9(e){let t,n,i,l,s=(0,a.c)(11),{markers:o,hoveredPlace:c}=e;return s[0]!==c||s[1]!==o?(t=(0,r.jsx)(T.j,{markers:o,hoveredPlace:c}),s[0]=c,s[1]=o,s[2]=t):t=s[2],s[3]!==o?(n=(0,r.jsx)(B.L,{markers:o}),s[3]=o,s[4]=n):n=s[4],s[5]!==c?(i=(0,r.jsx)(J.J,{hoveredPlace:c}),s[5]=c,s[6]=i):i=s[6],s[7]!==t||s[8]!==n||s[9]!==i?(l=(0,r.jsxs)($.GoogleMap,{id:"collection-map",children:[t,n,i]}),s[7]=t,s[8]=n,s[9]=i,s[10]=l):l=s[10],l}let te={all:"All",hotel:"Stays",restaurant:"Restaurants",attraction:"Experiences",location:"Locations"};function tt(e){return"collection"in e&&void 0!==e.collection}function tn(e){let t=(0,A.jL)(),n=(0,A.GV)(P.YN),a=(0,A.GV)(P.Qi),s=(0,A.GV)(S.f6),m=(0,A.GV)(S.oc),h=(0,A.GV)(S.dB),x=(0,A.GV)(S.Xx),g=(0,A.GV)(F.lu),b=(0,A.GV)(O.vG),$=(0,A.GV)(S.NF),T=tt(e)?e.collection:void 0,B=tt(e)?e.meta:void 0,J=T?.ref||("collectionRef"in e?e.collectionRef:void 0)||$,U=(0,A.GV)(S.Vs),Y=B&&B.current_page!==U&&1===U?B.current_page:U,{data:W,isFetching:K,isLoading:q}=L.m3.endpoints.getCollection.useQuery(J?{ref:J,page:Y}:u.hT),X=W?.data||T,Z=W?.meta,ee=X?.collaboration?.permissions.can_manage_collaborators??!1,et=X?.collaboration?.permissions.can_add_remove_places??!1,en=X?.collaboration?.permissions.can_edit_collection_properties??!1,{openSearchPlacesDialog:er,updateSearchDialogLocation:ea,clearSearchDialogLoading:ei}=(0,o.q)(),{ref:el,inView:es}=(0,j.Wx)({initialInView:!0,rootMargin:"-64px 0px 0px 0px"}),eo=(0,i.useRef)(null),ec=(0,i.useRef)(!1),ed=(0,i.useRef)(!1),eu=(0,i.useRef)(!1),[em]=(0,L.w6)(),ef=(0,i.useMemo)(()=>X?.favorites.map(e=>e.entity)??[],[X]),ex=s&&a,eg=X?.favorites_count??0,ey=(0,i.useMemo)(()=>X?"all"===h?X.favorites:"attraction"===h?X.favorites.filter(e=>"attraction"===e.entity.type||"activity"===e.entity.type):X.favorites.filter(e=>e.entity.type===h):[],[X,h]),ej=(0,i.useMemo)(()=>ey.map(e=>e.entity),[ey]),eb=(0,i.useMemo)(()=>ej.map(R.px).filter(D.Eb),[ej]),e_=(0,i.useMemo)(()=>X?.favorites.some(e=>e.notes&&e.notes.length>0)??!1,[X]),ew=(0,i.useMemo)(()=>ef.reduce((e,t)=>
1(e[t.type]=(e[t.type]||0)+1,e),{}),[ef]),eC=(0,i.useCallback)(()=>{ex?eo.current?.scrollTo({top:0,behavior:"smooth"}):window.scrollTo({top:0,behavior:"smooth"})},[ex,eo]);(0,i.useEffect)(()=>{a&&!s&&!ec.current&&eg>0&&(t(S.Ay.actions.setCurrentView("map")),ec.current=!0)},[a,s,eg,t]),(0,i.useEffect)(()=>()=>{ec.current=!1,t(S.Ay.actions.setCurrentView(void 0))},[t]),(0,i.useEffect)(()=>{eu.current=!0},[Y]),(0,i.useEffect)(()=>{ed.current&&!K&&eu.current&&(eC(),eu.current=!1),ed.current=K},[K,eC]);let ek=(0,i.useCallback)(async e=>{if(X){if(X.favorites.some(t=>t.entity.entity_ref===e.entity_ref))return void G.J.add({type:"info",description:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"no-translate",children:e.name})," is already in this collection"]})});try{await t((0,E.G9)({place:e,collection:X,showToast:!1})).unwrap(),G.J.add({type:"success",description:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"no-translate",children:e.name})," saved to this collection"]})}),Y>1&&J&&em({ref:J,page:1}),eC()}catch{G.J.add({type:"error",description:(0,r.jsxs)(r.Fragment,{children:["Failed to save"," ",(0,r.jsx)("span",{className:"no-translate",children:e.name})]})})}}},[t,X,Y,J,em,eC]);(0,v.pk)({addToCollection:ek});let eR=(0,i.useCallback)(()=>{X&&t((0,E.jN)({editCollection:X}))},[t,X]),eL=(0,i.useCallback)(e=>{t(S.Ay.actions.setFilterType(e))},[t]),eP=(0,i.useCallback)(e=>{t(S.Ay.actions.setCurrentPage(e))},[t]),eS=(0,i.useMemo)(()=>{let e=(0,_.Q)();return new N.S(e)},[]),eA=(0,i.useMemo)(()=>{let e=(0,_.Q)();return new k.U(e)},[]),eE=(0,i.useCallback)(()=>{X&&(er(void 0,l.G5,!0),(async()=>{try{let e=await eS.fetchCollectionBestMatchLocation({ref:X.ref});if(e.location)ea(e.location);else if(g)ea(g);else{let e=await eA.fetchUserLocation();ea(e)}}catch(e){if(console.warn("Unable to fetch location for a collection"),g)ea(g);else try{let e=await eA.fetchUserLocation();ea(e)}catch{ei()}}})())},[X,er,eS,eA,ea,ei,g]),eF=(0,i.useMemo)(()=>X?f()(X.favorites.flatMap(e=>e.medias||[]),"ref"):[],[X]);if(!X)return(0,r.jsx)("div",{className:"flex flex-1 items-center justify-center",children:(0,r.jsx)(e6.R,{})});let eG=(0,w._n)(X.canonical_url),eD="true"===(0,C._K)("NEXT_PUBLIC_ALLOW_GOOGLE_MAPS_LIST_IMPORT");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:(0,p.cn)("flex flex-1 flex-col split:flex-row",s&&"split:h-svh split:flex-none split:overflow-hidden"),children:[(0,r.jsxs)("div",{ref:eo,className:(0,p.cn)("relative flex flex-1 flex-col pb-24 split:pb-20",ex&&"overflow-x-hidden overflow-y-auto [&::-webkit-scrollbar-track]:mt-(--header-height)"),children:[(0,r.jsx)(tr,{collection:X,addPlaceInView:es,scrollRef:ex?eo:void 0,onAddPlace:eE}),(0,r.jsxs)(z.m,{className:(0,p.cn)("flex flex-1 flex-col pt-4 sm:pt-5",s&&"sm:px-7"),children:[(0,r.jsx)("div",{className:"@container mb-1.5",children:(0,r.jsx)("h1",{className:"no-translate text-2xl leading-tight font-semibold text-pretty sm:text-balance @xl:text-3xl",children:X.name})}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5 text-sm text-muted",children:["all"===h?y()("place",X.favorites_count,!0):y()("place",ej.length,!0),(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)(eO.S,{onClick:en?eR:void 0,className:(0,p.cn)("-m-1.5 flex items-center gap-0.5 p-1.5 text-foreground",en&&"hover:underline"),children:[(0,r.jsx)(ev.I,{name:X.public?"globe":"lock",className:"-mt-0.5 text-[1.25em]"}),(0,r.jsx)("span",{children:X.public?"Public":"Private"})]}),eF.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"\xb7"}),(0,r.jsxs)(ep.rI,{children:[(0,r.jsxs)(ep.ty,{className:"-m-1 flex items-center gap-1 p-1 transition-colors hover:text-foreground data-popup-open:text-foreground",children:["Sources",(0,r.jsx)(ev.I,{name:"chevronDown",className:"stroke-2 text-[.75em]"})]}),(0,r.jsx)(ep.SQ,{children:eF.map(e=>{let t,n,a="link",i="";if(e.kind===c.MZ&&(t=e.inspiration.canonical_url,a="compass",n=e.inspiration.title,i=V._E.guide.title),e.kind===c.gH||e.kind===c.gO){let r=(0,d.j8)(e.attachment.url);t=e.attachment.url,a=r?.icon||"link",n=e.attachment.metadata?.title||e.attachment.url}return t?(0,r.jsx)(ep._2,{render:(0,r.jsx)(e3.N,{href:t,target:"_blank",rel:"noopener noreferrer",children:(0,r.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[(0,r.jsx)(ev.I,{name:a}),(0,r.jsx)("span",{className:(0,p.cn)("max-w-[20em] truncate",i),children:n})]})})},e.ref):null})})]})]})]}),(0,r.jsxs)("div",{className:"mt-6 flex items-center",ref:el,children:[eg>0&&et?(0,r.jsx)(eh.$,{variant:"outline",size:"md",onClick:eE,iconBefore:{name:"plus"},children:"Place"}):X.accepted_collaborator_refs?(0,r.jsx)(I.u,{userRefs:X.accepted_collaborator_refs,size:"md",maxShown:n?3:5,hoverCard:{side:"bottom"},linked:!0}):(0,r.jsx)(Q.H,{user:X.owner,size:"md",hoverCard:{side:"bottom"},linked:!0}),(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-2",children:[ef.length>0&&(0,r.jsxs)(e7.l6,{value:h,onValueChange:e=>null!=e&&eL(e),items:te,children:[(0,r.jsx)(e7.bq,{"aria-label":"Filter places",render:(0,r.jsx)(eh.$,{variant:"ghost",iconAfter:{name:"chevronDown"},size:"sm",disabled:0===ej.length&&"all"===h,children:(0,r.jsx)(e7.yv,{})})}),(0,r.jsx)(e7.gC,{align:"center",alignItemWithTrigger:!1,children:Object.entries(te).map(e=>{let[t,n]=e;return(0,r.jsx)(e7.eb,{value:t,disabled:"hotel"===t?!ew.hotel:"restaurant"===t?!ew.restaurant:"attraction"===t?!ew.attraction&&!ew.activity:"location"===t&&!ew.location,children:n},t)})})]}),(e_||et)&&(0,r.jsxs)("label",{className:"mr-0.5 flex h-(--button-sm-size) cursor-pointer items-center gap-1.5 text-xs text-muted transition-colors hover:text-foreground print:hidden",children:[(0,r.jsx)("span",{children:"Notes"}),(0,r.jsx)(e8.d,{"aria-label":"Show distances",size:"xs",checked:x,onCheckedChange:()=>t(S.Ay.actions.setShowNotes(!x))})]})]})]}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)(eX,{saves:ey,collectionUrl:eG,canManagePlaces:et,canEditProperties:en,currentPage:Y,maxPage:Z?.total_pages??1,onPageChange:eP,isLoading:q,onAddPlace:eE,scrollRef:ex?eo:void 0})})]})]}),s&&a&&(0,r.jsxs)("div",{className:"relative flex flex-1 flex-col overflow-hidden rounded-l-2xl",children:[(0,r.jsx)(e9,{markers:eb,hoveredPlace:b}),(0,r.jsx)("div",{className:"absolute top-2.5 right-5",children:(0,r.jsx)(H.K,{variant:"overlay",icon:{name:"cross",className:"text-[1.125em]",strokeWidth:3},onClick:()=>{t(S.Ay.actions.setCurrentView(void 0))},label:"Close",tooltip:{side:"bottom"}})})]})]}),!a&&(0,r.jsx)("div",{className:(0,p.cn)("fixed inset-0 transition-[transform,opacity] duration-drawer ease-drawer sm:left-(--nav-width)",!s&&"pointer-events-none translate-y-full opacity-0"),children:(0,r.jsx)(e9,{markers:eb,hoveredPlace:b})}),ee&&(0,r.jsx)(M.K,{open:m,onOpenChange:e=>t(S.Ay.actions.setCollaborationDialogOpen(e)),collection:X}),(0,r.jsx)(eN,{isPublic:X.public,collectionRef:X.ref}),et&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e4.c,{}),eD&&(0,r.jsx)(e5.Z,{})]})]})}let tr=(0,i.memo)(function(e){let t,n,l,s,o,c,d,u=(0,a.c)(18),{collection:m,addPlaceInView:f,scrollRef:g,onAddPlace:y}=e,[j,v]=(0,i.useState)(!1),b=(0,i.useRef)(0),_=(0,i.useRef)(!1);u[0]!==g?(t=()=>{let e=g?.current??window,t=()=>{b.current||(b.current=requestAnimationFrame(()=>{b.current=0;let t=e instanceof HTMLDivElement?e.scrollTop>0:window.scrollY>0;t!==_.current&&(_.current=t,v(t))}))};return t(),e.addEventListener("scroll",t,{passive:!0}),()=>{e.removeEventListener("scroll",t),cancelAnimationFrame(b.current)}},n=[g],u[0]=g,u[1]=t,u[2]=n):(t=u[1],n=u[2]),(0,i.useEffect)(t,n);let N=!j&&"border-transparent";return u[3]!==N?(l=(0,p.cn)("sticky top-0 z-2 flex h-(--header-height) shrink-0 items-center gap-4 border-b bg-background/80 px-(--container-pad) backdrop-blur-md duration-drawer ease-drawer sm:px-7",N),u[3]=N,u[4]=l):l=u[4],u[5]!==f||u[6]!==m?(s=!f&&(0,r.jsx)(h.PY1.div,{initial:{opacity:0,y:-4}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-4},className:"no-translate truncate font-semibold",children:m.name}),u[5]=f,u[6]=m,u[7]=s):s=u[7],u[8]!==s?(o=(0,r.jsx)(x.N,{children:s}),u[8]=s,u[9]=o):o=u[9],u[10]!==f||u[11]!==m||u[12]!==y?(c=(0,r.jsx)(ex,{collection:m,addPlaceInView:f,onAddPlace:y}),u[10]=f,u[11]=m,u[12]=y,u[13]=c):c=u[13],u[14]!==l||u[15]!==o||u[16]!==c?(d=(0,r.jsxs)("div",{className:l,children:[o,c]}),u[14]=l,u[15]=o,u[16]=c,u[17]=d):d=u[17],d});function ta(e){let t,n,i,l,o,c,d,u,p,m,f=(0,a.c)(22),{collectionRef:h,collaboratorRefs:x,onManageCollaborators:g}=e,{handleInviteLink:y,fetchInviteLink:j,inviteLinkLabel:v}=(0,s.f)(h);return f[0]!==j?(t=async e=>{e&&await j()},f[0]=j,f[1]=t):t=f[1],f[2]!==x?(n=x&&x.length>0?(0,r.jsx)(I.u,{userRefs:x,size:"2xs",tooltip:!0}):(0,r.jsx)(Q.H,{size:"2xs"}),f[2]=x,f[3]=n):n=f[3],f[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,r.jsx)("span",{children:"Invite"}),f[4]=i):i=f[4],f[5]!==n?(l=(0,r.jsx)(ep.ty,{render:(0,r.jsxs)(eh.$,{variant:"outline",size:"sm",className:"gap-1.5 pr-2.5 pl-1.5",children:[n,i]})}),f[5]=n,f[6]=l):l=f[6],f[7]!==y?(o=()=>{y(),(0,b.$)({name:"CollectionCopyInviteLink",properties:{target:"clipboard"}})},f[7]=y,f[8]=o):o=f[8],f[9]!==v||f[10]!==o?(c=(0,r.jsx)(ep._2,{onClick:o,iconName:"link",children:v}),f[9]=v,f[10]=o,f[11]=c):c=f[11],f[12]===Symbol.for("react.memo_cache_sentinel")?(d=(0,r.jsx)(ep.mB,{}),f[12]=d):d=f[12],f[13]!==g?(u=(0,r.jsx)(ep._2,{onClick:g,iconName:"twoPeople",children:"Manage collaborators"}),f[13]=g,f[14]=u):u=f[14],f[15]!==c||f[16]!==u?(p=(0,r.jsxs)(ep.SQ,{children:[c,d,u]}),f[15]=c,f[16]=u,f[17]=p):p=f[17],f[18]!==t||f[19]!==l||f[20]!==p?(m=(0,r.jsxs)(ep.rI,{onOpenChange:t,children:[l,p]}),f[18]=t,f[19]=l,f[20]=p,f[21]=m):m=f[21],m}},91783:(e,t,n)=>{n.d(t,{q:()=>s});var r=n(27964),a=n(89700),i=n(73271),l=n(32516);function s(){let e,t,n,s,o,c=(0,r.c)(13),d=(0,l.jL)();c[0]!==d?(e=async(e,t,n)=>{d(a.Ay.actions.setIsSearchDialogOpen(!0)),d(a.Ay.actions.setUnifiedSearchContext(t)),d(a.Ay.actions.setIsMultiSelectMode(n)),e?(await d((0,i.bv)({location:e})),d((0,i.Fd)())):(d(a.Ay.actions.setLoadingResults(!0)),d(a.Ay.actions.setAutoDetectingLocation(!0)))},c[0]=d,c[1]=e):e=c[1];let u=e;c[2]!==d?(t=async e=>{d(a.Ay.actions.setAutoDetectingLocation(!1)),await d((0,i.bv)({location:e})),d((0,i.Fd)())},c[2]=d,c[3]=t):t=c[3];let p=t;c[4]!==d?(n=()=>{d(a.Ay.actions.setAutoDetectingLocation(!1)),d(a.Ay.actions.setLoadingResults(!1))},c[4]=d,c[5]=n):n=c[5];let m=n;c[6]!==d?(s=()=>{d(a.Ay.actions.setIsSearchDialogOpen(!1))},c[6]=d,c[7]=s):s=c[7];let f=s;return c[8]!==m||c[9]!==f||c[10]!==u||c[11]!==p?(o={openSearchPlacesDialog:u,updateSearchDialogLocation:p,clearSearchDialogLoading:m,closeSearchPlacesDialog:f},c[8]=m,c[9]=f,c[10]=u,c[11]=p,c[12]=o):o=c[12],o}}}]);
2//# sourceMappingURL=7540-1e6a8a4bdf5740dc.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.