1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[316],{245:function(e,a,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/places",function(){return t(6724)}])},6724:function(e,a,t){"use strict";t.r(a),t.d(a,{default:function(){return places}});var n=t(5893),r=t(7294),i=t(2515),l=t(5833),o=t(737),s=t(872),d=t(7698),u=t(4746),c=t(5095),p=t(7054),h=t(2153),g=t(6093),m=t(3219),v=t(3013),b=t.n(v),f=t(6004),x=t(9251),w=t(7441);let S=[{value:"gallery",label:"Gallery"},{value:"museum",label:"Museum"},{value:"artfair",label:"Art fair"},{value:"studio",label:"Artist studio"},{value:"altspace",label:"Alternative space"}],j=[{value:"",label:"None"},{value:"member",label:"Member"},{value:"partner",label:"Partner"}],y=[{value:"",label:"N/A"},{value:"black-owned",label:"Black-owned"},{value:"asian-owned",label:"Asian-owned"},{value:"latinx-owned",label:"Latinx-owned"}],N=[{value:"westside",label:"Westside"},{value:"mid-city",label:"Mid-city"},{value:"hollywood",label:"Hollywood"},{value:"downtown",label:"Downtown"},{value:"eastside",label:"Eastside"},{value:"south-la",label:"South LA"},{value:"greater-la",label:"Greater LA"},{value:"",label:"Other"}],findOption=(e,a)=>e.find(e=>e.value===a)||null;var Admin_PlaceEditModal=e=>{var a,t;let{place:i,onClose:l,onSaved:o,onImageUploaded:s}=e,[d,u]=(0,r.useState)(i.title||""),[c,v]=(0,r.useState)(findOption(S,i.type||"")),[R,C]=(0,r.useState)(findOption(j,i.membership||"")),[L,_]=(0,r.useState)(i.address||""),[z,k]=(0,r.useState)(i.uri||""),[A,E]=(0,r.useState)(i.description||""),[T,Z]=(0,r.useState)(null!=i.owner_user_id?String(i.owner_user_id):""),[F,P]=(0,r.useState)(i.owner_name||""),[I,M]=(0,r.useState)(i.owner_email||""),[O,H]=(0,r.useState)(findOption(y,i.diversity||"")),[W,D]=(0,r.useState)(findOption(N,i.neighborhood||"")),[U,B]=(0,r.useState)(String(null!==(a=i.lat)&&void 0!==a?a:"")),[$,G]=(0,r.useState)(String(null!==(t=i.lng)&&void 0!==t?t:"")),[X,q]=(0,r.useState)(!1),[J,K]=(0,r.useState)(""),V=parseFloat(U),Q=parseFloat($),Y=!Number.isNaN(V)&&!Number.isNaN(Q),handleSave=async()=>{if(!d||!c){K("Title and type are required.");return}K(""),q(!0);try{await (0,m.Wt)("/api/admin/places/update",{id:i.id,title:d,type:c.value,membership:(null==R?void 0:R.value)||"",address:L,uri:z,description:A,owner_user_id:""===T.trim()?null:T.trim(),owner_name:F,owner_email:I,diversity:(null==O?void 0:O.value)||"",neighborhood:(null==W?void 0:W.value)||"",lat:Y?V:0,lng:Y?Q:0}),(0,w.A)("Location saved"),o()}catch(e){K(e.message||"There was an error saving this location."),q(!1)}};return(0,n.jsxs)(x.Z,{title:"Edit location",onClose:l,children:[(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Title"}),(0,n.jsx)("input",{type:"text",value:d,onChange:e=>u(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Type"}),(0,n.jsx)(h.ZP,{instanceId:"admin-place-type",options:S,value:c,onChange:e=>v(e)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Membership"}),(0,n.jsx)(h.ZP,{instanceId:"admin-place-membership",options:j,value:R,onChange:e=>C(e)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Address"}),(0,n.jsx)("input",{type:"text",value:L,onChange:e=>_(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"URL"}),(0,n.jsx)("input",{type:"text",value:z,onChange:e=>k(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Description"}),(0,n.jsx)(g.Z,{minRows:3,maxRows:10,value:A,onChange:e=>E(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Owner's user ID"}),(0,n.jsx)("input",{type:"text",value:T,onChange:e=>Z(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Owner name"}),(0,n.jsx)("input",{type:"text",value:F,onChange:e=>P(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Owner email"}),(0,n.jsx)("input",{type:"email",value:I,onChange:e=>M(e.target.value)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Diversity"}
1),(0,n.jsx)(h.ZP,{instanceId:"admin-place-diversity",options:y,value:O,onChange:e=>H(e)})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Neighborhood"}),(0,n.jsx)(h.ZP,{instanceId:"admin-place-neighborhood",options:N,value:W,onChange:e=>D(e)})]}),Y&&(0,n.jsx)(p.LM,{googleMapsApiKey:"AIzaSyAXSZrc8uxlgNUbEdlQLVA7_nuDnJTwMSI",children:(0,n.jsx)(p.b6,{mapContainerClassName:b().minimap,center:{lat:V,lng:Q},zoom:14,children:(0,n.jsx)(p.Jx,{position:{lat:V,lng:Q},draggable:!0,onDragEnd:e=>{e.latLng&&(B(String(e.latLng.lat())),G(String(e.latLng.lng())))}})})}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"GPS location"}),(0,n.jsxs)("div",{className:b().inlineFields,children:[(0,n.jsx)("input",{type:"text",value:U,onChange:e=>B(e.target.value),placeholder:"Latitude"}),(0,n.jsx)("input",{type:"text",value:$,onChange:e=>G(e.target.value),placeholder:"Longitude"})]})]}),(0,n.jsxs)("div",{className:b().formRow,children:[(0,n.jsx)("label",{children:"Image"}),(0,n.jsx)(f.Z,{id:i.id,uploadUrl:"/api/admin/places/image",currentImageUrl:"https://storage.googleapis.com/".concat("curate-la-uploads-prod","/places/").concat(i.id,"-md.jpg?t=").concat(i.last_modified||0),onUploaded:s})]}),J&&(0,n.jsx)("p",{className:b().formError,children:J}),(0,n.jsxs)("div",{className:b().modalFooter,children:[(0,n.jsx)("button",{className:"button secondary",onClick:l,children:"Cancel"}),(0,n.jsx)("button",{className:"button",onClick:handleSave,disabled:X,children:X?"Savingâ¦":"Save changes"})]})]})},R=t(5178),places=()=>{let[e,a]=(0,r.useState)("pending"),[t,p]=(0,r.useState)(""),[h,g]=(0,r.useState)(1),[v,f]=(0,r.useState)(25),[x,w]=(0,r.useState)("id"),[S,j]=(0,r.useState)("desc"),[y,N]=(0,r.useState)(null),C=new URLSearchParams({status:e,search:t,page:String(h),pageSize:String(v),sort:x,dir:S}),{data:L,mutate:_}=(0,i.ZP)("/api/admin/places?".concat(C.toString()),m.OV),z=[{key:"id",label:"ID",sortable:!0,render:e=>(0,n.jsx)("a",{href:"/places/".concat(e.id),target:"_blank",rel:"noopener noreferrer",children:e.id})},{key:"actions",label:"Actions",render:e=>(0,n.jsxs)("div",{className:b().rowActions,children:[(0,n.jsx)("button",{className:b().actionButton,onClick:()=>N(e),children:"Edit"}),(0,n.jsx)(s.Z,{id:e.id,title:e.title,approveUrl:"/api/admin/places/approve",rejectUrl:"/api/admin/places/reject",onDone:()=>_()})]})},{key:"approved",label:"Status",sortable:!0,render:e=>(0,n.jsx)(R.Z,{approved:e.approved})},{key:"image",label:"Image",render:e=>(0,n.jsx)("img",{className:b().thumb,src:"https://storage.googleapis.com/".concat("curate-la-uploads-prod","/places/").concat(e.id,"-md.jpg?t=").concat(e.last_modified||0),alt:"",loading:"lazy"})},{key:"title",label:"Title",sortable:!0,wrap:!0},{key:"type",label:"Type",sortable:!0},{key:"membership",label:"Membership"},{key:"neighborhood",label:"Neighborhood",sortable:!0},{key:"address",label:"Address",wrap:!0},{key:"owner_user_id",label:"Owner",render:e=>(0,n.jsx)(u.Z,{userId:e.owner_user_id,email:e.owner_account_email})}];return(0,n.jsxs)(l.Z,{children:[(0,n.jsx)("p",{className:b().signedInAs,children:"â ï¸ Approving a location sends a confirmation email to the owner (once emails are enabled)."}),(0,n.jsx)(d.Z,{status:e,onStatusChange:e=>{a(e),g(1)},search:t,onSearchChange:e=>{p(e),g(1)},total:null==L?void 0:L.total}),(0,n.jsx)(o.Z,{columns:z,rows:(null==L?void 0:L.rows)||[],rowKey:e=>e.id,sort:x,dir:S,onSort:e=>{x===e?j("asc"===S?"desc":"asc"):(w(e),j("desc")),g(1)},loading:!L,emptyMessage:"No locations match these filters."}),(0,n.jsx)(c.Z,{page:h,pageSize:v,total:(null==L?void 0:L.total)||0,onPageChange:g,onPageSizeChange:e=>{f(e),g(1)}}),y&&(0,n.jsx)(Admin_PlaceEditModal,{place:y,onClose:()=>N(null),onSaved:()=>{N(null),_()},onImageUploaded:()=>_()})]})}},6093:function(e,a,t){"use strict";t.d(a,{Z:function(){return p}});var n=t(7462),r=t(3366),i=t(7294),l=t(3469),useLatest=function(e){var a=i.useRef(e);return(0,l.Z)(function(){a.current=e}),a},updateRef=function(e,a){if("function"==typeof e){e(a);return}e.current=a},useComposedRef=function(e,a){var t=i.useRef();return i.useCallback(function(n){e.current=n,t.current&&updateRef(t.current,null),t.current=a,a&&updateRef(a,n)},[a])},o={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"}
1,forceHiddenStyles$1=function(e){Object.keys(o).forEach(function(a){e.style.setProperty(a,o[a],"important")})},s=null,getHeight=function(e,a){var t=e.scrollHeight;return"border-box"===a.sizingStyle.boxSizing?t+a.borderSize:t-a.paddingSize},noop=function(){},d=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],u=!!document.documentElement.currentStyle,getSizingData$1=function(e){var a=window.getComputedStyle(e);if(null===a)return null;var t=d.reduce(function(e,t){return e[t]=a[t],e},{}),n=t.boxSizing;if(""===n)return null;u&&"border-box"===n&&(t.width=parseFloat(t.width)+parseFloat(t.borderRightWidth)+parseFloat(t.borderLeftWidth)+parseFloat(t.paddingRight)+parseFloat(t.paddingLeft)+"px");var r=parseFloat(t.paddingBottom)+parseFloat(t.paddingTop),i=parseFloat(t.borderBottomWidth)+parseFloat(t.borderTopWidth);return{sizingStyle:t,paddingSize:r,borderSize:i}};function useListener(e,a,t){var n=useLatest(t);i.useLayoutEffect(function(){var handler=function(e){return n.current(e)};if(e)return e.addEventListener(a,handler),function(){return e.removeEventListener(a,handler)}},[])}var useFormResetListener=function(e,a){useListener(document.body,"reset",function(t){e.current.form===t.target&&a(t)})},useWindowResizeListener=function(e){useListener(window,"resize",e)},useFontsLoadedListener=function(e){useListener(document.fonts,"loadingdone",e)},c=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],p=i.forwardRef(function(e,a){var t=e.cacheMeasurements,l=e.maxRows,o=e.minRows,d=e.onChange,u=void 0===d?noop:d,p=e.onHeightChange,h=void 0===p?noop:p,g=(0,r.Z)(e,c),m=void 0!==g.value,v=i.useRef(null),b=useComposedRef(v,a),f=i.useRef(0),x=i.useRef(),resizeTextarea=function(){var e,a,n,r,i,d,u,c,p,g,m,b=v.current,w=t&&x.current?x.current:getSizingData$1(b);if(w){x.current=w;var S=(e=b.value||b.placeholder||"x",void 0===(a=o)&&(a=1),void 0===(n=l)&&(n=1/0),s||((s=document.createElement("textarea")).setAttribute("tabindex","-1"),s.setAttribute("aria-hidden","true"),forceHiddenStyles$1(s)),null===s.parentNode&&document.body.appendChild(s),r=w.paddingSize,i=w.borderSize,u=(d=w.sizingStyle).boxSizing,Object.keys(d).forEach(function(e){s.style[e]=d[e]}),forceHiddenStyles$1(s),s.value=e,c=getHeight(s,w),s.value=e,c=getHeight(s,w),s.value="x",g=(p=s.scrollHeight-r)*a,"border-box"===u&&(g=g+r+i),c=Math.max(g,c),m=p*n,"border-box"===u&&(m=m+r+i),[c=Math.min(m,c),p]),j=S[0],y=S[1];f.current!==j&&(f.current=j,b.style.setProperty("height",j+"px","important"),h(j,{rowHeight:y}))}};return i.useLayoutEffect(resizeTextarea),useFormResetListener(v,function(){if(!m){var e=v.current.value;requestAnimationFrame(function(){var a=v.current;a&&e!==a.value&&resizeTextarea()})}}),useWindowResizeListener(resizeTextarea),useFontsLoadedListener(resizeTextarea),i.createElement("textarea",(0,n.Z)({},g,{onChange:function(e){m||resizeTextarea(),u(e)},ref:b}))})}},function(e){e.O(0,[255,153,515,686,774,888,179],function(){return e(e.s=245)}),_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.