"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[452],{35071(e,t,s){var l=s(50539),o=s.n(l);var a=s(32091),r=s.n(a),n=s(17243);const i="SET_SELECTION",c="SET_STATUS",b="SET_PROGRESS",u="SET_BLOB",g="CLEAR_EXPORT",p="REQUEST_CANCEL",d="CLEAR_CANCEL_REQUEST";function S(e){return Array.isArray(e)&&e.every(e=>"string"==typeof e)}const y={selection:{contextSlugs:[],widgetSlugs:[]},status:"idle",progress:0,blobURL:null,blobFilename:null,cancelRequested:!1},m={setSelection:e=>(r()((0,n.isPlainObject)(e),"selection must be a plain object."),r()(S(e.contextSlugs),"selection.contextSlugs must be an array of strings."),r()(S(e.widgetSlugs),"selection.widgetSlugs must be an array of strings."),{payload:{selection:e},type:i}),setStatus(e){const t=["idle","progress","success","error"];return r()(t.includes(e),`status must be one of: ${t.join(", ")}.`),{payload:{status:e},type:c}},setProgress:e=>(r()("number"==typeof e&&Number.isFinite(e)&&e>=0&&e<=100,"progress must be a number between 0 and 100."),{payload:{progress:e},type:b}),setBlob:e=>(r()((0,n.isPlainObject)(e),"blob must be a plain object."),r()("string"==typeof e.url&&e.url.length>0,"blob.url must be a non-empty string."),r()("string"==typeof e.filename&&e.filename.length>0,"blob.filename must be a non-empty string."),{payload:{blob:e},type:u}),clearExport:()=>({payload:{},type:g}),requestCancel:()=>({payload:{},type:p}),clearCancelRequest:()=>({payload:{},type:d})},R=(0,l.createReducer)((e,t)=>{switch(t.type){case i:e.selection=t.payload.selection;break;case c:e.status=t.payload.status;break;case b:e.progress=t.payload.progress;break;case u:e.blobURL=t.payload.blob.url,e.blobFilename=t.payload.blob.filename;break;case g:e.status=y.status,e.progress=y.progress,e.blobURL=y.blobURL,e.blobFilename=y.blobFilename;break;case p:e.cancelRequested=!0;break;case d:e.cancelRequested=!1}}),E={initialState:y,actions:m,controls:{},reducer:R,resolvers:{},selectors:{getSelection:e=>e.selection,getSelectedContextSlugs:e=>e.selection.contextSlugs,getSelectedWidgetSlugs:e=>e.selection.widgetSlugs,getStatus:e=>e.status,getProgress:e=>e.progress,getBlob:e=>({url:e.blobURL,filename:e.blobFilename}),isCancelRequested:e=>e.cancelRequested}},f=(0,l.combineStores)(l.commonStore,E);f.initialState,f.actions,f.controls,f.reducer,f.resolvers,f.selectors;o().registerStore("core/pdf",f)},50539(e){e.exports=googlesitekit.data}},e=>{e.O(0,[660],()=>{return t=35071,e(e.s=t);var t});e.O()}]);