import{s as Ka,o as et,n as S}from"../chunks/scheduler.6062bdaf.js";import{S as at,i as tt,g as b,s as l,r as i,A as ot,h as f,f as o,c as r,j as P,u as h,x as M,k as j,y,a as s,v as g,d as p,t as u,w as c}from"../chunks/index.4bca734e.js";import{T as Le}from"../chunks/Tip.b9ac1f03.js";import{D as C}from"../chunks/Docstring.ed07512f.js";import{C as Ha}from"../chunks/CodeBlock.fa01571c.js";import{E as Ga}from"../chunks/ExampleCodeBlock.823fb173.js";import{H as T}from"../chunks/Heading.723dceba.js";function nt(v){let t,d=`Check out this <a href="../guides/webhooks_server">guide</a> for a step-by-step tutorial on how to setup your webhooks server and
deploy it as a Space.`;return{c(){t=b("p"),t.innerHTML=d},l(n){t=f(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-d4pen0"&&(t.innerHTML=d)},m(n,m){s(n,t,m)},p:S,d(n){n&&o(t)}}}function st(v){let t,d=`This is an experimental feature. This means that we are still working on improving the API. Breaking changes might be
introduced in the future without prior notice. Make sure to pin the version of <code>huggingface_hub</code> in your requirements.
A warning is triggered when you use an experimental feature. You can disable it by setting <code>HF_HUB_DISABLE_EXPERIMENTAL_WARNING=1</code> as an environment variable.`;return{c(){t=b("p"),t.innerHTML=d},l(n){t=f(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1dmzgpm"&&(t.innerHTML=d)},m(n,m){s(n,t,m)},p:S,d(n){n&&o(t)}}}function lt(v){let t,d="<code>WebhooksServer</code> is experimental. Its API is subject to change in the future.";return{c(){t=b("p"),t.innerHTML=d},l(n){t=f(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-172l28e"&&(t.innerHTML=d)},m(n,m){s(n,t,m)},p:S,d(n){n&&o(t)}}}function rt(v){let t,d="You must have <code>gradio</code> installed to use <code>WebhooksServer</code> (<code>pip install --upgrade gradio</code>).";return{c(){t=b("p"),t.innerHTML=d},l(n){t=f(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1hd0atb"&&(t.innerHTML=d)},m(n,m){s(n,t,m)},p:S,d(n){n&&o(t)}}}function it(v){let t,d="Example:",n,m,U;return m=new Ha({props:{code:"aW1wb3J0JTIwZ3JhZGlvJTIwYXMlMjBnciUwQWZyb20lMjBodWdnaW5nZmFjZV9odWIlMjBpbXBvcnQlMjBXZWJob29rc1NlcnZlciUyQyUyMFdlYmhvb2tQYXlsb2FkJTBBJTBBd2l0aCUyMGdyLkJsb2NrcygpJTIwYXMlMjB1aSUzQSUwQSUyMCUyMCUyMCUyMC4uLiUwQSUwQWFwcCUyMCUzRCUyMFdlYmhvb2tzU2VydmVyKHVpJTNEdWklMkMlMjB3ZWJob29rX3NlY3JldCUzRCUyMm15X3NlY3JldF9rZXklMjIpJTBBJTBBJTQwYXBwLmFkZF93ZWJob29rKCUyMiUyRnNheV9oZWxsbyUyMiklMEFhc3luYyUyMGRlZiUyMGhlbGxvKHBheWxvYWQlM0ElMjBXZWJob29rUGF5bG9hZCklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjAlN0IlMjJtZXNzYWdlJTIyJTNBJTIwJTIyaGVsbG8lMjIlN0QlMEElMEFhcHAucnVuKCk=",highlighted:`<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr
<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> WebhooksServer, WebhookPayload

<span class="hljs-keyword">with</span> gr.Blocks() <span class="hljs-keyword">as</span> ui:
    ...

app = WebhooksServer(ui=ui, webhook_secret=<span class="hljs-string">&quot;my_secret_key&quot;</span>)

<span class="hljs-meta">@app.add_webhook(<span class="hljs-params"><span class="hljs-string">&quot;/say_hello&quot;</span></span>)</span>
<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">hello</span>(<span class="hljs-params">payload: WebhookPayload</span>):
    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;message&quot;</span>: <span class="hljs-string">&quot;hello&quot;</span>}

app.run()`,wrap:!1}}),{c(){t=b("p"),t.textContent=d,n=l(),i(m.$$.fragment)},l(_){t=f(_,"P",{"data-svelte-h":!0}),M(t)!=="svelte-11lpom8"&&(t.textContent=d),n=r(_),h(m.$$.fragment,_)},m(_,I){s(_,t,I),s(_,n,I),g(m,_,I),U=!0},p:S,i(_){U||(p(m.$$.fragment,_),U=!0)},o(_){u(m.$$.fragment,_),U=!1},d(_){_&&(o(t),o(n)),c(m,_)}}}function ht(v){let t,d="<code>webhook_endpoint</code> is experimental. Its API is subject to change in the future.";return{c(){t=b("p"),t.innerHTML=d},l(n){t=f(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-1p6oojg"&&(t.innerHTML=d)},m(n,m){s(n,t,m)},p:S,d(n){n&&o(t)}}}function gt(v){let t,d="You must have <code>gradio</code> installed to use <code>webhook_endpoint</code> (<code>pip install --upgrade gradio</code>).";return{c(){t=b("p"),t.innerHTML=d},l(n){t=f(n,"P",{"data-svelte-h":!0}),M(t)!=="svelte-siz6u1"&&(t.innerHTML=d)},m(n,m){s(n,t,m)},p:S,d(n){n&&o(t)}}}function pt(v){let t,d;return t=new Ha({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHdlYmhvb2tfZW5kcG9pbnQlMkMlMjBXZWJob29rUGF5bG9hZCUwQSUwQSU0MHdlYmhvb2tfZW5kcG9pbnQlMEFhc3luYyUyMGRlZiUyMHRyaWdnZXJfdHJhaW5pbmcocGF5bG9hZCUzQSUyMFdlYmhvb2tQYXlsb2FkKSUzQSUwQSUyMCUyMCUyMCUyMGlmJTIwcGF5bG9hZC5yZXBvLnR5cGUlMjAlM0QlM0QlMjAlMjJkYXRhc2V0JTIyJTIwYW5kJTIwcGF5bG9hZC5ldmVudC5hY3Rpb24lMjAlM0QlM0QlMjAlMjJ1cGRhdGUlMjIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBUcmlnZ2VyJTIwYSUyMHRyYWluaW5nJTIwam9iJTIwaWYlMjBhJTIwZGF0YXNldCUyMGlzJTIwdXBkYXRlZCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4uLiUwQSUwQSUyMyUyMFNlcnZlciUyMGlzJTIwYXV0b21hdGljYWxseSUyMHN0YXJ0ZWQlMjBhdCUyMHRoZSUyMGVuZCUyMG9mJTIwdGhlJTIwc2NyaXB0Lg==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> webhook_endpoint, WebhookPayload

<span class="hljs-meta">@webhook_endpoint</span>
<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">trigger_training</span>(<span class="hljs-params">payload: WebhookPayload</span>):
    <span class="hljs-keyword">if</span> payload.repo.<span class="hljs-built_in">type</span> == <span class="hljs-string">&quot;dataset&quot;</span> <span class="hljs-keyword">and</span> payload.event.action == <span class="hljs-string">&quot;update&quot;</span>:
        <span class="hljs-comment"># Trigger a training job if a dataset is updated</span>
        ...

<span class="hljs-comment"># Server is automatically started at the end of the script.</span>`,wrap:!1}}),{c(){i(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,m){g(t,n,m),d=!0},p:S,i(n){d||(p(t.$$.fragment,n),d=!0)},o(n){u(t.$$.fragment,n),d=!1},d(n){c(t,n)}}}function ut(v){let t,d;return t=new Ha({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMHdlYmhvb2tfZW5kcG9pbnQlMkMlMjBXZWJob29rUGF5bG9hZCUwQSUwQSU0MHdlYmhvb2tfZW5kcG9pbnQlMEFhc3luYyUyMGRlZiUyMHRyaWdnZXJfdHJhaW5pbmcocGF5bG9hZCUzQSUyMFdlYmhvb2tQYXlsb2FkKSUzQSUwQSUyMCUyMCUyMCUyMGlmJTIwcGF5bG9hZC5yZXBvLnR5cGUlMjAlM0QlM0QlMjAlMjJkYXRhc2V0JTIyJTIwYW5kJTIwcGF5bG9hZC5ldmVudC5hY3Rpb24lMjAlM0QlM0QlMjAlMjJ1cGRhdGUlMjIlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBUcmlnZ2VyJTIwYSUyMHRyYWluaW5nJTIwam9iJTIwaWYlMjBhJTIwZGF0YXNldCUyMGlzJTIwdXBkYXRlZCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMC4uLiUwQSUwQSUyMyUyMFN0YXJ0JTIwdGhlJTIwc2VydmVyJTIwbWFudWFsbHklMEF0cmlnZ2VyX3RyYWluaW5nLnJ1bigp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> webhook_endpoint, WebhookPayload

<span class="hljs-meta">@webhook_endpoint</span>
<span class="hljs-keyword">async</span> <span class="hljs-keyword">def</span> <span class="hljs-title function_">trigger_training</span>(<span class="hljs-params">payload: WebhookPayload</span>):
    <span class="hljs-keyword">if</span> payload.repo.<span class="hljs-built_in">type</span> == <span class="hljs-string">&quot;dataset&quot;</span> <span class="hljs-keyword">and</span> payload.event.action == <span class="hljs-string">&quot;update&quot;</span>:
        <span class="hljs-comment"># Trigger a training job if a dataset is updated</span>
        ...

<span class="hljs-comment"># Start the server manually</span>
trigger_training.run()`,wrap:!1}}),{c(){i(t.$$.fragment)},l(n){h(t.$$.fragment,n)},m(n,m){g(t,n,m),d=!0},p:S,i(n){d||(p(t.$$.fragment,n),d=!0)},o(n){u(t.$$.fragment,n),d=!1},d(n){c(t,n)}}}function ct(v){let t,d,n,m,U,_,I,Ea=`Webhooks are a foundation for MLOps-related features. They allow you to listen for new changes on specific repos or to
all repos belonging to particular users/organizations you’re interested in following. To learn
more about webhooks on the Huggingface Hub, you can read the Webhooks <a href="https://huggingface.co/docs/hub/webhooks" rel="nofollow">guide</a>.`,Be,J,Ne,L,Re,Q,Fe,B,Ya=`The server is a <a href="https://gradio.app/" rel="nofollow">Gradio</a> app. It has a UI to display instructions for you or your users and an API
to listen to webhooks. Implementing a webhook endpoint is as simple as decorating a function. You can then debug it
by redirecting the Webhooks to your machine (using a Gradio tunnel) before deploying it to a Space.`,Xe,N,De,w,R,va,Pe,Za=`The <a href="/docs/huggingface_hub/v0.21.0.rc0/en/package_reference/webhooks_server#huggingface_hub.WebhooksServer">WebhooksServer()</a> class lets you create an instance of a Gradio app that can receive Huggingface webhooks.
These webhooks can be registered using the <code>add_webhook()</code> decorator. Webhook endpoints are added to
the app as a POST endpoint to the FastAPI router. Once all the webhooks are registered, the <code>run</code> method has to be
called to start the app.`,_a,je,Aa=`It is recommended to accept <a href="/docs/huggingface_hub/v0.21.0.rc0/en/package_reference/webhooks_server#huggingface_hub.WebhookPayload">WebhookPayload</a> as the first argument of the webhook function. It is a Pydantic
model that contains all the information about the webhook event. The data will be parsed automatically for you.`,wa,Te,Qa=`Check out the <a href="../guides/webhooks_server">webhooks guide</a> for a step-by-step tutorial on how to setup your
WebhooksServer and deploy it on a Space.`,Ma,x,Wa,G,Pa,H,Ve,F,Oe,$,X,ja,Ue,Ba='Decorator to start a <a href="/docs/huggingface_hub/v0.21.0.rc0/en/package_reference/webhooks_server#huggingface_hub.WebhooksServer">WebhooksServer()</a> and register the decorated function as a webhook endpoint.',Ta,Ce,Na=`This is a helper to get started quickly. If you need more flexibility (custom landing page or webhook secret),
you can use <a href="/docs/huggingface_hub/v0.21.0.rc0/en/package_reference/webhooks_server#huggingface_hub.WebhooksServer">WebhooksServer()</a> directly. You can register multiple webhook endpoints (to the same server) by using
this decorator multiple times.`,Ua,Ie,Ra=`Check out the <a href="../guides/webhooks_server">webhooks guide</a> for a step-by-step tutorial on how to setup your
server and deploy it on a Space.`,Ca,E,Ia,Y,Sa,Se,Fa=`Examples:
The default usage is to register a function as a webhook endpoint. The function name will be used as the path.
The server will be started automatically at exit (i.e. at the end of the script).`,Ja,Z,La,Je,Xa=`Advanced usage: register a function as a webhook endpoint and start the server manually. This is useful if you
are running it in a notebook.`,xa,A,qe,D,ze,V,Da=`<a href="/docs/huggingface_hub/v0.21.0.rc0/en/package_reference/webhooks_server#huggingface_hub.WebhookPayload">WebhookPayload</a> is the main data structure that contains the payload from Webhooks. This is
a <code>pydantic</code> class which makes it very easy to use with FastAPI. If you pass it as a parameter to a webhook endpoint, it
will be automatically validated and parsed as a Python object.`,Ke,O,Va='For more information about webhooks payload, you can refer to the Webhooks Payload <a href="https://huggingface.co/docs/hub/webhooks#webhook-payloads" rel="nofollow">guide</a>.',ea,q,z,aa,K,ta,ee,ae,oa,te,na,oe,ne,sa,se,la,le,re,ra,ie,ia,he,ge,ha,pe,ga,ue,ce,pa,de,ua,be,fe,ca,me,da,$e,ye,ba,ke,fa,ve,_e,ma,we,$a,Me,We,ya,xe,ka;return U=new T({props:{title:"Webhooks Server",local:"webhooks-server",headingTag:"h1"}}),J=new Le({props:{$$slots:{default:[nt]},$$scope:{ctx:v}}}),L=new Le({props:{warning:!0,$$slots:{default:[st]},$$scope:{ctx:v}}}),Q=new T({props:{title:"Server",local:"server",headingTag:"h2"}}),N=new T({props:{title:"WebhooksServer",local:"huggingface_hub.WebhooksServer",headingTag:"h3"}}),R=new C({props:{name:"huggingface_hub.WebhooksServer",anchor:"huggingface_hub.WebhooksServer",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"huggingface_hub.WebhooksServer.ui",description:`<strong>ui</strong> (<code>gradio.Blocks</code>, optional) &#x2014;
A Gradio UI instance to be used as the Space landing page. If <code>None</code>, a UI displaying instructions
about the configured webhooks is created.`,name:"ui"},{anchor:"huggingface_hub.WebhooksServer.webhook_secret",description:`<strong>webhook_secret</strong> (<code>str</code>, optional) &#x2014;
A secret key to verify incoming webhook requests. You can set this value to any secret you want as long as
you also configure it in your <a href="https://huggingface.co/settings/webhooks" rel="nofollow">webhooks settings panel</a>. You
can also set this value as the <code>WEBHOOK_SECRET</code> environment variable. If no secret is provided, the
webhook endpoints are opened without any security.`,name:"webhook_secret"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_server.py#L38"}}),x=new Le({props:{warning:!0,$$slots:{default:[lt]},$$scope:{ctx:v}}}),G=new Le({props:{warning:!0,$$slots:{default:[rt]},$$scope:{ctx:v}}}),H=new Ga({props:{anchor:"huggingface_hub.WebhooksServer.example",$$slots:{default:[it]},$$scope:{ctx:v}}}),F=new T({props:{title:"@webhook_endpoint",local:"huggingface_hub.webhook_endpoint",headingTag:"h3"}}),X=new C({props:{name:"huggingface_hub.webhook_endpoint",anchor:"huggingface_hub.webhook_endpoint",parameters:[{name:"path",val:": Optional = None"}],parametersDescription:[{anchor:"huggingface_hub.webhook_endpoint.path",description:`<strong>path</strong> (<code>str</code>, optional) &#x2014;
The URL path to register the webhook function. If not provided, the function name will be used as the path.
In any case, all webhooks are registered under <code>/webhooks</code>.`,name:"path"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_server.py#L223"}}),E=new Le({props:{warning:!0,$$slots:{default:[ht]},$$scope:{ctx:v}}}),Y=new Le({props:{warning:!0,$$slots:{default:[gt]},$$scope:{ctx:v}}}),Z=new Ga({props:{anchor:"huggingface_hub.webhook_endpoint.example",$$slots:{default:[pt]},$$scope:{ctx:v}}}),A=new Ga({props:{anchor:"huggingface_hub.webhook_endpoint.example-2",$$slots:{default:[ut]},$$scope:{ctx:v}}}),D=new T({props:{title:"Payload",local:"huggingface_hub.WebhookPayload",headingTag:"h2"}}),z=new C({props:{name:"class huggingface_hub.WebhookPayload",anchor:"huggingface_hub.WebhookPayload",parameters:[{name:"event",val:": WebhookPayloadEvent"},{name:"repo",val:": WebhookPayloadRepo"},{name:"discussion",val:": Optional = None"},{name:"comment",val:": Optional = None"},{name:"webhook",val:": WebhookPayloadWebhook"},{name:"movedTo",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L109"}}),K=new T({props:{title:"WebhookPayload",local:"huggingface_hub.WebhookPayload",headingTag:"h3"}}),ae=new C({props:{name:"class huggingface_hub.WebhookPayload",anchor:"huggingface_hub.WebhookPayload",parameters:[{name:"event",val:": WebhookPayloadEvent"},{name:"repo",val:": WebhookPayloadRepo"},{name:"discussion",val:": Optional = None"},{name:"comment",val:": Optional = None"},{name:"webhook",val:": WebhookPayloadWebhook"},{name:"movedTo",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L109"}}),te=new T({props:{title:"WebhookPayloadComment",local:"huggingface_hub.WebhookPayloadComment",headingTag:"h3"}}),ne=new C({props:{name:"class huggingface_hub.WebhookPayloadComment",anchor:"huggingface_hub.WebhookPayloadComment",parameters:[{name:"id",val:": str"},{name:"author",val:": ObjectId"},{name:"hidden",val:": bool"},{name:"content",val:": Optional = None"},{name:"url",val:": WebhookPayloadUrl"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L80"}}),se=new T({props:{title:"WebhookPayloadDiscussion",local:"huggingface_hub.WebhookPayloadDiscussion",headingTag:"h3"}}),re=new C({props:{name:"class huggingface_hub.WebhookPayloadDiscussion",anchor:"huggingface_hub.WebhookPayloadDiscussion",parameters:[{name:"id",val:": str"},{name:"num",val:": int"},{name:"author",val:": ObjectId"},{name:"url",val:": WebhookPayloadUrl"},{name:"title",val:": str"},{name:"isPullRequest",val:": bool"},{name:"status",val:": Literal"},{name:"changes",val:": Optional = None"},{name:"pinned",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L87"}}),ie=new T({props:{title:"WebhookPayloadDiscussionChanges",local:"huggingface_hub.WebhookPayloadDiscussionChanges",headingTag:"h3"}}),ge=new C({props:{name:"class huggingface_hub.WebhookPayloadDiscussionChanges",anchor:"huggingface_hub.WebhookPayloadDiscussionChanges",parameters:[{name:"base",val:": str"},{name:"mergeCommitId",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L75"}}),pe=new T({props:{title:"WebhookPayloadEvent",local:"huggingface_hub.WebhookPayloadEvent",headingTag:"h3"}}),ce=new C({props:{name:"class huggingface_hub.WebhookPayloadEvent",anchor:"huggingface_hub.WebhookPayloadEvent",parameters:[{name:"action",val:": Literal"},{name:"scope",val:": str"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L70"}}),de=new T({props:{title:"WebhookPayloadMovedTo",local:"huggingface_hub.WebhookPayloadMovedTo",headingTag:"h3"}}),fe=new C({props:{name:"class huggingface_hub.WebhookPayloadMovedTo",anchor:"huggingface_hub.WebhookPayloadMovedTo",parameters:[{name:"name",val:": str"},{name:"owner",val:": ObjectId"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L61"}}),me=new T({props:{title:"WebhookPayloadRepo",local:"huggingface_hub.WebhookPayloadRepo",headingTag:"h3"}}),ye=new C({props:{name:"class huggingface_hub.WebhookPayloadRepo",anchor:"huggingface_hub.WebhookPayloadRepo",parameters:[{name:"id",val:": str"},{name:"owner",val:": ObjectId"},{name:"head_sha",val:": Optional = None"},{name:"name",val:": str"},{name:"private",val:": bool"},{name:"subdomain",val:": Optional = None"},{name:"tags",val:": Optional = None"},{name:"type",val:": Literal"},{name:"url",val:": WebhookPayloadUrl"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L98"}}),ke=new T({props:{title:"WebhookPayloadUrl",local:"huggingface_hub.WebhookPayloadUrl",headingTag:"h3"}}),_e=new C({props:{name:"class huggingface_hub.WebhookPayloadUrl",anchor:"huggingface_hub.WebhookPayloadUrl",parameters:[{name:"web",val:": str"},{name:"api",val:": Optional = None"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L56"}}),we=new T({props:{title:"WebhookPayloadWebhook",local:"huggingface_hub.WebhookPayloadWebhook",headingTag:"h3"}}),We=new C({props:{name:"class huggingface_hub.WebhookPayloadWebhook",anchor:"huggingface_hub.WebhookPayloadWebhook",parameters:[{name:"id",val:": str"},{name:"version",val:": Literal"}],source:"https://github.com/huggingface/huggingface_hub/blob/v0.21.0.rc0/src/huggingface_hub/_webhooks_payload.py#L66"}}),{c(){t=b("meta"),d=l(),n=b("p"),m=l(),i(U.$$.fragment),_=l(),I=b("p"),I.innerHTML=Ea,Be=l(),i(J.$$.fragment),Ne=l(),i(L.$$.fragment),Re=l(),i(Q.$$.fragment),Fe=l(),B=b("p"),B.innerHTML=Ya,Xe=l(),i(N.$$.fragment),De=l(),w=b("div"),i(R.$$.fragment),va=l(),Pe=b("p"),Pe.innerHTML=Za,_a=l(),je=b("p"),je.innerHTML=Aa,wa=l(),Te=b("p"),Te.innerHTML=Qa,Ma=l(),i(x.$$.fragment),Wa=l(),i(G.$$.fragment),Pa=l(),i(H.$$.fragment),Ve=l(),i(F.$$.fragment),Oe=l(),$=b("div"),i(X.$$.fragment),ja=l(),Ue=b("p"),Ue.innerHTML=Ba,Ta=l(),Ce=b("p"),Ce.innerHTML=Na,Ua=l(),Ie=b("p"),Ie.innerHTML=Ra,Ca=l(),i(E.$$.fragment),Ia=l(),i(Y.$$.fragment),Sa=l(),Se=b("p"),Se.textContent=Fa,Ja=l(),i(Z.$$.fragment),La=l(),Je=b("p"),Je.textContent=Xa,xa=l(),i(A.$$.fragment),qe=l(),i(D.$$.fragment),ze=l(),V=b("p"),V.innerHTML=Da,Ke=l(),O=b("p"),O.innerHTML=Va,ea=l(),q=b("div"),i(z.$$.fragment),aa=l(),i(K.$$.fragment),ta=l(),ee=b("div"),i(ae.$$.fragment),oa=l(),i(te.$$.fragment),na=l(),oe=b("div"),i(ne.$$.fragment),sa=l(),i(se.$$.fragment),la=l(),le=b("div"),i(re.$$.fragment),ra=l(),i(ie.$$.fragment),ia=l(),he=b("div"),i(ge.$$.fragment),ha=l(),i(pe.$$.fragment),ga=l(),ue=b("div"),i(ce.$$.fragment),pa=l(),i(de.$$.fragment),ua=l(),be=b("div"),i(fe.$$.fragment),ca=l(),i(me.$$.fragment),da=l(),$e=b("div"),i(ye.$$.fragment),ba=l(),i(ke.$$.fragment),fa=l(),ve=b("div"),i(_e.$$.fragment),ma=l(),i(we.$$.fragment),$a=l(),Me=b("div"),i(We.$$.fragment),ya=l(),xe=b("p"),this.h()},l(e){const a=ot("svelte-u9bgzb",document.head);t=f(a,"META",{name:!0,content:!0}),a.forEach(o),d=r(e),n=f(e,"P",{}),P(n).forEach(o),m=r(e),h(U.$$.fragment,e),_=r(e),I=f(e,"P",{"data-svelte-h":!0}),M(I)!=="svelte-1aa8i1a"&&(I.innerHTML=Ea),Be=r(e),h(J.$$.fragment,e),Ne=r(e),h(L.$$.fragment,e),Re=r(e),h(Q.$$.fragment,e),Fe=r(e),B=f(e,"P",{"data-svelte-h":!0}),M(B)!=="svelte-1ocv8du"&&(B.innerHTML=Ya),Xe=r(e),h(N.$$.fragment,e),De=r(e),w=f(e,"DIV",{class:!0});var W=P(w);h(R.$$.fragment,W),va=r(W),Pe=f(W,"P",{"data-svelte-h":!0}),M(Pe)!=="svelte-jdv3ln"&&(Pe.innerHTML=Za),_a=r(W),je=f(W,"P",{"data-svelte-h":!0}),M(je)!=="svelte-gny9te"&&(je.innerHTML=Aa),wa=r(W),Te=f(W,"P",{"data-svelte-h":!0}),M(Te)!=="svelte-19yut5m"&&(Te.innerHTML=Qa),Ma=r(W),h(x.$$.fragment,W),Wa=r(W),h(G.$$.fragment,W),Pa=r(W),h(H.$$.fragment,W),W.forEach(o),Ve=r(e),h(F.$$.fragment,e),Oe=r(e),$=f(e,"DIV",{class:!0});var k=P($);h(X.$$.fragment,k),ja=r(k),Ue=f(k,"P",{"data-svelte-h":!0}),M(Ue)!=="svelte-1wxa7hl"&&(Ue.innerHTML=Ba),Ta=r(k),Ce=f(k,"P",{"data-svelte-h":!0}),M(Ce)!=="svelte-co00xt"&&(Ce.innerHTML=Na),Ua=r(k),Ie=f(k,"P",{"data-svelte-h":!0}),M(Ie)!=="svelte-1fvc5uk"&&(Ie.innerHTML=Ra),Ca=r(k),h(E.$$.fragment,k),Ia=r(k),h(Y.$$.fragment,k),Sa=r(k),Se=f(k,"P",{"data-svelte-h":!0}),M(Se)!=="svelte-a86ntl"&&(Se.textContent=Fa),Ja=r(k),h(Z.$$.fragment,k),La=r(k),Je=f(k,"P",{"data-svelte-h":!0}),M(Je)!=="svelte-t28ynx"&&(Je.textContent=Xa),xa=r(k),h(A.$$.fragment,k),k.forEach(o),qe=r(e),h(D.$$.fragment,e),ze=r(e),V=f(e,"P",{"data-svelte-h":!0}),M(V)!=="svelte-rmjtfw"&&(V.innerHTML=Da),Ke=r(e),O=f(e,"P",{"data-svelte-h":!0}),M(O)!=="svelte-es7vl3"&&(O.innerHTML=Va),ea=r(e),q=f(e,"DIV",{class:!0});var Ge=P(q);h(z.$$.fragment,Ge),Ge.forEach(o),aa=r(e),h(K.$$.fragment,e),ta=r(e),ee=f(e,"DIV",{class:!0});var He=P(ee);h(ae.$$.fragment,He),He.forEach(o),oa=r(e),h(te.$$.fragment,e),na=r(e),oe=f(e,"DIV",{class:!0});var Ee=P(oe);h(ne.$$.fragment,Ee),Ee.forEach(o),sa=r(e),h(se.$$.fragment,e),la=r(e),le=f(e,"DIV",{class:!0});var Ye=P(le);h(re.$$.fragment,Ye),Ye.forEach(o),ra=r(e),h(ie.$$.fragment,e),ia=r(e),he=f(e,"DIV",{class:!0});var Ze=P(he);h(ge.$$.fragment,Ze),Ze.forEach(o),ha=r(e),h(pe.$$.fragment,e),ga=r(e),ue=f(e,"DIV",{class:!0});var Ae=P(ue);h(ce.$$.fragment,Ae),Ae.forEach(o),pa=r(e),h(de.$$.fragment,e),ua=r(e),be=f(e,"DIV",{class:!0});var Qe=P(be);h(fe.$$.fragment,Qe),Qe.forEach(o),ca=r(e),h(me.$$.fragment,e),da=r(e),$e=f(e,"DIV",{class:!0});var Oa=P($e);h(ye.$$.fragment,Oa),Oa.forEach(o),ba=r(e),h(ke.$$.fragment,e),fa=r(e),ve=f(e,"DIV",{class:!0});var qa=P(ve);h(_e.$$.fragment,qa),qa.forEach(o),ma=r(e),h(we.$$.fragment,e),$a=r(e),Me=f(e,"DIV",{class:!0});var za=P(Me);h(We.$$.fragment,za),za.forEach(o),ya=r(e),xe=f(e,"P",{}),P(xe).forEach(o),this.h()},h(){j(t,"name","hf:doc:metadata"),j(t,"content",dt),j(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j($,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(le,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),j(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,a){y(document.head,t),s(e,d,a),s(e,n,a),s(e,m,a),g(U,e,a),s(e,_,a),s(e,I,a),s(e,Be,a),g(J,e,a),s(e,Ne,a),g(L,e,a),s(e,Re,a),g(Q,e,a),s(e,Fe,a),s(e,B,a),s(e,Xe,a),g(N,e,a),s(e,De,a),s(e,w,a),g(R,w,null),y(w,va),y(w,Pe),y(w,_a),y(w,je),y(w,wa),y(w,Te),y(w,Ma),g(x,w,null),y(w,Wa),g(G,w,null),y(w,Pa),g(H,w,null),s(e,Ve,a),g(F,e,a),s(e,Oe,a),s(e,$,a),g(X,$,null),y($,ja),y($,Ue),y($,Ta),y($,Ce),y($,Ua),y($,Ie),y($,Ca),g(E,$,null),y($,Ia),g(Y,$,null),y($,Sa),y($,Se),y($,Ja),g(Z,$,null),y($,La),y($,Je),y($,xa),g(A,$,null),s(e,qe,a),g(D,e,a),s(e,ze,a),s(e,V,a),s(e,Ke,a),s(e,O,a),s(e,ea,a),s(e,q,a),g(z,q,null),s(e,aa,a),g(K,e,a),s(e,ta,a),s(e,ee,a),g(ae,ee,null),s(e,oa,a),g(te,e,a),s(e,na,a),s(e,oe,a),g(ne,oe,null),s(e,sa,a),g(se,e,a),s(e,la,a),s(e,le,a),g(re,le,null),s(e,ra,a),g(ie,e,a),s(e,ia,a),s(e,he,a),g(ge,he,null),s(e,ha,a),g(pe,e,a),s(e,ga,a),s(e,ue,a),g(ce,ue,null),s(e,pa,a),g(de,e,a),s(e,ua,a),s(e,be,a),g(fe,be,null),s(e,ca,a),g(me,e,a),s(e,da,a),s(e,$e,a),g(ye,$e,null),s(e,ba,a),g(ke,e,a),s(e,fa,a),s(e,ve,a),g(_e,ve,null),s(e,ma,a),g(we,e,a),s(e,$a,a),s(e,Me,a),g(We,Me,null),s(e,ya,a),s(e,xe,a),ka=!0},p(e,[a]){const W={};a&2&&(W.$$scope={dirty:a,ctx:e}),J.$set(W);const k={};a&2&&(k.$$scope={dirty:a,ctx:e}),L.$set(k);const Ge={};a&2&&(Ge.$$scope={dirty:a,ctx:e}),x.$set(Ge);const He={};a&2&&(He.$$scope={dirty:a,ctx:e}),G.$set(He);const Ee={};a&2&&(Ee.$$scope={dirty:a,ctx:e}),H.$set(Ee);const Ye={};a&2&&(Ye.$$scope={dirty:a,ctx:e}),E.$set(Ye);const Ze={};a&2&&(Ze.$$scope={dirty:a,ctx:e}),Y.$set(Ze);const Ae={};a&2&&(Ae.$$scope={dirty:a,ctx:e}),Z.$set(Ae);const Qe={};a&2&&(Qe.$$scope={dirty:a,ctx:e}),A.$set(Qe)},i(e){ka||(p(U.$$.fragment,e),p(J.$$.fragment,e),p(L.$$.fragment,e),p(Q.$$.fragment,e),p(N.$$.fragment,e),p(R.$$.fragment,e),p(x.$$.fragment,e),p(G.$$.fragment,e),p(H.$$.fragment,e),p(F.$$.fragment,e),p(X.$$.fragment,e),p(E.$$.fragment,e),p(Y.$$.fragment,e),p(Z.$$.fragment,e),p(A.$$.fragment,e),p(D.$$.fragment,e),p(z.$$.fragment,e),p(K.$$.fragment,e),p(ae.$$.fragment,e),p(te.$$.fragment,e),p(ne.$$.fragment,e),p(se.$$.fragment,e),p(re.$$.fragment,e),p(ie.$$.fragment,e),p(ge.$$.fragment,e),p(pe.$$.fragment,e),p(ce.$$.fragment,e),p(de.$$.fragment,e),p(fe.$$.fragment,e),p(me.$$.fragment,e),p(ye.$$.fragment,e),p(ke.$$.fragment,e),p(_e.$$.fragment,e),p(we.$$.fragment,e),p(We.$$.fragment,e),ka=!0)},o(e){u(U.$$.fragment,e),u(J.$$.fragment,e),u(L.$$.fragment,e),u(Q.$$.fragment,e),u(N.$$.fragment,e),u(R.$$.fragment,e),u(x.$$.fragment,e),u(G.$$.fragment,e),u(H.$$.fragment,e),u(F.$$.fragment,e),u(X.$$.fragment,e),u(E.$$.fragment,e),u(Y.$$.fragment,e),u(Z.$$.fragment,e),u(A.$$.fragment,e),u(D.$$.fragment,e),u(z.$$.fragment,e),u(K.$$.fragment,e),u(ae.$$.fragment,e),u(te.$$.fragment,e),u(ne.$$.fragment,e),u(se.$$.fragment,e),u(re.$$.fragment,e),u(ie.$$.fragment,e),u(ge.$$.fragment,e),u(pe.$$.fragment,e),u(ce.$$.fragment,e),u(de.$$.fragment,e),u(fe.$$.fragment,e),u(me.$$.fragment,e),u(ye.$$.fragment,e),u(ke.$$.fragment,e),u(_e.$$.fragment,e),u(we.$$.fragment,e),u(We.$$.fragment,e),ka=!1},d(e){e&&(o(d),o(n),o(m),o(_),o(I),o(Be),o(Ne),o(Re),o(Fe),o(B),o(Xe),o(De),o(w),o(Ve),o(Oe),o($),o(qe),o(ze),o(V),o(Ke),o(O),o(ea),o(q),o(aa),o(ta),o(ee),o(oa),o(na),o(oe),o(sa),o(la),o(le),o(ra),o(ia),o(he),o(ha),o(ga),o(ue),o(pa),o(ua),o(be),o(ca),o(da),o($e),o(ba),o(fa),o(ve),o(ma),o($a),o(Me),o(ya),o(xe)),o(t),c(U,e),c(J,e),c(L,e),c(Q,e),c(N,e),c(R),c(x),c(G),c(H),c(F,e),c(X),c(E),c(Y),c(Z),c(A),c(D,e),c(z),c(K,e),c(ae),c(te,e),c(ne),c(se,e),c(re),c(ie,e),c(ge),c(pe,e),c(ce),c(de,e),c(fe),c(me,e),c(ye),c(ke,e),c(_e),c(we,e),c(We)}}}const dt='{"title":"Webhooks Server","local":"webhooks-server","sections":[{"title":"Server","local":"server","sections":[{"title":"WebhooksServer","local":"huggingface_hub.WebhooksServer","sections":[],"depth":3},{"title":"@webhook_endpoint","local":"huggingface_hub.webhook_endpoint","sections":[],"depth":3}],"depth":2},{"title":"Payload","local":"huggingface_hub.WebhookPayload","sections":[{"title":"WebhookPayload","local":"huggingface_hub.WebhookPayload","sections":[],"depth":3},{"title":"WebhookPayloadComment","local":"huggingface_hub.WebhookPayloadComment","sections":[],"depth":3},{"title":"WebhookPayloadDiscussion","local":"huggingface_hub.WebhookPayloadDiscussion","sections":[],"depth":3},{"title":"WebhookPayloadDiscussionChanges","local":"huggingface_hub.WebhookPayloadDiscussionChanges","sections":[],"depth":3},{"title":"WebhookPayloadEvent","local":"huggingface_hub.WebhookPayloadEvent","sections":[],"depth":3},{"title":"WebhookPayloadMovedTo","local":"huggingface_hub.WebhookPayloadMovedTo","sections":[],"depth":3},{"title":"WebhookPayloadRepo","local":"huggingface_hub.WebhookPayloadRepo","sections":[],"depth":3},{"title":"WebhookPayloadUrl","local":"huggingface_hub.WebhookPayloadUrl","sections":[],"depth":3},{"title":"WebhookPayloadWebhook","local":"huggingface_hub.WebhookPayloadWebhook","sections":[],"depth":3}],"depth":2}],"depth":1}';function bt(v){return et(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class wt extends at{constructor(t){super(),tt(this,t,bt,ct,Ka,{})}}export{wt as component};
