import{s as ms,o as js,n as ts}from"../chunks/scheduler.53228c21.js";import{S as Ts,i as Us,e as u,s as i,c as w,h as us,a as d,d as n,b as o,f as ws,g as J,j as b,k as Js,l as ds,m as M,n as m,t as j,o as T,p as U}from"../chunks/index.100fac89.js";import{C as Is}from"../chunks/CopyLLMTxtMenu.9360b11d.js";import{C as Q}from"../chunks/CodeBlock.d30a6509.js";import{H as fs,E as hs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.c9001d7a.js";import{H as bs,a as es}from"../chunks/HfOption.fad27e59.js";function Bs(I){let e,p;return e=new Q({props:{code:"aW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwZGlmZnVzZXJzLm1vZHVsYXJfcGlwZWxpbmVzJTIwaW1wb3J0JTIwTW9kdWxhclBpcGVsaW5lQmxvY2tzJTJDJTIwSW5wdXRQYXJhbSUyQyUyME91dHB1dFBhcmFtJTBBJTBBY2xhc3MlMjBUZXh0VG9JbWFnZUJsb2NrKE1vZHVsYXJQaXBlbGluZUJsb2NrcyklM0ElMEElMjAlMjAlMjAlMjBtb2RlbF9uYW1lJTIwJTNEJTIwJTIydGV4dDJpbWclMjIlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGlucHV0cyhzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCU1QklucHV0UGFyYW0obmFtZSUzRCUyMnByb21wdCUyMiklNUQlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGludGVybWVkaWF0ZV9vdXRwdXRzKHNlbGYpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTVCJTVEJTBBJTBBJTIwJTIwJTIwJTIwJTQwcHJvcGVydHklMEElMjAlMjAlMjAlMjBkZWYlMjBkZXNjcmlwdGlvbihzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCUyMkknbSUyMGElMjB0ZXh0LXRvLWltYWdlJTIwd29ya2Zsb3chJTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19jYWxsX18oc2VsZiUyQyUyMGNvbXBvbmVudHMlMkMlMjBzdGF0ZSklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBibG9ja19zdGF0ZSUyMCUzRCUyMHNlbGYuZ2V0X2Jsb2NrX3N0YXRlKHN0YXRlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHByaW50KCUyMnJ1bm5pbmclMjB0aGUlMjB0ZXh0LXRvLWltYWdlJTIwd29ya2Zsb3clMjIpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwQWRkJTIweW91ciUyMHRleHQtdG8taW1hZ2UlMjBsb2dpYyUyMGhlcmUlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBGb3IlMjBleGFtcGxlJTNBJTIwZ2VuZXJhdGUlMjBpbWFnZSUyMGZyb20lMjBwcm9tcHQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLnNldF9ibG9ja19zdGF0ZShzdGF0ZSUyQyUyMGJsb2NrX3N0YXRlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGNvbXBvbmVudHMlMkMlMjBzdGF0ZQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">from</span> diffusers.modular_pipelines <span class="hljs-keyword">import</span> ModularPipelineBlocks, InputParam, OutputParam

<span class="hljs-keyword">class</span> <span class="hljs-title class_">TextToImageBlock</span>(<span class="hljs-title class_ inherited__">ModularPipelineBlocks</span>):
    model_name = <span class="hljs-string">&quot;text2img&quot;</span>

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> [InputParam(name=<span class="hljs-string">&quot;prompt&quot;</span>)]

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">intermediate_outputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> []

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;I&#x27;m a text-to-image workflow!&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, components, state</span>):
        block_state = self.get_block_state(state)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;running the text-to-image workflow&quot;</span>)
        <span class="hljs-comment"># Add your text-to-image logic here</span>
        <span class="hljs-comment"># For example: generate image from prompt</span>
        self.set_block_state(state, block_state)
        <span class="hljs-keyword">return</span> components, state`,wrap:!1}}),{c(){w(e.$$.fragment)},l(l){J(e.$$.fragment,l)},m(l,r){m(e,l,r),p=!0},p:ts,i(l){p||(j(e.$$.fragment,l),p=!0)},o(l){T(e.$$.fragment,l),p=!1},d(l){U(e,l)}}}function ks(I){let e,p;return e=new Q({props:{code:"Y2xhc3MlMjBJbWFnZVRvSW1hZ2VCbG9jayhNb2R1bGFyUGlwZWxpbmVCbG9ja3MpJTNBJTBBJTIwJTIwJTIwJTIwbW9kZWxfbmFtZSUyMCUzRCUyMCUyMmltZzJpbWclMjIlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQSUyMCUyMCUyMCUyMGRlZiUyMGlucHV0cyhzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMCU1QklucHV0UGFyYW0obmFtZSUzRCUyMnByb21wdCUyMiklMkMlMjBJbnB1dFBhcmFtKG5hbWUlM0QlMjJpbWFnZSUyMiklNUQlMEElMEElMjAlMjAlMjAlMjAlNDBwcm9wZXJ0eSUwQS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ImageToImageBlock</span>(<span class="hljs-title class_ inherited__">ModularPipelineBlocks</span>):
    model_name = <span class="hljs-string">&quot;img2img&quot;</span>

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> [InputParam(name=<span class="hljs-string">&quot;prompt&quot;</span>), InputParam(name=<span class="hljs-string">&quot;image&quot;</span>)]

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">intermediate_outputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> []

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;I&#x27;m an image-to-image workflow!&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, components, state</span>):
        block_state = self.get_block_state(state)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;running the image-to-image workflow&quot;</span>)
        <span class="hljs-comment"># Add your image-to-image logic here</span>
        <span class="hljs-comment"># For example: transform input image based on prompt</span>
        self.set_block_state(state, block_state)
        <span class="hljs-keyword">return</span> components, state`,wrap:!1}}),{c(){w(e.$$.fragment)},l(l){J(e.$$.fragment,l)},m(l,r){m(e,l,r),p=!0},p:ts,i(l){p||(j(e.$$.fragment,l),p=!0)},o(l){T(e.$$.fragment,l),p=!1},d(l){U(e,l)}}}function Cs(I){let e,p;return e=new Q({props:{code:"Y2xhc3MlMjBJbnBhaW50QmxvY2soTW9kdWxhclBpcGVsaW5lQmxvY2tzKSUzQSUwQSUyMCUyMCUyMCUyMG1vZGVsX25hbWUlMjAlM0QlMjAlMjJpbnBhaW50JTIyJTBBJTBBJTIwJTIwJTIwJTIwJTQwcHJvcGVydHklMEElMjAlMjAlMjAlMjBkZWYlMjBpbnB1dHMoc2VsZiklM0ElMEElM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lMjAlMjAlMjAlMjAlMjAlMjBzZWxmLnNldF9ibG9ja19zdGF0ZShzdGF0ZSUyQyUyMGJsb2NrX3N0YXRlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGNvbXBvbmVudHMlMkMlMjBzdGF0ZQ==",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">InpaintBlock</span>(<span class="hljs-title class_ inherited__">ModularPipelineBlocks</span>):
    model_name = <span class="hljs-string">&quot;inpaint&quot;</span>

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">inputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> [InputParam(name=<span class="hljs-string">&quot;prompt&quot;</span>), InputParam(name=<span class="hljs-string">&quot;image&quot;</span>), InputParam(name=<span class="hljs-string">&quot;mask&quot;</span>)]

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">intermediate_outputs</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> []

<span class="hljs-meta">    @property</span>
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> <span class="hljs-string">&quot;I&#x27;m an inpaint workflow!&quot;</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, components, state</span>):
        block_state = self.get_block_state(state)
        <span class="hljs-built_in">print</span>(<span class="hljs-string">&quot;running the inpaint workflow&quot;</span>)
        <span class="hljs-comment"># Add your inpainting logic here</span>
        <span class="hljs-comment"># For example: fill masked areas based on prompt</span>
        self.set_block_state(state, block_state)
        <span class="hljs-keyword">return</span> components, state`,wrap:!1}}),{c(){w(e.$$.fragment)},l(l){J(e.$$.fragment,l)},m(l,r){m(e,l,r),p=!0},p:ts,i(l){p||(j(e.$$.fragment,l),p=!0)},o(l){T(e.$$.fragment,l),p=!1},d(l){U(e,l)}}}function gs(I){let e,p,l,r,y,h;return e=new es({props:{id:"auto",option:"text-to-image",$$slots:{default:[Bs]},$$scope:{ctx:I}}}),l=new es({props:{id:"auto",option:"image-to-image",$$slots:{default:[ks]},$$scope:{ctx:I}}}),y=new es({props:{id:"auto",option:"inpaint",$$slots:{default:[Cs]},$$scope:{ctx:I}}}),{c(){w(e.$$.fragment),p=i(),w(l.$$.fragment),r=i(),w(y.$$.fragment)},l(a){J(e.$$.fragment,a),p=o(a),J(l.$$.fragment,a),r=o(a),J(y.$$.fragment,a)},m(a,c){m(e,a,c),M(a,p,c),m(l,a,c),M(a,r,c),m(y,a,c),h=!0},p(a,c){const f={};c&2&&(f.$$scope={dirty:c,ctx:a}),e.$set(f);const Y={};c&2&&(Y.$$scope={dirty:c,ctx:a}),l.$set(Y);const k={};c&2&&(k.$$scope={dirty:c,ctx:a}),y.$set(k)},i(a){h||(j(e.$$.fragment,a),j(l.$$.fragment,a),j(y.$$.fragment,a),h=!0)},o(a){T(e.$$.fragment,a),T(l.$$.fragment,a),T(y.$$.fragment,a),h=!1},d(a){a&&(n(p),n(r)),U(e,a),U(l,a),U(y,a)}}}function Gs(I){let e,p,l,r,y,h,a,c,f,Y='<a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> are a multi-block type containing blocks that support different workflows. It automatically selects which sub-blocks to run based on the input provided at runtime. This is typically used to package multiple workflows - text-to-image, image-to-image, inpaint - into a single pipeline for convenience.',k,C,as='This guide shows how to create <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a>.',E,g,ns='Create three <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.ModularPipelineBlocks">ModularPipelineBlocks</a> for text-to-image, image-to-image, and inpainting. These represent the different workflows available in the pipeline.',x,B,N,G,Ms='Create an <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> class that includes a list of the sub-block classes and their corresponding block names.',z,Z,ps="You also need to include <code>block_trigger_inputs</code>, a list of input names that trigger the corresponding block. If a trigger input is provided at runtime, then that block is selected to run. Use <code>None</code> to specify the default block to run if no trigger inputs are detected.",R,A,is="Lastly, it is important to include a <code>description</code> that clearly explains which inputs trigger which workflow. This helps users understand how to run specific workflows.",F,_,q,W,os='It is <strong>very</strong> important to include a <code>description</code> to avoid any confusion over how to run a block and what inputs are required. While <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> are convenient, it’s conditional logic may be difficult to figure out if it isn’t properly explained.',P,$,cs="Create an instance of <code>AutoImageBlocks</code>.",L,X,K,H,ys='For more complex compositions, such as nested <a href="/docs/diffusers/main/en/api/modular_diffusers/pipeline_blocks#diffusers.modular_pipelines.AutoPipelineBlocks">AutoPipelineBlocks</a> blocks when they’re used as sub-blocks in larger pipelines, use the <code>get_execution_blocks()</code> method to extract the a block that is actually run based on your input.',D,S,O,v,ss,V,ls;return y=new Is({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),a=new fs({props:{title:"AutoPipelineBlocks",local:"autopipelineblocks",headingTag:"h1"}}),B=new bs({props:{id:"auto",options:["text-to-image","image-to-image","inpaint"],$$slots:{default:[gs]},$$scope:{ctx:I}}}),_=new Q({props:{code:"ZnJvbSUyMGRpZmZ1c2Vycy5tb2R1bGFyX3BpcGVsaW5lcyUyMGltcG9ydCUyMEF1dG9QaXBlbGluZUJsb2NrcyUwQSUwQWNsYXNzJTIwQXV0b0ltYWdlQmxvY2tzKEF1dG9QaXBlbGluZUJsb2NrcyklM0ElMEElMjAlMjAlMjAlMjAlMjMlMjBMaXN0JTIwb2YlMjBzdWItYmxvY2slMjBjbGFzc2VzJTIwdG8lMjBjaG9vc2UlMjBmcm9tJTBBJTIwJTIw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yJTIwJTYwaW1hZ2UlNjAlMjBub3IlMjAlNjBtYXNrJTYwJTIwaXMlMjBwcm92aWRlZC4lNUNuJTIyJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKQ==",highlighted:`<span class="hljs-keyword">from</span> diffusers.modular_pipelines <span class="hljs-keyword">import</span> AutoPipelineBlocks

<span class="hljs-keyword">class</span> <span class="hljs-title class_">AutoImageBlocks</span>(<span class="hljs-title class_ inherited__">AutoPipelineBlocks</span>):
    <span class="hljs-comment"># List of sub-block classes to choose from</span>
    block_classes = [block_inpaint_cls, block_i2i_cls, block_t2i_cls]
    <span class="hljs-comment"># Names for each block in the same order</span>
    block_names = [<span class="hljs-string">&quot;inpaint&quot;</span>, <span class="hljs-string">&quot;img2img&quot;</span>, <span class="hljs-string">&quot;text2img&quot;</span>]
    <span class="hljs-comment"># Trigger inputs that determine which block to run</span>
    <span class="hljs-comment"># - &quot;mask&quot; triggers inpaint workflow</span>
    <span class="hljs-comment"># - &quot;image&quot; triggers img2img workflow (but only if mask is not provided)</span>
    <span class="hljs-comment"># - if none of above, runs the text2img workflow (default)</span>
    block_trigger_inputs = [<span class="hljs-string">&quot;mask&quot;</span>, <span class="hljs-string">&quot;image&quot;</span>, <span class="hljs-literal">None</span>]
    <span class="hljs-comment"># Description is extremely important for AutoPipelineBlocks</span>

    <span class="hljs-keyword">def</span> <span class="hljs-title function_">description</span>(<span class="hljs-params">self</span>):
        <span class="hljs-keyword">return</span> (
            <span class="hljs-string">&quot;Pipeline generates images given different types of conditions!\\n&quot;</span>
            + <span class="hljs-string">&quot;This is an auto pipeline block that works for text2img, img2img and inpainting tasks.\\n&quot;</span>
            + <span class="hljs-string">&quot; - inpaint workflow is run when \`mask\` is provided.\\n&quot;</span>
            + <span class="hljs-string">&quot; - img2img workflow is run when \`image\` is provided (but only when \`mask\` is not provided).\\n&quot;</span>
            + <span class="hljs-string">&quot; - text2img workflow is run when neither \`image\` nor \`mask\` is provided.\\n&quot;</span>
        )`,wrap:!1}}),X=new Q({props:{code:"YXV0b19ibG9ja3MlMjAlM0QlMjBBdXRvSW1hZ2VCbG9ja3MoKQ==",highlighted:"auto_blocks = AutoImageBlocks()",wrap:!1}}),S=new Q({props:{code:"YXV0b19ibG9ja3MuZ2V0X2V4ZWN1dGlvbl9ibG9ja3MoJTIybWFzayUyMik=",highlighted:'auto_blocks.get_execution_blocks(<span class="hljs-string">&quot;mask&quot;</span>)',wrap:!1}}),v=new hs({props:{source:"https://github.com/huggingface/diffusers/blob/main/docs/source/en/modular_diffusers/auto_pipeline_blocks.md"}}),{c(){e=u("meta"),p=i(),l=u("p"),r=i(),w(y.$$.fragment),h=i(),w(a.$$.fragment),c=i(),f=u("p"),f.innerHTML=Y,k=i(),C=u("p"),C.innerHTML=as,E=i(),g=u("p"),g.innerHTML=ns,x=i(),w(B.$$.fragment),N=i(),G=u("p"),G.innerHTML=Ms,z=i(),Z=u("p"),Z.innerHTML=ps,R=i(),A=u("p"),A.innerHTML=is,F=i(),w(_.$$.fragment),q=i(),W=u("p"),W.innerHTML=os,P=i(),$=u("p"),$.innerHTML=cs,L=i(),w(X.$$.fragment),K=i(),H=u("p"),H.innerHTML=ys,D=i(),w(S.$$.fragment),O=i(),w(v.$$.fragment),ss=i(),V=u("p"),this.h()},l(s){const t=us("svelte-u9bgzb",document.head);e=d(t,"META",{name:!0,content:!0}),t.forEach(n),p=o(s),l=d(s,"P",{}),ws(l).forEach(n),r=o(s),J(y.$$.fragment,s),h=o(s),J(a.$$.fragment,s),c=o(s),f=d(s,"P",{"data-svelte-h":!0}),b(f)!=="svelte-1ugzm89"&&(f.innerHTML=Y),k=o(s),C=d(s,"P",{"data-svelte-h":!0}),b(C)!=="svelte-1ahqkdy"&&(C.innerHTML=as),E=o(s),g=d(s,"P",{"data-svelte-h":!0}),b(g)!=="svelte-1wwe2b4"&&(g.innerHTML=ns),x=o(s),J(B.$$.fragment,s),N=o(s),G=d(s,"P",{"data-svelte-h":!0}),b(G)!=="svelte-8j7l4"&&(G.innerHTML=Ms),z=o(s),Z=d(s,"P",{"data-svelte-h":!0}),b(Z)!=="svelte-ay1e4a"&&(Z.innerHTML=ps),R=o(s),A=d(s,"P",{"data-svelte-h":!0}),b(A)!=="svelte-13ticwk"&&(A.innerHTML=is),F=o(s),J(_.$$.fragment,s),q=o(s),W=d(s,"P",{"data-svelte-h":!0}),b(W)!=="svelte-onwwut"&&(W.innerHTML=os),P=o(s),$=d(s,"P",{"data-svelte-h":!0}),b($)!=="svelte-hgnyn2"&&($.innerHTML=cs),L=o(s),J(X.$$.fragment,s),K=o(s),H=d(s,"P",{"data-svelte-h":!0}),b(H)!=="svelte-1cj50l7"&&(H.innerHTML=ys),D=o(s),J(S.$$.fragment,s),O=o(s),J(v.$$.fragment,s),ss=o(s),V=d(s,"P",{}),ws(V).forEach(n),this.h()},h(){Js(e,"name","hf:doc:metadata"),Js(e,"content",Zs)},m(s,t){ds(document.head,e),M(s,p,t),M(s,l,t),M(s,r,t),m(y,s,t),M(s,h,t),m(a,s,t),M(s,c,t),M(s,f,t),M(s,k,t),M(s,C,t),M(s,E,t),M(s,g,t),M(s,x,t),m(B,s,t),M(s,N,t),M(s,G,t),M(s,z,t),M(s,Z,t),M(s,R,t),M(s,A,t),M(s,F,t),m(_,s,t),M(s,q,t),M(s,W,t),M(s,P,t),M(s,$,t),M(s,L,t),m(X,s,t),M(s,K,t),M(s,H,t),M(s,D,t),m(S,s,t),M(s,O,t),m(v,s,t),M(s,ss,t),M(s,V,t),ls=!0},p(s,[t]){const rs={};t&2&&(rs.$$scope={dirty:t,ctx:s}),B.$set(rs)},i(s){ls||(j(y.$$.fragment,s),j(a.$$.fragment,s),j(B.$$.fragment,s),j(_.$$.fragment,s),j(X.$$.fragment,s),j(S.$$.fragment,s),j(v.$$.fragment,s),ls=!0)},o(s){T(y.$$.fragment,s),T(a.$$.fragment,s),T(B.$$.fragment,s),T(_.$$.fragment,s),T(X.$$.fragment,s),T(S.$$.fragment,s),T(v.$$.fragment,s),ls=!1},d(s){s&&(n(p),n(l),n(r),n(h),n(c),n(f),n(k),n(C),n(E),n(g),n(x),n(N),n(G),n(z),n(Z),n(R),n(A),n(F),n(q),n(W),n(P),n($),n(L),n(K),n(H),n(D),n(O),n(ss),n(V)),n(e),U(y,s),U(a,s),U(B,s),U(_,s),U(X,s),U(S,s),U(v,s)}}}const Zs='{"title":"AutoPipelineBlocks","local":"autopipelineblocks","sections":[],"depth":1}';function As(I){return js(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class vs extends Ts{constructor(e){super(),Us(this,e,As,Gs,ms,{})}}export{vs as component};
