1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[73199],{73199:(e,a,l)=>{l.r(a),l.d(a,{default:()=>A,propDefaults:()=>C});var t=l(95155),s=l(12115),n=l(52619),i=l.n(n),r=l(20063),c=l(63365),o=l(85387),d=l(65117),m=l(33599),u=l(28613),h=l(58825),p=l(18838),g=l(61633),x=l(67488),f=l(6017),j=l(60444),b=l(76144),y=l(96756),N=l(78542),v=l(21632),_=l(71269),w=l(76282);let C={marginTop:0,marginBottom:2,showLine:!0,lineColor:"pi-stone",hType:"h3",fetchLimit:16,showCardHeaderLine:!1,cardHeaderLineColor:"",type:"",enable_tag_cloud:!1,tags:[],expandSearchByDefault:!1,sortBy:"last_activity_at"},A=e=>{var a,l,n,A,S;let k={...C,...e},{title:L,type:E,pageId:O,filterByRelatedId:q,apsType:B,relatedId:M,relatedType:T,filterApprovedApplications:F,hType:U,showLine:I,lineColor:K,anchor:R,fetchLimit:H,showCardHeaderLine:P,cardHeaderLineColor:D,enableCreate:V,pageData:Y,enable_tag_cloud:z,tags:G,expandSearchByDefault:J,sortBy:Q}=k,W=(0,r.useSearchParams)(),X=(0,s.useMemo)(()=>[...null!=G?G:[]].sort((e,a)=>e.name.localeCompare(a.name)),[G]),Z=null!=(S=null==Y?void 0:Y.id)?S:M,{isAuthChecked:$,isAuthenticated:ee,currentUser:ea}=(0,_.Ay)(),[el,et]=(0,s.useState)({pageOffset:0,tag:z?W.get("tag"):null}),[es,en]=(0,s.useState)(!1),[ei,er]=(0,s.useState)(null),[ec,eo]=(0,s.useState)(null),[ed,em]=(0,s.useState)([]),[eu,eh]=(0,s.use
1State)(!1),[ep,eg]=(0,s.useState)(()=>!!(J||z&&W.get("tag"))&&"search"),[ex,ef]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!$)return;if(q&&!Z){em([]),eh(!1),en(!1);return}let e=new AbortController,a=el.pageOffset||0,l="/groups/".concat(E,"?_start=").concat(a,"&_limit=").concat(H);if(Q&&(l+="&sort=".concat(Q)),q&&Z&&(l+="&rid=".concat(Z)),el.q&&(l+="&q=".concat(encodeURIComponent(el.q))),el.language){let e=el.language.map(e=>e.id).join("&lang[]=");l+="&lang[]=".concat(e)}if(el.city&&el.geo_latitude&&el.geo_longitude?l+="&lat=".concat(el.geo_latitude,"&lng=").concat(el.geo_longitude):el.country&&(l+="&country=".concat(encodeURIComponent(el.country))),el.filterAps){let e=el.filterAps.map(e=>e.id).join("&aps[]=");l+="&aps[]=".concat(e)}return el.tag&&(l+="&tags[]=".concat(encodeURIComponent(el.tag))),F&&(l+="&status=application_approved"),en(!0),(0,w.Em)(l,null,{signal:e.signal}).then(l=>{!e.signal.aborted&&(em(e=>0===a?l.data:e.concat(l.data)),eh(l.hasMore),ec||eo({...l.meta,type:E}))}).catch(a=>{e.signal.aborted||er(a)}).finally(()=>{e.signal.aborted||en(!1)}),()=>{e.abort()}},[el,$]);let ej=(0,s.useMemo)(()=>ed.map(e=>{var a;let l=[e.city,e.country].filter(e=>e).join(", "),s=e.image?"with-image":"";return(0,t.jsx)(c.default,{children:(0,t.jsxs)(o.default,{className:"group-card w-q00 h-100 "+s,children:[e.image&&(0,t.jsx)("div",{className:"h-100 image-container",children:(0,t.jsx)(f.A,{image:e.image,fill:!0,blurPlaceholder:!0})}),(0,t.jsx)(i(),{href:(0,y.c3)("/g/".concat(e.type,"/").concat(e.slug)),legacyBehavior:!0,children:(0,t.jsxs)(o.default.Body,{className:"details",children:[(0,t.jsx)(o.default.Title,{className:"card-title fw-bold h5",children:(0,v.dK)(e,ec)}),P&&(0,t.jsx)("div",{className:"pi-head-line "+(D||"")}),(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"pi-fnt-extra-grey",children:[(0,t.jsx)("i",{className:"fal fa-user",style:{width:"17px",textAlign:"center"}})," Created by:"]})," ",e.created_by_user===(null==ea?void 0:ea.id)?"You":e.created_by_full_name,(0,t.jsx)("br",{})]}),e.accupuncture_points&&e.accupuncture_points.length>0&&(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"pi-fnt-extra-grey",children:[(0,t.jsx)("i",{className:"fal fa-scrubber",style:{width:"17px",textAlign:"center"}})," Focus Area",e.accupuncture_points.length>1?"s":"",":"]})," ",e.accupuncture_points.map((e,a)=>(0,t.jsxs)("span",{children:[a>0?", ":"",e.title]},a)),(0,t.jsx)("br",{})]}),(null==ec?void 0:ec.enable_language)&&e.language&&(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"pi-fnt-extra-grey",children:[(0,t.jsx)("i",{className:"fal fa-globe",style:{width:"17px",textAlign:"center"}})," Language:"]})," ",null==(a=e.language)?void 0:a.name," ",(0,t.jsx)("br",{})]}),(null==ec?void 0:ec.enable_location)&&""!==l&&(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"pi-fnt-extra-grey",children:[(0,t.jsx)("i",{className:"fal fa-map-marker-alt",style:{width:"17px",textAlign:"center"}})," Location:"]})," ",l," ",(0,t.jsx)("br",{})]}),(null==ec?void 0:ec.enable_members)&&void 0!==e.count_members&&(0,t.jsxs)("span",{children:[(0,t.jsxs)("span",{className:"pi-fnt-extra-grey",children:[(0,t.jsx)("i",{className:"fal fa-users",style:{width:"17px",textAlign:"center"}})," ",ec.members_label_plural,":"]})," ",Number(e.count_members),(0,t.jsx)("br",{})]}),(0,t.jsx)("p",{className:"pt-3 fst-italic",dangerouslySetInnerHTML:{__html:e.short_description||""}})]})}),(0,t.jsx)(o.default.Body,{className:"pt-0 button",children:(0,t.jsx)(i(),{href:(0,y.c3)("/g/".concat(e.type,"/").concat(e.slug)),className:"no-arrow",children:(0,t.jsxs)(d.default,{variant:"secondary",className:"btn-sm",children:["More ",(0,t.jsx)("i",{className:"fal fa-angle-right"})]})})})]})},e.id)}),[ed,null==ea?void 0:ea.id,P,D,ec]),eb=[(0,N.oc)(k)];if(q&&!Z)return null;if(!ei&&!ec)return(0,t.jsx)(b.A,{});if(ei&&(null==ei||null==(l=ei.props)||null==(a=l.error)?void 0:a.message)==="Authentication required")return(0,t.jsxs)("div",{className:"prototype-groups "+eb.join(" "),children:[(0,t.jsx)(h.A,{hType:U,showLine:I,lineColor:K,children:L}),(0,t.jsx)(m.default,{className:"pi-chat mx-0 ms-n3 me-md-3 ps-lg-1",children:(0,t.jsx)(c.default,{className:"col-12 col-lg-9",children:(0,t.jsx)("p",{className:"mt-3 p-3 text-muted bg-light",children:"Login to view the content"})})})]});if(ei)return(0,t.jsx)(j.default,{error:ei,showMinimal:!0});let ey=()=>{let e={};q&&(e.props={pageId:O},e.related_id=Z,e.related_type=T),ef(e)},eN=()=>{ev(null),et({pageOffset:0,reset:!0})},ev=e=>{let a=new URL(window.location.href);e?a.searchParams.set("tag",e):a.searchParams.delete("tag"),window.history.replaceState(null,"",a.toString())},e_=z&&X.length>0,ew=!!(el.q||el.tag||el.city||el.country||(null==(n=el.language)?void 0:n.length)||(null==(A=el.filterAps)?void 0:A.length));return(0,t.jsxs)("div",{className:eb.join(" "),children:[R&&""!==R&&(0,t.jsx)("a",{id:R,className:"anchor",children:R}),L&&(0,t.jsx)(h.A,{hType:U,showLine:I,lineColor:K,children:L}),(0,t.jsx)(u.default,{className:"pi-accordion group-search ps-1 mt-0 mx-n3 pt-n4",activeKey:ep||void 0,flush:!0,children:(0,t.jsxs)(u.default.Item,{eventKey:"search",children:[(0,t.jsx)(u.default.Header,{className:"pb-0 mb-n3 mt-0",onClick:e=>{e.preventDefault(),eg(!ep&&"search")},children:(0,t.jsxs)(m.default,{children:[(0,t.jsx)(c.default,{className:"col-auto pe-0",children:(0,t.jsx)("i",{className:"fal fa-search fs-4 mt-2 me-0 align-top"})}),(0,t.jsx)(c.default,{children:(0,t.jsxs)("p",{className:"lh-base mt-0",children:[(0,t.jsxs)("strong",{children:["Filter ",null==ec?void 0:ec.entity_name_plural]}),ew&&(0,t.jsx)("span",{className:"badge pi-bg-gold pi-fnt-black ms-2 align-middle",children:"Filters applied"}),(0,t.jsx)("br",{}),ew?"Showing filtered results".concat(el.tag?" for the â".concat(el.tag,"â tag"):"",". Click here to view or change the filters."):"Looking for a ".concat(null==ec?void 0:ec.entity_name,"? Click here to filter the results displayed below.")]})})]})}),(0,t.jsxs)(u.default.Body,{className:"mt-0 nof-line me-1",style:{marginLeft:"35px"},children:[(0,t.jsxs)(g.lV,{className:"mt-1",defaultValues:el,onSubmit:e=>{et({...el,...e,pageOffset:0,reset:!0})},children:[(0,t.jsx)(m.default,{children:(0,t.jsx)(g.gE,{as:c.default,md:12,className:"mb-2",children:(0,t.jsx)(g.pd,{name:"q",type:"search",className:"me-2 w-100",placeholder:"Search in title or description"})})}),(0,t.jsxs)(m.default,{children:[(null==ec?void 0:ec.enable_language)&&(0,t.jsx)(g.gE,{as:c.default,md:6,className:"mb-2",children:(0,t.jsx)(g.xf,{name:"language",label:"Filter by Language",placeholder:"Click to select one or multiple languages",fetchUrl:"/languages",labelKey:"name"})}),(null==ec?void 0:ec.enable_location)&&(0,t.jsx)(g.gE,{as:c.default,md:6,className:"mb-2",children:(0,t.jsx)(x.A,{name:"location",label:"Filter by Location",showSelected:!1})})]}),(null==ec?void 0:ec.enable_aps)&&(0,t.jsx)(g.gE,{className:"mb-2",children:(0,t.jsx)(g.xf,{name:"filterAps",label:"Filter by focus area",placeholder:"Click to select one or multiple areas of focus",fetchUrl:"/acupuncture-points"+(B?"?type="+B:""),labelKey:"title"})}),e_&&(0,t.jsx)("div",{className:"pi-tags mt-2 mb-3",children:X.map(e=>(0,t.jsx)("button",{type:"button",className:"pi-tag".concat(el.tag===e.name?" active":""),"aria-pressed":el.tag===e.name,onClick:()=>(e=>{let a=el.tag===e?null:e;et({...el,tag:a,pageOffset:0,reset:!0}),ev(a)})(e.name),children:e.name},e.id))}),(0,t.jsxs)(g.gE,{className:"mb-3 mt-4",children:[(0,t.jsx)(d.default,{variant:"primary",className:"mt-0",type:"submit",children:"Search"}),(0,t.jsx)(d.default,{variant:"secondary",className:"mt-0 ms-2",type:"reset",onClick:eN,children:"Reset"})]})]}),(0,t.jsx)("hr",{})]})]})}),V&&ee&&ej.length>5&&(0,t.jsx)(m.default,{children:(0,t.jsx)("div",{className:"mb-5 mt-2 text-left",children:(0,t.jsxs)(d.default,{variant:"primary",className:"px-5",onClick:ey,disabled:!ec,children:["Create ",null==ec?void 0:ec.entity_name]})})}),!ej.length&&(0,t.jsx)("div",{className:"row mt-5 mb-3",children:ew?(0,t.jsxs)("p",{className:"fs-6 text-muted",children:["No ",null==ec?void 0:ec.entity_name_plural," match the current filters."," ",(0,t.jsx)(d.default,{variant:"secondary",className:"px-2 py-0 align-baseline",onClick:eN,children:"Clear filters"})]}):(0,t.jsxs)("p",{className:"fs-6 text-muted",children:["There are no ",null==ec?void 0:ec.entity_name_plural," available yet",V?", be the first to create one!":""]})}),ej.length>0&&(0,t.jsx)(m.default,{xs:1,sm:2,md:3,lg:3,className:"d-flex g-4",children:ej}),es&&(0,t.jsx)(b.A,{}),eu&&(0,t.jsx)("div",{className:"mt-5 mb-5 text-center position-relative",children:(0,t.jsxs)(d.default,{variant:"secondary",className:" px-5 w-auto ",onClick:()=>{eu&&et({...el,pageOffset:el.pageOffset+(H||16),reset:!1})},children:[(0,t.jsx)("i",{className:"fal fa-chevron-down me-3"})," Show More ",(0,t.jsx)("i",{className:"fal fa-chevron-down ms-3"})]})}),V&&ee&&(0,t.jsx)(m.default,{children:(0,t.jsx)("div",{className:"my-5 text-center",children:(0,t.jsxs)(d.default,{variant:"primary",className:"px-5",onClick:ey,disabled:!ec,children:["Create ",null==ec?void 0:ec.entity_name]})})}),ex&&ec&&(0,t.jsx)(p.A,{isOpen:!!ex,data:ex,meta:ec,close:e=>{ef(!1),e&&et(e=>({...e}))}})]})}}}]);
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.