import{d as Y,u as ie,b as Ce,c as P,e as C,g as A,j as t,o,_ as ye,w as m,n as F,E as S,f as u,s as _e,t as V,bc as be,Q as I,R as G,h as ke,p as xe,l as Se,dE as ve,dU as he,y as q,Y as je,a3 as re,a9 as ue,aR as Be,af as se,dV as ne,bi as Ee,x as fe,a5 as Oe,bh as Fe,Z as De,a1 as Ne,W as Je,cG as Pe,dW as Ae,bD as we,dR as Ie,dS as Me,ds as Ue,X as We,dX as He,dY as Qe,bV as Ke,I as Te,bW as Ge,bX as ze,bf as Xe,dQ as Ye,bY as Ze,dZ as qe,U as et,C as tt,d_ as st,d$ as nt,e0 as at,e1 as lt,e2 as me,O as ot}from"./DPurtOtd.js";const H={ej:{columnDBName:{ja:"データベース名",en:"Database name"},columnGenre:{ja:"ジャンル",en:"Genre"},columnDescription:{ja:"説明",en:"Description"},columnData:{ja:"データ",en:"Data"},columnUsage:{ja:"利用",en:"Usage"}}},ct={class:"ej-head is-hidden-mobile"},rt={class:"srej-block"},ut={class:"srej-block"},it={class:"srej-block"},_t={class:"srej-block"},pt={key:1},dt={class:"has-text-body-s has-text-sub"},ht={key:0,class:"has-text-body-s has-text-sub"},ft={class:"has-text-headline-s has-text-heading is-hidden-desktop"},mt={class:"has-text-headline-s has-text-heading is-hidden-desktop"},gt=Y({__name:"SearchResultJsonEJ",props:{ss:{},cs:{},getValue:{type:Function}},setup(e){const{$langLabel:s}=ie(),l=Ce(),a=(r,B)=>d.getValue(r,B)?.[0]||"",i=r=>{const B=d.getValue(r,"library"),E=d.getValue(r,"pcflag"),O=l.$state.loc,v=l.$state.ejFlag?.split("")||[];return!(!he(B)&&!B.includes(O)||!he(E)&&v.every(_=>!E.includes(_)))},h=(r,B,E)=>{const O=d.cs.searchFields?.filter(_=>_.key===E)?.pop()?.options;return d.getValue(r,B).map(_=>O.filter(j=>j.key===_).pop()?.name).filter(_=>_).map(_=>s(_))},d=e,N=P(()=>d.ss.searchState.result);return(r,B)=>{const E=_e,O=be,v=xe,_=ke,j=ve,$=ye;return t(N)?(o(),C(,ドル{key:0,class:"search-result-ej"},{default:m(()=>[F("div",ct,[u(E,{gap:"40"},{default:m(()=>[F("p",null,V(t(s)(t(H).ej.columnDBName)),1),F("p",null,V(t(s)(t(H).ej.columnGenre)),1),F("p",null,V(t(s)(t(H).ej.columnDescription)),1)]),_:1}),F("div",rt,[u(O)]),F("div",ut,[F("p",null,V(t(s)(t(H).ej.columnData)),1)]),F("div",it,[u(O)]),F("div",_t,[F("p",null,V(t(s)(t(H).ej.columnUsage)),1)])]),(o(!0),S(I,null,G(t(N).list,p=>(o(),S("div",{key:a(p,"id"),class:"ej"},[u(_,{class:"ej-title",level:"3","visual-level":"headline"},{default:m(()=>[i(p)?(o(),C(v,{key:0,to:a(p,"url")},{default:m(()=>[Se(V(a(p,"title")),1)]),_:2},1032,["to"])):(o(),S("span",pt,V(a(p,"title")),1))]),_:2},1024),u(,ドル{class:"ej-desc has-text-body-s has-text-sub",gap:"8"},{default:m(()=>[F("span",null,V(h(p,"subject","genre").join(", "))+" - "+V(h(p,"subjectSub","genre").join(", ")),1),F("p",dt,[u(j,{md:a(p,"content")?.replaceAll(/\\n/g,` `)},null,8,["md"])]),i(p)?(o(),S("p",ht,[u(j,{md:a(p,"activeContent")?.replaceAll(/\\n/g,` `)},null,8,["md"])])):A("",!0)]),_:2},1024),u(,ドル{class:"ej-data srej-block has-text-body-s"},{default:m(()=>[F("span",ft,V(t(s)(t(H).ej.columnData)),1),(o(!0),S(I,null,G(h(p,"category","category"),L=>(o(),S("span",{key:L},V(L),1))),128))]),_:2},1024),u(,ドル{class:"ej-note srej-block has-text-body-s"},{default:m(()=>[F("span",mt,V(t(s)(t(H).ej.columnUsage)),1),(o(!0),S(I,null,G(e.getValue(p,"useNote"),L=>(o(),S("span",{key:L},V(L),1))),128))]),_:2},1024)]))),128))]),_:1})):A("",!0)}}}),yt=Object.assign(q(gt,[["__scopeId","data-v-11b8b6dd"]]),{__name:"SearchResultJsonEJ"}),bt={key:1},kt={key:0,class:"search-result-item-meta",gap:"8","flex-wrap":""},xt={key:0,class:"field-label has-text-headline-s has-text-heading"},St={key:1,class:"search-result-item-content"},vt=Y({__name:"SearchResultJsonEntry",props:{ss:{},cs:{},detailLink:{type:Boolean},detailAllOpen:{type:Boolean},layout:{},row:{},getValue:{type:Function}},setup(e){const{$langLabel:s}=ie(),l=e,{cs:a,ss:i}=je(l),h=O=>{const v=l.getValue(l.row,O);return v?v[0]:""},d=P(()=>l.ss.searchState.result),N=P(()=>l.layout==="page"?null:new RegExp(i.value.searchState.resultQuery?.keyword.join("|"))),r=re(!1);ue(d,()=>{r.value=!1});const B=P(()=>l.detailLink?`?cs=${a.value.id}&olid=${h("id")}`:h("url")?h("url"):null),E=O=>{if(!a.value.columns)return[];const v=[];return a.value.columns.forEach(_=>{const j=[];_.fields.forEach($=>{if(_.type==="OPTIONS"){const p=a.value.searchFields?.filter(L=>L.key===_.codeKey)?.pop()?.options;p&&l.getValue(O,$)?.forEach(L=>{const K=p.filter(J=>J.key===L).pop();K&&j.push(s(K.name))})}else l.getValue(O,$)?.forEach(p=>{j.push(p)});j.length>0&&v.push({label:_.header,values:j})})}),v};return(O,v)=>{const _=_e,j=xe,$=ke,p=be,L=Ee,K=ve;return o(),S("div",{class:Be(["search-result-json-entry","layout-"+e.layout])},[u(_,{class:"search-result-item-format","vertical-align":"top",gap:"8"}),u(_,{class:"search-result-item-heading",gap:"16"},{default:m(()=>[se((o(),C(,ドル{level:e.layout==="page"?1:3,"visual-level":e.layout==="page"?null:"headline"},{default:m(()=>[t(B)?(o(),C(j,{key:0,to:t(B)},{default:m(()=>[Se(V(h("title")),1)]),_:1},8,["to"])):(o(),S("span",bt,V(h("title")),1))]),_:1},8,["level","visual-level"])),[[t(ne),t(N)]])]),_:1}),t(a).columns?se((o(),S("div",kt,[(o(!0),S(I,null,G(E(e.row),(J,k)=>(o(),C(_,{key:k,gap:"16","vertical-align":"top"},{default:m(()=>[t(s)(J.label)?(o(),S("span",xt,V(t(s)(J.label)),1)):A("",!0),u(_,{gap:"8","flex-wrap":"",class:"has-text-body-s"},{default:m(()=>[(o(!0),S(I,null,G(J.values,(M,Z)=>(o(),S("span",{key:Z},V(M),1))),128))]),_:2},1024),u(p)]),_:2},1024))),128))])),[[t(ne),t(N)]]):A("",!0),h("content")?(o(),S(I,{key:1},[e.detailAllOpen?A("",!0):(o(),C(L,{key:0,modelValue:t(r),"onUpdate:modelValue":v[0]||(v[0]=J=>Oe(r)?r.value=J:null),class:"search-result-item-content-disclosure",labels:[t(s)(t(fe).result.detail.open),t(s)(t(fe).result.detail.close)]},null,8,["modelValue","labels"])),t(r)||e.detailAllOpen?se((o(),S("div",St,[u(K,{md:h("content")},null,8,["md"])])),[[t(ne),t(N)]]):A("",!0)],64)):A("",!0)],2)}}}),jt=Object.assign(q(vt,[["__scopeId","data-v-7b138407"]]),{__name:"SearchResultJsonEntry"}),Lt=Y({__name:"SearchResultJson",props:{ss:{},cs:{},detailAllOpen:{type:Boolean},detailLink:{type:Boolean},layout:{},getValue:{type:Function}},setup(e){const s=e,l=(d,N)=>{const r=s.getValue(d,N);return r?r[0]:""},{cs:a,ss:i}=je(s),h=P(()=>s.ss.searchState.result);return(d,N)=>{const r=jt,B=Fe;return t(h)?(o(),C(B,{key:0},{default:m(()=>[(o(!0),S(I,null,G(t(h).list,E=>(o(),C(r,{key:l(E,"id"),row:E,ss:t(i),cs:t(a),"get-value":e.getValue,"detail-link":e.detailLink,layout:e.layout,"detail-all-open":e.detailAllOpen},null,8,["row","ss","cs","get-value","detail-link","layout","detail-all-open"]))),128))]),_:1})):A("",!0)}}}),Rt=Object.assign(q(Lt,[["__scopeId","data-v-6c59d708"]]),{__name:"SearchResultJson"}),ae=(e,s="AND")=>{const l={must:[],should:[],must_not:[]};if(!e||e.length===0)return l;if(e.length===1){const{keyword:a,prefix:i}=le(e[0],s);i==="-"?l.must_not.push(a):l.must.push(a)}else{let a=null;switch(e.forEach(i=>{const h=le(i,s);if(a!==null)switch(a.prefix+h.prefix){case"++":case"+-":l.should.push(a.keyword);break;case"+/":l.should.push(a.keyword);break;case"-+":case"--":case"-/":l.must_not.push(a.keyword);break;case"/+":l.should.push(a.keyword);break;case"/-":case"//":l.must.push(a.keyword)}a=le(i,s)}),a.prefix){case"+":l.should.push(a.keyword);break;case"-":l.must_not.push(a.keyword);break;case"/":l.must.push(a.keyword)}}return l},le=(e,s)=>(e=e.replace(/^([+-]?)"(.+)"$/,"1ドル2ドル"),s==="OR"&&!e.startsWith("+")&&!e.startsWith("-")&&(e="+"+e),e.startsWith("-")?{keyword:e.substring(1),prefix:"-"}:e.startsWith("+")?{keyword:e.substring(1),prefix:"+"}:{keyword:e,prefix:"/"}),$t=e=>e.must_not.length>0&&e.must.length===0&&e.should.length===0,Q=e=>!e||e.length===0,oe=e=>e.map(s=>s?.split(/\|\|/g)).filter(s=>s).flatMap(s=>s),ce=(e,s,l)=>$t(s)?Q(e)||!e.some(a=>s.must_not.includes(a)):!(Q(e)||!Q(s.must)&&s.must.some(a=>e.every(i=>!l(i,a)))||!Q(s.should)&&s.should.every(a=>e.every(i=>!l(i,a)))||!Q(s.must_not)&&s.must_not.some(a=>e.some(i=>l(i,a)))),Vt=(e,s)=>!Q(e)&&!Q(s)?s.every(l=>{const a=l.from!==""?Number(l.from):null,i=l.to!==""?Number(l.to):null;return e.some(h=>{const d=h&&Number(h);return d==null?!1:i==null&&a==null?!0:i==null?a<=d:(a==null||a<=d)&&d<=i})}):!1,ge=(e,s)=>e?.toLocaleLowerCase().includes(s?.toLocaleLowerCase()),Ct=(e,s)=>s?.endsWith("*")?e?.toLocaleLowerCase().startsWith(s.toLocaleLowerCase().substring(0,s.length-1)):e?.toLocaleLowerCase()===s?.toLocaleLowerCase(),Bt=Y({__name:"SearchJsonPart",props:{url:{},layout:{default:"list"},detailLink:{type:Boolean,default:!1},detailAllOpen:{type:Boolean,default:!1},historyName:{}},async setup(e){let s,l;const a=De(),i=Ne(),h=e,d=([s,l]=Je(()=>Pe(h.url)),s=await s,l(),s),N=P(()=>d.template?i.page(d.template)?.md?.md:void 0),r=d.cs,B=d.columns.split(/\t/g),E=d.data.map(n=>n.split(/\t/g)),{$isEn:O}=ie(),v=n=>{if(O.value){const c=B.indexOf(n+"_en");if(c>=0)return c}return B.indexOf(n)},_=n=>n?.map(c=>v(c)).filter(c=>c>=0),j=(n,c)=>oe(c.map(R=>n[R]).filter(R=>R)),$=(n,c)=>{const R=v(c);return R<0||r>=n.length?null:n[R]?oe([n[R]])||[]:[]},p=re(null),L=P(()=>{if(p.value){const n=v("id");return E.filter(c=>c[n]===p.value).pop()}return null}),K=P(()=>{const n={};return B.forEach(c=>{n[c]=$(L.value,c)?.[0]?.replaceAll("\\n",` `)}),{id:$(L.value,"id")[0],title:$(L.value,"title")[0],md:{md:$(L.value,"content")[0]},props:n}}),J=n=>{const c=[];let R=!1,D="";for(let w=0;w0&&(c.push(D),D=""):D+=n[w];return D.length>0&&c.push(D),c},k=Ae(r.id,a.path,n=>{k.searchState.searching=!0,n.keyword=n.keyword.flatMap(f=>J(f)),Object.keys(n.query).forEach(f=>{n.query[f]=n.query[f].flatMap(x=>J(x))}),Object.keys(n.filter).forEach(f=>{n.filter[f]=n.filter[f].flatMap(x=>J(x))});let c=E;if(n.keyword){const f=_(r.keywordFields.map(x=>x.field));if(f.length){const x=ae(n.keyword);c=c.filter(g=>ce(j(g,f),x,ge))}}n.query&&Object.entries(n.query).forEach(([f,x])=>{const g=r.searchFields?.filter(y=>y.key===f)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));if(y.length){const b=ae(x);c=c.filter(U=>ce(j(U,y),b,ge))}}}),n.filter&&Object.entries(n.filter).forEach(([f,x])=>{const g=r.searchFields?.filter(y=>y.key===f)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));if(y.length){const b=ae(x,g.defaultOperator);c=c.filter(U=>ce(j(U,y),b,Ct))}}}),n.range&&Object.entries(n.range).forEach(([f,x])=>{const g=r.searchFields?.filter(y=>y.key===f)?.pop();if(g&&g.fields){const y=_(g.fields.map(b=>b.field));y.length&&(c=c.filter(b=>Vt(j(b,y),x)))}});const R=[];r.searchFields?.filter(f=>f.facetField)?.forEach(f=>{const x=v(f.facetField),g={};c?.forEach(y=>{y[x]&&oe([y[x]])?.forEach(b=>{g[b]?g[b]++:g[b]=1})}),R.push({field:f.key,counts:g})});const D=n.sort?.[0]||r.defaultSort||null;if(D){const[f,x]=D.split(":"),g=r.sorts?.filter(b=>b.key===f)?.pop(),y=_(g?.fields);y&&(c=c.sort((b,U)=>{const z=j(b,y)?.join("_"),X=j(U,y)?.join("_");let W=0;return z&&X?W=z.localeCompare(X,"ja"):X?W=-1:z&&(W=1),W*(x==="desc"?-1:1)}))}const w=Math.max(0,n.from||0),T=Math.min(w+(n.size||20),c.length);return{list:c.slice(w,T),hit:c.length,facets:R}}),M=P(()=>we(a)),Z=async()=>{M.value.cs?.[0]===r.id?M.value.olid?p.value=M.value.olid?.[0]:(k.restoreQuery(M.value),await k.apiCallSearch(),p.value=null):(p.value=null,k.searchState.result=null)};Z();const ee=re();ue(M,()=>{if(Z(),k.searchState.scroll){let n=ee.value?.getElementsByClassName("sticky-observer")[0];n||(n=ee.value?.getElementsByClassName("search-result")[0]),n&&n.scrollIntoView({behavior:"auto"}),k.searchState.scroll=!1}});const pe=P(()=>k.searchState.result),te=Ie(),{getSearchResultTitle:Le,getTitle:de}=Me(),Re=P(()=>p.value?de($(L.value,"title")[0],te.page.title):k.searchState.resultQuery&&r?Le(k.searchState.resultQuery,r):de(te.page.title,te.page.subSite));if(h.historyName){const n=Ue();ue(()=>a.query,()=>{n.setup(a,h.historyName)},{immediate:!0})}return We({title:Re}),(n,c)=>{const R=He,D=Qe,w=Ke,T=_e,f=Ge,x=ze,g=Xe,y=Ye,b=yt,U=Rt,z=Te,X=Ze,W=ye,$e=tt,Ve=et;return o(),S("div",{ref_key:"root",ref:ee,class:"search-bibpart"},[u(R,{ss:t(k),cs:t(r),"history-name":e.historyName},null,8,["ss","cs","history-name"]),t(pe)?(o(),C(W,{key:0,class:"search-result"},{default:m(()=>[u(W,{gap:"24"},{default:m(()=>[u(T,{gap:"24"},{default:m(()=>[u(D,{ss:t(k)},null,8,["ss"]),u(w,{ss:t(k),class:"is-hidden-mobile"},null,8,["ss"])]),_:1}),u(z,{padding:"0"},{default:m(()=>[u(T,{class:"search-result-option",gap:"8"},{default:m(()=>[u(T,{gap:"8"},{default:m(()=>[u(f,{ss:t(k)},null,8,["ss"]),u(x,{ss:t(k),cs:t(r)},null,8,["ss","cs"])]),_:1})]),_:1}),t(k)?.searchState?.searching?(o(),C(g,{key:0})):t(pe).hit===0?(o(),C(y,{key:1,"target-class":"search-result-ndls-bib-nohit"})):(o(),S(I,{key:2},[e.layout==="ej"?(o(),C(b,{key:0,ss:t(k),cs:t(r),"get-value":$},null,8,["ss","cs"])):(o(),C(U,{key:1,ss:t(k),cs:t(r),"get-value":,ドル"detail-link":e.detailLink,layout:e.layout,"detail-all-open":e.detailAllOpen},null,8,["ss","cs","detail-link","layout","detail-all-open"]))],64))]),_:1}),u(T,{align:"center"},{default:m(()=>[u(X,{ss:t(k),"auto-scroll":""},null,8,["ss"])]),_:1})]),_:1})]),_:1})):A("",!0),t(p)?(o(),C(qe,{key:1,to:"#main-overlay"},[t(L)?(o(),C(Ve,{key:0,class:"search-json-page"},{default:m(()=>[u($e,{page:t(K),template:t(N)},null,8,["page","template"])]),_:1})):A("",!0)])):A("",!0)],512)}}}),Et=Object.assign(q(Bt,[["__scopeId","data-v-a6393f5d"]]),{__name:"SearchJsonPart"}),Ot=Y({__name:"CmsSearchJson",props:{url:{},layout:{},detailLink:{type:Boolean},detailAllOpen:{type:Boolean}},setup(e){const s=e;return(l,a)=>{const i=lt,h=Et,d=ot;return o(),C(d,null,{fallback:m(()=>[u(i,{message:l.$langLabel(t(me).search_json.loading)},null,8,["message"])]),default:m(()=>[(o(),C(st,null,{fallback:m(()=>[u(i,{message:l.$langLabel(t(me).search_json.loading)},null,8,["message"])]),default:m(()=>[u(h,nt(at(s)),null,16)]),_:1}))]),_:1})}}}),Dt=Object.assign(Ot,{__name:"CmsSearchJson"});export{Dt as default};

AltStyle によって変換されたページ (->オリジナル) /