import{s as xt,n as _t,o as jt}from"../chunks/scheduler.d6170356.js";import{S as kt,i as Jt,g as i,s as o,r as H,A as Ht,h as d,f as a,c as n,j as qt,u as C,x as l,k as W,y as Ct,a as s,v as B,d as Z,t as G,w as I}from"../chunks/index.fcd4cc08.js";import{C as Mt}from"../chunks/CodeBlock.7b16bdef.js";import{H as R}from"../chunks/Heading.8660bd0e.js";function Bt(rt){let r,E,U,S,h,z,m,ct=`To give dataset creators more control over how their datasets are used, the Hub allows users to enable <strong>User Access requests</strong> through a dataset’s <strong>Settings</strong> tab.
Enabling this setting requires users to agree to share their contact information and accept the dataset authors’ terms and conditions in order to access the dataset.
The contact information is stored in a database, and dataset owners are able to download a copy of the user access report.`,P,f,V,g,ut="The User Access request dialog can be modified to include additional text and checkbox fields in the prompt. To do this, add a YAML section to the dataset’s <code>README.md</code> file (create one if it does not already exist) and add an <code>extra_gated_fields</code> property. Within this property, you’ll be able to add as many custom fields as you like and whether they are a <code>text</code> or <code>checkbox</code> field. An <code>extra_gated_prompt</code> property can also be included to add a customized text message.",N,v,A,c,pt='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-gated.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-gated-dark.png"/>',Y,y,ht='The <code>README.md</code> file for a dataset is called a <a href="./datasets-cards">Dataset Card</a>. Visit the documentation to learn more about how to use it and to see the properties that you can configure.',F,T,X,w,mt=`By default, requests to access the dataset are automatically accepted.
Dataset authors can set the approval mode to “Manual reviews” from the dataset’s <strong>Settings</strong> tab.
Doing so enforces that each access request will be manually reviewed and approved by the dataset authors.
Only users whose access requests have been approved will be able to access the dataset’s content.`,D,u,ft='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-gated-manual-approval.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/datasets-gated-manual-approval-dark.png"/>',Q,b,gt="You can automate the approval of access requests with the following API:",O,$,vt="<thead><tr><th>Method</th> <th>URI</th> <th>Description</th> <th>Payload</th></tr></thead> <tbody><tr><td><code>GET</code></td> <td><code>/api/datasets/{repo_id}/user-access-request/pending</code></td> <td>Retrieve the list of pending access requests for the given dataset.</td> <td><code>headers = { &quot;authorization&quot; : &quot;Bearer $token&quot; }</code></td></tr> <tr><td><code>GET</code></td> <td><code>/api/datasets/{repo_id}/user-access-request/accepted</code></td> <td>Retrieve the list of accepted access requests for the given dataset.</td> <td><code>headers = { &quot;authorization&quot; : &quot;Bearer $token&quot; }</code></td></tr> <tr><td><code>GET</code></td> <td><code>/api/datasets/{repo_id}/user-access-request/rejected</code></td> <td>Retrieve the list of rejected access requests for the given dataset.</td> <td><code>headers = { &quot;authorization&quot; : &quot;Bearer $token&quot; }</code></td></tr> <tr><td><code>POST</code></td> <td><code>/api/datasets/{repo_id}/user-access-request/handle</code></td> <td>Change the status of a given access request to <code>status</code>.</td> <td><code>headers = { &quot;authorization&quot; : &quot;Bearer $token&quot; }</code> <code>json = { &quot;status&quot;: &quot;accepted&quot; | &quot;rejected&quot; | &quot;pending&quot;, &quot;user&quot;: &quot;username&quot; }</code></td></tr> <tr><td><code>POST</code></td> <td><code>/api/datasets/{repo_id}/user-access-request/grant</code></td> <td>Allow a specific user to access your repository.</td> <td><code>headers = { &quot;authorization&quot; : &quot;Bearer $token&quot; }</code> <code>json = { &quot;user&quot;: &quot;username&quot; }</code></td></tr></tbody>",K,q,yt='The base URL for the HTTP endpoints above is <code>https://huggingface.co</code>. The <code>$token</code> to pass as a bearer token can be generated from <a href="https://huggingface.co/settings/tokens" rel="nofollow">your user settings</a>. It must have <code>write</code> access to the gated repository.',tt,M,et,x,Tt=`By default, notifications for new pending access requests are sent once a day via email.
When the repo lives in an organization, those emails are sent to the first 5 admins of the organization.`,at,_,wt=`You can customize the way you receive those notifications from the gated dataset’s settings page.
You can choose whether to receive notifications for new pending access requests in bulk once a day or in real-time.
You can also set a custom email to send those notifications to.`,st,p,bt='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-notifications.png"/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/models-gated-notifications-dark.png"/>',ot,j,nt,k,$t="In some cases, you might also want to modify the text in the heading of the gate as well as the text in the button. For those use cases you can modify <code>extra_gated_heading</code> and <code>extra_gated_button_content</code>.",it,J,dt,L,lt;return h=new R({props:{title:"Gated datasets",local:"gated-datasets",headingTag:"h1"}}),f=new R({props:{title:"Modifying the prompt",local:"modifying-the-prompt",headingTag:"h2"}}),v=new Mt({props:{code:"LS0tJTBBZXh0cmFfZ2F0ZWRfcHJvbXB0JTNBJTIwJTIyWW91JTIwYWdyZWUlMjB0byUyMG5vdCUyMGF0dGVtcHQlMjB0byUyMGRldGVybWluZSUyMHRoZSUyMGlkZW50aXR5JTIwb2YlMjBpbmRpdmlkdWFscyUyMGluJTIwdGhpcyUyMGRhdGFzZXQlMjIlMEFleHRyYV9nYXRlZF9maWVsZHMlM0ElMEElMjBOYW1lJTNBJTIwdGV4dCUwQSUyMEFmZmlsaWF0aW9uJTNBJTIwdGV4dCUwQSUyMEVtYWlsJTNBJTIwdGV4dCUwQSUyMEklMjBhZ3JlZSUyMHRvJTIwbm90JTIwYXR0ZW1wdCUyMHRvJTIwZGV0ZXJtaW5lJTIwdGhlJTIwaWRlbnRpdHklMjBvZiUyMHNwZWFrZXJzJTIwaW4lMjB0aGlzJTIwZGF0YXNldCUzQSUyMGNoZWNrYm94JTBBLS0t",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">extra_gated_prompt:</span> <span class="hljs-string">&quot;You agree to not attempt to determine the identity of individuals in this dataset&quot;</span>
<span class="hljs-attr">extra_gated_fields:</span>
 <span class="hljs-attr">Name:</span> <span class="hljs-string">text</span>
 <span class="hljs-attr">Affiliation:</span> <span class="hljs-string">text</span>
 <span class="hljs-attr">Email:</span> <span class="hljs-string">text</span>
 <span class="hljs-attr">I agree to not attempt to determine the identity of speakers in this dataset:</span> <span class="hljs-string">checkbox</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),T=new R({props:{title:"Manual approval",local:"manual-approval",headingTag:"h2"}}),M=new R({props:{title:"Notifications settings",local:"notifications-settings",headingTag:"h3"}}),j=new R({props:{title:"Additional Customization",local:"additional-customization",headingTag:"h2"}}),J=new Mt({props:{code:"LS0tJTBBZXh0cmFfZ2F0ZWRfaGVhZGluZyUzQSUyMCUyMkFja25vd2xlZGdlJTIwbGljZW5zZSUyMHRvJTIwYWNjZXB0JTIwdGhlJTIwcmVwb3NpdG9yeSUyMiUwQWV4dHJhX2dhdGVkX2J1dHRvbl9jb250ZW50JTNBJTIwJTIyQWNrbm93bGVkZ2UlMjBsaWNlbnNlJTIyJTBBLS0t",highlighted:`<span class="hljs-meta">---</span>
<span class="hljs-attr">extra_gated_heading:</span> <span class="hljs-string">&quot;Acknowledge license to accept the repository&quot;</span>
<span class="hljs-attr">extra_gated_button_content:</span> <span class="hljs-string">&quot;Acknowledge license&quot;</span>
<span class="hljs-meta">---</span>`,wrap:!1}}),{c(){r=i("meta"),E=o(),U=i("p"),S=o(),H(h.$$.fragment),z=o(),m=i("p"),m.innerHTML=ct,P=o(),H(f.$$.fragment),V=o(),g=i("p"),g.innerHTML=ut,N=o(),H(v.$$.fragment),A=o(),c=i("div"),c.innerHTML=pt,Y=o(),y=i("p"),y.innerHTML=ht,F=o(),H(T.$$.fragment),X=o(),w=i("p"),w.innerHTML=mt,D=o(),u=i("div"),u.innerHTML=ft,Q=o(),b=i("p"),b.textContent=gt,O=o(),$=i("table"),$.innerHTML=vt,K=o(),q=i("p"),q.innerHTML=yt,tt=o(),H(M.$$.fragment),et=o(),x=i("p"),x.textContent=Tt,at=o(),_=i("p"),_.textContent=wt,st=o(),p=i("div"),p.innerHTML=bt,ot=o(),H(j.$$.fragment),nt=o(),k=i("p"),k.innerHTML=$t,it=o(),H(J.$$.fragment),dt=o(),L=i("p"),this.h()},l(t){const e=Ht("svelte-u9bgzb",document.head);r=d(e,"META",{name:!0,content:!0}),e.forEach(a),E=n(t),U=d(t,"P",{}),qt(U).forEach(a),S=n(t),C(h.$$.fragment,t),z=n(t),m=d(t,"P",{"data-svelte-h":!0}),l(m)!=="svelte-1xc5w71"&&(m.innerHTML=ct),P=n(t),C(f.$$.fragment,t),V=n(t),g=d(t,"P",{"data-svelte-h":!0}),l(g)!=="svelte-115pems"&&(g.innerHTML=ut),N=n(t),C(v.$$.fragment,t),A=n(t),c=d(t,"DIV",{class:!0,"data-svelte-h":!0}),l(c)!=="svelte-16lirxr"&&(c.innerHTML=pt),Y=n(t),y=d(t,"P",{"data-svelte-h":!0}),l(y)!=="svelte-11oqfx7"&&(y.innerHTML=ht),F=n(t),C(T.$$.fragment,t),X=n(t),w=d(t,"P",{"data-svelte-h":!0}),l(w)!=="svelte-18k910j"&&(w.innerHTML=mt),D=n(t),u=d(t,"DIV",{class:!0,"data-svelte-h":!0}),l(u)!=="svelte-19y4241"&&(u.innerHTML=ft),Q=n(t),b=d(t,"P",{"data-svelte-h":!0}),l(b)!=="svelte-dedsbo"&&(b.textContent=gt),O=n(t),$=d(t,"TABLE",{"data-svelte-h":!0}),l($)!=="svelte-1fmnnjj"&&($.innerHTML=vt),K=n(t),q=d(t,"P",{"data-svelte-h":!0}),l(q)!=="svelte-gadjhb"&&(q.innerHTML=yt),tt=n(t),C(M.$$.fragment,t),et=n(t),x=d(t,"P",{"data-svelte-h":!0}),l(x)!=="svelte-3w5go9"&&(x.textContent=Tt),at=n(t),_=d(t,"P",{"data-svelte-h":!0}),l(_)!=="svelte-hw5suk"&&(_.textContent=wt),st=n(t),p=d(t,"DIV",{class:!0,"data-svelte-h":!0}),l(p)!=="svelte-9ic7xj"&&(p.innerHTML=bt),ot=n(t),C(j.$$.fragment,t),nt=n(t),k=d(t,"P",{"data-svelte-h":!0}),l(k)!=="svelte-vchjsx"&&(k.innerHTML=$t),it=n(t),C(J.$$.fragment,t),dt=n(t),L=d(t,"P",{}),qt(L).forEach(a),this.h()},h(){W(r,"name","hf:doc:metadata"),W(r,"content",Zt),W(c,"class","flex justify-center"),W(u,"class","flex justify-center"),W(p,"class","flex justify-center")},m(t,e){Ct(document.head,r),s(t,E,e),s(t,U,e),s(t,S,e),B(h,t,e),s(t,z,e),s(t,m,e),s(t,P,e),B(f,t,e),s(t,V,e),s(t,g,e),s(t,N,e),B(v,t,e),s(t,A,e),s(t,c,e),s(t,Y,e),s(t,y,e),s(t,F,e),B(T,t,e),s(t,X,e),s(t,w,e),s(t,D,e),s(t,u,e),s(t,Q,e),s(t,b,e),s(t,O,e),s(t,$,e),s(t,K,e),s(t,q,e),s(t,tt,e),B(M,t,e),s(t,et,e),s(t,x,e),s(t,at,e),s(t,_,e),s(t,st,e),s(t,p,e),s(t,ot,e),B(j,t,e),s(t,nt,e),s(t,k,e),s(t,it,e),B(J,t,e),s(t,dt,e),s(t,L,e),lt=!0},p:_t,i(t){lt||(Z(h.$$.fragment,t),Z(f.$$.fragment,t),Z(v.$$.fragment,t),Z(T.$$.fragment,t),Z(M.$$.fragment,t),Z(j.$$.fragment,t),Z(J.$$.fragment,t),lt=!0)},o(t){G(h.$$.fragment,t),G(f.$$.fragment,t),G(v.$$.fragment,t),G(T.$$.fragment,t),G(M.$$.fragment,t),G(j.$$.fragment,t),G(J.$$.fragment,t),lt=!1},d(t){t&&(a(E),a(U),a(S),a(z),a(m),a(P),a(V),a(g),a(N),a(A),a(c),a(Y),a(y),a(F),a(X),a(w),a(D),a(u),a(Q),a(b),a(O),a($),a(K),a(q),a(tt),a(et),a(x),a(at),a(_),a(st),a(p),a(ot),a(nt),a(k),a(it),a(dt),a(L)),a(r),I(h,t),I(f,t),I(v,t),I(T,t),I(M,t),I(j,t),I(J,t)}}}const Zt='{"title":"Gated datasets","local":"gated-datasets","sections":[{"title":"Modifying the prompt","local":"modifying-the-prompt","sections":[],"depth":2},{"title":"Manual approval","local":"manual-approval","sections":[{"title":"Notifications settings","local":"notifications-settings","sections":[],"depth":3}],"depth":2},{"title":"Additional Customization","local":"additional-customization","sections":[],"depth":2}],"depth":1}';function Gt(rt){return jt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Rt extends kt{constructor(r){super(),Jt(this,r,Gt,Bt,xt,{})}}export{Rt as component};
