From 33a17cf099fc5e74d28f4998e4ddb727eb4672b7 Mon Sep 17 00:00:00 2001 From: niheaven Date: Wed, 20 Mar 2024 14:38:50 +0000 Subject: [PATCH] deploy: ScoopInstaller/scoopinstaller.github.io@bba86088afcc1d5d43ac4c92f5ae65228990c7ed --- assets/{index-c571d8dd.js => index-06f14d8c.js} | 4 ++-- index.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename assets/{index-c571d8dd.js => index-06f14d8c.js} (99%) diff --git a/assets/index-c571d8dd.js b/assets/index-06f14d8c.js similarity index 99% rename from assets/index-c571d8dd.js rename to assets/index-06f14d8c.js index e2f32a9..ce47147 100644 --- a/assets/index-c571d8dd.js +++ b/assets/index-06f14d8c.js @@ -181,6 +181,6 @@ Created 'C:\\Users\\User\\Desktop\\foobar.json'.`})})]}),Q("hr",{}),_(we,{childr "autoupdate": { "url": "https://gif.ski/gifski-$version.zip" } -}`})}),Q(le,{lg:6,children:"Scoop manifests are simple JSON files, which can be optionally complemented with inline PowerShell statements."})]}),Q("h3",{className:"mt-5 mb-4 text-center fw-normal",children:"Documentation"}),_("p",{className:"text-center",children:["Looking for something specific, or ready to dive into Scoop internals? Check out"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop#readme",children:"Scoop's Readme"})," or refer to the"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop/wiki",children:"Wiki"}),"."]})]})})},oM=W.memo(AM),iM=e=>{const t="light",n="dark",r="preferred-color-scheme",[A,o]=C.exports.useState(mB),[i,a]=C.exports.useState(),[s,l]=C.exports.useState(),u=C.exports.useCallback(()=>{switch(s){case ue.Auto:l(i===ue.Light?ue.Dark:ue.Light);break;case ue.Light:l(i===ue.Light?ue.Auto:ue.Dark);break;case ue.Dark:l(i===ue.Dark?ue.Auto:ue.Light);break}},[s,i]),c=d=>d===null?ue.Auto:typeof d=="boolean"?d?ue.Dark:ue.Light:parseInt(d),g=d=>{const B=document.getElementsByTagName("html")[0];d===ue.Dark?(B.classList.remove(t),B.classList.add(n)):(B.classList.remove(n),B.classList.add(t))};return C.exports.useLayoutEffect(()=>{if(s===void 0||i===void 0)return;let d;s===ue.Auto?(d=i,localStorage.removeItem(r)):(d=s,localStorage.setItem(r,s.toString())),g(d),o({preferedColorScheme:s,browserColorScheme:i,isDarkMode:d===ue.Dark,toggleColorScheme:u})},[i,s,u]),C.exports.useLayoutEffect(()=>{const d=window.matchMedia("(prefers-color-scheme: dark)");d.addEventListener("change",B=>{a(c(B.matches))}),a(c(d.matches)),l(c(localStorage.getItem(r)))},[]),Q(ws.Provider,{value:A,children:e.children})},aM=()=>_(DA,{className:"footer text-lg-center",children:[Q("hr",{}),_(we,{className:"mb-3",children:[_(le,{md:4,className:"mb-2",children:[Q(ap,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller",children:"Scoop"})," created by"," ",Q("a",{href:"https://github.com/lukesampson",children:"lukesampson"})]}),_(le,{md:4,className:"mb-2",children:[Q(ap,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller/scoopinstaller.github.io",children:"Website"})," created by"," ",Q("a",{href:"https://github.com/gpailler",children:"gpailler"})," - ","0.2.0","/",Q("a",{href:`https://github.com/ScoopInstaller/scoopinstaller.github.io/commit/deae194 -`,children:`deae194 +}`})}),Q(le,{lg:6,children:"Scoop manifests are simple JSON files, which can be optionally complemented with inline PowerShell statements."})]}),Q("h3",{className:"mt-5 mb-4 text-center fw-normal",children:"Documentation"}),_("p",{className:"text-center",children:["Looking for something specific, or ready to dive into Scoop internals? Check out"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop#readme",children:"Scoop's Readme"})," or refer to the"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop/wiki",children:"Wiki"}),"."]})]})})},oM=W.memo(AM),iM=e=>{const t="light",n="dark",r="preferred-color-scheme",[A,o]=C.exports.useState(mB),[i,a]=C.exports.useState(),[s,l]=C.exports.useState(),u=C.exports.useCallback(()=>{switch(s){case ue.Auto:l(i===ue.Light?ue.Dark:ue.Light);break;case ue.Light:l(i===ue.Light?ue.Auto:ue.Dark);break;case ue.Dark:l(i===ue.Dark?ue.Auto:ue.Light);break}},[s,i]),c=d=>d===null?ue.Auto:typeof d=="boolean"?d?ue.Dark:ue.Light:parseInt(d),g=d=>{const B=document.getElementsByTagName("html")[0];d===ue.Dark?(B.classList.remove(t),B.classList.add(n)):(B.classList.remove(n),B.classList.add(t))};return C.exports.useLayoutEffect(()=>{if(s===void 0||i===void 0)return;let d;s===ue.Auto?(d=i,localStorage.removeItem(r)):(d=s,localStorage.setItem(r,s.toString())),g(d),o({preferedColorScheme:s,browserColorScheme:i,isDarkMode:d===ue.Dark,toggleColorScheme:u})},[i,s,u]),C.exports.useLayoutEffect(()=>{const d=window.matchMedia("(prefers-color-scheme: dark)");d.addEventListener("change",B=>{a(c(B.matches))}),a(c(d.matches)),l(c(localStorage.getItem(r)))},[]),Q(ws.Provider,{value:A,children:e.children})},aM=()=>_(DA,{className:"footer text-lg-center",children:[Q("hr",{}),_(we,{className:"mb-3",children:[_(le,{md:4,className:"mb-2",children:[Q(ap,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller",children:"Scoop"})," created by"," ",Q("a",{href:"https://github.com/lukesampson",children:"lukesampson"})]}),_(le,{md:4,className:"mb-2",children:[Q(ap,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller/scoopinstaller.github.io",children:"Website"})," created by"," ",Q("a",{href:"https://github.com/gpailler",children:"gpailler"})," - ","0.2.0","/",Q("a",{href:`https://github.com/ScoopInstaller/scoopinstaller.github.io/commit/bba8608 +`,children:`bba8608 `})]}),_(le,{md:4,className:"mb-2",children:[Q(tM,{className:"footer-icon"})," Maintained by the"," ",Q("a",{href:"https://github.com/orgs/ScoopInstaller/people",children:"community"})]})]})]}),sM=W.memo(aM);function Hp(e){return Ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"}}]})(e)}function jp(e){return Ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"}}]})(e)}function _p(e){return Ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"}}]})(e)}const lM=()=>{const{preferedColorScheme:e,browserColorScheme:t,toggleColorScheme:n}=C.exports.useContext(ws);return Q(xi,{expand:"sm",bg:"dark",variant:"dark",children:_(DA,{children:[_(xi.Brand,{as:nA,to:"/",children:[Q("img",{alt:"",src:"https://avatars.githubusercontent.com/u/16618068?s=30",width:"30",height:"30",className:"d-inline-block align-top rounded me-2"}),"Scoop"]}),Q(xi.Toggle,{"aria-controls":"responsive-navbar-nav"}),_(xi.Collapse,{id:"responsive-navbar-nav",children:[_(rA,{className:"me-auto",children:[Q(rA.Link,{as:nA,to:"/apps",children:"Apps"}),Q(rA.Link,{as:nA,to:"/buckets",children:"Buckets"})]}),_(ir,{onClick:n,size:"sm",variant:"secondary",children:[e==ue.Auto&&(t==ue.Light?Q(Hp,{title:"Auto mode. Click to switch to dark mode"}):Q(Hp,{title:"Auto mode. Click to switch to light mode"})),e==ue.Light&&(t==ue.Light?Q(_p,{title:"Light mode. Click to switch to OS/browser preferred mode"}):Q(_p,{title:"Light mode. Click to switch to dark mode"})),e==ue.Dark&&(t==ue.Light?Q(jp,{title:"Dark mode. Click to switch to light mode"}):Q(jp,{title:"Dark mode. Click to switch to OS/browser preferred mode"}))]})]})]})})},uM=W.memo(lM),cM=()=>Q("div",{children:Q(hu.Provider,{value:{className:"react-icon"},children:_(iM,{children:[Q(uM,{}),Q(Yy,{}),Q(sM,{})]})})}),gM=window.requestIdleCallback||function(t){const n=Date.now();return setTimeout(()=>{t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-n))}})},1)},qA=2,fM=e=>{const{currentPage:t,resultsCount:n,resultsPerPage:r,onPageChange:A}=e,o=i=>{const a=Math.ceil(n/r),s=Math.max(1,Math.min(i,a));A(s)};if(n>0){const i=Math.ceil(n/r);if(t>i&&A(i),i>1){const a=[];let s=Math.max(2,t-qA),l=Math.min(i-1,t+qA);const u=qA*2-(l-s),c=l-(l+u);l=Math.min(i-1,l+u),s=Math.max(2,s+c);for(let g=s;g<=l;g+=1)g===t-qA+c||g===t+qA+u?a.push(Q(Zn.Ellipsis,{disabled:!0},g)):a.push(Q(Zn.Item,{active:g===t,onClick:()=>o(g),children:g},g));return _(Zn,{size:"sm",children:[Q(Zn.Prev,{onClick:()=>o(t-1)},"prev"),Q(Zn.Item,{active:t===1,onClick:()=>o(1),children:1},1),a,Q(Zn.Item,{active:i===t,onClick:()=>o(i),children:i},i),Q(Zn.Next,{onClick:()=>o(t+1)},"next")]})}}return Q(ft,{})},dM=W.memo(fM);var pM=Object.defineProperty,CM=Object.getOwnPropertyDescriptor,IM=(e,t,n,r)=>{for(var A=r>1?void 0:r?CM(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(A=(r?i(t,n,A):i(A))||A);return r&&A&&pM(t,n,A),A};let xu=class{serialize(e){throw new Error("Conversion not supported")}deserialize(e){return new Date(e)}};xu=IM([fD],xu);const hM=xu;var EM=Object.defineProperty,BM=Object.getOwnPropertyDescriptor,Wn=(e,t,n,r)=>{for(var A=r>1?void 0:r?BM(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(A=(r?i(t,n,A):i(A))||A);return r&&A&&EM(t,n,A),A};let $t=class{constructor(){this.repository="",this.repositoryOfficial=!1,this.stars=0,this.branchName="",this.filePath="",this.committed=new Date,this.sha=""}};Wn([ve("Repository",String)],$t.prototype,"repository",2);Wn([ve("OfficialRepository",Boolean)],$t.prototype,"repositoryOfficial",2);Wn([ve("RepositoryStars",Number)],$t.prototype,"stars",2);Wn([ve("BranchName",String,!0)],$t.prototype,"branchName",2);Wn([ve("FilePath",String)],$t.prototype,"filePath",2);Wn([ve("Committed",hM)],$t.prototype,"committed",2);Wn([ve("Sha",String)],$t.prototype,"sha",2);$t=Wn([Qs("MetadataJson")],$t);const jB=$t;var QM=Object.defineProperty,mM=Object.getOwnPropertyDescriptor,kt=(e,t,n,r)=>{for(var A=r>1?void 0:r?mM(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(A=(r?i(t,n,A):i(A))||A);return r&&A&&QM(t,n,A),A};let lt=class{constructor(){this.id="",this.score=0,this.name="",this.namePartial="",this.nameSuffix="",this.description=void 0,this.homepage=void 0,this.license=void 0,this.version="",this.metadata=new jB,this.highlights=void 0}get highlightedName(){return this.tryGetHighlights(["NamePartial","Name","NameSuffix"],this.name)}get highlightedLicense(){return this.tryGetHighlight("License",this.license)}get highlightedRepository(){return this.tryGetHighlight("Metadata/Repository",this.metadata.repository)}get highlightedDescription(){return this.tryGetHighlight("Description",this.description)}get highlightedVersion(){return this.tryGetHighlight("Version",this.version.length?this.version:"Unknown")}get favicon(){if(this.homepage){const e=document.createElement("a");return e.href=this.homepage,`${e.origin}/favicon.ico`}}tryGetHighlight(e,t){return this.tryGetHighlights([e],t)}tryGetHighlights(e,t){const n=e.find(r=>this.highlights&&this.highlights[r]);return n&&this.highlights?this.highlights[n]:t}};kt([ve("Id",String)],lt.prototype,"id",2);kt([ve("@search.score",Number)],lt.prototype,"score",2);kt([ve("Name",String)],lt.prototype,"name",2);kt([ve("NamePartial",String)],lt.prototype,"namePartial",2);kt([ve("NameSuffix",String)],lt.prototype,"nameSuffix",2);kt([ve("Description",String,!0)],lt.prototype,"description",2);kt([ve("Homepage",String,!0)],lt.prototype,"homepage",2);kt([ve("License",String,!0)],lt.prototype,"license",2);kt([ve("Version",String,!0)],lt.prototype,"version",2);kt([ve("Metadata",jB)],lt.prototype,"metadata",2);kt([ve("@search.highlights",Fa,!0)],lt.prototype,"highlights",2);lt=kt([Qs("ManifestJson")],lt);const vM=lt;var yM=Object.defineProperty,wM=Object.getOwnPropertyDescriptor,ef=(e,t,n,r)=>{for(var A=r>1?void 0:r?wM(t,n):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(A=(r?i(t,n,A):i(A))||A);return r&&A&&yM(t,n,A),A};let jn=class{constructor(){this.count=0,this.results=Array()}static Create(e){return jn.jsonConvert.deserializeObject(e,jn)}};jn.jsonConvert=new UE;ef([ve("@odata.count",Number)],jn.prototype,"count",2);ef([ve("value",[vM])],jn.prototype,"results",2);jn=ef([Qs("SearchResultsJson")],jn);const SM=jn,Gr=[{DisplayName:"Best match",DefaultSortDirection:1,OrderBy:{[0]:["search.score() asc","Metadata/OfficialRepositoryNumber asc","NameSortable desc"],[1]:["search.score() desc","Metadata/OfficialRepositoryNumber desc","NameSortable asc"]}},{DisplayName:"Name",DefaultSortDirection:0,OrderBy:{[0]:["NameSortable asc","Metadata/OfficialRepositoryNumber desc","Metadata/RepositoryStars desc","Metadata/Committed desc"],[1]:["NameSortable desc","Metadata/OfficialRepositoryNumber asc","Metadata/RepositoryStars asc","Metadata/Committed asc"]}},{DisplayName:"Newest",DefaultSortDirection:1,OrderBy:{[0]:["Metadata/Committed asc","Metadata/OfficialRepositoryNumber asc","Metadata/RepositoryStars asc"],[1]:["Metadata/Committed desc","Metadata/OfficialRepositoryNumber desc","Metadata/RepositoryStars desc"]}}],{VITE_APP_AZURESEARCH_URL:$p,VITE_APP_AZURESEARCH_KEY:Kp}={VITE_APP_AZURESEARCH_URL:"https://scoopsearch.search.windows.net/indexes/apps/docs",VITE_APP_AZURESEARCH_KEY:"DC6D2BBE65FC7313F2C52BBD2B0286ED",BASE_URL:"/scoopinstaller-dev.github.io/",MODE:"production",DEV:!1,PROD:!0},DM=e=>{const[t,n]=C.exports.useState(0),[r,A]=C.exports.useState(!1),o=C.exports.useRef(new AbortController),{query:i,page:a,resultsPerPage:s,sortIndex:l,sortDirection:u,officialOnly:c,onOfficialOnlyChange:g,distinctManifestsOnly:d,onDistinctManifestsOnlyChange:B,installBucketName:m,onInstallBucketName:I,onResultsChange:p,onSortChange:f}=e,h=C.exports.useCallback((O,U)=>{f(O,U)},[f]),E=C.exports.useCallback(O=>{O.currentTarget.blur(),g(!c)},[c,g]),y=C.exports.useCallback(O=>{O.currentTarget.blur(),B(!d)},[d,B]),v=C.exports.useCallback(O=>{O.currentTarget.blur(),I(!m)},[m,I]),D=C.exports.useCallback((O,U)=>{O.currentTarget.blur(),h(U,U===l?(u+1)%2:Gr[U].DefaultSortDirection)},[l,u,h]);C.exports.useEffect(()=>(o.current.abort(),o.current=new AbortController,(U=>{if(A(!0),!$p)throw new Error("VITE_APP_AZURESEARCH_URL is not defined");if(!Kp)throw new Error("VITE_APP_AZURESEARCH_KEY is not defined");const Y=[];c&&Y.push("Metadata/OfficialRepositoryNumber eq 1"),d&&Y.push("Metadata/DuplicateOf eq null");const x=`${$p}/search?api-version=2020-06-30`;fetch(x,{method:"POST",body:JSON.stringify({count:!0,search:i.trim(),searchMode:"all",filter:Y.join(" and "),orderby:Gr[l].OrderBy[u].join(", "),skip:(a-1)*s,top:s,select:["Id","Name","NamePartial","NameSuffix","Description","Homepage","License","Version","Metadata/Repository","Metadata/FilePath","Metadata/OfficialRepository","Metadata/RepositoryStars","Metadata/Committed","Metadata/Sha"].join(","),highlight:["Name","NamePartial","NameSuffix","Description","Version","License","Metadata/Repository"].join(","),highlightPreTag:"",highlightPostTag:""}),headers:{"api-key":Kp,"Content-Type":"application/json"},signal:U}).then(b=>{if(!b.ok)throw new Error(`${b.status} ${b.statusText}`);return b.json()}).then(b=>{const S=SM.Create(b);A(!1),n(S.count),p(S)}).catch(b=>{b.name!=="AbortError"&&(A(!1),n(0),p(void 0))})})(o.current.signal),()=>o.current.abort()),[i,a,l,u,c,d,s,p]);const F=O=>{const{currentSortIndex:U,...Y}=O;return l===U?u===Gr[U].DefaultSortDirection?Q(Jp,{...Y}):Q(XR,{...Y}):Q(Jp,{...Y,visibility:"hidden"})},L=()=>`${Gr[l].DisplayName}, ${c?"Official buckets only":"All buckets"}`;return Q(rt,{children:_(we,{children:[Q(le,{xs:6,className:"my-auto",children:Q(HE,{query:i,resultsCount:t,searching:r,type:vg.Applications})}),Q(le,{xs:6,className:"text-end",children:_(pt,{autoClose:"outside",align:"end",drop:"end",className:"sorting-filtering-button",children:[_(pt.Toggle,{size:"sm",variant:"secondary",children:[Q(vD,{className:"me-2"}),Q("span",{className:"d-none d-sm-inline",children:L()})]}),_(pt.Menu,{className:"sorting-filtering-menu",children:[Q(pt.Header,{children:"Sorting"}),Gr.map((O,U)=>_(pt.Item,{as:ir,onClick:Y=>D(Y,U),children:[Q(F,{currentSortIndex:U,className:"me-2"}),O.DisplayName]},O.DisplayName)),Q(pt.Divider,{}),Q(pt.Header,{children:"Filtering"}),Q(pt.Item,{as:ir,onClick:O=>E(O),children:_(rt.Switch,{className:"form-switch-sm",children:[Q(rt.Switch.Input,{checked:c}),_(rt.Switch.Label,{children:["Official buckets only ",Q(mg,{className:"ms-1",official:!0,showTooltip:!1})]})]})}),Q(pt.Item,{as:ir,onClick:O=>y(O),children:_(rt.Switch,{className:"form-switch-sm",children:[Q(rt.Switch.Input,{checked:d}),Q(rt.Switch.Label,{children:"Distinct manifests only"})]})}),Q(pt.Divider,{}),Q(pt.Header,{children:"Option"}),Q(pt.Item,{as:ir,onClick:O=>v(O),children:_(rt.Switch,{className:"form-switch-sm",children:[Q(rt.Switch.Input,{checked:m}),Q(rt.Switch.Label,{children:"Show bucket name"})]})})]})]})})]})})},kM=W.memo(DM);var _B={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ur,function(){var n=1e3,r=6e4,A=36e5,o="millisecond",i="second",a="minute",s="hour",l="day",u="week",c="month",g="quarter",d="year",B="date",m="Invalid Date",I=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(x){var b=["th","st","nd","rd"],S=x%100;return"["+x+(b[(S-20)%10]||b[S]||b[0])+"]"}},h=function(x,b,S){var N=String(x);return!N||N.length>=b?x:""+Array(b+1-N.length).join(S)+x},E={s:h,z:function(x){var b=-x.utcOffset(),S=Math.abs(b),N=Math.floor(S/60),k=S%60;return(b<=0?"+":"-")+h(N,2,"0")+":"+h(k,2,"0")},m:function x(b,S){if(b.date()1)return x(T[0])}else{var R=b.name;v[R]=b,k=R}return!N&&k&&(y=k),k||!N&&y},L=function(x,b){if(D(x))return x.clone();var S=typeof b=="object"?b:{};return S.date=x,S.args=arguments,new U(S)},O=E;O.l=F,O.i=D,O.w=function(x,b){return L(x,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var U=function(){function x(S){this.$L=F(S.locale,null,!0),this.parse(S)}var b=x.prototype;return b.parse=function(S){this.$d=function(N){var k=N.date,M=N.utc;if(k===null)return new Date(NaN);if(O.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var T=k.match(I);if(T){var R=T[2]-1||0,w=(T[7]||"0").substring(0,3);return M?new Date(Date.UTC(T[1],R,T[3]||1,T[4]||0,T[5]||0,T[6]||0,w)):new Date(T[1],R,T[3]||1,T[4]||0,T[5]||0,T[6]||0,w)}}return new Date(k)}(S),this.$x=S.x||{},this.init()},b.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},b.$utils=function(){return O},b.isValid=function(){return this.$d.toString()!==m},b.isSame=function(S,N){var k=L(S);return this.startOf(N)<=k&&k<=this.endOf(N)},b.isAfter=function(S,N){return L(S)0,v<=y.r||!y.r){v<=1&&E>0&&(y=f[E-1]);var D=p[y.l];d&&(v=d(""+v)),m=typeof D=="string"?D.replace("%d",v):D(v,u,y.l,I);break}}if(u)return m;var F=I?p.future:p.past;return typeof F=="function"?F(m):F.replace("%s",m)},o.to=function(l,u){return a(l,u,this,!0)},o.from=function(l,u){return a(l,u,this)};var s=function(l){return l.$u?A.utc():A()};o.toNow=function(l){return this.to(s(this),l)},o.fromNow=function(l){return this.from(s(this),l)}}})})(KB);const LM=KB.exports;var zB=function(e){var t=e.decode,n=t===void 0?!0:t,r=e.crossOrigin,A=r===void 0?"":r;return function(o){return new Promise(function(i,a){var s=new Image;A&&(s.crossOrigin=A),s.onload=function(){n&&s.decode?s.decode().then(i).catch(a):i()},s.onerror=a,s.src=o})}};function zp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(A){return Object.getOwnPropertyDescriptor(e,A).enumerable})),n.push.apply(n,r)}return n}function Pi(e){for(var t=1;t{const[n,r]=C.exports.useState(!1),{onClick:A,...o}=e;C.exports.useEffect(()=>{n&&setTimeout(()=>{r(!1)},TM)},[n]);const i=C.exports.useCallback(a=>{A==null||A.call(void 0,a),r(!0)},[A]);return Q(ir,{...o,onClick:i,disabled:n,ref:t,children:n?Q(VR,{}):Q(eM,{})})});qB.displayName="CopyToClipboardButton";const PM=W.memo(qB),UM=OM.concat(GM);$a.extend(NM);$a.extend(LM);const YM=e=>{const{result:t,officialRepositories:n,installBucketName:r,onCopyToClipbard:A,onResultSelected:o,cardRef:i}=e,a=C.exports.useRef(null),[s,l]=C.exports.useState(!1),u=C.exports.useCallback(k=>{A(k)},[A]),c=C.exports.useCallback(()=>{o==null||o.call(void 0,t)},[o,t]),g=k=>k&&Q("span",{dangerouslySetInnerHTML:{__html:k}}),d=k=>{const{value:M,...T}=k,R=C.exports.useRef(null),w=()=>{var G;(G=R.current)==null||G.click()};return _(fA,{size:"sm",className:"copy-command-group",...T,children:[Q(fA.Text,{className:"border-end-0 copy-command-prefix",children:">"}),Q(rt.Control,{className:"border-start-0 copy-command-text",readOnly:!0,title:"Copy to clipboard",type:"text",value:M,onClick:w}),Q(PM,{className:"copy-command-button",ref:R,title:"Copy to clipboard",variant:"outline-secondary",onClick:()=>u(M)})]})},B=()=>{a.current&&l(a.current.offsetWidth>=a.current.scrollWidth)},{id:m,name:I,favicon:p,highlightedName:f,highlightedDescription:h,highlightedLicense:E,highlightedRepository:y,highlightedVersion:v,metadata:D,homepage:F,version:L,license:O}=t,U=(F??"").replace(/^(?:\w+:\/\/)(.+?)\/*$/,"$1"),Y=D.repositoryOfficial?y==null?void 0:y.toString().replace(D.repository,n[D.repository]):y==null?void 0:y.toString().replace(/^(|)(?:.*?\/){3}(.+)$/,"$1$2"),x=L.length>0&&/^\d/.test(L)&&"v",b=D.repositoryOfficial?n[D.repository]||D.repository.substring(D.repository.lastIndexOf("/")+1).toLowerCase():`${Qg.extractPathFromUrl(D.repository,"_")}`,S=D.repositoryOfficial?"":`${D.repository}`;console.log(b,S);const N=`${b} ${S}`.trim();return _(Al,{className:"mb-2",ref:i,children:[Q(Al.Header,{children:_(we,{children:[_(le,{lg:7,className:"valign-items",children:[p&&Q(FM,{className:"me-2",src:p,width:20,height:20}),Q("span",{className:"fw-bold",role:o?"button":void 0,onClick:c,children:g(f)}),Q("span",{className:"me-1 ms-1",children:"in"}),Q("a",{href:D.repository,children:g(Y)}),Q(mg,{className:"ms-1",official:D.repositoryOfficial,stars:D.stars})]}),_(le,{lg:5,className:"text-lg-end text-truncate",children:[Q(BD,{title:"Updated",className:"me-1"}),Q("a",{href:`${D.repository}/commit/${D.sha}`,title:`Diff (${$a(D.committed).format("LLL")})`,children:$a(D.committed).fromNow()}),Q("span",{className:"ms-1 me-1",children:"|"}),Q(mD,{title:"Version",className:"me-1"}),_("a",{href:`${D.repository}/blob/master/${D.filePath.replace("#","%23")}`,title:"Manifest file",children:[x,g(v)]})]})]})}),Q(Al.Body,{children:Q(DA,{className:"p-0",children:_(we,{children:[_(le,{lg:6,children:[Q(we,{children:h&&g(h)}),_(we,{className:"mt-2",children:[F&&_("span",{className:"text-truncate",ref:a,children:[Q(QD,{title:"Homepage",className:"me-1"}),Q("a",{href:F,onMouseOver:B,title:s?"":F,children:Q("span",{children:g(U)})})]}),O&&_("span",{children:[Q(ED,{title:"License",className:"me-1"}),O&&UM.includes(O)&&Q("a",{href:`https://spdx.org/licenses/${O}.html`,children:g(E)})||g(E)]})]})]}),_(le,{lg:6,className:"mt-4 mt-lg-0",children:[Q(we,{children:Q(d,{value:`scoop bucket add ${N}`,id:"bucket-command"})}),Q(we,{className:"mt-2",children:Q(d,{value:`scoop install ${r?b+"/":""}${I}`,id:"app-command"})})]})]})})})]},m)},qp=W.memo(YM),Wp=20,Vp="q",Zp="p",Xp="s",eC="d",tC="o",nC="dm",rC="n",AC="id",JM=500;function HM(e,t){const[n,r]=C.exports.useState(e);return C.exports.useEffect(()=>{const A=setTimeout(()=>r(e),t||JM);return()=>{clearTimeout(A)}},[e,t]),n}const jM=()=>{const[e,t]=Vy(),n=C.exports.useCallback(()=>e.get(Vp)??"",[e]),r=C.exports.useCallback(()=>parseInt(e.get(Zp)||"1"),[e]),A=C.exports.useCallback((z,ke)=>{const Re=e.get(z)||localStorage.getItem(z);if(Re)switch(typeof ke){case"number":return parseInt(Re);case"boolean":return Re==="true";case"string":return Re}return ke},[e]),o=C.exports.useCallback(()=>A(Xp,0),[A]),i=C.exports.useCallback(z=>A(eC,Gr[z].DefaultSortDirection),[A]),a=C.exports.useCallback(()=>A(tC,!0),[A]),s=C.exports.useCallback(()=>A(nC,!0),[A]),l=C.exports.useCallback(()=>A(rC,!0),[A]),u=C.exports.useCallback(()=>A(AC,""),[A]),c=C.exports.useCallback((z,ke,Re)=>{ke?(e.set(z,ke),Re&&localStorage.setItem(z,ke)):(e.delete(z),Re&&localStorage.removeItem(z)),t(e,{replace:!0})},[e,t]),[g,d]=C.exports.useState(n),[B,m]=C.exports.useState(n),I=HM(B),[p,f]=C.exports.useState(r),[h,E]=C.exports.useState(o),[y,v]=C.exports.useState(i(h)),[D,F]=C.exports.useState(a),[L,O]=C.exports.useState(s()),[U,Y]=C.exports.useState(l()),[x,b]=C.exports.useState(),[S,N]=C.exports.useState({}),[k,M]=C.exports.useState(),[T,R]=C.exports.useState(u),w=C.exports.useRef(null);C.exports.useEffect(()=>{const z=n();d(z),m(z)},[n]),C.exports.useEffect(()=>{f(r())},[r]),o()!==h&&E(o()),i(o())!==y&&E(i(o())),a()!==D&&F(a()),s()!==L&&O(s()),l()!==U&&Y(l()),C.exports.useEffect(()=>{var z;if(x!=null&&x.results&&T){const ke=x.results.find(Re=>Re.id===T);ke&&(M(ke),(z=w.current)==null||z.scrollIntoView())}else M(void 0);c(AC,T,!1)},[T,x,c]),C.exports.useEffect(()=>{fetch("https://cdn.jsdelivr.net/gh/ScoopInstaller/Scoop/buckets.json").then(z=>z.json()).then(z=>{const ke=z,Re={};Object.keys(ke).forEach(Vn=>{Re[ke[Vn]]=Vn}),N(Re)}).catch(z=>console.log(z))},[]);const G=C.exports.useCallback(z=>{c(Vp,z,!1),d(z),f(1)},[c]),P=C.exports.useCallback(()=>{m(g)},[g]),J=C.exports.useRef(-1),j=C.exports.useCallback(z=>{J.current=gM(()=>b(z))},[]);C.exports.useEffect(()=>()=>cancelIdleCallback(J.current),[J]);const $=C.exports.useCallback(z=>{c(Zp,z.toString(),!1),f(z),window.scrollTo(0,0)},[c]),X=C.exports.useCallback((z,ke)=>{c(Xp,z.toString(),!0),c(eC,ke.toString(),!0),E(z),v(ke)},[c]),se=C.exports.useCallback(z=>{c(tC,z.toString(),!0),F(z)},[c]),ne=C.exports.useCallback(z=>{c(nC,z.toString(),!0),O(z)},[c]),he=C.exports.useCallback(z=>{(async Re=>{await navigator.clipboard.writeText(Re)})(z).finally(()=>{})},[]),Ee=C.exports.useCallback(z=>{R(z.id)},[]),Ye=C.exports.useCallback(()=>{R("")},[]),re=C.exports.useCallback(z=>{c(rC,z.toString(),!0),Y(z)},[c]);return _(ft,{children:[Q(Jo,{children:_("title",{children:["Apps",B&&` (${B})`]})}),_(DA,{className:"mt-5 mb-5",children:[Q(we,{className:"justify-content-center",children:Q(le,{sm:8,children:Q(HB,{query:g,onQueryChange:G,onSubmit:P})})}),Q(we,{className:"mt-5 mb-1",children:Q(le,{children:Q(kM,{resultsPerPage:Wp,page:p,query:I,sortIndex:h,sortDirection:y,officialOnly:D,onOfficialOnlyChange:se,distinctManifestsOnly:L,onDistinctManifestsOnlyChange:ne,onResultsChange:j,onSortChange:X,installBucketName:U,onInstallBucketName:re})})}),Q(we,{className:"mt-2",children:Q(le,{children:x==null?void 0:x.results.map(z=>Q(qp,{cardRef:z.id==T?w:void 0,result:z,officialRepositories:S,installBucketName:U,onCopyToClipbard:he,onResultSelected:Ee},z.id))})}),Q(we,{children:Q(le,{className:"d-flex justify-content-center",children:Q(dM,{resultsPerPage:Wp,currentPage:p,resultsCount:(x==null?void 0:x.count)??0,onPageChange:$})})})]}),Q(rp,{show:k!==void 0,onHide:Ye,restoreFocus:!1,size:"xl",centered:!0,className:"modal-selected-result",children:Q(rp.Body,{children:k&&Q(qp,{result:k,officialRepositories:S,installBucketName:U,onCopyToClipbard:he})})})]})},_M=W.memo(jM),$M=()=>_(ft,{children:[Q(Jo,{defaultTitle:"Scoop",titleTemplate:"Scoop - %s"}),Q(qy,{children:Q(Hy,{children:_(to,{path:"/",element:Q(cM,{}),children:[Q(to,{path:"apps",element:Q(_M,{})}),Q(to,{path:"buckets",element:Q(FD,{})}),Q(to,{index:!0,element:Q(oM,{})})]})})})]}),KM=e=>{e&&e instanceof Function&&ok(()=>import("./web-vitals-60d3425a.js"),[]).then(({getCLS:t,getFID:n,getFCP:r,getLCP:A,getTTFB:o})=>{t(e),n(e),r(e),A(e),o(e)})};vn.render(Q(W.StrictMode,{children:Q($M,{})}),document.getElementById("root"));KM()});export default zM(); diff --git a/index.html b/index.html index 8333072..626bf4f 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-nightshade.min.css" rel="stylesheet" /> - +