1import{n as e}from"./pinia-YL0TXNFu.js";import{S as t,b as n,v as r,x as i,y as a}from"./maintenance-service-B-yNArdO.js";var o=e(`search-store`,{state:()=>({isSearching:!1,config:void 0,searchTerm:void 0,sortingColumn:void 0,sortingOrder:`ASC`,searchPage:1,from:0,perPage:0,total:0,requestToken:0}),actions:{reset(){this.isSearching=!1,this.config=void 0,this.searchTerm=void 0,this.sortingColumn=void 0,this.sortingOrder=`ASC`,this.searchPage=1,this.from=0,this.perPage=0,this.total=0,this.requestToken++},load(){let e=a(),t=n();return this.config===void 0?r.init(e.albumId).then(e=>{this.config=e.data,t.layout=this.config.photo_layout}):Promise.resolve()},search(e,n=1){let o=i(),s=t(),c=a();if(e.length<(this.config?.search_minimum_length??3))return this.requestToken++,o.albums=[],s.photos=[],Promise.resolve();this.searchTerm=e,this.searchPage=n,this.isSearching=!0;let l=++this.requestToken;return r.search(c.albumId,this.searchTerm,this.searchPage,this.sortingColumn,this.sortingOrder).then(e=>{l===this.requestToken&&(o.albums=e.data.albums,s.setPhotos(e.data.photos,!1,this.searchPage),this.from=e.data.from,this.perPage=e.data.per_page,this.total=e.data.total)}).finally(()=>{l===this.requestToken&&(this.isSearching=!1)})},refresh(){let e=i(),n=t(),o=a();if(this.searchTerm===void 0)return Promise.resolve();this.isSearching=!0,this.searchPage=Math.ceil(this.from/this.perPage)+1;let s=++this.requestToken;return r.search(o.albumId,this.searchTerm,this.searchPage,this.sortingColumn,this.sortingOrder).then(t=>{s===this.requestToken&&(e.albums=t.data.albums,n.setPhotos(t.data.photos,!1,this.searchPage),this.from=t.data.from,this.perPage=t.data.per_page,this.total=t.data.total)}).finally(()=>{s===this.requestToken&&(this.isSearching=!1)})},clear(){let e=i(),n=t();this.requestToken++,e.albums=[],n.reset(),this.sortingColumn=void 0,this.sortingOrder=`ASC`,this.from=0,this.perPage=0,this.total=0}}});function s(e){function n(){return e.currentRoute.value.params.albumId}function r(r){let i=e.currentRoute.value.name,a=n(),s=t().photoPageMap[r],c=s!==void 0&&Number.isInteger(s)&&s>=1?{page:String(s)}:{};if(i.startsWith(`search`)){let e=o(),t=e.searchTerm?{q:e.searchTerm,...c}:{};return{name:`search`,params:{albumId:a??`all`,photoId:r},query:t}}return i===`tag`?{name:`tag`,params:{tagId:e.currentRoute.value.params.tagId,photoId:r}}:i.startsWith(`flow`)?{name:`flow-album`,params:{albumId:a??`all`,photoId:r},query:c}:i.startsWith(`timeline`)?{name:`timeline`,params:{date:e.currentRoute.value.params.date,photoId:r}}:i===`person`?{name:`person`,params:{personId:e.currentRoute.value.params.personId,photoId:r}}:{name:`album`,params:{albumId:a??`all`,photoId:r},query:c}}return{getParentId:n,photoRoute:r}}export{o as n,s as t};
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.