@evfrenkel/decap-cms-core 3.13.0-image-conversions.1 → 3.13.0-image-conversions.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/20.decap-cms-core.js +1 -1
- package/dist/20.decap-cms-core.js.map +1 -1
- package/dist/@evfrenkel/decap-cms-core.js +1 -1
- package/dist/@evfrenkel/decap-cms-core.js.map +1 -1
- package/dist/decap-cms-core.js +20 -23
- package/dist/decap-cms-core.js.map +1 -1
- package/dist/esm/bootstrap.js +2 -2
- package/dist/esm/components/UI/ErrorBoundary.js +2 -2
- package/dist/esm/lib/imageTransformations.js +13 -1
- package/package.json +1 -1
- package/src/lib/__tests__/imageTransformations.spec.ts +53 -0
- package/src/lib/imageTransformations.ts +15 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
`),!n)throw Error(`Widget "${t}" registered without \`controlComponent\`.`);or.widgets[t]={control:n,preview:r,schema:o,globalStyles:a,allowMapValue:i,...s}}else console.error("`registerWidget` failed, called with incorrect arguments.")}function lr(e){return or.widgets[e]}function ur(e){return lr(e||"string")||lr("unknown")}function cr(){return or.editorComponents}function fr(){return or.remarkPlugins}function dr(e){return or.widgetValueSerializers[e]}function pr(e){return or.backends[e]}function hr(e){return or.mediaLibraries.find(t=>t.name===e)}function gr(e){if(!nr.includes(e))throw new Error(`Invalid event name '${e}'`)}async function mr({name:e,data:t}){gr(e);const n=or.eventHandlers[e];let r={...t};for(const{handler:e,options:o}of n){const n=await e(r,o);if(void 0!==n){const e=r.entry.set("data",n);r={...t,entry:e}}}return r.entry}function yr(e){return or.locales[e]}function vr(){return Object.entries(or.formats).reduce(function(e,[t,{extension:n}]){return{...e,[t]:n}},{})}function br(){return Object.entries(or.formats).reduce(function(e,[t,{formatter:n}]){return{...e,[t]:n}},{})}const wr={yml:"yml",yaml:"yml",toml:"toml",json:"json",frontmatter:"md","json-frontmatter":"md","toml-frontmatter":"md","yaml-frontmatter":"md"},xr={yml:mn,yaml:mn,toml:Cn,json:On,md:Ln,markdown:Ln,html:Ln};function Sr(e,t){const n={yml:mn,yaml:mn,toml:Cn,json:On,frontmatter:Ln,"json-frontmatter":Fn(t),"toml-frontmatter":$n(t),"yaml-frontmatter":Nn(t),...br()};if(e in n)return n[e];throw new Error(`No formatter available with name: ${e}`)}function kr(e,t){const n=e.get("frontmatter_delimiter"),r=(o=n,Ve.List.isList(o)?n.toArray():n);var o;const i=e.get("format");if(i)return Sr(i,r);const a=t&&t.path;if(a){const e=a.split(".").pop();if(e)return nn()(xr,e)}const s=e.get("extension");return s?nn()(xr,s):Sr("frontmatter",r)}__webpack_require__(52743);var _r=__webpack_require__(90959),Er=__webpack_require__.n(_r),Cr=__webpack_require__(3514),Or=__webpack_require__.n(Cr);const Tr="simple",Pr="editorial_workflow",Rr=(0,Ve.OrderedMap)({DRAFT:"draft",PENDING_REVIEW:"pending_review",PENDING_PUBLISH:"pending_publish"});(0,Ve.Map)({[Rr.get("DRAFT")]:"Draft",[Rr.get("PENDING_REVIEW")]:"Waiting for Review",[Rr.get("PENDING_PUBLISH")]:"Waiting to go live"});__webpack_require__(11601),__webpack_require__(68678),__webpack_require__(67156);const Mr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Ar;const Ir=new Uint8Array(16);function Dr(){if(!Ar&&(Ar="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Ar))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ar(Ir)}const jr=[];for(let e=0;e<256;++e)jr.push((e+256).toString(16).slice(1));const Lr=function(e,t,n){if(Mr.randomUUID&&!t&&!e)return Mr.randomUUID();const r=(e=e||{}).random||(e.rng||Dr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return function(e,t=0){return jr[e[t+0]]+jr[e[t+1]]+jr[e[t+2]]+jr[e[t+3]]+"-"+jr[e[t+4]]+jr[e[t+5]]+"-"+jr[e[t+6]]+jr[e[t+7]]+"-"+jr[e[t+8]]+jr[e[t+9]]+"-"+jr[e[t+10]]+jr[e[t+11]]+jr[e[t+12]]+jr[e[t+13]]+jr[e[t+14]]+jr[e[t+15]]}(r)};var Nr=__webpack_require__(87809),$r=__webpack_require__.n(Nr),Fr=__webpack_require__(83985),zr=__webpack_require__.n(Fr);const Br="file_based_collection",Ur="folder_based_collection",qr="commit_author",Wr="commit_date";var Hr=__webpack_require__(48110);const Vr=["title","path"],Kr={title:{type:"string",secondaryTypes:[],synonyms:["title","name","label","headline","header"],defaultPreview:e=>(0,Hr.jsx)("h1",null,e),fallbackToFirstField:!0,showError:!0},shortTitle:{type:"string",secondaryTypes:[],synonyms:["short_title","shortTitle","short"],defaultPreview:e=>(0,Hr.jsx)("h2",null,e),fallbackToFirstField:!1,showError:!1},author:{type:"string",secondaryTypes:[],synonyms:["author","name","by","byline","owner"],defaultPreview:e=>(0,Hr.jsx)("strong",null,e),fallbackToFirstField:!1,showError:!1},date:{type:"datetime",secondaryTypes:["date"],synonyms:["date","publishDate","publish_date"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1},description:{type:"string",secondaryTypes:["text","markdown"],synonyms:["shortDescription","short_description","shortdescription","description","intro","introduction","brief","content","biography","bio","summary"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1},image:{type:"image",secondaryTypes:[],synonyms:["image","thumbnail","thumb","picture","avatar","photo","cover","hero","logo"],defaultPreview:e=>e,fallbackToFirstField:!1,showError:!1}};var Gr=__webpack_require__(47354),Yr=__webpack_require__.n(Gr),Qr=__webpack_require__(56622),Jr=__webpack_require__.n(Qr);let Xr=function(e){return e.Ascending="Ascending",e.Descending="Descending",e.None="None",e}({});var Zr=__webpack_require__(62879),eo=__webpack_require__.n(Zr),to=__webpack_require__(14098),no=__webpack_require__.n(to),ro=__webpack_require__(17426),oo=__webpack_require__.n(ro),io=__webpack_require__(75442),ao=__webpack_require__(51048),so=__webpack_require__.n(ao),lo=__webpack_require__(69465),uo=__webpack_require__(89361),co=__webpack_require__.n(uo),fo=__webpack_require__(8138),po=__webpack_require__.n(fo);function ho(e,t){return function(e,t){return`${t?"/#":""}${e}`}(`/collections/${e}/new`,t)}function go(e,t){const n=io.parse(e,!0);return n.query={...n.query,...t},io.format(n)}const mo=/[\w\-.~]/i,yo=/[\xA0-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFEF}\u{10000}-\u{1FFFD}\u{20000}-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}\u{50000}-\u{5FFFD}\u{60000}-\u{6FFFD}\u{70000}-\u{7FFFD}\u{80000}-\u{8FFFD}\u{90000}-\u{9FFFD}\u{A0000}-\u{AFFFD}\u{B0000}-\u{BFFFD}\u{C0000}-\u{CFFFD}\u{D0000}-\u{DFFFD}\u{E1000}-\u{EFFFD}]/u;function vo(e){return mo.test(e)}function bo(e){return mo.test(e)||yo.test(e)}function wo(e,t){const{replacement:n,preserveSlashes:r}=t;let o;if("unicode"===e)o=bo;else{if("ascii"!==e)throw new Error('`options.encoding` must be "unicode" or "ascii".');o=vo}if(!Array.from(n).every(o))throw new Error("The replacement character(s) (options.replacement) is itself unsafe.");return(e,t=0,i=[e])=>r&&"/"===e&&0!==t&&t!==i.length-1||o(e)?e:n}function xo(e,t){const{replacement:n="",encoding:r="unicode",preserveSlashes:o}=t||{};if(!po()(e))throw new Error("The input slug must be a string.");if(!po()(n))throw new Error("`options.replacement` must be a string.");return Array.from(e).map(wo(r,{replacement:n,preserveSlashes:o})).join("")}function So(e,t){const{encoding:n="unicode",sanitize_replacement:r=""}=t||{};return wo(n,{replacement:r})(e)}function ko(e,t,n){if(!po()(e))throw new Error("The input slug must be a string.");const{encoding:r,clean_accents:o,sanitize_replacement:i}=t||{},a=eo()([...o?[lo.TF]:[],no()(xo,{replacement:i,encoding:r,preserveSlashes:n}),n?e=>e.split("/").filter(Boolean).map(e=>co()(e,{replacement:i})).join("/"):no()(co(),{replacement:i})])(e),s=new RegExp(`(?:${zr()(i)})+`,"g"),l=new RegExp(`${zr()(i)}$`),u=new RegExp(`^${zr()(i)}`);return a.replace(s,i).replace(u,"").replace(l,"")}const{compileStringTemplate:_o,parseDateFromEntry:Eo,parseDateFromEntryData:Co,SLUG_MISSING_REQUIRED_DATE:Oo,keyToPathArray:To,addFileTemplateFields:Po}=cn.stringTemplate,Ro={create:"Create {{collection}} “{{slug}}”",update:"Update {{collection}} “{{slug}}”",delete:"Delete {{collection}} “{{slug}}”",uploadMedia:"Upload “{{path}}”",deleteMedia:"Delete “{{path}}”",openAuthoring:"{{message}}"},Mo=/\{\{([^}]+)\}\}/g;function Ao(e,t,{slug:n,path:r,collection:o,authorLogin:i,authorName:a,authorEmail:s},l){const u={...Ro,...t.backend.commit_messages||{}};let c="";t.backend.signoff_commits&&(a?s?c=`\n\nSigned-off-by: ${a} <${s}>\n`:console.warn("Option signoff_commits is enabled, but author email is unknown"):console.warn("Option signoff_commits is enabled, but author name is unknown"));const f=u[e].replace(Mo,(e,t)=>{switch(t){case"slug":return n||"";case"path":return r||"";case"collection":return o?o.get("label_singular")||o.get("label"):"";case"author-login":return i||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in commit message template.`),""}});return l?u.openAuthoring.replace(Mo,(e,t)=>{switch(t){case"message":return f;case"author-login":return i||"";case"author-name":return a||"";default:return console.warn(`Ignoring unknown variable “${t}” in open authoring message template.`),""}})+c:f+c}function Io(e){return e.trim().toLocaleLowerCase().replace(/[']/g,"").replace(/[.]/g,"-")}function Do(e,t,n){return r=>t&&t.includes(r)?r:eo()([e=>String(e),Io,no()(ko,e,n)])(r)}function jo(e,t,n,r,o){if(!e)return;const i=oo()(e,"/"),a=t.get("type")===Br?Rl(t,r.get("slug")):void 0,s=a?.get("preview_path")??t.get("preview_path");if(!s)return e;let l=r.get("data");l=Po(r.get("path"),l,t.get("folder"));const u=(a?.get("preview_path_date_field")??t.get("preview_path_date_field"))||Bl(t,"date"),c=Eo(r,u),f=!!(t.get("preview_path_preserve_slashes")??t.has("nested")),d=Do(o,[l.get("dirname")],f);let p;try{p=_o(s,c,n,l,d)}catch(e){if(e instanceof Error&&e.name===Oo)return console.error(tr`
|
|
12
12
|
Collection "${t.get("name")}" configuration error:
|
|
13
13
|
\`preview_path_date_field\` must be a field with a valid date. Ignoring \`preview_path\`.
|
|
14
|
-
`),i;throw e}return`${i}/${Er()(p," /")}`}function Lo(e,t,n,r,o,i){if(!t||!t.get("data"))return e;let a=t.get("data").set(o,r);a=Po(t.get("path"),a,n.get("folder"));const s=Eo(t,Bl(n,"date"))||null,l=a.getIn(To(zl(n))),u=Do(i,[r,a.get("dirname")]);return _o(e,s,l,a,u)}var No=__webpack_require__(46343),$o=__webpack_require__.n(No),Fo=__webpack_require__(22563),zo=__webpack_require__.n(Fo);function Bo(e,t="",n="",r={}){return{collection:e,slug:t,path:n,partial:r.partial||!1,raw:r.raw||"",data:r.data||{},label:r.label||null,isModification:zo()(r.isModification)?r.isModification:null,mediaFiles:r.mediaFiles||[],author:r.author||"",updatedOn:r.updatedOn||"",status:r.status||"",meta:r.meta||{},i18n:r.i18n||{}}}const{fetchWithTimeout:Uo}=ln.unsentRequest;class qo{constructor(e){if(this.config=e,null==e.get("applicationID")||null==e.get("apiKey"))throw"The Algolia search integration needs the credentials (applicationID and apiKey) in the integration configuration.";this.applicationID=e.get("applicationID"),this.apiKey=e.get("apiKey");const t=e.get("indexPrefix");this.indexPrefix=t?`${t}-`:"",this.searchURL=`https://${this.applicationID}-dsn.algolia.net/1`,this.entriesCache={collection:null,page:null,entries:[]}}requestHeaders(e={}){return{"X-Algolia-API-Key":this.apiKey,"X-Algolia-Application-Id":this.applicationID,"Content-Type":"application/json",...e}}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const n=[];if(t.params)for(const e in t.params)n.push(`${e}=${encodeURIComponent(t.params[e])}`);return n.length&&(e+=`?${n.join("&")}`),e}request(e,t={}){const n=this.requestHeaders(t.headers||{}),r=this.urlFor(e,t);return Uo(r,{...t,headers:n}).then(e=>{const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text()})}search(e,t,n){const r=e.map(e=>({indexName:`${this.indexPrefix}${e}`,params:`query=${t}&page=${n}`}));return this.request(`${this.searchURL}/indexes/*/queries`,{method:"POST",body:JSON.stringify({requests:r})}).then(t=>{const r=t.results.map((t,n)=>t.hits.map(t=>{const r=t.path.split("/").pop().replace(/\.[^.]+$/,"");return Bo(e[n],r,t.path,{data:t.data,partial:!0})}));return{entries:Vt()(r),pagination:n}})}searchBy(e,t,n){return this.request(`${this.searchURL}/indexes/${this.indexPrefix}${t}`,{params:{restrictSearchableAttributes:e,query:n}})}listEntries(e,t){return this.entriesCache.collection===e&&this.entriesCache.page===t?Promise.resolve({page:this.entriesCache.page,entries:this.entriesCache.entries}):this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{page:t}}).then(t=>{const n=t.hits.map(t=>{const n=jl(e,t.path);return Bo(e.get("name"),n,t.path,{data:t.data,partial:!0})});return this.entriesCache={collection:e,pagination:t.page,entries:n},{entries:n,pagination:t.page}})}async listAllEntries(e){const t={hitsPerPage:1e3};let n=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:t}),{nbPages:r=0,hits:o,page:i}=n;for(i+=1;i<r;)n=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{...t,page:i}}),o=[...o,...n.hits],i+=1;const a=o.map(t=>{const n=jl(e,t.path);return Bo(e.get("name"),n,t.path,{data:t.data,partial:!0})});return a}getEntry(e,t){return this.searchBy("slug",e.get("name"),t).then(n=>{const r=n.hits.filter(e=>e.slug===t)[0];return Bo(e.get("name"),t,r.path,{data:r.data,partial:!0})})}}var Wo=__webpack_require__(16735),Ho=__webpack_require__.n(Wo);const{fetchWithTimeout:Vo}=ln.unsentRequest;class Ko{constructor(e,t){if(this.config=e,null==e.get("getSignedFormURL"))throw"The AssetStore integration needs the getSignedFormURL in the integration configuration.";this.getToken=t,this.shouldConfirmUpload=e.get("shouldConfirmUpload",!1),this.getSignedFormURL=oo()(e.get("getSignedFormURL"),"/")}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const n=[];if(t.params)for(const e in t.params)n.push(`${e}=${encodeURIComponent(t.params[e])}`);return n.length&&(e+=`?${n.join("&")}`),e}requestHeaders(e={}){return{...e}}confirmRequest(e){this.getToken().then(t=>this.request(`${this.getSignedFormURL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({state:"uploaded"})}))}async request(e,t={}){const n=this.requestHeaders(t.headers||{}),r=this.urlFor(e,t),o=await Vo(r,{...t,headers:n}),i=o.headers.get("Content-Type");return i&&i.match(/json/)?await this.parseJsonResponse(o):o.text()}async retrieve(e,t,n){const r=Ho()({search:e,page:t,filter:n?"private":"public"},e=>!!e),o=go(this.getSignedFormURL,r),i={"Content-Type":"application/json",Authorization:`Bearer ${await this.getToken()}`},a=(await this.request(o,{headers:i})).map(({id:e,name:t,size:n,url:r})=>({id:e,name:t,size:n,displayURL:r,url:r,path:r}));return a}delete(e){const t=`${this.getSignedFormURL}/${e}`;return this.getToken().then(e=>this.request(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}))}async upload(e,t=!1){const n={name:e.name,size:e.size};e.type&&(n.content_type=e.type),t&&(n.visibility="private");try{const t=await this.getToken(),r=await this.request(this.getSignedFormURL,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)}),o=r.form.url,i=r.form.fields,{id:a,name:s,size:l,url:u}=r.asset,c=new FormData;return Object.keys(i).forEach(e=>c.append(e,i[e])),c.append("file",e,e.name),await this.request(o,{method:"POST",body:c}),this.shouldConfirmUpload&&await this.confirmRequest(a),{success:!0,asset:{id:a,name:s,size:l,displayURL:u,url:u,path:u}}}catch(e){throw console.error(e),e}}}const Go=function(){let e=null;return(t,n,r)=>(e||(e=function(e,t){let n=(0,Ve.Map)({});return e.get("providers").forEach((e,r)=>{switch(r){case"algolia":n=n.set("algolia",new qo(e));break;case"assetStore":n=n.set("assetStore",new Ko(e,t))}}),n}(t,n)),e.get(r))}(),Yo="SEARCH_ENTRIES_REQUEST",Qo="SEARCH_ENTRIES_SUCCESS",Jo="SEARCH_ENTRIES_FAILURE",Xo="QUERY_REQUEST",Zo="QUERY_SUCCESS",ei="QUERY_FAILURE",ti="SEARCH_CLEAR",ni="CLEAR_REQUESTS";function ri(){return{type:ti}}function oi(e,t,n,r,o,i){return async(a,s)=>{const l=s(),u=Iu(l.config),c=wc(l,t,"search"),f=l.collections.find(e=>e.get("name")===t);a({type:ni});const d=`${t}-${n.join()}-${r}-${o}-${i}`,p=l.search.requests.find(({id:e})=>e==d),h=p?p.queryResponse:c?Go(l.integrations,u.getToken,c).searchBy(n.map(e=>`data.${e}`),t,r):u.query(f,n,r,o,i);a(function(e,t){return{type:Xo,payload:{searchTerm:e,request:t}}}(r,p?void 0:{id:d,expires:new Date((new Date).getTime()+1e4),queryResponse:h}));try{const t=await h;return a(function(e,t){return{type:Zo,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){return a(function(e){return{type:ei,payload:{error:e}}}(e))}}}function ii(e,t){return new ln.Cursor(e.getIn(["cursorsByType","collectionEntries",t]))}var ai=__webpack_require__(3668),si=__webpack_require__.n(ai);function li(e,t,n){let r=t.reduce((t,r)=>{const o=r.get("name"),i=e.get(o),a=dr(r.get("widget")),s=r.get("fields");return s&&Ve.List.isList(i)?t.set(o,i.map(e=>li(e,s,n))):s&&Ve.Map.isMap(i)?t.set(o,li(i,s,n)):a&&!si()(i)?t.set(o,a[n](i)):si()(i)?t:t.set(o,i)},(0,Ve.Map)());return r=e.mergeDeep(r),r}const ui="PRESENCE",ci="CUSTOM";function fi({predicate:e,run:t}){return{type:He,predicate:e,run:t}}async function di(e,t,n=3e4){let r=!1;const o=new Promise(n=>{e(fi(t(n)))}),i=new Promise(e=>{setTimeout(()=>{r?e():(console.warn("Wait Action timed out"),e(null))},n)});return await Promise.race([o.then(e=>(r=!0,e)).catch(null),i])}const pi="NOTIFICATION_SEND",hi="NOTIFICATION_DISMISS",gi="NOTIFICATION_CLEAR";function mi(e){return{type:pi,payload:e}}function yi(e){return{type:hi,id:e}}const vi=["jpg","jpeg","png","webp"];function bi(e){const t=e.format?.toLowerCase();return{...e,format:"jpeg"===t?"jpg":t}}function wi(e,t){const n=function(e){const t=function(e){return"function"==typeof e?.get}(e)?e.get("image_transformations"):e?.image_transformations;return t?.toJS?t.toJS():t}(t)??e.image_transformations;if(n)return Array.isArray(n)?{keepOriginal:!0,variants:n.map(bi)}:{keepOriginal:n.keep_original??!0,variants:(n.variants||[]).map(bi)}}function xi(e,t){return!!t&&t.variants.length>0&&e.type.startsWith("image/")&&"image/svg+xml"!==e.type}function Si(e){switch(e){case"jpg":case"jpeg":return"image/jpeg";case"webp":return"image/webp";default:return"image/png"}}function ki(e,t,n){const r=(0,ln.basename)(e),o=e.slice(0,Math.max(0,e.length-r.length));return(0,un.join)(o,"_transformations",t,n)}const _i="MEDIA_LIBRARY_OPEN",Ei="MEDIA_LIBRARY_CLOSE",Ci="MEDIA_LIBRARY_CREATE",Oi="MEDIA_INSERT",Ti="MEDIA_REMOVE_INSERTED",Pi="MEDIA_LOAD_REQUEST",Ri="MEDIA_LOAD_SUCCESS",Mi="MEDIA_LOAD_FAILURE",Ai="MEDIA_PERSIST_REQUEST",Ii="MEDIA_PERSIST_SUCCESS",Di="MEDIA_PERSIST_FAILURE",ji="MEDIA_DELETE_REQUEST",Li="MEDIA_DELETE_SUCCESS",Ni="MEDIA_DELETE_FAILURE",$i="MEDIA_DISPLAY_URL_REQUEST",Fi="MEDIA_DISPLAY_URL_SUCCESS",zi="MEDIA_DISPLAY_URL_FAILURE";function Bi(e){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");r&&r.onClearControl({id:e})}}function Ui(e){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");r&&r.onRemoveControl({id:e})}}function qi(e={}){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");if(r){const{controlID:t,value:n,config:o=(0,Ve.Map)(),allowMultiple:i,forImage:a}=e;r.show({id:t,value:n,config:o.toJS(),allowMultiple:i,imagesOnly:a})}t(function(e){return{type:_i,payload:e}}(e))}}function Wi(e,t){return(n,r)=>{const o=r(),i=o.config,a=o.entryDraft.get("entry"),s=o.entryDraft.getIn(["entry","collection"]),l=o.collections.get(s);n(function(e){return{type:Oi,payload:{mediaPath:e}}}(e=Array.isArray(e)?e.map(e=>_l(i,l,e,a,t)):_l(i,l,e,a,t)))}}function Hi(e){return{type:Ti,payload:{controlID:e}}}function Vi(e={}){const{delay:t=0,query:n="",page:r=1,privateUpload:o}=e;return async(e,i)=>{const a=i(),s=Iu(a.config),l=wc(a,null,"assetStore");if(l){const t=Go(a.integrations,s.getToken,l);e(Ji(r));try{const i=await t.retrieve(n,r,o);return e(Xi(i,{page:r,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:n,privateUpload:o}))}catch(t){return e(Zi({privateUpload:o}))}}function u(){return s.getMedia().then(t=>e(Xi(t))).catch(t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(Xi([]))):e(Zi())})}return e(Ji(r)),t>0?new Promise(e=>{setTimeout(()=>e(u()),t)}):u()}}function Ki({id:e,file:t,assetProxy:n,draft:r}){return{id:e,name:(0,ln.basename)(n.path),displayURL:n.url,draft:r,file:t,size:t.size,url:n.url,path:n.path,field:n.field}}function Gi(e,t={}){const{privateUpload:n,field:r}=t;return async(t,o)=>{const i=o(),a=Iu(i.config),s=wc(i,null,"assetStore"),l=la(i,r),u=ko(e.name.toLowerCase(),i.config.slug),c=s?void 0:wi(i.config,r),f=!xi(e,c)||c?.keepOriginal,d=l.find(e=>e.name.toLowerCase()===u),p=El(i.entryDraft);if(!s&&f&&d){if(!window.confirm(`${d.name} already exists. Do you want to replace it?`))return;await t(Yi(d,{privateUpload:n}))}!s&&p||t({type:Ai});try{let o,l;if(s)try{const t=Go(i.integrations,a.getToken,s),r=await t.upload(e,n);o=[{file:e,assetProxy:_n({url:r.asset.url,path:r.asset.url})}]}catch(t){o=[{file:e,assetProxy:_n({file:e,path:u})}]}else{if(n)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=i.entryDraft.get("entry"),n=i.collections.get(t?.get("collection")),a=kl(i.config,n,t,u,r),s=await async function({file:e,fileName:t,path:n,config:r,field:o}){const i=wi(r,o);return xi(e,i)?function(e){const t=e.findIndex(e=>e.default),n=e.findIndex(e=>e.original),r=t>=0?t:n;if(r<0)return e;const o=e[r];return[...e.slice(0,r),...e.slice(r+1),o]}(await async function(e,t,n){const r=await __webpack_require__.e(20).then(__webpack_require__.bind(__webpack_require__,65020)),o=r.default;await o();const i=r.PhotonImage.new_from_blob(e);try{const o=n.variants.map(n=>{const{width:o,height:a}=function(e,t){const n=e.get_width(),r=e.get_height();if(t.keep_original_size||!t.width&&!t.height)return{width:n,height:r};if(t.width&&t.height){const e=Math.min(t.width/n,t.height/r);return{width:Math.round(n*e),height:Math.round(r*e)}}if(t.width)return{width:t.width,height:Math.round(r*t.width/n)};const o=t.height;return{width:Math.round(n*o/r),height:o}}(i,n),s=o===i.get_width()&&a===i.get_height()?i:r.resize(i,o,a,r.SamplingFilter.Lanczos3),l=function(e,t){const n=(0,ln.fileExtension)(e).toLowerCase(),r=t.format||n;return vi.includes(r)?r:"png"}(e.name,n),u=function(e,t){const n=(0,ln.fileExtensionWithSeparator)(e);return`${n?(0,ln.basename)(e,n):(0,ln.basename)(e)}.${"jpeg"===t?"jpg":t}`}(e.name,l),c=function(e,t,n=75){return"jpg"===t||"jpeg"===t?e.get_bytes_jpeg(n):"webp"===t?e.get_bytes_webp():e.get_bytes()}(s,l,n.quality),f=new File([c],u,{type:Si(l)});return s!==i&&s.free(),{file:f,path:ki(t,n.name,u),default:n.default}});return n.keepOriginal?[{file:e,path:t,original:!0},...o]:o}finally{i.free()}}(e,n,i)).map(e=>({file:e.file,path:e.path||t})):[{file:e,path:n}]}({file:e,fileName:u,path:a,config:i.config,field:r});o=s.map(e=>({file:e.file,assetProxy:_n({file:e.file,path:e.path,field:r})}))}}for(const{file:e,assetProxy:r}of o){let o;if(t(ya(r)),s)o=Ki({id:await(0,ln.getBlobSHA)(e),file:e,assetProxy:r,draft:!1});else{if(p){o=Ki({id:await(0,ln.getBlobSHA)(e),file:e,assetProxy:r,draft:p}),l=t(Ns(o));continue}o=await a.persistMedia(i.config,r)}l=t(ea(o,{privateUpload:n}))}return l}catch(e){return console.error(e),t(mi({message:`Failed to persist media: ${e}`,type:"error",dismissAfter:8e3})),t(function(e={}){const{privateUpload:t}=e;return{type:Di,payload:{privateUpload:t}}}({privateUpload:n}))}}}function Yi(e,t={}){const{privateUpload:n}=t;return async(t,r)=>{const o=r(),i=Iu(o.config),a=wc(o,null,"assetStore");if(a){const r=Go(o.integrations,i.getToken,a);t(ta());try{return await r.delete(e.id),t(na(e,{privateUpload:n}))}catch(e){return console.error(e),t(mi({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(ra({privateUpload:n}))}}try{if(e.draft)t(va(e.path)),t($s({id:e.id}));else{const n=El(o.entryDraft);t(ta()),t(va(e.path)),await i.deleteMedia(o.config,e.path),t(na(e)),n&&t($s({id:e.id}))}}catch(e){return console.error(e),t(mi({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(ra())}}}function Qi(e){return async(t,n)=>{const{displayURL:r,id:o}=e,i=n(),a=ua(i,o);if(!o||!r||a.get("url")||a.get("isFetching")||a.get("err"))return Promise.resolve();if("string"==typeof r)return t(oa(o)),void t(ia(o,r));try{const e=Iu(i.config);t(oa(o));const n=await e.getMediaDisplayURL(r);if(!n)throw new Error("No display URL was returned!");t(ia(o,n))}catch(e){console.error(e),t(function(e,t){return{type:zi,payload:{key:e,err:t}}}(o,e))}}}function Ji(e){return{type:Pi,payload:{page:e}}}function Xi(e,t={}){return{type:Ri,payload:{files:e,...t}}}function Zi(e={}){const{privateUpload:t}=e;return{type:Mi,payload:{privateUpload:t}}}function ea(e,t={}){const{privateUpload:n}=t;return{type:Ii,payload:{file:e,privateUpload:n}}}function ta(){return{type:ji}}function na(e,t={}){const{privateUpload:n}=t;return{type:Li,payload:{file:e,privateUpload:n}}}function ra(e={}){const{privateUpload:t}=e;return{type:Ni,payload:{privateUpload:t}}}function oa(e){return{type:$i,payload:{key:e}}}function ia(e,t){return{type:Fi,payload:{key:e,url:t}}}async function aa(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await di(e,e=>({predicate:({type:e})=>e===Ri||e===Mi,run:()=>e()}))}const sa={isVisible:!1,showMediaButton:!0,controlMedia:(0,Ve.Map)(),displayURLs:(0,Ve.Map)(),config:(0,Ve.Map)()};function la(e,t){const{mediaLibrary:n,entryDraft:r}=e,o=El(e.entryDraft),i=wc(e,null,"assetStore");let a;if(o&&!i){const n=r.getIn(["entry","mediaFiles"],(0,Ve.List)()).toJS(),o=r.get("entry"),i=e.collections.get(o?.get("collection")),s=Sl(e.config,i,o,t);a=n.filter(e=>(0,un.dirname)(e.path)===s).map(e=>({key:e.id,...e}))}else a=n.get("files")||[];return a}function ua(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,Ve.Map)())}const ca="ADD_ASSETS",fa="ADD_ASSET",da="REMOVE_ASSET",pa="LOAD_ASSET_REQUEST",ha="LOAD_ASSET_SUCCESS",ga="LOAD_ASSET_FAILURE";function ma(e){return{type:ca,payload:e}}function ya(e){return{type:fa,payload:e}}function va(e){return{type:da,payload:e}}const ba=_n({path:"empty.svg",file:new File(['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],"empty.svg",{type:"image/svg+xml"})});function wa(e,t,n){return function(r,o){return e(xa({collection:t,entry:n,path:r,field:o}))}}function xa({collection:e,entry:t,path:n,field:r}){return(o,i)=>{if(!n)return ba;const a=i(),s=kl(a.config,e,t,n,r);let{asset:l,isLoading:u,error:c}=a.medias[s]||{};return u?ba:l||((0,ln.isAbsolutePath)(s)||c?(l=_n({path:s,url:n}),o(ya(l))):(o(function(e){return async(t,n)=>{try{t({type:pa,payload:{path:e}}),await aa(t,n());const i=(r=n(),o=e,la(r).find(e=>e.path===o));if(i){const r=await async function(e,t,n){const r=ua(t,n.id);let o;if(r.get("url"))o=r.get("url");else if(r.get("err"))o=null;else{const t=n.id,i=di(e,e=>({predicate:({type:e,payload:n})=>(e===Fi||e===zi)&&n.key===t,run:(t,n,r)=>e(r.payload.url)}));r.get("isFetching")||e(Qi(n)),o=await i??null}return o}(t,n(),i);t(ya(_n({path:e,url:r||e})))}else{const{url:r}=await async function(e,t){const n=Iu(e.config),{url:r}=await n.getMediaFile(t);return{url:r}}(n(),e);t(ya(_n({path:e,url:r})))}t(function(e){return{type:ha,payload:{path:e}}}(e))}catch(n){t(function(e,t){return{type:ga,payload:{path:e,error:t}}}(e,n))}var r,o}}(s)),l=ba),l)}}const Sa=function(e){void 0===e&&(e={}),fe||re(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,o=void 0===r?de:r,i=n.hashType,a=void 0===i?"slash":i,s=e.basename?se(oe(e.basename)):"",l=he[a],u=l.encodePath,c=l.decodePath;function f(){var e=c(me());return s&&(e=ae(e,s)),ue(e)}var p=ce();function h(e){d(C,e),C.length=t.length,p.notifyListeners(C.location,C.action)}var g=!1,m=null;function y(){var e=me(),t=u(e);if(e!==t)ye(t);else{var n=f(),r=C.location;if(!g&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(r,n))return;if(m===le(n))return;m=null,function(e){if(g)g=!1,h();else{p.confirmTransitionTo(e,"POP",o,function(t){t?h({action:"POP",location:e}):function(e){var t=C.location,n=x.lastIndexOf(le(t));-1===n&&(n=0);var r=x.lastIndexOf(le(e));-1===r&&(r=0);var o=n-r;o&&(g=!0,S(o))}(e)})}}(n)}}var v=me(),b=u(v);v!==b&&ye(b);var w=f(),x=[le(w)];function S(e){t.go(e)}var k=0;function _(e){1===(k+=e)&&1===e?window.addEventListener(pe,y):0===k&&window.removeEventListener(pe,y)}var E=!1,C={length:t.length,action:"POP",location:w,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=ge(window.location.href)),n+"#"+u(s+le(e))},push:function(e,t){var n="PUSH",r=ue(e,void 0,void 0,C.location);p.confirmTransitionTo(r,n,o,function(e){if(e){var t=le(r),o=u(s+t);if(me()!==o){m=t,function(e){window.location.hash=e}(o);var i=x.lastIndexOf(le(C.location)),a=x.slice(0,i+1);a.push(t),x=a,h({action:n,location:r})}else h()}})},replace:function(e,t){var n="REPLACE",r=ue(e,void 0,void 0,C.location);p.confirmTransitionTo(r,n,o,function(e){if(e){var t=le(r),o=u(s+t);me()!==o&&(m=t,ye(o));var i=x.indexOf(le(C.location));-1!==i&&(x[i]=t),h({action:n,location:r})}})},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return E||(_(1),E=!0),function(){return E&&(E=!1,_(-1)),t()}},listen:function(e){var t=p.appendListener(e);return _(1),function(){_(-1),t()}}};return C}();function ka(e){return Sa.push(`/collections/${e}`)}function _a(e){return Sa.replace(`/collections/${e}/new`)}function Ea(e,t){return Sa.replace(`/collections/${e}/entries/${t}`)}const Ca="UNPUBLISHED_ENTRY_REQUEST",Oa="UNPUBLISHED_ENTRY_SUCCESS",Ta="UNPUBLISHED_ENTRY_REDIRECT",Pa="UNPUBLISHED_ENTRIES_REQUEST",Ra="UNPUBLISHED_ENTRIES_SUCCESS",Ma="UNPUBLISHED_ENTRY_PERSIST_REQUEST",Aa="UNPUBLISHED_ENTRY_PERSIST_SUCCESS",Ia="UNPUBLISHED_ENTRY_PERSIST_FAILURE",Da="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",ja="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",La="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",Na="UNPUBLISHED_ENTRY_PUBLISH_REQUEST",$a="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",Fa="UNPUBLISHED_ENTRY_PUBLISH_FAILURE",za="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function Ba(e,t){return{type:Ra,payload:{entries:e,pages:t}}}function Ua(e,t){return{type:Ma,payload:{collection:e.get("name"),slug:t}}}function qa(e,t){return{type:Aa,payload:{collection:e.get("name"),entry:t}}}function Wa(e,t,n){return{type:Ia,payload:{error:e,collection:t.get("name"),slug:n},error:e}}function Ha(e,t){return async(n,r)=>{const o=r(),i=Iu(o.config);if(!nn()(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await i.unpublishedEntries(o.collections);n(Ba(e,t))}catch(e){}n(function(e,t){return{type:Ca,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const r=await i.unpublishedEntry(o,e,t),a=await Promise.all(r.mediaFiles.filter(e=>e.draft).map(({url:e,file:t,path:n})=>_n({path:n,url:e,file:t})));n(ma(a)),n(function(e,t){return{type:Oa,payload:{collection:e.get("name"),entry:t}}}(e,r)),n(js(r))}catch(r){r.name===ln.EDITORIAL_WORKFLOW_ERROR&&r.notUnderEditorialWorkflow?(n(function(e,t){return{type:Ta,payload:{collection:e.get("name"),slug:t}}}(e,t)),n(Fs(e,t))):n(mi({message:{key:"ui.toast.onFailToLoadEntries",details:r},type:"error",dismissAfter:8e3}))}}}function Va(e){return(t,n)=>{const r=n(),o=Iu(r.config),i=nn()(r.editorialWorkflow.toJS(),"pages.ids",!1);r.config.publish_mode!==Pr||i||(t({type:Pa}),o.unpublishedEntries(e).then(e=>t(Ba(e.entries,e.pagination))).catch(e=>{t(mi({message:{key:"ui.toast.onFailToLoadEntries",details:e},type:"error",dismissAfter:8e3})),t(function(e){return{type:"UNPUBLISHED_ENTRIES_FAILURE",error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)}))}}function Ka(e,t,n,r){return(o,i)=>{if(n===r)return;const a=i(),s=Iu(a.config);o(function(e,t){return{type:Da,payload:{collection:e,slug:t}}}(e,t)),s.updateUnpublishedEntryStatus(e,t,r).then(()=>{o(mi({message:{key:"ui.toast.entryUpdated"},type:"success",dismissAfter:4e3})),o(function(e,t,n){return{type:ja,payload:{collection:e,slug:t,newStatus:n}}}(e,t,r))}).catch(n=>{o(mi({message:{key:"ui.toast.onFailToUpdateStatus",details:n},type:"error",dismissAfter:8e3})),o(function(e,t){return{type:La,payload:{collection:e,slug:t}}}(e,t))})}}function Ga(e,t){return(n,r)=>{const o=r(),i=Iu(o.config);return n(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t}}}(e,t)),i.deleteUnpublishedEntry(e,t).then(()=>{n(mi({message:{key:"ui.toast.onDeleteUnpublishedChanges"},type:"success",dismissAfter:4e3})),n(function(e,t){return{type:za,payload:{collection:e,slug:t}}}(e,t))}).catch(r=>{n(mi({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:r},type:"error",dismissAfter:8e3})),n(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t}}}(e,t))})}}function Ya(e,t){return async(n,r)=>{const o=r(),i=o.collections,a=Iu(o.config),s=vc(o,e,t);n(function(e,t){return{type:Na,payload:{collection:e,slug:t}}}(e,t));try{await a.publishUnpublishedEntry(s),n(Vi()),n(mi({message:{key:"ui.toast.entryPublished"},type:"success",dismissAfter:4e3})),n(function(e,t){return{type:$a,payload:{collection:e,slug:t}}}(e,t));const r=i.get(e);if(!r.has("nested"))return n(Fs(r,t));{n(qs(r));const e=Tu(r,s.get("path"));Fs(r,e),t!==e&&El(o.entryDraft)&&Ea(r.get("name"),e)}}catch(r){n(mi({message:{key:"ui.toast.onFailToPublishEntry",details:r},type:"error",dismissAfter:8e3})),n(function(e,t){return{type:Fa,payload:{collection:e,slug:t}}}(e,t))}}}const Qa=(0,Ve.Map)({entry:(0,Ve.Map)(),fieldsMetaData:(0,Ve.Map)(),fieldsErrors:(0,Ve.Map)(),hasChanged:!1,key:""});function Ja(e,t){if(!ql(e))return;const n=t.getIn(["entry","meta"]),r=n&&n.get("path");if(!r)return;const o=Al(e),i=nn()(e.toJS(),["meta","path","index_file"]);if(i)return(0,un.join)(e.get("folder"),r,`${i}.${o}`);const a=t.getIn(["entry","newRecord"]),s=t.getIn(["entry","path"]);let l;if(a||!s){const e=t.getIn(["entry","data"]);l=(u=e&&e.get("title"))&&ko(u.toString().toLowerCase().trim(),{sanitize_replacement:"-",encoding:"unicode"})||"untitled"}else l=(0,un.basename)(s,`.${o}`);var u;return(0,un.join)(e.get("folder"),r,`${l}.${o}`)}const Xa="ENTRY_REQUEST",Za="ENTRY_SUCCESS",es="ENTRY_FAILURE",ts="ENTRIES_REQUEST",ns="ENTRIES_SUCCESS",rs="ENTRIES_FAILURE",os="SORT_ENTRIES_REQUEST",is="SORT_ENTRIES_SUCCESS",as="SORT_ENTRIES_FAILURE",ss="FILTER_ENTRIES_REQUEST",ls="FILTER_ENTRIES_SUCCESS",us="FILTER_ENTRIES_FAILURE",cs="GROUP_ENTRIES_REQUEST",fs="GROUP_ENTRIES_SUCCESS",ds="GROUP_ENTRIES_FAILURE",ps="DRAFT_CREATE_FROM_ENTRY",hs="DRAFT_CREATE_EMPTY",gs="DRAFT_DISCARD",ms="DRAFT_CHANGE_FIELD",ys="DRAFT_VALIDATION_ERRORS",vs="DRAFT_CLEAR_ERRORS",bs="DRAFT_LOCAL_BACKUP_RETRIEVED",ws="DRAFT_CREATE_FROM_LOCAL_BACKUP",xs="DRAFT_CREATE_DUPLICATE_FROM_ENTRY",Ss="ENTRY_PERSIST_REQUEST",ks="ENTRY_PERSIST_SUCCESS",_s="ENTRY_PERSIST_FAILURE",Es="ENTRY_DELETE_SUCCESS",Cs="ADD_DRAFT_ENTRY_MEDIA_FILE",Os="REMOVE_DRAFT_ENTRY_MEDIA_FILE",Ts="CHANGE_VIEW_STYLE";function Ps(e){return{type:ts,payload:{collection:e.get("name")}}}function Rs(e,t,n,r,o=!0){return{type:ns,payload:{collection:e.get("name"),entries:t,page:n,cursor:ln.Cursor.create(r),append:o}}}function Ms(e,t){return{type:rs,error:"Failed to load entries",payload:t.toString(),meta:{collection:e.get("name")}}}async function As(e,t){const n=Iu(e.config),r=wc(e,t.get("name"),"listEntries"),o=r?Go(e.integrations,n.getToken,r):n;return await o.listAllEntries(t)}function Is(e,t,n=Xr.Ascending){return async(r,o)=>{const i=o(),a=yl(i.entries,e.get("name"));if(r({type:os,payload:{collection:e.get("name"),key:t,direction:n}}),!a)try{const o=await As(i,e);r({type:is,payload:{collection:e.get("name"),key:t,direction:n,entries:o}})}catch(o){r({type:as,payload:{collection:e.get("name"),key:t,direction:n,error:o}})}}}function Ds(e,t){return{type:Es,payload:{collectionName:e.get("name"),entrySlug:t}}}function js(e){return{type:ps,payload:{entry:e}}}function Ls(e){return{type:vs,payload:{uniqueFieldId:e}}}function Ns(e){return{type:Cs,payload:e}}function $s({id:e}){return{type:Os,payload:{id:e}}}function Fs(e,t){return async(n,r)=>{await aa(n,r()),n(function(e,t){return{type:Xa,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const o=await zs(r(),e,t);n(function(e,t){return{type:Za,payload:{collection:e.get("name"),entry:t}}}(e,o)),n(js(o))}catch(r){n(mi({message:{details:r.message,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),n(function(e,t,n){return{type:es,payload:{error:e,collection:t.get("name"),slug:n}}}(r,e,t))}}}async function zs(e,t,n){const r=Iu(e.config);return await r.getEntry(e,t,n)}const Bs=(0,Ve.fromJS)({append_next:{action:"next",append:!0}});function Us(e){return ln.Cursor.create(e).updateStore("actions",e=>e.union(Bs.filter(t=>e.has(t.get("action"))).keySeq()))}function qs(e,t=0){return async(n,r)=>{if(e.get("isFetching"))return;const o=r(),i=dl(o.entries,e.get("name"));if(i&&i.length>0){const t=i[0];return n(Is(e,t.get("key"),t.get("direction")))}const a=function(e){const t=e.get("sortable_fields").toArray().find(e=>void 0!==e.get("default_sort"));if(!t)return null;const n=t.get("field"),r=t.get("default_sort");let o;return o=!0===r||"asc"===r?"asc":"desc"===r?"desc":"asc",{field:n,direction:o}}(e);if(a){const t="desc"===a.direction?Xr.Descending:Xr.Ascending;return n(Is(e,a.field,t))}const s=Iu(o.config),l=wc(o,e.get("name"),"listEntries"),u=l?Go(o.integrations,s.getToken,l):s,c=!!(t&&!isNaN(t)&&t>0);n(Ps(e));try{const r=e.has("nested")||Kl(e);let o=await(r?u.listAllEntries(e).then(e=>({entries:e})):u.listEntries(e,t));o={...o,cursor:l?ln.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):ln.Cursor.create(o.cursor)},n(Rs(e,o.cursor.meta.get("usingOldPaginationAPI")?o.entries.reverse():o.entries,o.pagination,Us(o.cursor),c))}catch(t){return n(mi({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(n(Ms(e,t)))}}}function Ws(e){return!!["true","True","TRUE"].includes(e)||!["false","False","FALSE"].includes(e)&&function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(e)}function Hs(e,t=()=>!1){return e.reduce((e,n)=>{const r=e,o=n;if(t(o))return r;const i=o.get("field")||o.get("fields"),a="list"==o.get("widget"),s=o.get("name"),l=o.get("default",null);if(Ve.List.isList(i)||Ve.Map.isMap(i)){if(a&&Ve.List.isList(l))r[s]=l;else{const e=Ve.List.isList(i)?i:(0,Ve.List)([i]),n=a?[Hs(e,t)]:Hs(e,t);u=n,[[{}],{}].some(e=>$o()(u,e))||(r[s]=n)}return r}var u;return null!==l&&(r[s]=l),r},{})}function Vs({entry:e}){return e.get("mediaFiles").toArray().filter(e=>e.get("draft")).map(e=>_n({path:e.get("path"),file:e.get("file"),url:e.get("url"),field:e.get("field")}))}function Ks(e,t){const n=Ml(e,t.get("slug"));function r(e){return function(e,t){return li(e,t,"serialize")}(e,n)}const o=r(t.get("data"));let i=t.set("data",o);return Kl(e)&&(i=function(e,t,n){const{locales:r,defaultLocale:o}=Gl(e);return r.filter(e=>e!==o).forEach(e=>{const r=Xl(e);t=t.setIn(r,n(t.getIn(r)))}),t}(e,i,r)),i}function Gs(e,t,n){return{error:{type:ci,message:n(`editor.editorControlPane.widget.${t}`,{path:e})}}}const Ys="VIEW_STYLE_LIST",Qs="VIEW_STYLE_GRID",{keyToPathArray:Js}=cn.stringTemplate;let Xs,Zs,el,tl,nl;const rl="decap-cms.entries.sort",ol="decap-cms.entries.viewStyle";function il(e){return e?e.replace(/([^:]\/)\/+/g,"$1"):e}const al=Yr()(()=>{const e=localStorage.getItem(rl);if(e)try{const t=JSON.parse(e);let n=(0,Ve.Map)();return Object.entries(t).forEach(([e,t])=>{let r=(0,Ve.OrderedMap)();en()(Object.values(t),["index"]).forEach(e=>{const{key:t,direction:n}=e;r=r.set(t,(0,Ve.fromJS)({key:t,direction:n}))}),n=n.set(e,r)}),n}catch(e){return(0,Ve.Map)()}return(0,Ve.Map)()});function sl(e){if(e){const t={};e.keySeq().forEach(n=>{const r=n;e.get(r).valueSeq().toJS().map((e,t)=>({...e,index:t})).forEach(e=>{on()(t,[r,e.key],e)})}),localStorage.setItem(rl,JSON.stringify(t))}else localStorage.removeItem(rl)}const ll=Yr()(()=>localStorage.getItem(ol)||(localStorage.setItem(ol,Ys),Ys));function ul(e,t){const n=e.get("sort");return n?.get(t)}function cl(e,t){const n=e.get("filter");return n?.get(t)||(0,Ve.Map)()}function fl(e,t){const n=e.get("group");return n?.get(t)||(0,Ve.Map)()}function dl(e,t){const n=ul(e,t),r=n?.valueSeq().filter(e=>e?.get("direction")!==Xr.None).toArray()||[];return r}function pl(e,t,n){return e.getIn(["entities",`${t}.${n}`])}function hl(e,t){return e.getIn(["pages",t,"ids"],(0,Ve.List)())}function gl(e,t){const n=hl(e,t),r=n&&n.map(n=>pl(e,t,n));return r}function ml(e,t){const n=t.get("name");let r=gl(e,n);const o=dl(e,n);if(o&&o.length>0){const e=o.map(e=>function(e,t){return t===Wr?"updatedOn":t!==qr||$l(e,t)?`data.${t}`:"author"}(t,e.get("key"))),n=o.map(e=>e.get("direction")===Xr.Ascending?"asc":"desc");r=(0,Ve.fromJS)(Jr()(r.toJS(),e,n))}const i=function(e,t){const n=cl(e,t),r=n?.valueSeq().filter(e=>!0===e?.get("active")).toArray()||[];return r}(e,n);return i&&i.length>0&&(r=r.filter(e=>{const t=i.every(t=>{const n=t.get("pattern"),r=t.get("field"),o=(e.get("data")||(0,Ve.Map)()).getIn(Js(r));return void 0!==o&&new RegExp(String(n)).test(String(o))});return t}).toList()),r}function yl(e,t){return e.getIn(["pages",t,"isFetching"],!1)}function vl(e,t){const n=e.find(e=>e?.get("name")===t);return n}function bl(e,t,n,r){if(!t)return!1;if(r&&r.has(e))return!0;if(t.has("files")){const r=vl(t.get("files"),n);if(r&&r.has(e))return!0}return!!t.has(e)}function wl(e,t,n,r,o,i,a){const s=i.filter(e=>e===o)[0];if(s)return Lo(s.has(e)?s.get(e):`{{${e}}}`,r,n,a,e,t.slug);for(let s of i){s.has(e)||(s=s.set(e,`{{${e}}}`));const i=Lo(s.get(e),r,n,a,e,t.slug);let l=null;if(s.has("fields")?l=wl(e,t,n,r,o,s.get("fields").toArray(),i):s.has("field")?l=wl(e,t,n,r,o,[s.get("field")],i):s.has("types")&&(l=wl(e,t,n,r,o,s.get("types").toArray(),i)),null!=l)return l}return null}function xl(e,t,n,r,o){let i=t[e];if(n.has(e)||(n=n.set(e,`{{${e}}}`)),n.has("files")){i=Lo(n.get(e),r,n,i,e,t.slug);let a=vl(n.get("files"),r?.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),i=Lo(a.get(e),r,n,i,e,t.slug),o)){const s=wl(e,t,n,r,o,a.get("fields").toArray(),i);null!==s&&(i=s)}}else if(i=Lo(n.get(e),r,n,i,e,t.slug),o){const a=wl(e,t,n,r,o,n.get("fields").toArray(),i);null!==a&&(i=a)}return i}function Sl(e,t,n,r){const o="media_folder";let i=e[o];if(bl(o,t,n?.get("slug"),r)){const a=xl(o,e,t,n,r);if(a.startsWith("/"))i=(0,un.join)(a);else{const e=n?.get("path");i=e?(0,un.join)((0,un.dirname)(e),a):t.get("folder")}}return Xt()(i,"/")}function kl(e,t,n,r,o){if((0,ln.isAbsolutePath)(r))return r;const i=Sl(e,t,n,o);return(0,un.join)(i,(0,ln.basename)(r))}function _l(e,t,n,r,o){if((0,ln.isAbsolutePath)(n))return n;const i="public_folder";let a=il(e[i]);return bl(i,t,r?.get("slug"),o)&&(a=il(xl(i,e,t,r,o))),(0,ln.isAbsolutePath)(a)?function(e,...t){return so()(e,...t)}(a,(0,ln.basename)(n)):(0,un.join)(a,(0,ln.basename)(n))}function El(e){const t=e.get("entry");return t&&!t.isEmpty()}const{keyToPathArray:Cl}=cn.stringTemplate,Ol=(0,Ve.fromJS)({}),Tl={[Ur]:{entryExtension(e){const t=e.get("extension")||nn()({...wr,...vr()},e.get("format")||"frontmatter");if(!t)throw new Error(`No extension found for format ${e.get("format")}`);return t.replace(/^\./,"")},fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){const n=e.get("folder").replace(/\/$/,""),r=t.split(n+"/").pop()?.replace(new RegExp(`\\.${zr()(this.entryExtension(e))}$`),"");return r},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[Br]:{fileForEntry(e,t){const n=e.get("files");return n&&n.filter(e=>e?.get("name")===t).get(0)},fields(e,t){const n=this.fileForEntry(e,t);return n&&n.get("fields")},entryPath(e,t){const n=this.fileForEntry(e,t);return n&&n.get("file")},entrySlug(e,t){const n=e.get("files").filter(e=>e?.get("file")===t).get(0);return n&&n.get("name")},entryLabel(e,t){const n=this.fileForEntry(e,t);return n&&n.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}};function Pl(e){const t=e.reduce((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){const n=t.get("fields")?.toArray();e=[...e,...Pl(n)]}else if(t.has("field")){const n=t.get("field");e=[...e,...Pl([n])]}else if(t.has("types")){const n=t.get("types")?.toArray();e=[...e,...Pl(n)]}return e},[]);return t}function Rl(e,t){return e.get("files")?.toArray().find(e=>e.get("name")===t)}function Ml(e,t){return Tl[e.get("type")].fields(e,t)}function Al(e){return Tl[Ur].entryExtension(e)}function Il(e,t){return Tl[Br].entryLabel(e,t)}function Dl(e,t){return Tl[e.get("type")].entryPath(e,t)}function jl(e,t){return Tl[e.get("type")].entrySlug(e,t)}function Ll(e){return Tl[e.get("type")].allowDeletion(e)}function Nl(e,t=""){let n=e.map(e=>`${t}${e.get("name")}`);return e.forEach((e,t)=>{if(e.has("fields")){const r=e.get("fields")?.toArray();n=[...n,...Nl(r,`${n[t]}.`)]}else if(e.has("field")){const r=e.get("field");n=[...n,...Nl([r],`${n[t]}.`)]}else if(e.has("types")){const r=e.get("types")?.toArray();n=[...n,...Nl(r,`${n[t]}.`)]}}),n}function $l(e,t){const n=Cl(t);let r,o,i=e.get("fields",(0,Ve.List)()).toArray();for(;(r=n.shift())&&i;)o=i.find(e=>e.get("name")===r),o?.has("fields")?i=o?.get("fields")?.toArray():o?.has("field")?i=[o?.get("field")]:o?.has("types")&&(i=o?.get("types")?.toArray());return o}function Fl(e,t,n=()=>!1){return n()||(e=e.map(e=>{const r=t(e);return n()?r:r.has("fields")?r.set("fields",Fl(r.get("fields"),t,n)):r.has("field")?r.set("field",Fl((0,Ve.List)([r.get("field")]),t,n).get(0)):r.has("types")?r.set("types",Fl(r.get("types"),t,n)):r}).toList()),e}function zl(e){const t=e.get("identifier_field"),n=t?[t,...Vr]:[...Vr],r=Nl(e.get("fields",(0,Ve.List)()).toArray());return n.find(e=>r.find(t=>t.toLowerCase().trim()===e.toLowerCase().trim()))}function Bl(e,t){if("title"===t&&e.get("identifier_field"))return zl(e);const n=Kr[t],r=e.get("fields");let o;if(!r||!n)return null;const i=r.filter(e=>e?.get("widget","string")===n.type).map(e=>e?.get("name"));if(o=i.filter(e=>-1!==n.synonyms.indexOf(e)),o&&o.size>0)return o.first();const a=r.filter(e=>-1!==n.secondaryTypes.indexOf(e?.get("widget","string"))).map(e=>e?.get("name"));return o=a.filter(e=>-1!==n.synonyms.indexOf(e)),o&&o.size>0?o.first():n.fallbackToFirstField&&i.size>0?i.first():(n.showError&&(s=`The Field ${t} is missing for the collection “${e.get("name")}”`,l=`Decap CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`,console.error(`%c ⛔ ${s}\n%c${l}\n\n`,"color: black; font-weight: bold; font-size: 16px; line-height: 50px;","color: black;")),null);var s,l}function Ul(e,t){const n=e.get("summary");if(n)return function(e,t,n){let r=t.get("data");const o=Eo(t,Bl(n,"date"))||null,i=r.getIn(To(zl(n)));return r=Po(t.get("path"),r,n.get("folder")),t.get("author")&&!$l(n,qr)&&(r=r.set(qr,t.get("author"))),t.get("updatedOn")&&!$l(n,Wr)&&(r=r.set(Wr,t.get("updatedOn"))),_o(e,o,i,r)}(n,t,e);if(e.get("type")==Br){const n=Il(e,t.get("slug"));if(n)return n}const r=t.get("data"),o=Bl(e,"title"),i=o&&r.getIn(Cl(o));return i||"title"===o?i:r.getIn(Cl("title"))}function ql(e){return e.has("folder")&&e.get("type")===Ur&&e.has("meta")&&e.get("meta")?.has("path")}const Wl="i18n";let Hl=function(e){return e.MULTIPLE_FOLDERS="multiple_folders",e.MULTIPLE_FILES="multiple_files",e.SINGLE_FILE="single_file",e}({}),Vl=function(e){return e.TRANSLATE="translate",e.DUPLICATE="duplicate",e.NONE="none",e}({});function Kl(e){return e.has(Wl)}function Gl(e){if(!Kl(e))return{};const{structure:t,locales:n,default_locale:r}=e.get(Wl).toJS();return{structure:t,locales:n,defaultLocale:r}}function Yl(e,t,n){return t!==n&&e.get(Wl)===Vl.TRANSLATE}function Ql(e,t,n){return t!==n&&e.get(Wl)===Vl.DUPLICATE}function Jl(e,t,n){return t!==n&&e.get(Wl)===Vl.NONE}function Xl(e){return[Wl,e,"data"]}function Zl(e,t){return e!==t?Xl(e):["data"]}function eu(e,t,n,r,o){switch(e){case Hl.MULTIPLE_FOLDERS:return n.replace(`/${r}`,`/${o}/${r}`);case Hl.MULTIPLE_FILES:return n.replace(new RegExp(`${zr()(t)}$`),`${o}.${t}`);case Hl.SINGLE_FILE:default:return n}}function tu(e,t,n){switch(e){case Hl.MULTIPLE_FOLDERS:{const e=n.split("/");return e.pop(),e.pop()}case Hl.MULTIPLE_FILES:return n.slice(0,-`.${t}`.length).split(".").pop();case Hl.SINGLE_FILE:default:return""}}function nu(e,t,n,r){const{structure:o,locales:i}=Gl(e);return o===Hl.SINGLE_FILE?[n]:i.map(e=>eu(o,t,n,r,e))}function ru(e,t,n){switch(e){case Hl.MULTIPLE_FOLDERS:return t.replace(`${n}/`,"");case Hl.MULTIPLE_FILES:return t.replace(`.${n}`,"");case Hl.SINGLE_FILE:default:return t}}function ou(e,t,n,r){let o=r.find(e=>e.locale===n);o||(o=r[0],console.warn(`Could not locale entry for default locale '${n}'`));const i=r.filter(e=>e.locale!==o.locale).reduce((t,{locale:n,value:r})=>{const i=Xl(n);return o&&function(e,t,n){void 0!==e.get("fields")&&e.get("fields").forEach(e=>{e&&e.get(Wl)===Vl.DUPLICATE&&(t.data[e.get("name")]||(t.data[e.get("name")]=n.data[e.get("name")]))})}(e,r,o.value),on()(t,i,r.data)},{}),a=ru(t,o.value.path,n),s=jl(e,a);return{...o.value,raw:"",...i,path:a,slug:s}}function iu(e,t,n){const r=e.data[t]||{},o=n.filter(e=>e!==t).map(t=>({locale:t,value:e.data[t]})).filter(e=>e.value).reduce((e,t)=>({...e,[t.locale]:{data:t.value}}),{});return{...e,data:r,i18n:o,raw:""}}function au(e,t,n){const{structure:r,defaultLocale:o,locales:i}=Gl(e);if(r===Hl.SINGLE_FILE)return n.map(e=>iu(e,o,i));const a=$r()(n.map(e=>({locale:tu(r,t,e.path),value:e})),({locale:e,value:t})=>ru(r,t.path,e));return Object.values(a).reduce((t,n)=>[...t,ou(e,r,o,n)],[])}function su(e,t,n,r,o=[t.get("name")]){const i=e.getIn(["entry","data",...o]);return t.get(Wl)===Vl.DUPLICATE&&n.filter(e=>e!==r).forEach(t=>{e=e.setIn(["entry",...Zl(t,r),...o],i)}),t.has("field")&&!Ve.List.isList(i)?[t.get("field")].forEach(t=>{e=su(e,t,n,r,[...o,t.get("name")])}):t.has("fields")&&!Ve.List.isList(i)&&t.get("fields").toArray().forEach(t=>{e=su(e,t,n,r,[...o,t.get("name")])}),e}const lu={type:"string",minLength:2,maxLength:10,pattern:"^[a-zA-Z-_]+$"},uu={type:"object",properties:{structure:{type:"string",enum:Object.values(Hl)},locales:{type:"array",minItems:1,items:lu,uniqueItems:!0},default_locale:lu}};Object.values(Vl);Error;function cu(e){const t=(e.integrations||[]).reduce((t,n)=>{const{hooks:r,collections:o,provider:i,...a}=n;if(t.providers[i]={...a},!o)return r.forEach(e=>{t.hooks[e]=i}),t;const s="*"===o?e.collections.map(e=>e.name):o;return s.forEach(e=>{r.forEach(n=>{t.hooks[e]?t.hooks[e][n]=i:t.hooks[e]={[n]:i}})}),t},{providers:{},hooks:{}});return(0,Ve.fromJS)(t)}const fu=(0,Ve.fromJS)({providers:{},hooks:{}});function du(e,t,n){return t?e.getIn(["hooks",t,n],!1):e.getIn(["hooks",n],!1)}const pu="CONFIG_REQUEST",hu="CONFIG_SUCCESS",gu="CONFIG_FAILURE";function mu(e){return{type:gu,error:"Error loading config",payload:e}}function yu(e){return e.locale||"en"}function vu(e){return e.publish_mode===Pr}const bu=Ut((e,t)=>{switch(t.type){case pu:e.isFetching=!0;break;case hu:return{...t.payload,isFetching:!1,error:void 0};case gu:e.isFetching=!1,e.error=t.payload.toString()}},{isFetching:!0}),{extractTemplateVars:wu,dateParsers:xu,expandPath:Su}=cn.stringTemplate;class ku{storageKey="decap-cms-user";retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function _u(e,t){const n="backup";return e?`${n}.${e}${t?`.${t}`:""}`:n}function Eu(e,t){const n=nn()(t.data,e);if(n)return String(n);{const n=e.split(".")[0];return t[n]?t[n]:""}}function Cu(e){return t=>e.reduce((e,n)=>{const r=Eu(n,t);return r?`${e} ${r}`:e},"")}function Ou(e,t){return e.score>t.score?-1:e.score<t.score?1:0}function Tu(e,t){const n=e.get("folder",""),r=t.toLowerCase().replace(n.toLowerCase(),"");return(0,un.join)((0,un.dirname)(Xt()(r,"/")),(0,un.basename)(r,(0,un.extname)(t)))}function Pu(e,t){return ql(t)?(0,un.dirname)(e).slice(t.get("folder").length+1)||"/":e}function Ru(e){let t;return t=e.get("nested")?.get("depth")||(0,ln.getPathDepth)(e.get("path","")),Kl(e)&&(t=function(e,t){const{structure:n}=Gl(e);return n===Hl.MULTIPLE_FOLDERS?t+1:t}(e,t)),t}class Mu{constructor(e,{backendName:t,authStore:n,config:r}){if(this.deleteAnonymousBackup(),this.config=r,this.implementation=e.init(this.config,{useWorkflow:vu(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:Rr.first()}),this.backendName=t,this.authStore=n,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,ln.asyncLock)()}async status(){let e={auth:{status:!0},api:{status:!0,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every(e=>!0===e.status))return e;await new Promise(e=>setTimeout(e,1e3*t))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then(e=>(this.user={...e,backendName:this.backendName},this.authStore.store(this.user),this.user)):Promise.resolve(null)}isGitBackend(){return this.implementation.isGitBackend?.()||!1}updateUserCredentials=e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user={...t,...e},this.authStore.store(this.user),this.user};authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then(e=>(this.user={...e,backendName:this.backendName},this.authStore&&this.authStore.store(this.user),this.user))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}getToken=()=>this.implementation.getToken();async entryExist(e,t,n,r){const o=r&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:n}).catch(e=>e.name===ln.EDITORIAL_WORKFLOW_ERROR&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e));return o||await this.implementation.getEntry(t).then(({data:e})=>e).catch(()=>Promise.resolve(!1))}async generateUniqueSlug(e,t,n,r,o){const i=n.slug;let a;a=o?Tu(e,o):function(e,t,n){const r=e.get("slug")||"{{slug}}",o=t.getIn(To(zl(e)));if(!o)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const i=Do(n),a=Co(t,Bl(e,"date"))||new Date(Date.now()),s=_o(r,a,o,t,i);if(e.has("path")){const n=Io(e.get("path"));return _o(n,a,s,t,e=>e===s?e:i(e))}return s}(e,t,i);let s=1,l=a;for(;r.includes(l)||await this.entryExist(e,Dl(e,l),l,vu(n));)l=`${a}${So(" ",i)}${s++}`;return l}processEntries(e,t){const n=e.map(e=>Bo(t.get("name"),jl(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn,meta:{path:Pu(e.file.path,t)}})).map(this.entryWithFormat(t)),r=t.get("filter"),o=r?this.filterEntries({entries:n},r):n;if(Kl(t)){const e=Al(t);return au(t,e,o)}return o}async listEntries(e){const t=Al(e);let n;const r=e.get("type");if(r===Ur)n=()=>{const n=Ru(e);return this.implementation.entriesByFolder(e.get("folder"),t,n)};else{if(r!==Br)throw new Error(`Unknown collection type: ${r}`);{const t=e.get("files").map(e=>({path:e.get("file"),label:e.get("label")})).toArray();n=()=>this.implementation.entriesByFiles(t)}}const o=await n(),i=ln.Cursor.create(o[ln.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(o,e),pagination:i.meta?.get("page"),cursor:i}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){const t=Ru(e),n=Al(e);return this.implementation.allEntriesByFolder(e.get("folder"),n,t,function(e){let t="";return e.get("path")&&(t=`${e.get("folder")}/${e.get("path")}`.replace(/{{.*}}/gm,"(.*)")),Kl(e)&&(t=function(e,{defaultLocale:t,structure:n}){return n===Hl.MULTIPLE_FOLDERS?`${t}\\/${e}`:n===Hl.MULTIPLE_FILES?`${e}\\.${t}\\..*`:e}(t,Gl(e))),t?new RegExp(t):void 0}(e)).then(t=>this.processEntries(t,e))}const t=await this.listEntries(e),{entries:n}=t;let{cursor:r}=t;for(;r&&r.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(r,"next");n.push(...e),r=t}return n}async search(e,t){const n=[],r=e.map(async e=>{const n=e.get("summary",""),r=wu(n);let o=[];e.get("type")===Br?e.get("files")?.forEach(e=>{const t=e.get("fields").map(e=>e.get("name")).toArray();o=[...o,...t]}):o=[Bl(e,"title"),Bl(e,"shortTitle"),Bl(e,"author"),...r.map(t=>xu[t]?Bl(e,"date"):t)];const i=o.filter(Boolean),a=await this.listAllEntries(e);return an.filter(t,a,{extract:Cu(Qt()(i))})}).map(e=>e.catch(e=>(n.push(e),[]))),o=await Promise.all(r).then(e=>Vt()(e));if(n.length>0)throw new Error({message:"Errors occurred while searching entries locally!",errors:n});const i=o.filter(({score:e})=>e>5).sort(Ou).map(e=>e.original);return{entries:i}}async query(e,t,n,r,o){let i=await this.listAllEntries(e);r&&(i=i.filter(e=>e.slug===r));const a=function(e,t){const n=e.reduce((e,n)=>{const r=t.reduce((e,t)=>{const r=Su({data:n.data,path:t});return e.push(...r),e},[]);for(let t=0;t<r.length;t++)e.push({...n,field:r[t]});return e},[]);return n}(i,t);let s=an.filter(n,a,{extract:e=>Eu(e.field,e)}).sort(Ou).map(e=>e.original);void 0!==o&&o>0&&(s=s.slice(0,o));const l=function(e){const t=e.map(e=>e.field),n={},r=e.reduce((e,t)=>{if(!e[t.slug]){const{field:r,...o}=t;e[t.slug]=o,n[t.slug]=(0,Ve.Set)()}const r=t.field.split(".");let o=e[t.slug].data;for(let e=0;e<r.length;e++)if(o=o[r[e]],Array.isArray(o)){const o=r.slice(0,e+1).join(".");n[t.slug]=n[t.slug].add(o)}return e},{});return Object.keys(r).forEach(e=>{const o=r[e].data;for(const r of n[e].toArray()){const e=nn()(o,r),n=e.filter((e,n)=>t.some(e=>`${e}.`.startsWith(`${r}.${n}.`)));n.sort((n,o)=>{const i=e.indexOf(n),a=e.indexOf(o),s=`${r}.${i}.`,l=`${r}.${a}.`,u=t.findIndex(e=>`${e}.`.startsWith(s)),c=t.findIndex(e=>`${e}.`.startsWith(l));return u-c}),on()(o,r,n)}}),Object.values(r)}(s);return{query:n,hits:l}}traverseCursor(e,t){const[n,r]=e.unwrapData(),o=n.get("collection");return this.implementation.traverseCursor(r,t).then(async({entries:e,cursor:t})=>({entries:this.processEntries(e,o),cursor:ln.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:o})}))}async getLocalDraftBackup(e,t){const n=_u(e.get("name"),t),r=await ln.localForage.getItem(n);if(!r||!r.raw.trim())return{};const{raw:o,path:i}=r;let{mediaFiles:a=[]}=r;a=a.map(e=>e.file?{...e,url:URL.createObjectURL(e.file)}:e);const s=Il(e,t),l=n=>this.entryWithFormat(e)(Bo(e.get("name"),t,i,{raw:n,label:s,mediaFiles:a,meta:{path:Pu(i,e)}})),u=l(o);if(Kl(e)&&r.i18n){const e=function(e,t){const n=Object.entries(e).reduce((e,[n,{raw:r}])=>{const o=t(r);return{...e,[n]:{data:o.data}}},{});return n}(r.i18n,l);u.i18n=e}return{entry:u}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const n=_u(t.get("name"),e.get("slug")),r=this.entryToRaw(t,e);if(!r.trim())return;const o=await Promise.all(e.get("mediaFiles").toJS().map(async e=>{if(e.url?.startsWith("blob:")){const t=await fetch(e.url).then(e=>e.blob());return{...e,file:(0,ln.blobToFileObj)(e.name,t)}}return e}));let i;return Kl(t)&&(i=function(e,t,n){const{locales:r,defaultLocale:o}=Gl(e),i=r.filter(e=>e!==o).reduce((e,r)=>{const i=Zl(r,o),a=t.getIn(i);if(!a)return e;const s=t.set("data",a);return{...e,[r]:{raw:n(s)}}},{});return i}(t,e,e=>this.entryToRaw(t,e))),await ln.localForage.setItem(n,{raw:r,path:e.get("path"),mediaFiles:o,...i&&{i18n:i}}),await ln.localForage.setItem(_u(),r)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{return await this.backupSync.acquire(),await ln.localForage.removeItem(_u(e.get("name"),t)),t&&await ln.localForage.removeItem(_u(e.get("name"))),await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return ln.localForage.removeItem(_u())}async getEntry(e,t,n){const r=Dl(t,n),o=Il(t,n),i=Al(t),a=async r=>{const i=await this.implementation.getEntry(r);let a=Bo(t.get("name"),n,i.file.path,{raw:i.data,label:o,mediaFiles:[],meta:{path:Pu(i.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a};let s;return s=Kl(t)?await async function(e,t,n,r,o){const{structure:i,locales:a,defaultLocale:s}=Gl(e);let l;if(i===Hl.SINGLE_FILE)l=iu(await o(n),s,a);else{const u=await Promise.allSettled(a.map(async e=>{const a=eu(i,t,n,r,e);return{value:await o(a),locale:e}})),c=u.map(e=>"fulfilled"===e.status?e.value:void 0).filter(e=>void 0!==e);if(0===c.length){const[e=new Error("No entry values found for any locale")]=u.map(e=>"rejected"===e.status?e.reason:void 0).filter(e=>void 0!==e);throw e}l=ou(e,i,s,c)}return l}(t,i,r,n,a):await a(r),s}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const n=kr(e,t);if(t&&void 0!==t.raw){const e=n&&Wt()(n.fromFile.bind(n,t.raw))||{};return Gt()(e)&&console.error(e),Object.assign(t,{data:Gt()(e)?{}:e})}return n.fromFile(t)}}async processUnpublishedEntry(e,t,n){const{slug:r}=t;let o;if(e.get("type")===Br){const t=e.get("files").find(e=>e?.get("name")===r);o=(0,un.extname)(t.get("file"))}else o=Al(e);const i=[];if(n){const n=t.diffs.filter(e=>!e.path.endsWith(o)),a=await Promise.all(n.map(t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),r,t.path,t.id)));i.push(...a.map(e=>({...e,draft:!0})))}const a=en()(t.diffs.filter(e=>e.path.endsWith(o)),e=>e.path.length),s=(n,o,a)=>{const s=Bo(e.get("name"),r,o,{raw:n,isModification:!a,label:e&&Il(e,r),mediaFiles:i,updatedOn:t.updatedAt,author:t.pullRequestAuthor,status:t.status,meta:{path:Pu(o,e)}});return this.entryWithFormat(e)(s)},l=async n=>{const r=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,n.path,n.id);return s(r,n.path,n.newFile)};if(a.length<=0){const t=await this.implementation.getEntry(Dl(e,r));return s(t.data,t.file.path,!1)}if(Kl(e)){const t=Dl(e,r),n=function(e,t,n,r,o){const{structure:i}=Gl(e);return i===Hl.SINGLE_FILE?o:nu(e,t,n,r).reduce((e,t)=>{const n=o.find(e=>e.path===t);return n?[...e,n]:[...e,{path:t,id:"",newFile:!1}]},[])}(e,o,t,r,a);let i=await Promise.all(n.map(e=>l(e).catch(()=>null)));return i=i.filter(Boolean),(await au(e,o,i))[0]}return await l(a[0])}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries(),n=(await Promise.all(t.map(async t=>{const n=await this.implementation.unpublishedEntry({id:t}),r=n.collection,o=e.find(e=>e.get("name")===r);return o?await this.processUnpublishedEntry(o,n,!1):(console.warn(`Missing collection '${r}' for unpublished entry '${t}'`),null)}))).filter(Boolean);return{pagination:0,entries:n}}async processEntry(e,t,n){const r=du(e.integrations,null,"assetStore"),o=function(e,t,n){const r=function(e,t){return e.has("folder")?Pl(e.get("fields").toArray()):e.has("files")?Pl(Rl(e,t)?.get("fields").toArray()||[]):[]}(t,n.get("slug")),o=r.map(r=>Sl(e,t,n,r));return t.has("files")&&Rl(t,n.get("slug"))&&o.unshift(Sl(e,t,n,void 0)),t.has("media_folder")&&(t=t.delete("files"),o.unshift(Sl(e,t,n,void 0))),(0,Ve.Set)(o).toArray()}(e.config,t,(0,Ve.fromJS)(n));if(o.length>0&&!r){const e=await Promise.all(o.map(e=>this.implementation.getMedia(e)));n.mediaFiles=n.mediaFiles.concat(...e)}else n.mediaFiles=n.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return n}async unpublishedEntry(e,t,n){const r=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:n});let o=await this.processUnpublishedEntry(t,r,!0);return o=await this.processEntry(e,t,o),o}getDeploy(e,t,n){const r=this.config.site_url;if(r&&!1!==this.config.show_preview_links)return{url:jo(r,e,t,n,this.config.slug),status:"SUCCESS"}}async getDeployPreview(e,t,n,{maxAttempts:r=1,interval:o=5e3,signal:i}={}){if(!this.implementation.getDeployPreview||!1===this.config.show_preview_links)return;let a,s=0;for(;!a&&s<r;){if(i?.aborted)return;s++,a=await this.implementation.getDeployPreview(e.get("name"),t),a||await new Promise(e=>setTimeout(()=>e(void 0),o))}return a?{url:jo(a.url,e,t,n,this.config.slug),status:a.status?a.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:n,assetProxies:r,usedSlugs:o,unpublished:i=!1,status:a}){const s=await this.invokePreSaveEvent(n.get("entry"));let l;l=void 0===s.get("data")?s&&n.setIn(["entry","data"],s)||n:s&&n.setIn(["entry"],s)||n;const u=l.getIn(["entry","newRecord"])||!1,c=vu(e),f=Ja(t,l);let d;if(u){if(!function(e){return Tl[e.get("type")].allowNewEntries(e)}(t))throw new Error("Not allowed to create new entries in this collection");const n=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,o,f),i=f||Dl(t,n);d={path:i,slug:n,raw:this.entryToRaw(t,l.get("entry"))},function(e,t,n,r,o){e.map(e=>{const i=e.path,a=kl(t,n,r.get("entry").set("path",o),i,e.field);e.path=a})}(r,e,t,l,i)}else{const e=l.getIn(["entry","slug"]),n=l.getIn(["entry","path"]);d={path:n,slug:f&&!c?Tu(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f===n?void 0:f}}const{slug:p,path:h,newPath:g}=d;let m=[d];if(Kl(t)){const e=Al(t);m=function(e,t,n,r,o,i,a){const{structure:s,defaultLocale:l,locales:u}=Gl(e);if(s===Hl.SINGLE_FILE){const e=u.reduce((e,t)=>{const r=Zl(t,l);return e.set(t,n.getIn(r))},(0,Ve.Map)({})),c=n.set("data",e);return[{path:eu(s,t,o,i,u[0]),slug:i,raw:r(c),...a&&{newPath:eu(s,t,a,i,u[0])}}]}return u.map(e=>{const u=Zl(e,l),c=n.set("data",n.getIn(u));return{path:eu(s,t,o,i,e),slug:i,raw:c.get("data")?r(c):"",...a&&{newPath:eu(s,t,a,i,e)}}}).filter(e=>e.raw)}(t,e,l.get("entry"),e=>this.entryToRaw(t,e),h,p,g)}const y=await this.currentUser(),v={newEntry:u,commitMessage:Ao(u?"create":"update",e,{collection:t,slug:p,path:h,authorLogin:y.login,authorName:y.name,authorEmail:y.email},y.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:c,hasSubfolders:!1!==t.get("nested")?.get("subfolders"),unpublished:i,status:a};return c||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry({dataFiles:m,assets:r},v),await this.invokePostSaveEvent(l.get("entry")),c||await this.invokePostPublishEvent(l.get("entry")),p}async invokeEventWithEntry(e,t){const{login:n,name:r}=await this.currentUser();return await mr({name:e,data:{entry:t,author:{login:n,name:r}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const n=await this.currentUser(),r={commitMessage:Ao("uploadMedia",e,{path:t.path,authorLogin:n.login,authorName:n.name,authorEmail:n.email},n.useOpenAuthoring)};return this.implementation.persistMedia(t,r)}async deleteEntry(e,t,n){const r=e.config,o=Dl(t,n),i=Al(t);if(!Ll(t))throw new Error("Not allowed to delete entries in this collection");const a=await this.currentUser(),s=Ao("delete",r,{collection:t,slug:n,path:o,authorLogin:a.login,authorName:a.name,authorEmail:a.email},a.useOpenAuthoring),l=pl(e.entries,t.get("name"),n);await this.invokePreUnpublishEvent(l);let u=[o];Kl(t)&&(u=nu(t,i,o,n)),await this.implementation.deleteFiles(u,s),await this.invokePostUnpublishEvent(l)}async deleteMedia(e,t){const n=await this.currentUser(),r=Ao("deleteMedia",e,{path:t,authorLogin:n.login,authorName:n.name,authorEmail:n.email},n.useOpenAuthoring);return this.implementation.deleteFiles([t],r)}persistUnpublishedEntry(e){return this.persistEntry({...e,unpublished:!0})}updateUnpublishedEntryStatus(e,t,n){return this.implementation.updateUnpublishedEntryStatus(e,t,n)}async publishUnpublishedEntry(e){const t=e.get("collection"),n=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,n),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const n=kr(e,t.toJS()),r=this.fieldsOrder(e,t),o=function(e,t){let n=[];if(e.has("folder"))n=e.get("fields").toArray();else if(e.has("files")){const r=e.get("files").find(e=>e?.get("name")===t.get("slug"));n=r.get("fields").toArray()}const r={};return Nl(n).forEach(t=>{const n=$l(e,t);n?.has("comment")&&(r[t]=n.get("comment"))}),r}(e,t);let i=n.toFile(t.get("data").toJS(),r,o);return"\n"!=i.slice(-1)&&(i+="\n"),i}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map(e=>e.get("name")).toArray();const n=(e.get("files")||(0,Ve.List)()).filter(e=>e.get("name")===t.get("slug")).get(0);if(null==n)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return n.get("fields").map(e=>e.get("name")).toArray()}filterEntries(e,t){return e.entries.filter(e=>{const n=e.data[t.get("field")];return Array.isArray(n)?n.includes(t.get("value")):n===t.get("value")})}}function Au(e){if(!e.backend.name)throw new Error("No backend defined in configuration");const{name:t}=e.backend,n=new ku,r=pr(t);if(r)return new Mu(r,{backendName:t,authStore:n,config:e});throw new Error(`Backend not found: ${t}`)}const Iu=function(){let e;return t=>e||(e=Au(t))}(),Du="AUTH_REQUEST",ju="AUTH_SUCCESS",Lu="AUTH_FAILURE",Nu="AUTH_REQUEST_DONE",$u="USE_OPEN_AUTHORING",Fu="LOGOUT";function zu(){return{type:Du}}function Bu(e){return{type:ju,payload:e}}function Uu(e){return{type:Lu,error:"Failed to authenticate",payload:e}}function qu(){return{type:$u}}function Wu(){return(e,t)=>{const n=t(),r=Iu(n.config);Promise.resolve(r.logout()).then(()=>{e({type:Fu}),e({type:gi})})}}const Hu=Ut((e,t)=>{switch(t.type){case Du:e.isFetching=!0;break;case ju:e.user=t.payload;break;case Lu:e.error=t.payload&&t.payload.toString();break;case Nu:e.isFetching=!1;break;case Fu:e.user=void 0,e.isFetching=!1}},{isFetching:!1,user:void 0,error:void 0});var Vu=__webpack_require__(62162),Ku=__webpack_require__.n(Vu);const Gu={isFetching:!1,term:"",collections:[],page:0,entryIds:[],queryHits:{},error:void 0,requests:[]},Yu=Ut((e,t)=>{switch(t.type){case ti:return Gu;case Yo:{const{page:n,searchTerm:r,searchCollections:o}=t.payload;e.isFetching=!0,e.term=r,e.collections=o,e.page=n;break}case Qo:{const{entries:n,page:r}=t.payload,o=n.map(e=>({collection:e.collection,slug:e.slug}));e.isFetching=!1,e.page=r,e.entryIds=!r||isNaN(r)||0===r?o:e.entryIds.concat(o);break}case Jo:{const{error:n}=t.payload;e.isFetching=!1,e.error=n;break}case Xo:{const{searchTerm:n,request:r}=t.payload;e.isFetching=!0,e.term=n,r&&e.requests.push(r);break}case ni:e.requests=e.requests.filter(e=>e.expires>=new Date);break;case Zo:{const{namespace:n,hits:r}=t.payload;e.isFetching=!1,e.queryHits[n]=r;break}case ei:{const{error:n}=t.payload;e.isFetching=!1,e.error=n}}},Gu),Qu=Yu;function Ju(e){return Object.values(e).some(e=>e.isLoading)}const Xu=Ut((e,t)=>{switch(t.type){case ca:t.payload.forEach(t=>{e[t.path]={asset:t,isLoading:!1,error:null}});break;case fa:{const n=t.payload;e[n.path]={asset:n,isLoading:!1,error:null};break}case da:{const n=t.payload;delete e[n];break}case pa:{const{path:n}=t.payload;e[n]=e[n]||{},e[n].isLoading=!0;break}case ha:{const{path:n}=t.payload;e[n]=e[n]||{},e[n].isLoading=!1,e[n].error=null;break}case ga:{const{path:n,error:r}=t.payload;e[n]=e[n]||{},e[n].isLoading=!1,e[n].error=r}}},{}),Zu="DEPLOY_PREVIEW_REQUEST",ec="DEPLOY_PREVIEW_SUCCESS",tc="DEPLOY_PREVIEW_FAILURE";function nc(e,t){return{type:tc,payload:{collection:e,slug:t}}}const rc=Ut((e,t)=>{switch(t.type){case Zu:{const{collection:n,slug:r}=t.payload;e[`${n}.${r}`]={isFetching:!0,status:"PENDING"};break}case ec:{const{collection:n,slug:r,url:o,status:i}=t.payload,a=`${n}.${r}`;e[a].isFetching=!1,e[a].url=o,e[a].status=i;break}case tc:{const{collection:n,slug:r}=t.payload,o=`${n}.${r}`;e[o].isFetching=!1,e[o].url=void 0,e[o].status="PENDING";break}}},{}),oc=rc,ic=["DEPLOY_PREVIEW","STATUS_REQUEST","STATUS_SUCCESS","STATUS_FAILURE"];function ac(e){return ic.some(t=>e.type.includes(t))}const sc=Ut((e,t)=>{!ac(t)&&t.type.includes("REQUEST")?e.isFetching=!0:ac(t)||!t.type.includes("SUCCESS")&&!t.type.includes("FAILURE")?t.type===$u&&(e.useOpenAuthoring=!0):e.isFetching=!1},{isFetching:!1,useOpenAuthoring:!1}),lc="STATUS_REQUEST",uc="STATUS_SUCCESS",cc="STATUS_FAILURE";function fc(e){return{type:uc,payload:{status:e}}}const dc=Ut((e,t)=>{switch(t.type){case lc:e.isFetching=!0;break;case uc:e.isFetching=!1,e.status=t.payload.status;break;case cc:e.isFetching=!1,e.error=t.payload.error}},{isFetching:!1,status:{auth:{status:!0},api:{status:!0,statusPage:""}},error:void 0}),pc=Ut((e,t)=>{switch(t.type){case gi:e.notifications=[];break;case hi:e.notifications=e.notifications.filter(e=>e.id!==t.id);break;case pi:e.notifications=[...e.notifications,{id:Lr(),...t.payload}]}},{notifications:[]}),hc={auth:Hu,config:bu,collections:function(e=Ol,t){if(t.type===hu){const e=t.payload.collections;let n=(0,Ve.OrderedMap)({});return e.forEach(e=>{n=n.set(e.name,(0,Ve.fromJS)(e))}),n}return e},search:Qu,integrations:function(e=fu,t){return t.type===hu?cu(t.payload):e},entries:function(e=(0,Ve.Map)({entities:(0,Ve.Map)(),pages:(0,Ve.Map)(),sort:al(),viewStyle:ll()}),t){switch(t.type){case Xa:{const n=t.payload;return e.setIn(["entities",`${n.collection}.${n.slug}`,"isFetching"],!0)}case Za:{const n=t.payload;return Xs=n.collection,nl=n.entry.slug,e.withMutations(e=>{e.setIn(["entities",`${Xs}.${nl}`],(0,Ve.fromJS)(n.entry));const t=e.getIn(["pages",Xs,"ids"],(0,Ve.List)());t.includes(nl)||e.setIn(["pages",Xs,"ids"],t.unshift(nl))})}case ts:{const n=t.payload,r=e.withMutations(e=>{e.setIn(["pages",n.collection,"isFetching"],!0)});return r}case ns:{const n=t.payload;return Xs=n.collection,Zs=n.entries,el=n.append,tl=n.page,e.withMutations(e=>{Zs.forEach(t=>e.setIn(["entities",`${Xs}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1)));const t=(0,Ve.List)(Zs.map(e=>e.slug));e.setIn(["pages",Xs],(0,Ve.Map)({page:tl,ids:el?e.getIn(["pages",Xs,"ids"],(0,Ve.List)()).concat(t):t}))})}case rs:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case es:{const n=t.payload;return e.withMutations(e=>{e.setIn(["entities",`${n.collection}.${n.slug}`,"isFetching"],!1),e.setIn(["entities",`${n.collection}.${n.slug}`,"error"],n.error.message)})}case Qo:{const n=t.payload;return Zs=n.entries,e.withMutations(e=>{Zs.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1)))})}case Es:{const n=t.payload;return e.withMutations(e=>{e.deleteIn(["entities",`${n.collectionName}.${n.entrySlug}`]),e.updateIn(["pages",n.collectionName,"ids"],e=>e.filter(e=>e!==n.entrySlug))})}case os:{const n=t.payload,{collection:r,key:o,direction:i}=n,a=e.withMutations(e=>{const t=(0,Ve.OrderedMap)({[o]:(0,Ve.Map)({key:o,direction:i})});e.setIn(["sort",r],t),e.setIn(["pages",r,"isFetching"],!0),e.deleteIn(["pages",r,"page"])});return sl(a.get("sort")),a}case fs:case ls:case is:{const n=t.payload,{collection:r,entries:o}=n;Zs=o;const i=e.withMutations(e=>{Zs.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1))),e.setIn(["pages",r,"isFetching"],!1);const t=(0,Ve.List)(Zs.map(e=>e.slug));e.setIn(["pages",r],(0,Ve.Map)({page:1,ids:t}))});return i}case as:{const n=t.payload,{collection:r,key:o}=n,i=e.withMutations(e=>{e.deleteIn(["sort",r,o]),e.setIn(["pages",r,"isFetching"],!1)});return sl(i.get("sort")),i}case ss:{const n=t.payload,{collection:r,filter:o}=n,i=e.withMutations(e=>{const t=e.getIn(["filter",r,o.id],(0,Ve.fromJS)(o));e.setIn(["filter",r,t.get("id")],t.set("active",!t.get("active")))});return i}case us:{const n=t.payload,{collection:r,filter:o}=n,i=e.withMutations(e=>{e.deleteIn(["filter",r,o.id]),e.setIn(["pages",r,"isFetching"],!1)});return i}case cs:{const n=t.payload,{collection:r,group:o}=n,i=e.withMutations(e=>{const t=e.getIn(["group",r,o.id],(0,Ve.fromJS)(o));e.deleteIn(["group",r]),e.setIn(["group",r,t.get("id")],t.set("active",!t.get("active")))});return i}case ds:{const n=t.payload,{collection:r,group:o}=n,i=e.withMutations(e=>{e.deleteIn(["group",r,o.id]),e.setIn(["pages",r,"isFetching"],!1)});return i}case Ts:{const r=t.payload,{style:o}=r,i=e.withMutations(e=>{e.setIn(["viewStyle"],o)});return(n=i.get("viewStyle"))?localStorage.setItem(ol,n):localStorage.removeItem(ol),i}default:return e}var n},cursors:function(e=(0,Ve.fromJS)({cursorsByType:{collectionEntries:{}}}),t){switch(t.type){case ns:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],ln.Cursor.create(t.payload.cursor).store);case ls:case fs:case is:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}},editorialWorkflow:function(e=(0,Ve.Map)(),t){switch(t.type){case hu:return(t.payload&&t.payload.publish_mode)===Pr?(0,Ve.Map)({entities:(0,Ve.Map)(),pages:(0,Ve.Map)()}):e;case Ca:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isFetching"],!0);case Ta:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);case Oa:return e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.slug}`],(0,Ve.fromJS)(t.payload.entry));case Pa:return e.setIn(["pages","isFetching"],!0);case Ra:return e.withMutations(e=>{t.payload.entries.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1))),e.set("pages",(0,Ve.Map)({...t.payload.pages,ids:(0,Ve.List)(t.payload.entries.map(e=>e.slug))}))});case Ma:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!0);case Aa:return e.withMutations(e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`],(0,Ve.fromJS)(t.payload.entry)),e.deleteIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`,"isPersisting"]),e.updateIn(["pages","ids"],(0,Ve.List)(),e=>e.push(t.payload.entry.get("slug")))});case Ia:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!1);case Da:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!0);case ja:return e.withMutations(e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"status"],t.payload.newStatus),e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1)});case La:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1);case Na:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPublishing"],!0);case $a:case za:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);default:return e}},entryDraft:function(e=(0,Ve.Map)(),t){switch(t.type){case ps:return e.withMutations(e=>{e.set("entry",(0,Ve.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!1),e.set("key",Lr())});case hs:return e.withMutations(e=>{e.set("entry",(0,Ve.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!1),e.set("key",Lr())});case ws:return e.withMutations(e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!0),e.set("key",Lr())});case xs:return e.withMutations(e=>{e.set("entry",(0,Ve.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,Ve.List)()),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!0)});case gs:return Qa;case bs:{const{entry:n}=t.payload,r=new Ve.Map({entry:(0,Ve.fromJS)(n)});return e.set("localBackup",r)}case ms:return e.withMutations(e=>{const{field:n,value:r,metadata:o,entries:i,i18n:a}=t.payload,s=n.get("name"),l=n.get("meta"),u=a&&Zl(a.currentLocale,a.defaultLocale)||["data"];l?e.setIn(["entry","meta",s],r):(e.setIn(["entry",...u,s],r),a&&(e=su(e,n,a.locales,a.defaultLocale))),e.mergeDeepIn(["fieldsMetaData"],(0,Ve.fromJS)(o));const c=e.getIn(["entry",...u]),f=e.getIn(["entry","meta"]);e.set("hasChanged",!i.some(e=>c.equals(e.get(...u)))||!i.some(e=>f.equals(e.get("meta"))))});case ys:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case vs:{const{uniqueFieldId:n}=t.payload;return e.deleteIn(["fieldsErrors",n])}case Ss:case Ma:return e.setIn(["entry","isPersisting"],!0);case _s:case Ia:return e.deleteIn(["entry","isPersisting"]);case Da:return e.setIn(["entry","isUpdatingStatus"],!0);case La:case ja:return e.deleteIn(["entry","isUpdatingStatus"]);case Na:return e.setIn(["entry","isPublishing"],!0);case $a:case Fa:return e.deleteIn(["entry","isPublishing"]);case ks:case Aa:return e.withMutations(e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)});case Es:return e.withMutations(e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)});case Cs:return e.withMutations(e=>{const n=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],n.filterNot(e=>e.get("id")===t.payload.id).insert(0,(0,Ve.fromJS)(t.payload))),e.set("hasChanged",!0)});case Os:return e.withMutations(e=>{const n=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],n.filterNot(e=>e.get("id")===t.payload.id)),e.set("hasChanged",!0)});default:return e}},medias:Xu,mediaLibrary:function(e=(0,Ve.Map)(sa),t){switch(t.type){case Ci:return e.withMutations(e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())});case _i:{const{controlID:n,forImage:r,privateUpload:o,config:i,field:a,value:s,replaceIndex:l}=t.payload,u=i||(0,Ve.Map)();return e.get("privateUpload")!==o?(0,Ve.Map)({isVisible:!0,forImage:r,controlID:n,canInsert:!!n,privateUpload:o,config:u,controlMedia:(0,Ve.Map)(),displayURLs:(0,Ve.Map)(),field:a,value:s,replaceIndex:l}):e.withMutations(e=>{e.set("isVisible",!0),e.set("forImage",r??!1),e.set("controlID",n??""),e.set("canInsert",!!n),e.set("privateUpload",o),e.set("config",u),e.set("field",a??""),e.set("value",""==s&&u.get("multiple")?[]:s??""),e.set("replaceIndex",l??!1)})}case Ei:return e.set("isVisible",!1);case Oi:{const{mediaPath:n}=t.payload,r=e.get("controlID"),o=e.get("value");if(!Array.isArray(o))return e.withMutations(e=>{e.setIn(["controlMedia",r],n)});const i=e.get("replaceIndex"),a=Array.isArray(n)?n:[n],s=o;return"number"==typeof i?s[i]=a[0]:s.push(...a),e.withMutations(e=>{e.setIn(["controlMedia",r],s)})}case Ti:{const n=t.payload.controlID;return e.setIn(["controlMedia",n],"")}case Pi:return e.withMutations(e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)});case Ri:{const{files:n=[],page:r,canPaginate:o,dynamicSearch:i,dynamicSearchQuery:a,privateUpload:s}=t.payload;if(e.get("privateUpload")!==s)return e;const l=n.map(e=>({...e,key:Lr()}));return e.withMutations(e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",r??1),e.set("hasNextPage",!!(o&&n.length>0)),e.set("dynamicSearch",i??!1),e.set("dynamicSearchQuery",a??""),e.set("dynamicSearchActive",!!a),r&&r>1){const t=e.get("files").concat(l);e.set("files",t)}else e.set("files",l)})}case Mi:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case Ai:return e.set("isPersisting",!0);case Ii:{const{file:n,privateUpload:r}=t.payload;return e.get("privateUpload")!==r?e:e.withMutations(e=>{const t=[{...n,key:Lr()},...e.get("files")];e.set("files",t),e.set("isPersisting",!1)})}case Di:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case ji:return e.set("isDeleting",!0);case Li:{const{file:n,privateUpload:r}=t.payload,{key:o,id:i}=n;return e.get("privateUpload")!==r?e:e.withMutations(e=>{const t=e.get("files").filter(e=>o?e.key!==o:e.id!==i);e.set("files",t),e.deleteIn(["displayURLs",i]),e.set("isDeleting",!1)})}case Ni:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case $i:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case Fi:{const n=["displayURLs",t.payload.key];return e.setIn([...n,"isFetching"],!1).setIn([...n,"url"],t.payload.url)}case zi:{const n=["displayURLs",t.payload.key];return e.setIn([...n,"isFetching"],!1).setIn([...n,"err"],t.payload.err||!0).deleteIn([...n,"url"])}default:return e}},deploys:oc,globalUI:sc,status:dc,notifications:pc};function gc(e,t,n){return pl(e.entries,t,n)}function mc(e,t){return hl(e.entries,t)}function yc(e,t,n){return function(e,t,n){return e[`${t}.${n}`]}(e.deploys,t,n)}function vc(e,t,n){return function(e,t,n){return e&&e.getIn(["entities",`${t}.${n}`])}(e.editorialWorkflow,t,n)}function bc(e,t){return function(e,t){return e?e.get("entities").filter(e=>e.get("status")===t).valueSeq():null}(e.editorialWorkflow,t)}function wc(e,t,n){return du(e.integrations,t,n)}const xc=(0,ze.y$)((0,ze.HY)({...hc}),(0,Be.tY)((0,ze.Tw)(We,({dispatch:e,getState:t})=>{let n=[];return r=>o=>{if(o.type===He)return n.push(o),null;const i=r(o);return function(r){const o=[],i=[];for(const e of n)e.predicate(r)?o.push(e):i.push(e);n=i;for(const n of o)n.run(e,t,r)}(o),i}})));var Sc=__webpack_require__(82451),kc=__webpack_require__.n(Sc);function _c(e){return kc()({},yr("en"),yr(e))}function Ec(e){var t=null;return function(){return null==t&&(t=e()),t}}function Cc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Oc(this,"entered",[]),Oc(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}var t,n;return t=e,n=[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var o=[];return n.forEach(function(e){return o.push(e)}),o}(this.entered.filter(function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))}),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter(function(e){return e!==n})),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],n&&Cc(t.prototype,n),e}(),Pc=Ec(function(){return/firefox/i.test(navigator.userAgent)}),Rc=Ec(function(){return Boolean(window.safari)});function Mc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ac(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ic=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ac(this,"xs",void 0),Ac(this,"ys",void 0),Ac(this,"c1s",void 0),Ac(this,"c2s",void 0),Ac(this,"c3s",void 0);for(var r=t.length,o=[],i=0;i<r;i++)o.push(i);o.sort(function(e,n){return t[e]<t[n]?-1:1});for(var a,s,l=[],u=[],c=[],f=0;f<r-1;f++)a=t[f+1]-t[f],s=n[f+1]-n[f],u.push(a),l.push(s),c.push(s/a);for(var d=[c[0]],p=0;p<u.length-1;p++){var h=c[p],g=c[p+1];if(h*g<=0)d.push(0);else{a=u[p];var m=u[p+1],y=a+m;d.push(3*y/((y+m)/h+(y+a)/g))}}d.push(c[c.length-1]);for(var v,b=[],w=[],x=0;x<d.length-1;x++){v=c[x];var S=d[x],k=1/u[x],_=S+d[x+1]-v-v;b.push((v-S-_)*k),w.push(_*k*k)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=b,this.c3s=w}var t,n;return t=e,n=[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return n[a];for(var s,l=0,u=i.length-1;l<=u;){var c=t[s=Math.floor(.5*(l+u))];if(c<e)l=s+1;else{if(!(c>e))return n[s];u=s-1}}var f=e-t[a=Math.max(0,u)],d=f*f;return n[a]+r[a]*f+o[a]*d+i[a]*f*d}}],n&&Mc(t.prototype,n),e}();function Dc(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function jc(e){return{x:e.clientX,y:e.clientY}}var Lc,Nc="__NATIVE_FILE__",$c="__NATIVE_URL__",Fc="__NATIVE_TEXT__",zc="__NATIVE_HTML__";function Bc(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},"");return null!=r?r:n}function Uc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qc=(Uc(Lc={},Nc,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),Uc(Lc,zc,{exposeProperties:{html:function(e,t){return Bc(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),Uc(Lc,$c,{exposeProperties:{urls:function(e,t){return Bc(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),Uc(Lc,Fc,{exposeProperties:{text:function(e,t){return Bc(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),Lc);function Wc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Hc(this,"item",void 0),Hc(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}var t,n;return t=e,(n=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach(function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&Wc(t.prototype,n),e}();function Kc(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(qc).filter(function(e){return qc[e].matchesTypes.some(function(e){return t.indexOf(e)>-1})})[0]||null}function Gc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qc=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Yc(this,"ownerDocument",null),Yc(this,"globalContext",void 0),Yc(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=n}var t,n;return t=e,(n=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}])&&Gc(t.prototype,n),e}();function Jc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jc(Object(n),!0).forEach(function(t){ef(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ef(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tf=function(){function t(e,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ef(this,"options",void 0),ef(this,"actions",void 0),ef(this,"monitor",void 0),ef(this,"registry",void 0),ef(this,"enterLeaveCounter",void 0),ef(this,"sourcePreviewNodes",new Map),ef(this,"sourcePreviewNodeOptions",new Map),ef(this,"sourceNodes",new Map),ef(this,"sourceNodeOptions",new Map),ef(this,"dragStartSourceIds",null),ef(this,"dropTargetIds",[]),ef(this,"dragEnterTargetIds",[]),ef(this,"currentNativeSource",null),ef(this,"currentNativeHandle",null),ef(this,"currentDragSourceNode",null),ef(this,"altKeyPressed",!1),ef(this,"mouseMoveTimeoutTimer",null),ef(this,"asyncEndDragFrameId",null),ef(this,"dragOverTargetIds",null),ef(this,"lastClientOffset",null),ef(this,"hoverRafId",null),ef(this,"getSourceClientOffset",function(e){var t=o.sourceNodes.get(e);return t&&Dc(t)||null}),ef(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),ef(this,"isNodeInDocument",function(e){return Boolean(e&&o.document&&o.document.body&&o.document.body.contains(e))}),ef(this,"endDragIfSourceWasRemovedFromDOM",function(){var e=o.currentDragSourceNode;null==e||o.isNodeInDocument(e)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),ef(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),ef(this,"handleTopDragStart",function(e){if(!e.defaultPrevented){var t=o.dragStartSourceIds;o.dragStartSourceIds=null;var n=jc(e);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:n});var r=e.dataTransfer,i=Kc(r);if(o.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){var a=o.monitor.getSourceId(),s=o.sourceNodes.get(a),l=o.sourcePreviewNodes.get(a)||s;if(l){var u=o.getCurrentSourcePreviewNodeOptions(),c=function(e,t,n,r,o){var i,a,s="IMG"===(i=t).nodeName&&(Pc()||!(null!==(a=document.documentElement)&&void 0!==a&&a.contains(i))),l=Dc(s?e:t),u={x:n.x-l.x,y:n.y-l.y},c=e.offsetWidth,f=e.offsetHeight,d=r.anchorX,p=r.anchorY,h=function(e,t,n,r){var o=e?t.width:n,i=e?t.height:r;return Rc()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(s,t,c,f),g=h.dragPreviewWidth,m=h.dragPreviewHeight,y=o.offsetX,v=o.offsetY,b=0===v||v;return{x:0===y||y?y:new Ic([0,.5,1],[u.x,u.x/c*g,u.x+g-c]).interpolate(d),y:b?v:function(){var e=new Ic([0,.5,1],[u.y,u.y/f*m,u.y+m-f]).interpolate(p);return Rc()&&s&&(e+=(window.devicePixelRatio-1)*m),e}()}}(s,l,n,{anchorX:u.anchorX,anchorY:u.anchorY},{offsetX:u.offsetX,offsetY:u.offsetY});r.setDragImage(l,c.x,c.y)}}try{null==r||r.setData("application/json",{})}catch(e){}o.setCurrentDragSourceNode(e.target),o.getCurrentSourcePreviewNodeOptions().captureDraggingState?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(i)o.beginDragNativeItem(i);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}}),ef(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),ef(this,"handleTopDragEnterCapture",function(e){if(o.dragEnterTargetIds=[],o.enterLeaveCounter.enter(e.target)&&!o.monitor.isDragging()){var t=e.dataTransfer,n=Kc(t);n&&o.beginDragNativeItem(n,t)}}),ef(this,"handleTopDragEnter",function(e){var t=o.dragEnterTargetIds;o.dragEnterTargetIds=[],o.monitor.isDragging()&&(o.altKeyPressed=e.altKey,t.length>0&&o.actions.hover(t,{clientOffset:jc(e)}),t.some(function(e){return o.monitor.canDropOnTarget(e)})&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())))}),ef(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),ef(this,"handleTopDragOver",function(e){var t=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));o.altKeyPressed=e.altKey,o.lastClientOffset=jc(e),null===o.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(t||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null})),(t||[]).some(function(e){return o.monitor.canDropOnTarget(e)})?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))}),ef(this,"handleTopDragLeaveCapture",function(e){o.isDraggingNativeItem()&&e.preventDefault(),o.enterLeaveCounter.leave(e.target)&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),ef(this,"handleTopDropCapture",function(e){var t;o.dropTargetIds=[],o.isDraggingNativeItem()?(e.preventDefault(),null===(t=o.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Kc(e.dataTransfer)&&e.preventDefault(),o.enterLeaveCounter.reset()}),ef(this,"handleTopDrop",function(e){var t=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(t,{clientOffset:jc(e)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),ef(this,"handleSelectStart",function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))}),this.options=new Qc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Tc(this.isNodeInDocument)}var n,r;return n=t,(r=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var o=function(t){return r.handleDragStart(t,e)},i=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},i=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Xc({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Xc({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var t=this.monitor.getItemType();return Object.keys(e).some(function(n){return e[n]===t})}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new Vc(qc[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}])&&Zc(n.prototype,r),t}(),nf=function(e,t,n){return new tf(e,t,n)};function rf(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw i.framesToPop=1,i}}function of(e,t,n){var r=n.getRegistry(),o=r.addTarget(e,t);return[o,function(){return r.removeTarget(o)}]}function af(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return[o,function(){return r.removeSource(o)}]}function sf(e){var t={};return Object.keys(e).forEach(function(r){var o=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var i=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,n.isValidElement)(t)){var o=t;return e(o,r),o}var i=t;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i);var a=r?function(t){return e(t,r)}:e;return function(e,t){var r=e.ref;return rf("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?(0,n.cloneElement)(e,{ref:function(e){lf(r,e),lf(t,e)}}):(0,n.cloneElement)(e,{ref:t})}(i,a)}}(o);t[r]=function(){return i}}}),t}function lf(e,t){"function"==typeof e?e(t):e.current=t}function uf(e){return uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uf(e)}function cf(e){return null!==e&&"object"===uf(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function ff(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var u=i[l];if(!s(u))return!1;var c=e[u],f=t[u];if(!1===(o=n?n.call(r,c,f,u):void 0)||void 0===o&&c!==f)return!1}return!0}function df(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hf=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pf(this,"hooks",sf({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,cf(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,cf(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}})),pf(this,"handlerId",null),pf(this,"dragSourceRef",null),pf(this,"dragSourceNode",void 0),pf(this,"dragSourceOptionsInternal",null),pf(this,"dragSourceUnsubscribe",void 0),pf(this,"dragPreviewRef",null),pf(this,"dragPreviewNode",void 0),pf(this,"dragPreviewOptionsInternal",null),pf(this,"dragPreviewUnsubscribe",void 0),pf(this,"lastConnectedHandlerId",null),pf(this,"lastConnectedDragSource",null),pf(this,"lastConnectedDragSourceOptions",null),pf(this,"lastConnectedDragPreview",null),pf(this,"lastConnectedDragPreviewOptions",null),pf(this,"backend",void 0),this.backend=t}var t,n;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!ff(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ff(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}])&&df(t.prototype,n),e}();function gf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yf=!1,vf=!1,bf=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),mf(this,"internalMonitor",void 0),mf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}var t,n;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){rf(!yf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return yf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{yf=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;rf(!vf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vf=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&gf(t.prototype,n),e}();function wf(e){return wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wf(e)}function xf(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function Sf(e){return"function"==typeof e}function kf(){}function _f(e){if(!function(e){return"object"===wf(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ef(e,t){return"string"==typeof e||"symbol"===wf(e)||!!t&&Array.isArray(e)&&e.every(function(e){return Ef(e,!1)})}var Cf=__webpack_require__(31085),Of=(0,n.createContext)({dragDropManager:void 0});function Tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rf(e,t,n){return t&&Pf(e.prototype,t),n&&Pf(e,n),e}function Mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Af=function(){function e(t){Tf(this,e),Mf(this,"isDisposed",!1),Mf(this,"action",void 0),this.action=Sf(t)?t:kf}return Rf(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Sf(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();Mf(Af,"empty",{dispose:kf});var If=function(){function e(){Tf(this,e),Mf(this,"isDisposed",!1),Mf(this,"disposables",void 0);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.disposables=n}return Rf(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var n=this.disposables.indexOf(e);-1!==n&&(t=!0,this.disposables.splice(n,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.disposables=[];for(var r=0;r<e;r++)t[r].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.disposables=[];for(var r=0;r<e;r++)t[r].dispose()}}}]),e}(),Df=function(){function e(){Tf(this,e),Mf(this,"isDisposed",!1),Mf(this,"current",void 0)}return Rf(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var n=this.current;this.current=e,n&&n.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}();function jf(e){return jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jf(e)}function Lf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $f(e,t){return $f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$f(e,t)}function Ff(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zf(e){return zf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zf(e)}function Bf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uf(e){var t=e.DecoratedComponent,r=e.createHandler,o=e.createMonitor,i=e.createConnector,a=e.registerHandler,s=e.containerDisplayName,l=e.getType,u=e.collect,c=e.options.arePropsEqual,f=void 0===c?ff:c,d=t,p=t.displayName||t.name||"Component",h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$f(e,t)}(m,e);var t,s,c,h,g=(c=m,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=zf(c);if(h){var n=zf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ff(e)}(this,e)});function m(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),Bf(Ff(t=g.call(this,e)),"decoratedRef",(0,n.createRef)()),Bf(Ff(t),"handlerId",void 0),Bf(Ff(t),"manager",void 0),Bf(Ff(t),"handlerMonitor",void 0),Bf(Ff(t),"handlerConnector",void 0),Bf(Ff(t),"handler",void 0),Bf(Ff(t),"disposable",void 0),Bf(Ff(t),"currentType",void 0),Bf(Ff(t),"handleChange",function(){var e=t.getCurrentState();ff(e,t.state)||t.setState(e)}),t.disposable=new Df,t.receiveProps(e),t.dispose(),t}return t=m,s=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return rf(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!f(e,this.props)||!ff(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new Df,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){f(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(l(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lf(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a(e,this.handler,this.manager),2),n=t[0],r=t[1];this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new If(new Af(o),new Af(r)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?u(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return(0,Cf.jsx)(Of.Consumer,{children:function(t){var n,r,o=t.dragDropManager;return e.receiveDragDropManager(o),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()}),(0,Cf.jsx)(d,Object.assign({},e.props,e.getCurrentState(),{ref:(n=d,(r=n)&&r.prototype&&"function"==typeof r.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null==e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(n)?e.decoratedRef:null)}),void 0)}},void 0)}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(rf(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",p,p),void 0!==e&&(this.manager=e,this.handlerMonitor=o(e),this.handlerConnector=i(e.getBackend()),this.handler=r(this.handlerMonitor,this.decoratedRef)))}}],s&&Nf(t.prototype,s),m}(n.Component);return Bf(h,"DecoratedComponent",t),Bf(h,"displayName","".concat(s,"(").concat(p,")")),g()(h,t)}function qf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hf=["canDrag","beginDrag","isDragging","endDrag"],Vf=["beginDrag"],Kf=function(){function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wf(this,"props",null),Wf(this,"spec",void 0),Wf(this,"monitor",void 0),Wf(this,"ref",void 0),Wf(this,"beginDrag",function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)}),this.spec=t,this.monitor=n,this.ref=r}var t,n;return t=e,(n=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,xf(this.ref))}}])&&qf(t.prototype,n),e}();function Gf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qf=!1,Jf=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Yf(this,"internalMonitor",void 0),Yf(this,"targetId",null),this.internalMonitor=t.getMonitor()}var t,n;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;rf(!Qf,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Qf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Qf=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&Gf(t.prototype,n),e}();function Xf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ed=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zf(this,"hooks",sf({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,cf(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}})),Zf(this,"handlerId",null),Zf(this,"dropTargetRef",null),Zf(this,"dropTargetNode",void 0),Zf(this,"dropTargetOptionsInternal",null),Zf(this,"unsubscribeDropTarget",void 0),Zf(this,"lastConnectedHandlerId",null),Zf(this,"lastConnectedDropTarget",null),Zf(this,"lastConnectedDropTargetOptions",null),Zf(this,"backend",void 0),this.backend=t}var t,n;return t=e,(n=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!ff(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}])&&Xf(t.prototype,n),e}();function td(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rd=["canDrop","hover","drop"],od=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),nd(this,"props",null),nd(this,"spec",void 0),nd(this,"monitor",void 0),nd(this,"ref",void 0),this.spec=t,this.monitor=n,this.ref=r}var t,n;return t=e,(n=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,xf(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&td(t.prototype,n),e}();var id="dnd-core/INIT_COORDS",ad="dnd-core/BEGIN_DRAG",sd="dnd-core/PUBLISH_DRAG_SOURCE",ld="dnd-core/HOVER",ud="dnd-core/DROP",cd="dnd-core/END_DRAG";function fd(e,t){return{type:id,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function dd(e){return dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dd(e)}function pd(e){return"object"===dd(e)}var hd={type:id,payload:{clientOffset:null,sourceClientOffset:null}};function gd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,o=void 0===r||r,i=n.clientOffset,a=n.getSourceClientOffset,s=e.getMonitor(),l=e.getRegistry();e.dispatch(fd(i)),function(e,t,n){rf(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){rf(n.getSource(e),"Expected sourceIds to be registered.")})}(t,s,l);var u=function(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,s);if(null!==u){var c=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){rf("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),c=a(u)}e.dispatch(fd(i,c));var f=l.getSource(u).beginDrag(s,u);if(null!=f){!function(e){rf(pd(e),"Item must be an object.")}(f),l.pinSource(u);var d=l.getSourceType(u);return{type:ad,payload:{itemType:d,item:f,sourceId:u,clientOffset:i||null,sourceClientOffset:c||null,isSourcePublic:!!o}}}}else e.dispatch(hd)}}function md(e){return function(){if(e.getMonitor().isDragging())return{type:sd}}}function yd(e,t){return null===t?null===e:Array.isArray(e)?e.some(function(e){return e===t}):e===t}function vd(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){rf(Array.isArray(e),"Expected targetIds to be an array.")}(t);var r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){rf(t.isDragging(),"Cannot call hover while not dragging."),rf(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var o=e[r];rf(e.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array."),rf(n.getTarget(o),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){for(var r=e.length-1;r>=0;r--){var o=e[r];yd(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}(r,o,i),{type:ld,payload:{targetIds:r,clientOffset:n||null}}}}function bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bd(Object(n),!0).forEach(function(t){xd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();!function(e){rf(e.isDragging(),"Cannot call drop while not dragging."),rf(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach(function(o,i){var a=function(e,t,n,r){var o=n.getTarget(e),i=o?o.drop(r,e):void 0;return function(e){rf(void 0===e||pd(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:r.getDropResult()),i}(o,i,r,n),s={type:ud,payload:{dropResult:wd(wd({},t),a)}};e.dispatch(s)})}}function kd(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){rf(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();return null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:cd}}}function _d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ed(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cd=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ed(this,"store",void 0),Ed(this,"monitor",void 0),Ed(this,"backend",void 0),Ed(this,"isSetUp",!1),Ed(this,"handleRefCountChange",function(){var e=r.store.getState().refCount>0;r.backend&&(e&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!e&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}var t,n;return t=e,n=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,n=function(e){return{beginDrag:gd(e),publishDragSource:md(e),hover:vd(e),drop:Sd(e),endDrag:kd(e)}}(this);return Object.keys(n).reduce(function(r,o){var i,a=n[o];return r[o]=(i=a,function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=i.apply(e,r);void 0!==a&&t(a)}),r},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],n&&_d(t.prototype,n),e}(),Od=function(e,t){return e===t};function Td(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Td(Object(n),!0).forEach(function(t){Rd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Td(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Md={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ad(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Md,r=arguments.length>1?arguments[1]:void 0,o=r.payload;switch(r.type){case id:case ad:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case ld:return e=n.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?n:Pd(Pd({},n),{},{clientOffset:o.clientOffset});case cd:case ud:return Md;default:return n}}var Id="dnd-core/ADD_SOURCE",Dd="dnd-core/ADD_TARGET",jd="dnd-core/REMOVE_SOURCE",Ld="dnd-core/REMOVE_TARGET";function Nd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nd(Object(n),!0).forEach(function(t){Fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zd={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Bd(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zd,r=arguments.length>1?arguments[1]:void 0,o=r.payload;switch(r.type){case ad:return $d($d({},n),{},{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case sd:return $d($d({},n),{},{isSourcePublic:!0});case ld:return $d($d({},n),{},{targetIds:o.targetIds});case Ld:return-1===n.targetIds.indexOf(o.targetId)?n:$d($d({},n),{},{targetIds:(e=n.targetIds,t=o.targetId,e.filter(function(e){return e!==t}))});case ud:return $d($d({},n),{},{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case cd:return $d($d({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Ud(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Id:case Dd:return e+1;case jd:case Ld:return e-1;default:return e}}var qd=[],Wd=[];function Hd(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ld:break;case Id:case Dd:case Ld:case jd:return qd;default:return Wd}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var o=[];return n.forEach(function(e,t){1===e&&o.push(t)}),o}(r,i),s=a.length>0||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Od;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(r,i);if(!s)return qd;var l=i[i.length-1],u=r[r.length-1];return l!==u&&(l&&a.push(l),u&&a.push(u)),a}function Vd(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(t){Yd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qd(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Hd(n.dirtyHandlerIds,{type:r.type,payload:Gd(Gd({},r.payload),{},{prevTargetIds:(e=n,t=[],"dragOperation.targetIds".split(".").reduce(function(e,n){return e&&e[n]?e[n]:t||null},e))})}),dragOffset:Ad(n.dragOffset,r),refCount:Ud(n.refCount,r),dragOperation:Bd(n.dragOperation,r),stateId:Vd(n.stateId)}}function Jd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}qd.__IS_NONE__=!0,Wd.__IS_ALL__=!0;var ep,tp=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zd(this,"store",void 0),Zd(this,"registry",void 0),this.store=t,this.registry=n}var t,n;return t=e,n=[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;rf("function"==typeof e,"listener must be a function."),rf(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe(function(){var o=t.store.getState(),i=o.stateId;try{var a=i===r||i===r+1&&!function(e,t){if(e===qd)return!1;if(e===Wd||void 0===t)return!0;var n,r=(n=e,t.filter(function(e){return n.indexOf(e)>-1}));return r.length>0}(o.dirtyHandlerIds,n);a||e()}finally{r=i}})}},{key:"subscribeToOffsetChange",value:function(e){var t=this;rf("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe(function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return rf(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return rf(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&yd(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return rf(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(r&&!yd(n,r))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset,t&&n&&r?Jd(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null;var e,t,n,r}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,n=e.initialClientOffset,t&&n?Jd(t,n):null;var e,t,n}}],n&&Xd(t.prototype,n),e}(),np=0;function rp(e){return rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rp(e)}function op(e,t){t&&Array.isArray(e)?e.forEach(function(e){return op(e,!1)}):rf("string"==typeof e||"symbol"===rp(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(ep||(ep={}));const ip=void 0!==__webpack_require__.g?__webpack_require__.g:self,ap=ip.MutationObserver||ip.WebKitMutationObserver;function sp(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const lp="function"==typeof ap?function(e){let t=1;const n=new ap(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:sp;class up{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const cp=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=lp(this.flush),this.requestErrorThrow=sp(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},fp=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new up(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(cp.registerPendingError);function dp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gp(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mp(e){switch(e[0]){case"S":return ep.SOURCE;case"T":return ep.TARGET;default:rf(!1,"Cannot parse handler ID: ".concat(e))}}function yp(e,t){var n=e.entries(),r=!1;do{var o=n.next(),i=o.done;if(hp(o.value,2)[1]===t)return!0;r=!!i}while(!r);return!1}var vp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pp(this,"types",new Map),pp(this,"dragSources",new Map),pp(this,"dropTargets",new Map),pp(this,"pinnedSourceId",null),pp(this,"pinnedSource",null),pp(this,"store",void 0),this.store=t}var t,n;return t=e,n=[{key:"addSource",value:function(e,t){op(e),function(e){rf("function"==typeof e.canDrag,"Expected canDrag to be a function."),rf("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),rf("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(ep.SOURCE,e,t);return this.store.dispatch(function(e){return{type:Id,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){op(e,!0),function(e){rf("function"==typeof e.canDrop,"Expected canDrop to be a function."),rf("function"==typeof e.hover,"Expected hover to be a function."),rf("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(ep.TARGET,e,t);return this.store.dispatch(function(e){return{type:Dd,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return yp(this.dragSources,e)||yp(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return rf(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return rf(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return rf(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return rf(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return mp(e)===ep.SOURCE}},{key:"isTargetId",value:function(e){return mp(e)===ep.TARGET}},{key:"removeSource",value:function(e){var t,n=this;rf(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:jd,payload:{sourceId:e}}}(e)),t=function(){n.dragSources.delete(e),n.types.delete(e)},cp.enqueueTask(fp.create(t))}},{key:"removeTarget",value:function(e){rf(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Ld,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);rf(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){rf(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=function(e){var t=(np++).toString();switch(e){case ep.SOURCE:return"S".concat(t);case ep.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(r,t),e===ep.SOURCE?this.dragSources.set(r,n):e===ep.TARGET&&this.dropTargets.set(r,n),r}}],n&&dp(t.prototype,n),e}();function bp(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,(0,ze.y$)(Qd,t&&n&&n({name:"dnd-core",instanceId:"dnd-core"}))),a=new tp(i,new vp(i)),s=new Cd(i,a),l=e(s,r,o);return s.receiveBackend(l),s}var wp=["children"];function xp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Sp=0,kp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),_p=(0,n.memo)(function(e){var t=e.children,r=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ep(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t;return o[kp]||(o[kp]={dragDropManager:bp(e,t,n,r)}),o[kp]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,wp)),o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xp(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,2),i=o[0],a=o[1];return(0,n.useEffect)(function(){if(a){var e=Ep();return++Sp,function(){0===--Sp&&(e[kp]=null)}}},[]),(0,Cf.jsx)(Of.Provider,Object.assign({value:i},{children:t}),void 0)});function Ep(){return void 0!==__webpack_require__.g?__webpack_require__.g:window}function Cp({namespace:e,...t}){const n=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(rf(Ef(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),rf(_f(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=function(e){return Object.keys(e).forEach(function(t){rf(Hf.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',Hf.join(", "),t),rf("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])}),Vf.forEach(function(t){rf("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])}),function(t,n){return new Kf(e,t,n)}}(t);return rf("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),rf(_f(r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),function(e){return Uf({containerDisplayName:"DragSource",createHandler:i,registerHandler:af,createConnector:function(e){return new hf(e)},createMonitor:function(e){return new bf(e)},DecoratedComponent:e,getType:o,collect:n,options:r})}}(e,{beginDrag:({children:e,isDragging:t,connectDragComponent:n,...r})=>r},e=>({connectDragComponent:e.dragSource()}))(({children:e,connectDragComponent:t})=>e(t));return r().createElement(n,t,t.children)}function Op({onDrop:e,namespace:t,...n}){const o=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(rf(Ef(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),rf(_f(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=function(e){return Object.keys(e).forEach(function(t){rf(rd.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',rd.join(", "),t),rf("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])}),function(t,n){return new od(e,t,n)}}(t);return rf("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),rf(_f(r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),function(e){return Uf({containerDisplayName:"DropTarget",createHandler:i,registerHandler:of,createMonitor:function(e){return new Jf(e)},createConnector:function(e){return new ed(e)},DecoratedComponent:e,getType:o,collect:n,options:r})}}(t,{drop(t,n){e(n.getItem())}},(e,t)=>({connectDropTarget:e.dropTarget(),isHovered:t.isOver()}))(({children:e,connectDropTarget:t,isHovered:n})=>e(t,{isHovered:n}));return r().createElement(o,n,n.children)}Cp.propTypes={namespace:i().any.isRequired,children:i().func.isRequired},Op.propTypes={onDrop:i().func.isRequired,namespace:i().any.isRequired,children:i().func.isRequired};var Tp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Pp(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Rp=/[A-Z]|^ms/g,Mp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ap=function(e){return 45===e.charCodeAt(1)},Ip=function(e){return null!=e&&"boolean"!=typeof e},Dp=Pp(function(e){return Ap(e)?e:e.replace(Rp,"-$&").toLowerCase()}),jp=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Mp,function(e,t,n){return Np={name:t,styles:n,next:Np},t})}return 1===Tp[e]||Ap(e)||"number"!=typeof t||0===t?t:t+"px"};function Lp(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return Np={name:o.name,styles:o.styles,next:Np},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Np={name:a.name,styles:a.styles,next:Np},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Lp(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":Ip(s)&&(r+=Dp(i)+":"+jp(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=Lp(e,t,a);switch(i){case"animation":case"animationName":r+=Dp(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var u=0;u<a.length;u++)Ip(a[u])&&(r+=Dp(i)+":"+jp(i,a[u])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Np,l=n(e);return Np=s,Lp(e,t,l)}}var u=n;if(null==t)return u;var c=t[u];return void 0!==c?c:u}var Np,$p=/label:\s*([^\s;{]+)\s*(;|$)/g,Fp=!!n.useInsertionEffect&&n.useInsertionEffect,zp=Fp||function(e){return e()};Fp||n.useLayoutEffect;var Bp=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Up=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,qp=Pp(function(e){return Up.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Wp=function(e){return"theme"!==e},Hp=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?qp:Wp},Vp=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Kp=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Bp(t,n,r),zp(function(){return function(e,t,n){Bp(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)}),null},Gp=function e(t,r){var o,i,a=t.__emotion_real===t,s=a&&t.__emotion_base||t;void 0!==r&&(o=r.label,i=r.target);var l=Vp(t,r,a),u=l||Hp(s),c=!u("as");return function(){var f=arguments,p=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{var h=f[0];p.push(h[0]);for(var g=f.length,m=1;m<g;m++)p.push(f[m],h[m])}var y=(0,Hr.withEmotionCache)(function(e,t,r){var o,a,f,d,h=c&&e.as||s,g="",m=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=n.useContext(Hr.ThemeContext)}"string"==typeof e.className?(o=t.registered,a=m,f=e.className,d="",f.split(" ").forEach(function(e){void 0!==o[e]?a.push(o[e]+";"):e&&(d+=e+" ")}),g=d):null!=e.className&&(g=e.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Np=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Lp(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=Lp(n,t,e[a]),r&&(o+=i[a]);$p.lastIndex=0;for(var s,l="";null!==(s=$p.exec(o));)l+="-"+s[1];var u=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:u,styles:o,next:Np}}(p.concat(m),t.registered,y);g+=t.key+"-"+b.name,void 0!==i&&(g+=" "+i);var w=c&&void 0===l?Hp(h):u,x={};for(var S in e)c&&"as"===S||w(S)&&(x[S]=e[S]);return x.className=g,r&&(x.ref=r),n.createElement(n.Fragment,null,n.createElement(Kp,{cache:t,serialized:b,isStringTag:"string"==typeof h}),n.createElement(h,x))});return y.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",y.defaultProps=t.defaultProps,y.__emotion_real=y,y.__emotion_base=s,y.__emotion_styles=p,y.__emotion_forwardProp=l,Object.defineProperty(y,"toString",{value:function(){return"."+i}}),y.withComponent=function(t,n){return e(t,d({},r,n,{shouldForwardProp:Vp(y,n,!0)})).apply(void 0,p)},y}},Yp=__webpack_require__(20685),Qp=__webpack_require__.n(Yp);function Jp({title:e,config:t}){const n=t?.issue_reports?.url??"https://github.com/decaporg/decap-cms/issues/new";try{const r=function({config:e}){let t="";"string"==typeof DECAP_CMS_VERSION?t=`decap-cms@${DECAP_CMS_VERSION}`:"string"==typeof DECAP_CMS_APP_VERSION&&(t=`decap-cms-app@${DECAP_CMS_APP_VERSION}`);const n=function({version:e,provider:t,browser:n,config:r}){return`\n**Describe the bug**\n\n**To Reproduce**\n\n**Expected behavior**\n\n**Screenshots**\n\n**Applicable Versions:**\n - Decap CMS version: \`${e}\`\n - Git provider: \`${t}\`\n - Browser version: \`${n}\`\n\n**CMS configuration**\n\`\`\`\n${r}\n\`\`\`\n\n**Additional context**\n`}({version:t,provider:e.backend.name,browser:navigator.userAgent,config:dn().stringify(e)});return n}({config:t}),o=new URLSearchParams;return o.append("title",Qp()(e,{length:100})),o.append("body",Qp()(r,{length:4e3,omission:"\n..."})),o.append("labels","type: bug"),`${n}?${o.toString()}`}catch(e){return console.log(e),`${n}?template=bug_report.md`}}const Xp=Gp("div",{target:"e59ncyd2",label:"ErrorBoundaryContainer"})("padding:40px;h1{font-size:28px;color:",$e.colors.text,";}h2{font-size:20px;}strong{color:",$e.colors.textLead,";font-weight:500;}hr{width:200px;margin:30px 0;border:0;height:1px;background-color:",$e.colors.text,";}a{color:",$e.colors.active,";}"),Zp=Gp("span",{target:"e59ncyd1",label:"PrivacyWarning"})("color:",$e.colors.text,";"),eh=Gp("button",{target:"e59ncyd0",label:"CopyButton"})($e.buttons.button,";",$e.buttons.default,";",$e.buttons.gray,";display:block;margin:12px 0;");function th({entry:e,t}){return console.log(e),(0,Hr.jsx)(r().Fragment,null,(0,Hr.jsx)("hr",null),(0,Hr.jsx)("h2",null,t("ui.errorBoundary.recoveredEntry.heading")),(0,Hr.jsx)("strong",null,t("ui.errorBoundary.recoveredEntry.warning")),(0,Hr.jsx)(eh,{onClick:()=>navigator.clipboard.writeText(e)},t("ui.errorBoundary.recoveredEntry.copyButtonLabel")),(0,Hr.jsx)("pre",null,(0,Hr.jsx)("code",null,e)))}class nh extends r().Component{static propTypes={children:i().node,t:i().func.isRequired,config:i().object.isRequired};state={hasError:!1,errorMessage:"",errorTitle:"",backup:""};static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:e.stack||e.toString(),errorTitle:e.toString()}}componentDidMount(){i().checkPropTypes(nh.propTypes,this.props,"prop","ErrorBoundary")}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await ln.localForage.getItem("backup");e&&console.log(e),this.setState({backup:e})}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:o}=this.state,{showBackup:i,t:a}=this.props;return e?(0,Hr.jsx)(Xp,null,(0,Hr.jsx)("h1",null,a("ui.errorBoundary.title")),(0,Hr.jsx)("p",null,(0,Hr.jsx)("span",null,a("ui.errorBoundary.details")),(0,Hr.jsx)("a",{href:Jp({title:o,config:this.props.config}),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},a("ui.errorBoundary.reportIt"))),(0,Hr.jsx)("p",null,a("ui.errorBoundary.privacyWarning").split("\n").map((e,t)=>(0,Hr.jsx)(r().Fragment,null,(0,Hr.jsx)(Zp,{key:t},e),(0,Hr.jsx)("br",null)))),(0,Hr.jsx)("hr",null),(0,Hr.jsx)("h2",null,a("ui.errorBoundary.detailsHeading")),(0,Hr.jsx)("p",null,t),n&&i&&(0,Hr.jsx)(th,{entry:n,t:a})):this.props.children}}const rh=(0,Fe.Tl)()(nh);function oh({label:e,imagesOnly:t,onChange:n,disabled:r,className:o}){return(0,Hr.jsx)("label",{tabIndex:"0",className:`nc-fileUploadButton ${o||""}`},(0,Hr.jsx)("span",null,e),(0,Hr.jsx)("input",{type:"file",accept:t?"image/*":"*/*",onChange:n,disabled:r}))}oh.propTypes={className:i().string,label:i().string.isRequired,imagesOnly:i().bool,onChange:i().func.isRequired,disabled:i().bool};var ih=__webpack_require__(70373),ah=__webpack_require__.n(ih),sh={name:"1o9c9d2-ReactModalGlobalStyles",styles:".ReactModal__Body--open{overflow:hidden;};label:ReactModalGlobalStyles;"};function lh(){return(0,Hr.jsx)(Hr.Global,{styles:sh})}const uh=`\n ${$e.shadows.dropDeep};\n background-color: #fff;\n border-radius: ${$e.lengths.borderRadius};\n height: 80%;\n text-align: center;\n max-width: 2200px;\n padding: 20px;\n\n &:focus {\n outline: none;\n }\n `,ch=`\n z-index: ${$e.zIndex.zIndex99999};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0);\n transition: background-color ${$e.transitions.main}, opacity ${$e.transitions.main};\n `;class fh extends r().Component{static propTypes={children:i().node.isRequired,isOpen:i().bool.isRequired,className:i().string,onClose:i().func.isRequired};componentDidMount(){i().checkPropTypes(fh.propTypes,this.props,"prop","Modal"),ah().setAppElement("#nc-root")}render(){const{isOpen:e,children:t,className:n,onClose:o}=this.props;return(0,Hr.jsx)(r().Fragment,null,(0,Hr.jsx)(lh,null),(0,Hr.jsx)(Hr.ClassNames,null,({css:r,cx:i})=>(0,Hr.jsx)(ah(),{isOpen:e,onRequestClose:o,closeTimeoutMS:300,className:{base:i(r`
|
|
14
|
+
`),i;throw e}return`${i}/${Er()(p," /")}`}function Lo(e,t,n,r,o,i){if(!t||!t.get("data"))return e;let a=t.get("data").set(o,r);a=Po(t.get("path"),a,n.get("folder"));const s=Eo(t,Bl(n,"date"))||null,l=a.getIn(To(zl(n))),u=Do(i,[r,a.get("dirname")]);return _o(e,s,l,a,u)}var No=__webpack_require__(46343),$o=__webpack_require__.n(No),Fo=__webpack_require__(22563),zo=__webpack_require__.n(Fo);function Bo(e,t="",n="",r={}){return{collection:e,slug:t,path:n,partial:r.partial||!1,raw:r.raw||"",data:r.data||{},label:r.label||null,isModification:zo()(r.isModification)?r.isModification:null,mediaFiles:r.mediaFiles||[],author:r.author||"",updatedOn:r.updatedOn||"",status:r.status||"",meta:r.meta||{},i18n:r.i18n||{}}}const{fetchWithTimeout:Uo}=ln.unsentRequest;class qo{constructor(e){if(this.config=e,null==e.get("applicationID")||null==e.get("apiKey"))throw"The Algolia search integration needs the credentials (applicationID and apiKey) in the integration configuration.";this.applicationID=e.get("applicationID"),this.apiKey=e.get("apiKey");const t=e.get("indexPrefix");this.indexPrefix=t?`${t}-`:"",this.searchURL=`https://${this.applicationID}-dsn.algolia.net/1`,this.entriesCache={collection:null,page:null,entries:[]}}requestHeaders(e={}){return{"X-Algolia-API-Key":this.apiKey,"X-Algolia-Application-Id":this.applicationID,"Content-Type":"application/json",...e}}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const n=[];if(t.params)for(const e in t.params)n.push(`${e}=${encodeURIComponent(t.params[e])}`);return n.length&&(e+=`?${n.join("&")}`),e}request(e,t={}){const n=this.requestHeaders(t.headers||{}),r=this.urlFor(e,t);return Uo(r,{...t,headers:n}).then(e=>{const t=e.headers.get("Content-Type");return t&&t.match(/json/)?this.parseJsonResponse(e):e.text()})}search(e,t,n){const r=e.map(e=>({indexName:`${this.indexPrefix}${e}`,params:`query=${t}&page=${n}`}));return this.request(`${this.searchURL}/indexes/*/queries`,{method:"POST",body:JSON.stringify({requests:r})}).then(t=>{const r=t.results.map((t,n)=>t.hits.map(t=>{const r=t.path.split("/").pop().replace(/\.[^.]+$/,"");return Bo(e[n],r,t.path,{data:t.data,partial:!0})}));return{entries:Vt()(r),pagination:n}})}searchBy(e,t,n){return this.request(`${this.searchURL}/indexes/${this.indexPrefix}${t}`,{params:{restrictSearchableAttributes:e,query:n}})}listEntries(e,t){return this.entriesCache.collection===e&&this.entriesCache.page===t?Promise.resolve({page:this.entriesCache.page,entries:this.entriesCache.entries}):this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{page:t}}).then(t=>{const n=t.hits.map(t=>{const n=jl(e,t.path);return Bo(e.get("name"),n,t.path,{data:t.data,partial:!0})});return this.entriesCache={collection:e,pagination:t.page,entries:n},{entries:n,pagination:t.page}})}async listAllEntries(e){const t={hitsPerPage:1e3};let n=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:t}),{nbPages:r=0,hits:o,page:i}=n;for(i+=1;i<r;)n=await this.request(`${this.searchURL}/indexes/${this.indexPrefix}${e.get("name")}`,{params:{...t,page:i}}),o=[...o,...n.hits],i+=1;const a=o.map(t=>{const n=jl(e,t.path);return Bo(e.get("name"),n,t.path,{data:t.data,partial:!0})});return a}getEntry(e,t){return this.searchBy("slug",e.get("name"),t).then(n=>{const r=n.hits.filter(e=>e.slug===t)[0];return Bo(e.get("name"),t,r.path,{data:r.data,partial:!0})})}}var Wo=__webpack_require__(16735),Ho=__webpack_require__.n(Wo);const{fetchWithTimeout:Vo}=ln.unsentRequest;class Ko{constructor(e,t){if(this.config=e,null==e.get("getSignedFormURL"))throw"The AssetStore integration needs the getSignedFormURL in the integration configuration.";this.getToken=t,this.shouldConfirmUpload=e.get("shouldConfirmUpload",!1),this.getSignedFormURL=oo()(e.get("getSignedFormURL"),"/")}parseJsonResponse(e){return e.json().then(t=>e.ok?t:Promise.reject(t))}urlFor(e,t){const n=[];if(t.params)for(const e in t.params)n.push(`${e}=${encodeURIComponent(t.params[e])}`);return n.length&&(e+=`?${n.join("&")}`),e}requestHeaders(e={}){return{...e}}confirmRequest(e){this.getToken().then(t=>this.request(`${this.getSignedFormURL}/${e}`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({state:"uploaded"})}))}async request(e,t={}){const n=this.requestHeaders(t.headers||{}),r=this.urlFor(e,t),o=await Vo(r,{...t,headers:n}),i=o.headers.get("Content-Type");return i&&i.match(/json/)?await this.parseJsonResponse(o):o.text()}async retrieve(e,t,n){const r=Ho()({search:e,page:t,filter:n?"private":"public"},e=>!!e),o=go(this.getSignedFormURL,r),i={"Content-Type":"application/json",Authorization:`Bearer ${await this.getToken()}`},a=(await this.request(o,{headers:i})).map(({id:e,name:t,size:n,url:r})=>({id:e,name:t,size:n,displayURL:r,url:r,path:r}));return a}delete(e){const t=`${this.getSignedFormURL}/${e}`;return this.getToken().then(e=>this.request(t,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}}))}async upload(e,t=!1){const n={name:e.name,size:e.size};e.type&&(n.content_type=e.type),t&&(n.visibility="private");try{const t=await this.getToken(),r=await this.request(this.getSignedFormURL,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)}),o=r.form.url,i=r.form.fields,{id:a,name:s,size:l,url:u}=r.asset,c=new FormData;return Object.keys(i).forEach(e=>c.append(e,i[e])),c.append("file",e,e.name),await this.request(o,{method:"POST",body:c}),this.shouldConfirmUpload&&await this.confirmRequest(a),{success:!0,asset:{id:a,name:s,size:l,displayURL:u,url:u,path:u}}}catch(e){throw console.error(e),e}}}const Go=function(){let e=null;return(t,n,r)=>(e||(e=function(e,t){let n=(0,Ve.Map)({});return e.get("providers").forEach((e,r)=>{switch(r){case"algolia":n=n.set("algolia",new qo(e));break;case"assetStore":n=n.set("assetStore",new Ko(e,t))}}),n}(t,n)),e.get(r))}(),Yo="SEARCH_ENTRIES_REQUEST",Qo="SEARCH_ENTRIES_SUCCESS",Jo="SEARCH_ENTRIES_FAILURE",Xo="QUERY_REQUEST",Zo="QUERY_SUCCESS",ei="QUERY_FAILURE",ti="SEARCH_CLEAR",ni="CLEAR_REQUESTS";function ri(){return{type:ti}}function oi(e,t,n,r,o,i){return async(a,s)=>{const l=s(),u=Iu(l.config),c=wc(l,t,"search"),f=l.collections.find(e=>e.get("name")===t);a({type:ni});const d=`${t}-${n.join()}-${r}-${o}-${i}`,p=l.search.requests.find(({id:e})=>e==d),h=p?p.queryResponse:c?Go(l.integrations,u.getToken,c).searchBy(n.map(e=>`data.${e}`),t,r):u.query(f,n,r,o,i);a(function(e,t){return{type:Xo,payload:{searchTerm:e,request:t}}}(r,p?void 0:{id:d,expires:new Date((new Date).getTime()+1e4),queryResponse:h}));try{const t=await h;return a(function(e,t){return{type:Zo,payload:{namespace:e,hits:t}}}(e,t.hits))}catch(e){return a(function(e){return{type:ei,payload:{error:e}}}(e))}}}function ii(e,t){return new ln.Cursor(e.getIn(["cursorsByType","collectionEntries",t]))}var ai=__webpack_require__(3668),si=__webpack_require__.n(ai);function li(e,t,n){let r=t.reduce((t,r)=>{const o=r.get("name"),i=e.get(o),a=dr(r.get("widget")),s=r.get("fields");return s&&Ve.List.isList(i)?t.set(o,i.map(e=>li(e,s,n))):s&&Ve.Map.isMap(i)?t.set(o,li(i,s,n)):a&&!si()(i)?t.set(o,a[n](i)):si()(i)?t:t.set(o,i)},(0,Ve.Map)());return r=e.mergeDeep(r),r}const ui="PRESENCE",ci="CUSTOM";function fi({predicate:e,run:t}){return{type:He,predicate:e,run:t}}async function di(e,t,n=3e4){let r=!1;const o=new Promise(n=>{e(fi(t(n)))}),i=new Promise(e=>{setTimeout(()=>{r?e():(console.warn("Wait Action timed out"),e(null))},n)});return await Promise.race([o.then(e=>(r=!0,e)).catch(null),i])}const pi="NOTIFICATION_SEND",hi="NOTIFICATION_DISMISS",gi="NOTIFICATION_CLEAR";function mi(e){return{type:pi,payload:e}}function yi(e){return{type:hi,id:e}}const vi=["jpg","jpeg","png","webp"];function bi(e){const t=e.format?.toLowerCase();return{...e,format:"jpeg"===t?"jpg":t}}function wi(e,t){const n=function(e){const t=function(e){return"function"==typeof e?.get}(e)?e.get("image_transformations"):e?.image_transformations;return t?.toJS?t.toJS():t}(t)??e.image_transformations;if(n)return Array.isArray(n)?{keepOriginal:!0,variants:n.map(bi)}:{keepOriginal:n.keep_original??!0,variants:(n.variants||[]).map(bi)}}function xi(e,t){return!!t&&t.variants.length>0&&e.type.startsWith("image/")&&"image/svg+xml"!==e.type}function Si(e){switch(e){case"jpg":case"jpeg":return"image/jpeg";case"webp":return"image/webp";default:return"image/png"}}function ki(e,t,n){const r=(0,ln.basename)(e),o=e.slice(0,Math.max(0,e.length-r.length));return(0,un.join)(o,"_transformations",t,n)}const _i="MEDIA_LIBRARY_OPEN",Ei="MEDIA_LIBRARY_CLOSE",Ci="MEDIA_LIBRARY_CREATE",Oi="MEDIA_INSERT",Ti="MEDIA_REMOVE_INSERTED",Pi="MEDIA_LOAD_REQUEST",Ri="MEDIA_LOAD_SUCCESS",Mi="MEDIA_LOAD_FAILURE",Ai="MEDIA_PERSIST_REQUEST",Ii="MEDIA_PERSIST_SUCCESS",Di="MEDIA_PERSIST_FAILURE",ji="MEDIA_DELETE_REQUEST",Li="MEDIA_DELETE_SUCCESS",Ni="MEDIA_DELETE_FAILURE",$i="MEDIA_DISPLAY_URL_REQUEST",Fi="MEDIA_DISPLAY_URL_SUCCESS",zi="MEDIA_DISPLAY_URL_FAILURE";function Bi(e){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");r&&r.onClearControl({id:e})}}function Ui(e){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");r&&r.onRemoveControl({id:e})}}function qi(e={}){return(t,n)=>{const r=n().mediaLibrary.get("externalLibrary");if(r){const{controlID:t,value:n,config:o=(0,Ve.Map)(),allowMultiple:i,forImage:a}=e;r.show({id:t,value:n,config:o.toJS(),allowMultiple:i,imagesOnly:a})}t(function(e){return{type:_i,payload:e}}(e))}}function Wi(e,t){return(n,r)=>{const o=r(),i=o.config,a=o.entryDraft.get("entry"),s=o.entryDraft.getIn(["entry","collection"]),l=o.collections.get(s);n(function(e){return{type:Oi,payload:{mediaPath:e}}}(e=Array.isArray(e)?e.map(e=>_l(i,l,e,a,t)):_l(i,l,e,a,t)))}}function Hi(e){return{type:Ti,payload:{controlID:e}}}function Vi(e={}){const{delay:t=0,query:n="",page:r=1,privateUpload:o}=e;return async(e,i)=>{const a=i(),s=Iu(a.config),l=wc(a,null,"assetStore");if(l){const t=Go(a.integrations,s.getToken,l);e(Ji(r));try{const i=await t.retrieve(n,r,o);return e(Xi(i,{page:r,canPaginate:!0,dynamicSearch:!0,dynamicSearchQuery:n,privateUpload:o}))}catch(t){return e(Zi({privateUpload:o}))}}function u(){return s.getMedia().then(t=>e(Xi(t))).catch(t=>{console.error(t),404===t.status?(console.log("This 404 was expected and handled appropriately."),e(Xi([]))):e(Zi())})}return e(Ji(r)),t>0?new Promise(e=>{setTimeout(()=>e(u()),t)}):u()}}function Ki({id:e,file:t,assetProxy:n,draft:r}){return{id:e,name:(0,ln.basename)(n.path),displayURL:n.url,draft:r,file:t,size:t.size,url:n.url,path:n.path,field:n.field}}function Gi(e,t={}){const{privateUpload:n,field:r}=t;return async(t,o)=>{const i=o(),a=Iu(i.config),s=wc(i,null,"assetStore"),l=la(i,r),u=ko(e.name.toLowerCase(),i.config.slug),c=s?void 0:wi(i.config,r),f=!xi(e,c)||c?.keepOriginal,d=l.find(e=>e.name.toLowerCase()===u),p=El(i.entryDraft);if(!s&&f&&d){if(!window.confirm(`${d.name} already exists. Do you want to replace it?`))return;await t(Yi(d,{privateUpload:n}))}!s&&p||t({type:Ai});try{let o,l;if(s)try{const t=Go(i.integrations,a.getToken,s),r=await t.upload(e,n);o=[{file:e,assetProxy:_n({url:r.asset.url,path:r.asset.url})}]}catch(t){o=[{file:e,assetProxy:_n({file:e,path:u})}]}else{if(n)throw new Error("The Private Upload option is only available for Asset Store Integration");{const t=i.entryDraft.get("entry"),n=i.collections.get(t?.get("collection")),a=kl(i.config,n,t,u,r),s=await async function({file:e,fileName:t,path:n,config:r,field:o}){const i=wi(r,o);return xi(e,i)?function(e){const t=e.findIndex(e=>e.default),n=e.findIndex(e=>e.original),r=t>=0?t:n;if(r<0)return e;const o=e[r];return[...e.slice(0,r),...e.slice(r+1),o]}(await async function(e,t,n){const r=await __webpack_require__.e(20).then(__webpack_require__.bind(__webpack_require__,65020)),o=r.default;await o();const i=await async function(e){return"function"==typeof e.arrayBuffer?new Uint8Array(await e.arrayBuffer()):new Promise((t,n)=>{const r=new FileReader;r.onload=()=>t(new Uint8Array(r.result)),r.onerror=()=>n(r.error),r.readAsArrayBuffer(e)})}(e),a=r.PhotonImage.new_from_byteslice(i);try{const o=n.variants.map(n=>{const{width:o,height:i}=function(e,t){const n=e.get_width(),r=e.get_height();if(t.keep_original_size||!t.width&&!t.height)return{width:n,height:r};if(t.width&&t.height){const e=Math.min(t.width/n,t.height/r);return{width:Math.round(n*e),height:Math.round(r*e)}}if(t.width)return{width:t.width,height:Math.round(r*t.width/n)};const o=t.height;return{width:Math.round(n*o/r),height:o}}(a,n),s=o===a.get_width()&&i===a.get_height()?a:r.resize(a,o,i,r.SamplingFilter.Lanczos3),l=function(e,t){const n=(0,ln.fileExtension)(e).toLowerCase(),r=t.format||n;return vi.includes(r)?r:"png"}(e.name,n),u=function(e,t){const n=(0,ln.fileExtensionWithSeparator)(e);return`${n?(0,ln.basename)(e,n):(0,ln.basename)(e)}.${"jpeg"===t?"jpg":t}`}(e.name,l),c=function(e,t,n=75){return"jpg"===t||"jpeg"===t?e.get_bytes_jpeg(n):"webp"===t?e.get_bytes_webp():e.get_bytes()}(s,l,n.quality),f=new File([c],u,{type:Si(l)});return s!==a&&s.free(),{file:f,path:ki(t,n.name,u),default:n.default}});return n.keepOriginal?[{file:e,path:t,original:!0},...o]:o}finally{a.free()}}(e,n,i)).map(e=>({file:e.file,path:e.path||t})):[{file:e,path:n}]}({file:e,fileName:u,path:a,config:i.config,field:r});o=s.map(e=>({file:e.file,assetProxy:_n({file:e.file,path:e.path,field:r})}))}}for(const{file:e,assetProxy:r}of o){let o;if(t(ya(r)),s)o=Ki({id:await(0,ln.getBlobSHA)(e),file:e,assetProxy:r,draft:!1});else{if(p){o=Ki({id:await(0,ln.getBlobSHA)(e),file:e,assetProxy:r,draft:p}),l=t(Ns(o));continue}o=await a.persistMedia(i.config,r)}l=t(ea(o,{privateUpload:n}))}return l}catch(e){return console.error(e),t(mi({message:`Failed to persist media: ${e}`,type:"error",dismissAfter:8e3})),t(function(e={}){const{privateUpload:t}=e;return{type:Di,payload:{privateUpload:t}}}({privateUpload:n}))}}}function Yi(e,t={}){const{privateUpload:n}=t;return async(t,r)=>{const o=r(),i=Iu(o.config),a=wc(o,null,"assetStore");if(a){const r=Go(o.integrations,i.getToken,a);t(ta());try{return await r.delete(e.id),t(na(e,{privateUpload:n}))}catch(e){return console.error(e),t(mi({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(ra({privateUpload:n}))}}try{if(e.draft)t(va(e.path)),t($s({id:e.id}));else{const n=El(o.entryDraft);t(ta()),t(va(e.path)),await i.deleteMedia(o.config,e.path),t(na(e)),n&&t($s({id:e.id}))}}catch(e){return console.error(e),t(mi({message:`Failed to delete media: ${e.message}`,type:"error",dismissAfter:8e3})),t(ra())}}}function Qi(e){return async(t,n)=>{const{displayURL:r,id:o}=e,i=n(),a=ua(i,o);if(!o||!r||a.get("url")||a.get("isFetching")||a.get("err"))return Promise.resolve();if("string"==typeof r)return t(oa(o)),void t(ia(o,r));try{const e=Iu(i.config);t(oa(o));const n=await e.getMediaDisplayURL(r);if(!n)throw new Error("No display URL was returned!");t(ia(o,n))}catch(e){console.error(e),t(function(e,t){return{type:zi,payload:{key:e,err:t}}}(o,e))}}}function Ji(e){return{type:Pi,payload:{page:e}}}function Xi(e,t={}){return{type:Ri,payload:{files:e,...t}}}function Zi(e={}){const{privateUpload:t}=e;return{type:Mi,payload:{privateUpload:t}}}function ea(e,t={}){const{privateUpload:n}=t;return{type:Ii,payload:{file:e,privateUpload:n}}}function ta(){return{type:ji}}function na(e,t={}){const{privateUpload:n}=t;return{type:Li,payload:{file:e,privateUpload:n}}}function ra(e={}){const{privateUpload:t}=e;return{type:Ni,payload:{privateUpload:t}}}function oa(e){return{type:$i,payload:{key:e}}}function ia(e,t){return{type:Fi,payload:{key:e,url:t}}}async function aa(e,t){!1===t.mediaLibrary.get("isLoading")||t.mediaLibrary.get("externalLibrary")||await di(e,e=>({predicate:({type:e})=>e===Ri||e===Mi,run:()=>e()}))}const sa={isVisible:!1,showMediaButton:!0,controlMedia:(0,Ve.Map)(),displayURLs:(0,Ve.Map)(),config:(0,Ve.Map)()};function la(e,t){const{mediaLibrary:n,entryDraft:r}=e,o=El(e.entryDraft),i=wc(e,null,"assetStore");let a;if(o&&!i){const n=r.getIn(["entry","mediaFiles"],(0,Ve.List)()).toJS(),o=r.get("entry"),i=e.collections.get(o?.get("collection")),s=Sl(e.config,i,o,t);a=n.filter(e=>(0,un.dirname)(e.path)===s).map(e=>({key:e.id,...e}))}else a=n.get("files")||[];return a}function ua(e,t){return e.mediaLibrary.getIn(["displayURLs",t],(0,Ve.Map)())}const ca="ADD_ASSETS",fa="ADD_ASSET",da="REMOVE_ASSET",pa="LOAD_ASSET_REQUEST",ha="LOAD_ASSET_SUCCESS",ga="LOAD_ASSET_FAILURE";function ma(e){return{type:ca,payload:e}}function ya(e){return{type:fa,payload:e}}function va(e){return{type:da,payload:e}}const ba=_n({path:"empty.svg",file:new File(['<svg xmlns="http://www.w3.org/2000/svg"></svg>'],"empty.svg",{type:"image/svg+xml"})});function wa(e,t,n){return function(r,o){return e(xa({collection:t,entry:n,path:r,field:o}))}}function xa({collection:e,entry:t,path:n,field:r}){return(o,i)=>{if(!n)return ba;const a=i(),s=kl(a.config,e,t,n,r);let{asset:l,isLoading:u,error:c}=a.medias[s]||{};return u?ba:l||((0,ln.isAbsolutePath)(s)||c?(l=_n({path:s,url:n}),o(ya(l))):(o(function(e){return async(t,n)=>{try{t({type:pa,payload:{path:e}}),await aa(t,n());const i=(r=n(),o=e,la(r).find(e=>e.path===o));if(i){const r=await async function(e,t,n){const r=ua(t,n.id);let o;if(r.get("url"))o=r.get("url");else if(r.get("err"))o=null;else{const t=n.id,i=di(e,e=>({predicate:({type:e,payload:n})=>(e===Fi||e===zi)&&n.key===t,run:(t,n,r)=>e(r.payload.url)}));r.get("isFetching")||e(Qi(n)),o=await i??null}return o}(t,n(),i);t(ya(_n({path:e,url:r||e})))}else{const{url:r}=await async function(e,t){const n=Iu(e.config),{url:r}=await n.getMediaFile(t);return{url:r}}(n(),e);t(ya(_n({path:e,url:r})))}t(function(e){return{type:ha,payload:{path:e}}}(e))}catch(n){t(function(e,t){return{type:ga,payload:{path:e,error:t}}}(e,n))}var r,o}}(s)),l=ba),l)}}const Sa=function(e){void 0===e&&(e={}),fe||re(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),r=n.getUserConfirmation,o=void 0===r?de:r,i=n.hashType,a=void 0===i?"slash":i,s=e.basename?se(oe(e.basename)):"",l=he[a],u=l.encodePath,c=l.decodePath;function f(){var e=c(me());return s&&(e=ae(e,s)),ue(e)}var p=ce();function h(e){d(C,e),C.length=t.length,p.notifyListeners(C.location,C.action)}var g=!1,m=null;function y(){var e=me(),t=u(e);if(e!==t)ye(t);else{var n=f(),r=C.location;if(!g&&function(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash}(r,n))return;if(m===le(n))return;m=null,function(e){if(g)g=!1,h();else{p.confirmTransitionTo(e,"POP",o,function(t){t?h({action:"POP",location:e}):function(e){var t=C.location,n=x.lastIndexOf(le(t));-1===n&&(n=0);var r=x.lastIndexOf(le(e));-1===r&&(r=0);var o=n-r;o&&(g=!0,S(o))}(e)})}}(n)}}var v=me(),b=u(v);v!==b&&ye(b);var w=f(),x=[le(w)];function S(e){t.go(e)}var k=0;function _(e){1===(k+=e)&&1===e?window.addEventListener(pe,y):0===k&&window.removeEventListener(pe,y)}var E=!1,C={length:t.length,action:"POP",location:w,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=ge(window.location.href)),n+"#"+u(s+le(e))},push:function(e,t){var n="PUSH",r=ue(e,void 0,void 0,C.location);p.confirmTransitionTo(r,n,o,function(e){if(e){var t=le(r),o=u(s+t);if(me()!==o){m=t,function(e){window.location.hash=e}(o);var i=x.lastIndexOf(le(C.location)),a=x.slice(0,i+1);a.push(t),x=a,h({action:n,location:r})}else h()}})},replace:function(e,t){var n="REPLACE",r=ue(e,void 0,void 0,C.location);p.confirmTransitionTo(r,n,o,function(e){if(e){var t=le(r),o=u(s+t);me()!==o&&(m=t,ye(o));var i=x.indexOf(le(C.location));-1!==i&&(x[i]=t),h({action:n,location:r})}})},go:S,goBack:function(){S(-1)},goForward:function(){S(1)},block:function(e){void 0===e&&(e=!1);var t=p.setPrompt(e);return E||(_(1),E=!0),function(){return E&&(E=!1,_(-1)),t()}},listen:function(e){var t=p.appendListener(e);return _(1),function(){_(-1),t()}}};return C}();function ka(e){return Sa.push(`/collections/${e}`)}function _a(e){return Sa.replace(`/collections/${e}/new`)}function Ea(e,t){return Sa.replace(`/collections/${e}/entries/${t}`)}const Ca="UNPUBLISHED_ENTRY_REQUEST",Oa="UNPUBLISHED_ENTRY_SUCCESS",Ta="UNPUBLISHED_ENTRY_REDIRECT",Pa="UNPUBLISHED_ENTRIES_REQUEST",Ra="UNPUBLISHED_ENTRIES_SUCCESS",Ma="UNPUBLISHED_ENTRY_PERSIST_REQUEST",Aa="UNPUBLISHED_ENTRY_PERSIST_SUCCESS",Ia="UNPUBLISHED_ENTRY_PERSIST_FAILURE",Da="UNPUBLISHED_ENTRY_STATUS_CHANGE_REQUEST",ja="UNPUBLISHED_ENTRY_STATUS_CHANGE_SUCCESS",La="UNPUBLISHED_ENTRY_STATUS_CHANGE_FAILURE",Na="UNPUBLISHED_ENTRY_PUBLISH_REQUEST",$a="UNPUBLISHED_ENTRY_PUBLISH_SUCCESS",Fa="UNPUBLISHED_ENTRY_PUBLISH_FAILURE",za="UNPUBLISHED_ENTRY_DELETE_SUCCESS";function Ba(e,t){return{type:Ra,payload:{entries:e,pages:t}}}function Ua(e,t){return{type:Ma,payload:{collection:e.get("name"),slug:t}}}function qa(e,t){return{type:Aa,payload:{collection:e.get("name"),entry:t}}}function Wa(e,t,n){return{type:Ia,payload:{error:e,collection:t.get("name"),slug:n},error:e}}function Ha(e,t){return async(n,r)=>{const o=r(),i=Iu(o.config);if(!nn()(o.editorialWorkflow.toJS(),"pages.ids",!1))try{const{entries:e,pagination:t}=await i.unpublishedEntries(o.collections);n(Ba(e,t))}catch(e){}n(function(e,t){return{type:Ca,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const r=await i.unpublishedEntry(o,e,t),a=await Promise.all(r.mediaFiles.filter(e=>e.draft).map(({url:e,file:t,path:n})=>_n({path:n,url:e,file:t})));n(ma(a)),n(function(e,t){return{type:Oa,payload:{collection:e.get("name"),entry:t}}}(e,r)),n(js(r))}catch(r){r.name===ln.EDITORIAL_WORKFLOW_ERROR&&r.notUnderEditorialWorkflow?(n(function(e,t){return{type:Ta,payload:{collection:e.get("name"),slug:t}}}(e,t)),n(Fs(e,t))):n(mi({message:{key:"ui.toast.onFailToLoadEntries",details:r},type:"error",dismissAfter:8e3}))}}}function Va(e){return(t,n)=>{const r=n(),o=Iu(r.config),i=nn()(r.editorialWorkflow.toJS(),"pages.ids",!1);r.config.publish_mode!==Pr||i||(t({type:Pa}),o.unpublishedEntries(e).then(e=>t(Ba(e.entries,e.pagination))).catch(e=>{t(mi({message:{key:"ui.toast.onFailToLoadEntries",details:e},type:"error",dismissAfter:8e3})),t(function(e){return{type:"UNPUBLISHED_ENTRIES_FAILURE",error:"Failed to load entries",payload:e}}(e)),Promise.reject(e)}))}}function Ka(e,t,n,r){return(o,i)=>{if(n===r)return;const a=i(),s=Iu(a.config);o(function(e,t){return{type:Da,payload:{collection:e,slug:t}}}(e,t)),s.updateUnpublishedEntryStatus(e,t,r).then(()=>{o(mi({message:{key:"ui.toast.entryUpdated"},type:"success",dismissAfter:4e3})),o(function(e,t,n){return{type:ja,payload:{collection:e,slug:t,newStatus:n}}}(e,t,r))}).catch(n=>{o(mi({message:{key:"ui.toast.onFailToUpdateStatus",details:n},type:"error",dismissAfter:8e3})),o(function(e,t){return{type:La,payload:{collection:e,slug:t}}}(e,t))})}}function Ga(e,t){return(n,r)=>{const o=r(),i=Iu(o.config);return n(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_REQUEST",payload:{collection:e,slug:t}}}(e,t)),i.deleteUnpublishedEntry(e,t).then(()=>{n(mi({message:{key:"ui.toast.onDeleteUnpublishedChanges"},type:"success",dismissAfter:4e3})),n(function(e,t){return{type:za,payload:{collection:e,slug:t}}}(e,t))}).catch(r=>{n(mi({message:{key:"ui.toast.onDeleteUnpublishedChanges",details:r},type:"error",dismissAfter:8e3})),n(function(e,t){return{type:"UNPUBLISHED_ENTRY_DELETE_FAILURE",payload:{collection:e,slug:t}}}(e,t))})}}function Ya(e,t){return async(n,r)=>{const o=r(),i=o.collections,a=Iu(o.config),s=vc(o,e,t);n(function(e,t){return{type:Na,payload:{collection:e,slug:t}}}(e,t));try{await a.publishUnpublishedEntry(s),n(Vi()),n(mi({message:{key:"ui.toast.entryPublished"},type:"success",dismissAfter:4e3})),n(function(e,t){return{type:$a,payload:{collection:e,slug:t}}}(e,t));const r=i.get(e);if(!r.has("nested"))return n(Fs(r,t));{n(qs(r));const e=Tu(r,s.get("path"));Fs(r,e),t!==e&&El(o.entryDraft)&&Ea(r.get("name"),e)}}catch(r){n(mi({message:{key:"ui.toast.onFailToPublishEntry",details:r},type:"error",dismissAfter:8e3})),n(function(e,t){return{type:Fa,payload:{collection:e,slug:t}}}(e,t))}}}const Qa=(0,Ve.Map)({entry:(0,Ve.Map)(),fieldsMetaData:(0,Ve.Map)(),fieldsErrors:(0,Ve.Map)(),hasChanged:!1,key:""});function Ja(e,t){if(!ql(e))return;const n=t.getIn(["entry","meta"]),r=n&&n.get("path");if(!r)return;const o=Al(e),i=nn()(e.toJS(),["meta","path","index_file"]);if(i)return(0,un.join)(e.get("folder"),r,`${i}.${o}`);const a=t.getIn(["entry","newRecord"]),s=t.getIn(["entry","path"]);let l;if(a||!s){const e=t.getIn(["entry","data"]);l=(u=e&&e.get("title"))&&ko(u.toString().toLowerCase().trim(),{sanitize_replacement:"-",encoding:"unicode"})||"untitled"}else l=(0,un.basename)(s,`.${o}`);var u;return(0,un.join)(e.get("folder"),r,`${l}.${o}`)}const Xa="ENTRY_REQUEST",Za="ENTRY_SUCCESS",es="ENTRY_FAILURE",ts="ENTRIES_REQUEST",ns="ENTRIES_SUCCESS",rs="ENTRIES_FAILURE",os="SORT_ENTRIES_REQUEST",is="SORT_ENTRIES_SUCCESS",as="SORT_ENTRIES_FAILURE",ss="FILTER_ENTRIES_REQUEST",ls="FILTER_ENTRIES_SUCCESS",us="FILTER_ENTRIES_FAILURE",cs="GROUP_ENTRIES_REQUEST",fs="GROUP_ENTRIES_SUCCESS",ds="GROUP_ENTRIES_FAILURE",ps="DRAFT_CREATE_FROM_ENTRY",hs="DRAFT_CREATE_EMPTY",gs="DRAFT_DISCARD",ms="DRAFT_CHANGE_FIELD",ys="DRAFT_VALIDATION_ERRORS",vs="DRAFT_CLEAR_ERRORS",bs="DRAFT_LOCAL_BACKUP_RETRIEVED",ws="DRAFT_CREATE_FROM_LOCAL_BACKUP",xs="DRAFT_CREATE_DUPLICATE_FROM_ENTRY",Ss="ENTRY_PERSIST_REQUEST",ks="ENTRY_PERSIST_SUCCESS",_s="ENTRY_PERSIST_FAILURE",Es="ENTRY_DELETE_SUCCESS",Cs="ADD_DRAFT_ENTRY_MEDIA_FILE",Os="REMOVE_DRAFT_ENTRY_MEDIA_FILE",Ts="CHANGE_VIEW_STYLE";function Ps(e){return{type:ts,payload:{collection:e.get("name")}}}function Rs(e,t,n,r,o=!0){return{type:ns,payload:{collection:e.get("name"),entries:t,page:n,cursor:ln.Cursor.create(r),append:o}}}function Ms(e,t){return{type:rs,error:"Failed to load entries",payload:t.toString(),meta:{collection:e.get("name")}}}async function As(e,t){const n=Iu(e.config),r=wc(e,t.get("name"),"listEntries"),o=r?Go(e.integrations,n.getToken,r):n;return await o.listAllEntries(t)}function Is(e,t,n=Xr.Ascending){return async(r,o)=>{const i=o(),a=yl(i.entries,e.get("name"));if(r({type:os,payload:{collection:e.get("name"),key:t,direction:n}}),!a)try{const o=await As(i,e);r({type:is,payload:{collection:e.get("name"),key:t,direction:n,entries:o}})}catch(o){r({type:as,payload:{collection:e.get("name"),key:t,direction:n,error:o}})}}}function Ds(e,t){return{type:Es,payload:{collectionName:e.get("name"),entrySlug:t}}}function js(e){return{type:ps,payload:{entry:e}}}function Ls(e){return{type:vs,payload:{uniqueFieldId:e}}}function Ns(e){return{type:Cs,payload:e}}function $s({id:e}){return{type:Os,payload:{id:e}}}function Fs(e,t){return async(n,r)=>{await aa(n,r()),n(function(e,t){return{type:Xa,payload:{collection:e.get("name"),slug:t}}}(e,t));try{const o=await zs(r(),e,t);n(function(e,t){return{type:Za,payload:{collection:e.get("name"),entry:t}}}(e,o)),n(js(o))}catch(r){n(mi({message:{details:r.message,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),n(function(e,t,n){return{type:es,payload:{error:e,collection:t.get("name"),slug:n}}}(r,e,t))}}}async function zs(e,t,n){const r=Iu(e.config);return await r.getEntry(e,t,n)}const Bs=(0,Ve.fromJS)({append_next:{action:"next",append:!0}});function Us(e){return ln.Cursor.create(e).updateStore("actions",e=>e.union(Bs.filter(t=>e.has(t.get("action"))).keySeq()))}function qs(e,t=0){return async(n,r)=>{if(e.get("isFetching"))return;const o=r(),i=dl(o.entries,e.get("name"));if(i&&i.length>0){const t=i[0];return n(Is(e,t.get("key"),t.get("direction")))}const a=function(e){const t=e.get("sortable_fields").toArray().find(e=>void 0!==e.get("default_sort"));if(!t)return null;const n=t.get("field"),r=t.get("default_sort");let o;return o=!0===r||"asc"===r?"asc":"desc"===r?"desc":"asc",{field:n,direction:o}}(e);if(a){const t="desc"===a.direction?Xr.Descending:Xr.Ascending;return n(Is(e,a.field,t))}const s=Iu(o.config),l=wc(o,e.get("name"),"listEntries"),u=l?Go(o.integrations,s.getToken,l):s,c=!!(t&&!isNaN(t)&&t>0);n(Ps(e));try{const r=e.has("nested")||Kl(e);let o=await(r?u.listAllEntries(e).then(e=>({entries:e})):u.listEntries(e,t));o={...o,cursor:l?ln.Cursor.create({actions:["next"],meta:{usingOldPaginationAPI:!0},data:{nextPage:t+1}}):ln.Cursor.create(o.cursor)},n(Rs(e,o.cursor.meta.get("usingOldPaginationAPI")?o.entries.reverse():o.entries,o.pagination,Us(o.cursor),c))}catch(t){return n(mi({message:{details:t,key:"ui.toast.onFailToLoadEntries"},type:"error",dismissAfter:8e3})),Promise.reject(n(Ms(e,t)))}}}function Ws(e){return!!["true","True","TRUE"].includes(e)||!["false","False","FALSE"].includes(e)&&function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(e)}function Hs(e,t=()=>!1){return e.reduce((e,n)=>{const r=e,o=n;if(t(o))return r;const i=o.get("field")||o.get("fields"),a="list"==o.get("widget"),s=o.get("name"),l=o.get("default",null);if(Ve.List.isList(i)||Ve.Map.isMap(i)){if(a&&Ve.List.isList(l))r[s]=l;else{const e=Ve.List.isList(i)?i:(0,Ve.List)([i]),n=a?[Hs(e,t)]:Hs(e,t);u=n,[[{}],{}].some(e=>$o()(u,e))||(r[s]=n)}return r}var u;return null!==l&&(r[s]=l),r},{})}function Vs({entry:e}){return e.get("mediaFiles").toArray().filter(e=>e.get("draft")).map(e=>_n({path:e.get("path"),file:e.get("file"),url:e.get("url"),field:e.get("field")}))}function Ks(e,t){const n=Ml(e,t.get("slug"));function r(e){return function(e,t){return li(e,t,"serialize")}(e,n)}const o=r(t.get("data"));let i=t.set("data",o);return Kl(e)&&(i=function(e,t,n){const{locales:r,defaultLocale:o}=Gl(e);return r.filter(e=>e!==o).forEach(e=>{const r=Xl(e);t=t.setIn(r,n(t.getIn(r)))}),t}(e,i,r)),i}function Gs(e,t,n){return{error:{type:ci,message:n(`editor.editorControlPane.widget.${t}`,{path:e})}}}const Ys="VIEW_STYLE_LIST",Qs="VIEW_STYLE_GRID",{keyToPathArray:Js}=cn.stringTemplate;let Xs,Zs,el,tl,nl;const rl="decap-cms.entries.sort",ol="decap-cms.entries.viewStyle";function il(e){return e?e.replace(/([^:]\/)\/+/g,"$1"):e}const al=Yr()(()=>{const e=localStorage.getItem(rl);if(e)try{const t=JSON.parse(e);let n=(0,Ve.Map)();return Object.entries(t).forEach(([e,t])=>{let r=(0,Ve.OrderedMap)();en()(Object.values(t),["index"]).forEach(e=>{const{key:t,direction:n}=e;r=r.set(t,(0,Ve.fromJS)({key:t,direction:n}))}),n=n.set(e,r)}),n}catch(e){return(0,Ve.Map)()}return(0,Ve.Map)()});function sl(e){if(e){const t={};e.keySeq().forEach(n=>{const r=n;e.get(r).valueSeq().toJS().map((e,t)=>({...e,index:t})).forEach(e=>{on()(t,[r,e.key],e)})}),localStorage.setItem(rl,JSON.stringify(t))}else localStorage.removeItem(rl)}const ll=Yr()(()=>localStorage.getItem(ol)||(localStorage.setItem(ol,Ys),Ys));function ul(e,t){const n=e.get("sort");return n?.get(t)}function cl(e,t){const n=e.get("filter");return n?.get(t)||(0,Ve.Map)()}function fl(e,t){const n=e.get("group");return n?.get(t)||(0,Ve.Map)()}function dl(e,t){const n=ul(e,t),r=n?.valueSeq().filter(e=>e?.get("direction")!==Xr.None).toArray()||[];return r}function pl(e,t,n){return e.getIn(["entities",`${t}.${n}`])}function hl(e,t){return e.getIn(["pages",t,"ids"],(0,Ve.List)())}function gl(e,t){const n=hl(e,t),r=n&&n.map(n=>pl(e,t,n));return r}function ml(e,t){const n=t.get("name");let r=gl(e,n);const o=dl(e,n);if(o&&o.length>0){const e=o.map(e=>function(e,t){return t===Wr?"updatedOn":t!==qr||$l(e,t)?`data.${t}`:"author"}(t,e.get("key"))),n=o.map(e=>e.get("direction")===Xr.Ascending?"asc":"desc");r=(0,Ve.fromJS)(Jr()(r.toJS(),e,n))}const i=function(e,t){const n=cl(e,t),r=n?.valueSeq().filter(e=>!0===e?.get("active")).toArray()||[];return r}(e,n);return i&&i.length>0&&(r=r.filter(e=>{const t=i.every(t=>{const n=t.get("pattern"),r=t.get("field"),o=(e.get("data")||(0,Ve.Map)()).getIn(Js(r));return void 0!==o&&new RegExp(String(n)).test(String(o))});return t}).toList()),r}function yl(e,t){return e.getIn(["pages",t,"isFetching"],!1)}function vl(e,t){const n=e.find(e=>e?.get("name")===t);return n}function bl(e,t,n,r){if(!t)return!1;if(r&&r.has(e))return!0;if(t.has("files")){const r=vl(t.get("files"),n);if(r&&r.has(e))return!0}return!!t.has(e)}function wl(e,t,n,r,o,i,a){const s=i.filter(e=>e===o)[0];if(s)return Lo(s.has(e)?s.get(e):`{{${e}}}`,r,n,a,e,t.slug);for(let s of i){s.has(e)||(s=s.set(e,`{{${e}}}`));const i=Lo(s.get(e),r,n,a,e,t.slug);let l=null;if(s.has("fields")?l=wl(e,t,n,r,o,s.get("fields").toArray(),i):s.has("field")?l=wl(e,t,n,r,o,[s.get("field")],i):s.has("types")&&(l=wl(e,t,n,r,o,s.get("types").toArray(),i)),null!=l)return l}return null}function xl(e,t,n,r,o){let i=t[e];if(n.has(e)||(n=n.set(e,`{{${e}}}`)),n.has("files")){i=Lo(n.get(e),r,n,i,e,t.slug);let a=vl(n.get("files"),r?.get("slug"));if(a&&(a.has(e)||(a=a.set(e,`{{${e}}}`)),i=Lo(a.get(e),r,n,i,e,t.slug),o)){const s=wl(e,t,n,r,o,a.get("fields").toArray(),i);null!==s&&(i=s)}}else if(i=Lo(n.get(e),r,n,i,e,t.slug),o){const a=wl(e,t,n,r,o,n.get("fields").toArray(),i);null!==a&&(i=a)}return i}function Sl(e,t,n,r){const o="media_folder";let i=e[o];if(bl(o,t,n?.get("slug"),r)){const a=xl(o,e,t,n,r);if(a.startsWith("/"))i=(0,un.join)(a);else{const e=n?.get("path");i=e?(0,un.join)((0,un.dirname)(e),a):t.get("folder")}}return Xt()(i,"/")}function kl(e,t,n,r,o){if((0,ln.isAbsolutePath)(r))return r;const i=Sl(e,t,n,o);return(0,un.join)(i,(0,ln.basename)(r))}function _l(e,t,n,r,o){if((0,ln.isAbsolutePath)(n))return n;const i="public_folder";let a=il(e[i]);return bl(i,t,r?.get("slug"),o)&&(a=il(xl(i,e,t,r,o))),(0,ln.isAbsolutePath)(a)?function(e,...t){return so()(e,...t)}(a,(0,ln.basename)(n)):(0,un.join)(a,(0,ln.basename)(n))}function El(e){const t=e.get("entry");return t&&!t.isEmpty()}const{keyToPathArray:Cl}=cn.stringTemplate,Ol=(0,Ve.fromJS)({}),Tl={[Ur]:{entryExtension(e){const t=e.get("extension")||nn()({...wr,...vr()},e.get("format")||"frontmatter");if(!t)throw new Error(`No extension found for format ${e.get("format")}`);return t.replace(/^\./,"")},fields:e=>e.get("fields"),entryPath(e,t){return`${e.get("folder").replace(/\/$/,"")}/${t}.${this.entryExtension(e)}`},entrySlug(e,t){const n=e.get("folder").replace(/\/$/,""),r=t.split(n+"/").pop()?.replace(new RegExp(`\\.${zr()(this.entryExtension(e))}$`),"");return r},allowNewEntries:e=>e.get("create"),allowDeletion:e=>e.get("delete",!0),templateName:e=>e.get("name")},[Br]:{fileForEntry(e,t){const n=e.get("files");return n&&n.filter(e=>e?.get("name")===t).get(0)},fields(e,t){const n=this.fileForEntry(e,t);return n&&n.get("fields")},entryPath(e,t){const n=this.fileForEntry(e,t);return n&&n.get("file")},entrySlug(e,t){const n=e.get("files").filter(e=>e?.get("file")===t).get(0);return n&&n.get("name")},entryLabel(e,t){const n=this.fileForEntry(e,t);return n&&n.get("label")},allowNewEntries:()=>!1,allowDeletion:e=>e.get("delete",!1),templateName:(e,t)=>t}};function Pl(e){const t=e.reduce((e,t)=>{if(t.has("media_folder")&&(e=[...e,t]),t.has("fields")){const n=t.get("fields")?.toArray();e=[...e,...Pl(n)]}else if(t.has("field")){const n=t.get("field");e=[...e,...Pl([n])]}else if(t.has("types")){const n=t.get("types")?.toArray();e=[...e,...Pl(n)]}return e},[]);return t}function Rl(e,t){return e.get("files")?.toArray().find(e=>e.get("name")===t)}function Ml(e,t){return Tl[e.get("type")].fields(e,t)}function Al(e){return Tl[Ur].entryExtension(e)}function Il(e,t){return Tl[Br].entryLabel(e,t)}function Dl(e,t){return Tl[e.get("type")].entryPath(e,t)}function jl(e,t){return Tl[e.get("type")].entrySlug(e,t)}function Ll(e){return Tl[e.get("type")].allowDeletion(e)}function Nl(e,t=""){let n=e.map(e=>`${t}${e.get("name")}`);return e.forEach((e,t)=>{if(e.has("fields")){const r=e.get("fields")?.toArray();n=[...n,...Nl(r,`${n[t]}.`)]}else if(e.has("field")){const r=e.get("field");n=[...n,...Nl([r],`${n[t]}.`)]}else if(e.has("types")){const r=e.get("types")?.toArray();n=[...n,...Nl(r,`${n[t]}.`)]}}),n}function $l(e,t){const n=Cl(t);let r,o,i=e.get("fields",(0,Ve.List)()).toArray();for(;(r=n.shift())&&i;)o=i.find(e=>e.get("name")===r),o?.has("fields")?i=o?.get("fields")?.toArray():o?.has("field")?i=[o?.get("field")]:o?.has("types")&&(i=o?.get("types")?.toArray());return o}function Fl(e,t,n=()=>!1){return n()||(e=e.map(e=>{const r=t(e);return n()?r:r.has("fields")?r.set("fields",Fl(r.get("fields"),t,n)):r.has("field")?r.set("field",Fl((0,Ve.List)([r.get("field")]),t,n).get(0)):r.has("types")?r.set("types",Fl(r.get("types"),t,n)):r}).toList()),e}function zl(e){const t=e.get("identifier_field"),n=t?[t,...Vr]:[...Vr],r=Nl(e.get("fields",(0,Ve.List)()).toArray());return n.find(e=>r.find(t=>t.toLowerCase().trim()===e.toLowerCase().trim()))}function Bl(e,t){if("title"===t&&e.get("identifier_field"))return zl(e);const n=Kr[t],r=e.get("fields");let o;if(!r||!n)return null;const i=r.filter(e=>e?.get("widget","string")===n.type).map(e=>e?.get("name"));if(o=i.filter(e=>-1!==n.synonyms.indexOf(e)),o&&o.size>0)return o.first();const a=r.filter(e=>-1!==n.secondaryTypes.indexOf(e?.get("widget","string"))).map(e=>e?.get("name"));return o=a.filter(e=>-1!==n.synonyms.indexOf(e)),o&&o.size>0?o.first():n.fallbackToFirstField&&i.size>0?i.first():(n.showError&&(s=`The Field ${t} is missing for the collection “${e.get("name")}”`,l=`Decap CMS tries to infer the entry ${t} automatically, but one couldn't be found for entries of the collection “${e.get("name")}”. Please check your site configuration.`,console.error(`%c ⛔ ${s}\n%c${l}\n\n`,"color: black; font-weight: bold; font-size: 16px; line-height: 50px;","color: black;")),null);var s,l}function Ul(e,t){const n=e.get("summary");if(n)return function(e,t,n){let r=t.get("data");const o=Eo(t,Bl(n,"date"))||null,i=r.getIn(To(zl(n)));return r=Po(t.get("path"),r,n.get("folder")),t.get("author")&&!$l(n,qr)&&(r=r.set(qr,t.get("author"))),t.get("updatedOn")&&!$l(n,Wr)&&(r=r.set(Wr,t.get("updatedOn"))),_o(e,o,i,r)}(n,t,e);if(e.get("type")==Br){const n=Il(e,t.get("slug"));if(n)return n}const r=t.get("data"),o=Bl(e,"title"),i=o&&r.getIn(Cl(o));return i||"title"===o?i:r.getIn(Cl("title"))}function ql(e){return e.has("folder")&&e.get("type")===Ur&&e.has("meta")&&e.get("meta")?.has("path")}const Wl="i18n";let Hl=function(e){return e.MULTIPLE_FOLDERS="multiple_folders",e.MULTIPLE_FILES="multiple_files",e.SINGLE_FILE="single_file",e}({}),Vl=function(e){return e.TRANSLATE="translate",e.DUPLICATE="duplicate",e.NONE="none",e}({});function Kl(e){return e.has(Wl)}function Gl(e){if(!Kl(e))return{};const{structure:t,locales:n,default_locale:r}=e.get(Wl).toJS();return{structure:t,locales:n,defaultLocale:r}}function Yl(e,t,n){return t!==n&&e.get(Wl)===Vl.TRANSLATE}function Ql(e,t,n){return t!==n&&e.get(Wl)===Vl.DUPLICATE}function Jl(e,t,n){return t!==n&&e.get(Wl)===Vl.NONE}function Xl(e){return[Wl,e,"data"]}function Zl(e,t){return e!==t?Xl(e):["data"]}function eu(e,t,n,r,o){switch(e){case Hl.MULTIPLE_FOLDERS:return n.replace(`/${r}`,`/${o}/${r}`);case Hl.MULTIPLE_FILES:return n.replace(new RegExp(`${zr()(t)}$`),`${o}.${t}`);case Hl.SINGLE_FILE:default:return n}}function tu(e,t,n){switch(e){case Hl.MULTIPLE_FOLDERS:{const e=n.split("/");return e.pop(),e.pop()}case Hl.MULTIPLE_FILES:return n.slice(0,-`.${t}`.length).split(".").pop();case Hl.SINGLE_FILE:default:return""}}function nu(e,t,n,r){const{structure:o,locales:i}=Gl(e);return o===Hl.SINGLE_FILE?[n]:i.map(e=>eu(o,t,n,r,e))}function ru(e,t,n){switch(e){case Hl.MULTIPLE_FOLDERS:return t.replace(`${n}/`,"");case Hl.MULTIPLE_FILES:return t.replace(`.${n}`,"");case Hl.SINGLE_FILE:default:return t}}function ou(e,t,n,r){let o=r.find(e=>e.locale===n);o||(o=r[0],console.warn(`Could not locale entry for default locale '${n}'`));const i=r.filter(e=>e.locale!==o.locale).reduce((t,{locale:n,value:r})=>{const i=Xl(n);return o&&function(e,t,n){void 0!==e.get("fields")&&e.get("fields").forEach(e=>{e&&e.get(Wl)===Vl.DUPLICATE&&(t.data[e.get("name")]||(t.data[e.get("name")]=n.data[e.get("name")]))})}(e,r,o.value),on()(t,i,r.data)},{}),a=ru(t,o.value.path,n),s=jl(e,a);return{...o.value,raw:"",...i,path:a,slug:s}}function iu(e,t,n){const r=e.data[t]||{},o=n.filter(e=>e!==t).map(t=>({locale:t,value:e.data[t]})).filter(e=>e.value).reduce((e,t)=>({...e,[t.locale]:{data:t.value}}),{});return{...e,data:r,i18n:o,raw:""}}function au(e,t,n){const{structure:r,defaultLocale:o,locales:i}=Gl(e);if(r===Hl.SINGLE_FILE)return n.map(e=>iu(e,o,i));const a=$r()(n.map(e=>({locale:tu(r,t,e.path),value:e})),({locale:e,value:t})=>ru(r,t.path,e));return Object.values(a).reduce((t,n)=>[...t,ou(e,r,o,n)],[])}function su(e,t,n,r,o=[t.get("name")]){const i=e.getIn(["entry","data",...o]);return t.get(Wl)===Vl.DUPLICATE&&n.filter(e=>e!==r).forEach(t=>{e=e.setIn(["entry",...Zl(t,r),...o],i)}),t.has("field")&&!Ve.List.isList(i)?[t.get("field")].forEach(t=>{e=su(e,t,n,r,[...o,t.get("name")])}):t.has("fields")&&!Ve.List.isList(i)&&t.get("fields").toArray().forEach(t=>{e=su(e,t,n,r,[...o,t.get("name")])}),e}const lu={type:"string",minLength:2,maxLength:10,pattern:"^[a-zA-Z-_]+$"},uu={type:"object",properties:{structure:{type:"string",enum:Object.values(Hl)},locales:{type:"array",minItems:1,items:lu,uniqueItems:!0},default_locale:lu}};Object.values(Vl);Error;function cu(e){const t=(e.integrations||[]).reduce((t,n)=>{const{hooks:r,collections:o,provider:i,...a}=n;if(t.providers[i]={...a},!o)return r.forEach(e=>{t.hooks[e]=i}),t;const s="*"===o?e.collections.map(e=>e.name):o;return s.forEach(e=>{r.forEach(n=>{t.hooks[e]?t.hooks[e][n]=i:t.hooks[e]={[n]:i}})}),t},{providers:{},hooks:{}});return(0,Ve.fromJS)(t)}const fu=(0,Ve.fromJS)({providers:{},hooks:{}});function du(e,t,n){return t?e.getIn(["hooks",t,n],!1):e.getIn(["hooks",n],!1)}const pu="CONFIG_REQUEST",hu="CONFIG_SUCCESS",gu="CONFIG_FAILURE";function mu(e){return{type:gu,error:"Error loading config",payload:e}}function yu(e){return e.locale||"en"}function vu(e){return e.publish_mode===Pr}const bu=Ut((e,t)=>{switch(t.type){case pu:e.isFetching=!0;break;case hu:return{...t.payload,isFetching:!1,error:void 0};case gu:e.isFetching=!1,e.error=t.payload.toString()}},{isFetching:!0}),{extractTemplateVars:wu,dateParsers:xu,expandPath:Su}=cn.stringTemplate;class ku{storageKey="decap-cms-user";retrieve(){const e=window.localStorage.getItem(this.storageKey);return e&&JSON.parse(e)}store(e){window.localStorage.setItem(this.storageKey,JSON.stringify(e))}logout(){window.localStorage.removeItem(this.storageKey)}}function _u(e,t){const n="backup";return e?`${n}.${e}${t?`.${t}`:""}`:n}function Eu(e,t){const n=nn()(t.data,e);if(n)return String(n);{const n=e.split(".")[0];return t[n]?t[n]:""}}function Cu(e){return t=>e.reduce((e,n)=>{const r=Eu(n,t);return r?`${e} ${r}`:e},"")}function Ou(e,t){return e.score>t.score?-1:e.score<t.score?1:0}function Tu(e,t){const n=e.get("folder",""),r=t.toLowerCase().replace(n.toLowerCase(),"");return(0,un.join)((0,un.dirname)(Xt()(r,"/")),(0,un.basename)(r,(0,un.extname)(t)))}function Pu(e,t){return ql(t)?(0,un.dirname)(e).slice(t.get("folder").length+1)||"/":e}function Ru(e){let t;return t=e.get("nested")?.get("depth")||(0,ln.getPathDepth)(e.get("path","")),Kl(e)&&(t=function(e,t){const{structure:n}=Gl(e);return n===Hl.MULTIPLE_FOLDERS?t+1:t}(e,t)),t}class Mu{constructor(e,{backendName:t,authStore:n,config:r}){if(this.deleteAnonymousBackup(),this.config=r,this.implementation=e.init(this.config,{useWorkflow:vu(this.config),updateUserCredentials:this.updateUserCredentials,initialWorkflowStatus:Rr.first()}),this.backendName=t,this.authStore=n,null===this.implementation)throw new Error("Cannot instantiate a Backend with no implementation");this.backupSync=(0,ln.asyncLock)()}async status(){let e={auth:{status:!0},api:{status:!0,statusPage:""}};for(let t=1;t<=3;t++){if(e=await this.implementation.status(),Object.values(e).every(e=>!0===e.status))return e;await new Promise(e=>setTimeout(e,1e3*t))}return e}currentUser(){if(this.user)return this.user;const e=this.authStore.retrieve();return e&&e.backendName===this.backendName?Promise.resolve(this.implementation.restoreUser(e)).then(e=>(this.user={...e,backendName:this.backendName},this.authStore.store(this.user),this.user)):Promise.resolve(null)}isGitBackend(){return this.implementation.isGitBackend?.()||!1}updateUserCredentials=e=>{const t=this.authStore.retrieve();if(t&&t.backendName===this.backendName)return this.user={...t,...e},this.authStore.store(this.user),this.user};authComponent(){return this.implementation.authComponent()}authenticate(e){return this.implementation.authenticate(e).then(e=>(this.user={...e,backendName:this.backendName},this.authStore&&this.authStore.store(this.user),this.user))}async logout(){try{await this.implementation.logout()}catch(e){console.warn("Error during logout",e.message)}finally{this.user=null,this.authStore&&this.authStore.logout()}}getToken=()=>this.implementation.getToken();async entryExist(e,t,n,r){const o=r&&await this.implementation.unpublishedEntry({collection:e.get("name"),slug:n}).catch(e=>e.name===ln.EDITORIAL_WORKFLOW_ERROR&&e.notUnderEditorialWorkflow?Promise.resolve(!1):Promise.reject(e));return o||await this.implementation.getEntry(t).then(({data:e})=>e).catch(()=>Promise.resolve(!1))}async generateUniqueSlug(e,t,n,r,o){const i=n.slug;let a;a=o?Tu(e,o):function(e,t,n){const r=e.get("slug")||"{{slug}}",o=t.getIn(To(zl(e)));if(!o)throw new Error("Collection must have a field name that is a valid entry identifier, or must have `identifier_field` set");const i=Do(n),a=Co(t,Bl(e,"date"))||new Date(Date.now()),s=_o(r,a,o,t,i);if(e.has("path")){const n=Io(e.get("path"));return _o(n,a,s,t,e=>e===s?e:i(e))}return s}(e,t,i);let s=1,l=a;for(;r.includes(l)||await this.entryExist(e,Dl(e,l),l,vu(n));)l=`${a}${So(" ",i)}${s++}`;return l}processEntries(e,t){const n=e.map(e=>Bo(t.get("name"),jl(t,e.file.path),e.file.path,{raw:e.data||"",label:e.file.label,author:e.file.author,updatedOn:e.file.updatedOn,meta:{path:Pu(e.file.path,t)}})).map(this.entryWithFormat(t)),r=t.get("filter"),o=r?this.filterEntries({entries:n},r):n;if(Kl(t)){const e=Al(t);return au(t,e,o)}return o}async listEntries(e){const t=Al(e);let n;const r=e.get("type");if(r===Ur)n=()=>{const n=Ru(e);return this.implementation.entriesByFolder(e.get("folder"),t,n)};else{if(r!==Br)throw new Error(`Unknown collection type: ${r}`);{const t=e.get("files").map(e=>({path:e.get("file"),label:e.get("label")})).toArray();n=()=>this.implementation.entriesByFiles(t)}}const o=await n(),i=ln.Cursor.create(o[ln.CURSOR_COMPATIBILITY_SYMBOL]).wrapData({cursorType:"collectionEntries",collection:e});return{entries:this.processEntries(o,e),pagination:i.meta?.get("page"),cursor:i}}async listAllEntries(e){if(e.get("folder")&&this.implementation.allEntriesByFolder){const t=Ru(e),n=Al(e);return this.implementation.allEntriesByFolder(e.get("folder"),n,t,function(e){let t="";return e.get("path")&&(t=`${e.get("folder")}/${e.get("path")}`.replace(/{{.*}}/gm,"(.*)")),Kl(e)&&(t=function(e,{defaultLocale:t,structure:n}){return n===Hl.MULTIPLE_FOLDERS?`${t}\\/${e}`:n===Hl.MULTIPLE_FILES?`${e}\\.${t}\\..*`:e}(t,Gl(e))),t?new RegExp(t):void 0}(e)).then(t=>this.processEntries(t,e))}const t=await this.listEntries(e),{entries:n}=t;let{cursor:r}=t;for(;r&&r.actions.includes("next");){const{entries:e,cursor:t}=await this.traverseCursor(r,"next");n.push(...e),r=t}return n}async search(e,t){const n=[],r=e.map(async e=>{const n=e.get("summary",""),r=wu(n);let o=[];e.get("type")===Br?e.get("files")?.forEach(e=>{const t=e.get("fields").map(e=>e.get("name")).toArray();o=[...o,...t]}):o=[Bl(e,"title"),Bl(e,"shortTitle"),Bl(e,"author"),...r.map(t=>xu[t]?Bl(e,"date"):t)];const i=o.filter(Boolean),a=await this.listAllEntries(e);return an.filter(t,a,{extract:Cu(Qt()(i))})}).map(e=>e.catch(e=>(n.push(e),[]))),o=await Promise.all(r).then(e=>Vt()(e));if(n.length>0)throw new Error({message:"Errors occurred while searching entries locally!",errors:n});const i=o.filter(({score:e})=>e>5).sort(Ou).map(e=>e.original);return{entries:i}}async query(e,t,n,r,o){let i=await this.listAllEntries(e);r&&(i=i.filter(e=>e.slug===r));const a=function(e,t){const n=e.reduce((e,n)=>{const r=t.reduce((e,t)=>{const r=Su({data:n.data,path:t});return e.push(...r),e},[]);for(let t=0;t<r.length;t++)e.push({...n,field:r[t]});return e},[]);return n}(i,t);let s=an.filter(n,a,{extract:e=>Eu(e.field,e)}).sort(Ou).map(e=>e.original);void 0!==o&&o>0&&(s=s.slice(0,o));const l=function(e){const t=e.map(e=>e.field),n={},r=e.reduce((e,t)=>{if(!e[t.slug]){const{field:r,...o}=t;e[t.slug]=o,n[t.slug]=(0,Ve.Set)()}const r=t.field.split(".");let o=e[t.slug].data;for(let e=0;e<r.length;e++)if(o=o[r[e]],Array.isArray(o)){const o=r.slice(0,e+1).join(".");n[t.slug]=n[t.slug].add(o)}return e},{});return Object.keys(r).forEach(e=>{const o=r[e].data;for(const r of n[e].toArray()){const e=nn()(o,r),n=e.filter((e,n)=>t.some(e=>`${e}.`.startsWith(`${r}.${n}.`)));n.sort((n,o)=>{const i=e.indexOf(n),a=e.indexOf(o),s=`${r}.${i}.`,l=`${r}.${a}.`,u=t.findIndex(e=>`${e}.`.startsWith(s)),c=t.findIndex(e=>`${e}.`.startsWith(l));return u-c}),on()(o,r,n)}}),Object.values(r)}(s);return{query:n,hits:l}}traverseCursor(e,t){const[n,r]=e.unwrapData(),o=n.get("collection");return this.implementation.traverseCursor(r,t).then(async({entries:e,cursor:t})=>({entries:this.processEntries(e,o),cursor:ln.Cursor.create(t).wrapData({cursorType:"collectionEntries",collection:o})}))}async getLocalDraftBackup(e,t){const n=_u(e.get("name"),t),r=await ln.localForage.getItem(n);if(!r||!r.raw.trim())return{};const{raw:o,path:i}=r;let{mediaFiles:a=[]}=r;a=a.map(e=>e.file?{...e,url:URL.createObjectURL(e.file)}:e);const s=Il(e,t),l=n=>this.entryWithFormat(e)(Bo(e.get("name"),t,i,{raw:n,label:s,mediaFiles:a,meta:{path:Pu(i,e)}})),u=l(o);if(Kl(e)&&r.i18n){const e=function(e,t){const n=Object.entries(e).reduce((e,[n,{raw:r}])=>{const o=t(r);return{...e,[n]:{data:o.data}}},{});return n}(r.i18n,l);u.i18n=e}return{entry:u}}async persistLocalDraftBackup(e,t){try{await this.backupSync.acquire();const n=_u(t.get("name"),e.get("slug")),r=this.entryToRaw(t,e);if(!r.trim())return;const o=await Promise.all(e.get("mediaFiles").toJS().map(async e=>{if(e.url?.startsWith("blob:")){const t=await fetch(e.url).then(e=>e.blob());return{...e,file:(0,ln.blobToFileObj)(e.name,t)}}return e}));let i;return Kl(t)&&(i=function(e,t,n){const{locales:r,defaultLocale:o}=Gl(e),i=r.filter(e=>e!==o).reduce((e,r)=>{const i=Zl(r,o),a=t.getIn(i);if(!a)return e;const s=t.set("data",a);return{...e,[r]:{raw:n(s)}}},{});return i}(t,e,e=>this.entryToRaw(t,e))),await ln.localForage.setItem(n,{raw:r,path:e.get("path"),mediaFiles:o,...i&&{i18n:i}}),await ln.localForage.setItem(_u(),r)}catch(e){console.warn("persistLocalDraftBackup",e)}finally{this.backupSync.release()}}async deleteLocalDraftBackup(e,t){try{return await this.backupSync.acquire(),await ln.localForage.removeItem(_u(e.get("name"),t)),t&&await ln.localForage.removeItem(_u(e.get("name"))),await this.deleteAnonymousBackup()}catch(e){console.warn("deleteLocalDraftBackup",e)}finally{this.backupSync.release()}}deleteAnonymousBackup(){return ln.localForage.removeItem(_u())}async getEntry(e,t,n){const r=Dl(t,n),o=Il(t,n),i=Al(t),a=async r=>{const i=await this.implementation.getEntry(r);let a=Bo(t.get("name"),n,i.file.path,{raw:i.data,label:o,mediaFiles:[],meta:{path:Pu(i.file.path,t)}});return a=this.entryWithFormat(t)(a),a=await this.processEntry(e,t,a),a};let s;return s=Kl(t)?await async function(e,t,n,r,o){const{structure:i,locales:a,defaultLocale:s}=Gl(e);let l;if(i===Hl.SINGLE_FILE)l=iu(await o(n),s,a);else{const u=await Promise.allSettled(a.map(async e=>{const a=eu(i,t,n,r,e);return{value:await o(a),locale:e}})),c=u.map(e=>"fulfilled"===e.status?e.value:void 0).filter(e=>void 0!==e);if(0===c.length){const[e=new Error("No entry values found for any locale")]=u.map(e=>"rejected"===e.status?e.reason:void 0).filter(e=>void 0!==e);throw e}l=ou(e,i,s,c)}return l}(t,i,r,n,a):await a(r),s}getMedia(){return this.implementation.getMedia()}getMediaFile(e){return this.implementation.getMediaFile(e)}getMediaDisplayURL(e){if(this.implementation.getMediaDisplayURL)return this.implementation.getMediaDisplayURL(e);const t=new Error("getMediaDisplayURL is not implemented by the current backend, but the backend returned a displayURL which was not a string!");return t.displayURL=e,Promise.reject(t)}entryWithFormat(e){return t=>{const n=kr(e,t);if(t&&void 0!==t.raw){const e=n&&Wt()(n.fromFile.bind(n,t.raw))||{};return Gt()(e)&&console.error(e),Object.assign(t,{data:Gt()(e)?{}:e})}return n.fromFile(t)}}async processUnpublishedEntry(e,t,n){const{slug:r}=t;let o;if(e.get("type")===Br){const t=e.get("files").find(e=>e?.get("name")===r);o=(0,un.extname)(t.get("file"))}else o=Al(e);const i=[];if(n){const n=t.diffs.filter(e=>!e.path.endsWith(o)),a=await Promise.all(n.map(t=>this.implementation.unpublishedEntryMediaFile(e.get("name"),r,t.path,t.id)));i.push(...a.map(e=>({...e,draft:!0})))}const a=en()(t.diffs.filter(e=>e.path.endsWith(o)),e=>e.path.length),s=(n,o,a)=>{const s=Bo(e.get("name"),r,o,{raw:n,isModification:!a,label:e&&Il(e,r),mediaFiles:i,updatedOn:t.updatedAt,author:t.pullRequestAuthor,status:t.status,meta:{path:Pu(o,e)}});return this.entryWithFormat(e)(s)},l=async n=>{const r=await this.implementation.unpublishedEntryDataFile(e.get("name"),t.slug,n.path,n.id);return s(r,n.path,n.newFile)};if(a.length<=0){const t=await this.implementation.getEntry(Dl(e,r));return s(t.data,t.file.path,!1)}if(Kl(e)){const t=Dl(e,r),n=function(e,t,n,r,o){const{structure:i}=Gl(e);return i===Hl.SINGLE_FILE?o:nu(e,t,n,r).reduce((e,t)=>{const n=o.find(e=>e.path===t);return n?[...e,n]:[...e,{path:t,id:"",newFile:!1}]},[])}(e,o,t,r,a);let i=await Promise.all(n.map(e=>l(e).catch(()=>null)));return i=i.filter(Boolean),(await au(e,o,i))[0]}return await l(a[0])}async unpublishedEntries(e){const t=await this.implementation.unpublishedEntries(),n=(await Promise.all(t.map(async t=>{const n=await this.implementation.unpublishedEntry({id:t}),r=n.collection,o=e.find(e=>e.get("name")===r);return o?await this.processUnpublishedEntry(o,n,!1):(console.warn(`Missing collection '${r}' for unpublished entry '${t}'`),null)}))).filter(Boolean);return{pagination:0,entries:n}}async processEntry(e,t,n){const r=du(e.integrations,null,"assetStore"),o=function(e,t,n){const r=function(e,t){return e.has("folder")?Pl(e.get("fields").toArray()):e.has("files")?Pl(Rl(e,t)?.get("fields").toArray()||[]):[]}(t,n.get("slug")),o=r.map(r=>Sl(e,t,n,r));return t.has("files")&&Rl(t,n.get("slug"))&&o.unshift(Sl(e,t,n,void 0)),t.has("media_folder")&&(t=t.delete("files"),o.unshift(Sl(e,t,n,void 0))),(0,Ve.Set)(o).toArray()}(e.config,t,(0,Ve.fromJS)(n));if(o.length>0&&!r){const e=await Promise.all(o.map(e=>this.implementation.getMedia(e)));n.mediaFiles=n.mediaFiles.concat(...e)}else n.mediaFiles=n.mediaFiles.concat(e.mediaLibrary.get("files")||[]);return n}async unpublishedEntry(e,t,n){const r=await this.implementation.unpublishedEntry({collection:t.get("name"),slug:n});let o=await this.processUnpublishedEntry(t,r,!0);return o=await this.processEntry(e,t,o),o}getDeploy(e,t,n){const r=this.config.site_url;if(r&&!1!==this.config.show_preview_links)return{url:jo(r,e,t,n,this.config.slug),status:"SUCCESS"}}async getDeployPreview(e,t,n,{maxAttempts:r=1,interval:o=5e3,signal:i}={}){if(!this.implementation.getDeployPreview||!1===this.config.show_preview_links)return;let a,s=0;for(;!a&&s<r;){if(i?.aborted)return;s++,a=await this.implementation.getDeployPreview(e.get("name"),t),a||await new Promise(e=>setTimeout(()=>e(void 0),o))}return a?{url:jo(a.url,e,t,n,this.config.slug),status:a.status?a.status.toUpperCase():""}:void 0}async persistEntry({config:e,collection:t,entryDraft:n,assetProxies:r,usedSlugs:o,unpublished:i=!1,status:a}){const s=await this.invokePreSaveEvent(n.get("entry"));let l;l=void 0===s.get("data")?s&&n.setIn(["entry","data"],s)||n:s&&n.setIn(["entry"],s)||n;const u=l.getIn(["entry","newRecord"])||!1,c=vu(e),f=Ja(t,l);let d;if(u){if(!function(e){return Tl[e.get("type")].allowNewEntries(e)}(t))throw new Error("Not allowed to create new entries in this collection");const n=await this.generateUniqueSlug(t,l.getIn(["entry","data"]),e,o,f),i=f||Dl(t,n);d={path:i,slug:n,raw:this.entryToRaw(t,l.get("entry"))},function(e,t,n,r,o){e.map(e=>{const i=e.path,a=kl(t,n,r.get("entry").set("path",o),i,e.field);e.path=a})}(r,e,t,l,i)}else{const e=l.getIn(["entry","slug"]),n=l.getIn(["entry","path"]);d={path:n,slug:f&&!c?Tu(t,f):e,raw:this.entryToRaw(t,l.get("entry")),newPath:f===n?void 0:f}}const{slug:p,path:h,newPath:g}=d;let m=[d];if(Kl(t)){const e=Al(t);m=function(e,t,n,r,o,i,a){const{structure:s,defaultLocale:l,locales:u}=Gl(e);if(s===Hl.SINGLE_FILE){const e=u.reduce((e,t)=>{const r=Zl(t,l);return e.set(t,n.getIn(r))},(0,Ve.Map)({})),c=n.set("data",e);return[{path:eu(s,t,o,i,u[0]),slug:i,raw:r(c),...a&&{newPath:eu(s,t,a,i,u[0])}}]}return u.map(e=>{const u=Zl(e,l),c=n.set("data",n.getIn(u));return{path:eu(s,t,o,i,e),slug:i,raw:c.get("data")?r(c):"",...a&&{newPath:eu(s,t,a,i,e)}}}).filter(e=>e.raw)}(t,e,l.get("entry"),e=>this.entryToRaw(t,e),h,p,g)}const y=await this.currentUser(),v={newEntry:u,commitMessage:Ao(u?"create":"update",e,{collection:t,slug:p,path:h,authorLogin:y.login,authorName:y.name,authorEmail:y.email},y.useOpenAuthoring),collectionName:t.get("name"),useWorkflow:c,hasSubfolders:!1!==t.get("nested")?.get("subfolders"),unpublished:i,status:a};return c||await this.invokePrePublishEvent(l.get("entry")),await this.implementation.persistEntry({dataFiles:m,assets:r},v),await this.invokePostSaveEvent(l.get("entry")),c||await this.invokePostPublishEvent(l.get("entry")),p}async invokeEventWithEntry(e,t){const{login:n,name:r}=await this.currentUser();return await mr({name:e,data:{entry:t,author:{login:n,name:r}}})}async invokePrePublishEvent(e){await this.invokeEventWithEntry("prePublish",e)}async invokePostPublishEvent(e){await this.invokeEventWithEntry("postPublish",e)}async invokePreUnpublishEvent(e){await this.invokeEventWithEntry("preUnpublish",e)}async invokePostUnpublishEvent(e){await this.invokeEventWithEntry("postUnpublish",e)}async invokePreSaveEvent(e){return await this.invokeEventWithEntry("preSave",e)}async invokePostSaveEvent(e){await this.invokeEventWithEntry("postSave",e)}async persistMedia(e,t){const n=await this.currentUser(),r={commitMessage:Ao("uploadMedia",e,{path:t.path,authorLogin:n.login,authorName:n.name,authorEmail:n.email},n.useOpenAuthoring)};return this.implementation.persistMedia(t,r)}async deleteEntry(e,t,n){const r=e.config,o=Dl(t,n),i=Al(t);if(!Ll(t))throw new Error("Not allowed to delete entries in this collection");const a=await this.currentUser(),s=Ao("delete",r,{collection:t,slug:n,path:o,authorLogin:a.login,authorName:a.name,authorEmail:a.email},a.useOpenAuthoring),l=pl(e.entries,t.get("name"),n);await this.invokePreUnpublishEvent(l);let u=[o];Kl(t)&&(u=nu(t,i,o,n)),await this.implementation.deleteFiles(u,s),await this.invokePostUnpublishEvent(l)}async deleteMedia(e,t){const n=await this.currentUser(),r=Ao("deleteMedia",e,{path:t,authorLogin:n.login,authorName:n.name,authorEmail:n.email},n.useOpenAuthoring);return this.implementation.deleteFiles([t],r)}persistUnpublishedEntry(e){return this.persistEntry({...e,unpublished:!0})}updateUnpublishedEntryStatus(e,t,n){return this.implementation.updateUnpublishedEntryStatus(e,t,n)}async publishUnpublishedEntry(e){const t=e.get("collection"),n=e.get("slug");await this.invokePrePublishEvent(e),await this.implementation.publishUnpublishedEntry(t,n),await this.invokePostPublishEvent(e)}deleteUnpublishedEntry(e,t){return this.implementation.deleteUnpublishedEntry(e,t)}entryToRaw(e,t){const n=kr(e,t.toJS()),r=this.fieldsOrder(e,t),o=function(e,t){let n=[];if(e.has("folder"))n=e.get("fields").toArray();else if(e.has("files")){const r=e.get("files").find(e=>e?.get("name")===t.get("slug"));n=r.get("fields").toArray()}const r={};return Nl(n).forEach(t=>{const n=$l(e,t);n?.has("comment")&&(r[t]=n.get("comment"))}),r}(e,t);let i=n.toFile(t.get("data").toJS(),r,o);return"\n"!=i.slice(-1)&&(i+="\n"),i}fieldsOrder(e,t){if(e.get("fields"))return e.get("fields").map(e=>e.get("name")).toArray();const n=(e.get("files")||(0,Ve.List)()).filter(e=>e.get("name")===t.get("slug")).get(0);if(null==n)throw new Error(`No file found for ${t.get("slug")} in ${e.get("name")}`);return n.get("fields").map(e=>e.get("name")).toArray()}filterEntries(e,t){return e.entries.filter(e=>{const n=e.data[t.get("field")];return Array.isArray(n)?n.includes(t.get("value")):n===t.get("value")})}}function Au(e){if(!e.backend.name)throw new Error("No backend defined in configuration");const{name:t}=e.backend,n=new ku,r=pr(t);if(r)return new Mu(r,{backendName:t,authStore:n,config:e});throw new Error(`Backend not found: ${t}`)}const Iu=function(){let e;return t=>e||(e=Au(t))}(),Du="AUTH_REQUEST",ju="AUTH_SUCCESS",Lu="AUTH_FAILURE",Nu="AUTH_REQUEST_DONE",$u="USE_OPEN_AUTHORING",Fu="LOGOUT";function zu(){return{type:Du}}function Bu(e){return{type:ju,payload:e}}function Uu(e){return{type:Lu,error:"Failed to authenticate",payload:e}}function qu(){return{type:$u}}function Wu(){return(e,t)=>{const n=t(),r=Iu(n.config);Promise.resolve(r.logout()).then(()=>{e({type:Fu}),e({type:gi})})}}const Hu=Ut((e,t)=>{switch(t.type){case Du:e.isFetching=!0;break;case ju:e.user=t.payload;break;case Lu:e.error=t.payload&&t.payload.toString();break;case Nu:e.isFetching=!1;break;case Fu:e.user=void 0,e.isFetching=!1}},{isFetching:!1,user:void 0,error:void 0});var Vu=__webpack_require__(62162),Ku=__webpack_require__.n(Vu);const Gu={isFetching:!1,term:"",collections:[],page:0,entryIds:[],queryHits:{},error:void 0,requests:[]},Yu=Ut((e,t)=>{switch(t.type){case ti:return Gu;case Yo:{const{page:n,searchTerm:r,searchCollections:o}=t.payload;e.isFetching=!0,e.term=r,e.collections=o,e.page=n;break}case Qo:{const{entries:n,page:r}=t.payload,o=n.map(e=>({collection:e.collection,slug:e.slug}));e.isFetching=!1,e.page=r,e.entryIds=!r||isNaN(r)||0===r?o:e.entryIds.concat(o);break}case Jo:{const{error:n}=t.payload;e.isFetching=!1,e.error=n;break}case Xo:{const{searchTerm:n,request:r}=t.payload;e.isFetching=!0,e.term=n,r&&e.requests.push(r);break}case ni:e.requests=e.requests.filter(e=>e.expires>=new Date);break;case Zo:{const{namespace:n,hits:r}=t.payload;e.isFetching=!1,e.queryHits[n]=r;break}case ei:{const{error:n}=t.payload;e.isFetching=!1,e.error=n}}},Gu),Qu=Yu;function Ju(e){return Object.values(e).some(e=>e.isLoading)}const Xu=Ut((e,t)=>{switch(t.type){case ca:t.payload.forEach(t=>{e[t.path]={asset:t,isLoading:!1,error:null}});break;case fa:{const n=t.payload;e[n.path]={asset:n,isLoading:!1,error:null};break}case da:{const n=t.payload;delete e[n];break}case pa:{const{path:n}=t.payload;e[n]=e[n]||{},e[n].isLoading=!0;break}case ha:{const{path:n}=t.payload;e[n]=e[n]||{},e[n].isLoading=!1,e[n].error=null;break}case ga:{const{path:n,error:r}=t.payload;e[n]=e[n]||{},e[n].isLoading=!1,e[n].error=r}}},{}),Zu="DEPLOY_PREVIEW_REQUEST",ec="DEPLOY_PREVIEW_SUCCESS",tc="DEPLOY_PREVIEW_FAILURE";function nc(e,t){return{type:tc,payload:{collection:e,slug:t}}}const rc=Ut((e,t)=>{switch(t.type){case Zu:{const{collection:n,slug:r}=t.payload;e[`${n}.${r}`]={isFetching:!0,status:"PENDING"};break}case ec:{const{collection:n,slug:r,url:o,status:i}=t.payload,a=`${n}.${r}`;e[a].isFetching=!1,e[a].url=o,e[a].status=i;break}case tc:{const{collection:n,slug:r}=t.payload,o=`${n}.${r}`;e[o].isFetching=!1,e[o].url=void 0,e[o].status="PENDING";break}}},{}),oc=rc,ic=["DEPLOY_PREVIEW","STATUS_REQUEST","STATUS_SUCCESS","STATUS_FAILURE"];function ac(e){return ic.some(t=>e.type.includes(t))}const sc=Ut((e,t)=>{!ac(t)&&t.type.includes("REQUEST")?e.isFetching=!0:ac(t)||!t.type.includes("SUCCESS")&&!t.type.includes("FAILURE")?t.type===$u&&(e.useOpenAuthoring=!0):e.isFetching=!1},{isFetching:!1,useOpenAuthoring:!1}),lc="STATUS_REQUEST",uc="STATUS_SUCCESS",cc="STATUS_FAILURE";function fc(e){return{type:uc,payload:{status:e}}}const dc=Ut((e,t)=>{switch(t.type){case lc:e.isFetching=!0;break;case uc:e.isFetching=!1,e.status=t.payload.status;break;case cc:e.isFetching=!1,e.error=t.payload.error}},{isFetching:!1,status:{auth:{status:!0},api:{status:!0,statusPage:""}},error:void 0}),pc=Ut((e,t)=>{switch(t.type){case gi:e.notifications=[];break;case hi:e.notifications=e.notifications.filter(e=>e.id!==t.id);break;case pi:e.notifications=[...e.notifications,{id:Lr(),...t.payload}]}},{notifications:[]}),hc={auth:Hu,config:bu,collections:function(e=Ol,t){if(t.type===hu){const e=t.payload.collections;let n=(0,Ve.OrderedMap)({});return e.forEach(e=>{n=n.set(e.name,(0,Ve.fromJS)(e))}),n}return e},search:Qu,integrations:function(e=fu,t){return t.type===hu?cu(t.payload):e},entries:function(e=(0,Ve.Map)({entities:(0,Ve.Map)(),pages:(0,Ve.Map)(),sort:al(),viewStyle:ll()}),t){switch(t.type){case Xa:{const n=t.payload;return e.setIn(["entities",`${n.collection}.${n.slug}`,"isFetching"],!0)}case Za:{const n=t.payload;return Xs=n.collection,nl=n.entry.slug,e.withMutations(e=>{e.setIn(["entities",`${Xs}.${nl}`],(0,Ve.fromJS)(n.entry));const t=e.getIn(["pages",Xs,"ids"],(0,Ve.List)());t.includes(nl)||e.setIn(["pages",Xs,"ids"],t.unshift(nl))})}case ts:{const n=t.payload,r=e.withMutations(e=>{e.setIn(["pages",n.collection,"isFetching"],!0)});return r}case ns:{const n=t.payload;return Xs=n.collection,Zs=n.entries,el=n.append,tl=n.page,e.withMutations(e=>{Zs.forEach(t=>e.setIn(["entities",`${Xs}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1)));const t=(0,Ve.List)(Zs.map(e=>e.slug));e.setIn(["pages",Xs],(0,Ve.Map)({page:tl,ids:el?e.getIn(["pages",Xs,"ids"],(0,Ve.List)()).concat(t):t}))})}case rs:return e.setIn(["pages",t.meta.collection,"isFetching"],!1);case es:{const n=t.payload;return e.withMutations(e=>{e.setIn(["entities",`${n.collection}.${n.slug}`,"isFetching"],!1),e.setIn(["entities",`${n.collection}.${n.slug}`,"error"],n.error.message)})}case Qo:{const n=t.payload;return Zs=n.entries,e.withMutations(e=>{Zs.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1)))})}case Es:{const n=t.payload;return e.withMutations(e=>{e.deleteIn(["entities",`${n.collectionName}.${n.entrySlug}`]),e.updateIn(["pages",n.collectionName,"ids"],e=>e.filter(e=>e!==n.entrySlug))})}case os:{const n=t.payload,{collection:r,key:o,direction:i}=n,a=e.withMutations(e=>{const t=(0,Ve.OrderedMap)({[o]:(0,Ve.Map)({key:o,direction:i})});e.setIn(["sort",r],t),e.setIn(["pages",r,"isFetching"],!0),e.deleteIn(["pages",r,"page"])});return sl(a.get("sort")),a}case fs:case ls:case is:{const n=t.payload,{collection:r,entries:o}=n;Zs=o;const i=e.withMutations(e=>{Zs.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1))),e.setIn(["pages",r,"isFetching"],!1);const t=(0,Ve.List)(Zs.map(e=>e.slug));e.setIn(["pages",r],(0,Ve.Map)({page:1,ids:t}))});return i}case as:{const n=t.payload,{collection:r,key:o}=n,i=e.withMutations(e=>{e.deleteIn(["sort",r,o]),e.setIn(["pages",r,"isFetching"],!1)});return sl(i.get("sort")),i}case ss:{const n=t.payload,{collection:r,filter:o}=n,i=e.withMutations(e=>{const t=e.getIn(["filter",r,o.id],(0,Ve.fromJS)(o));e.setIn(["filter",r,t.get("id")],t.set("active",!t.get("active")))});return i}case us:{const n=t.payload,{collection:r,filter:o}=n,i=e.withMutations(e=>{e.deleteIn(["filter",r,o.id]),e.setIn(["pages",r,"isFetching"],!1)});return i}case cs:{const n=t.payload,{collection:r,group:o}=n,i=e.withMutations(e=>{const t=e.getIn(["group",r,o.id],(0,Ve.fromJS)(o));e.deleteIn(["group",r]),e.setIn(["group",r,t.get("id")],t.set("active",!t.get("active")))});return i}case ds:{const n=t.payload,{collection:r,group:o}=n,i=e.withMutations(e=>{e.deleteIn(["group",r,o.id]),e.setIn(["pages",r,"isFetching"],!1)});return i}case Ts:{const r=t.payload,{style:o}=r,i=e.withMutations(e=>{e.setIn(["viewStyle"],o)});return(n=i.get("viewStyle"))?localStorage.setItem(ol,n):localStorage.removeItem(ol),i}default:return e}var n},cursors:function(e=(0,Ve.fromJS)({cursorsByType:{collectionEntries:{}}}),t){switch(t.type){case ns:return e.setIn(["cursorsByType","collectionEntries",t.payload.collection],ln.Cursor.create(t.payload.cursor).store);case ls:case fs:case is:return e.deleteIn(["cursorsByType","collectionEntries",t.payload.collection]);default:return e}},editorialWorkflow:function(e=(0,Ve.Map)(),t){switch(t.type){case hu:return(t.payload&&t.payload.publish_mode)===Pr?(0,Ve.Map)({entities:(0,Ve.Map)(),pages:(0,Ve.Map)()}):e;case Ca:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isFetching"],!0);case Ta:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);case Oa:return e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.slug}`],(0,Ve.fromJS)(t.payload.entry));case Pa:return e.setIn(["pages","isFetching"],!0);case Ra:return e.withMutations(e=>{t.payload.entries.forEach(t=>e.setIn(["entities",`${t.collection}.${t.slug}`],(0,Ve.fromJS)(t).set("isFetching",!1))),e.set("pages",(0,Ve.Map)({...t.payload.pages,ids:(0,Ve.List)(t.payload.entries.map(e=>e.slug))}))});case Ma:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!0);case Aa:return e.withMutations(e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`],(0,Ve.fromJS)(t.payload.entry)),e.deleteIn(["entities",`${t.payload.collection}.${t.payload.entry.get("slug")}`,"isPersisting"]),e.updateIn(["pages","ids"],(0,Ve.List)(),e=>e.push(t.payload.entry.get("slug")))});case Ia:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPersisting"],!1);case Da:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!0);case ja:return e.withMutations(e=>{e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"status"],t.payload.newStatus),e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1)});case La:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isUpdatingStatus"],!1);case Na:return e.setIn(["entities",`${t.payload.collection}.${t.payload.slug}`,"isPublishing"],!0);case $a:case za:return e.deleteIn(["entities",`${t.payload.collection}.${t.payload.slug}`]);default:return e}},entryDraft:function(e=(0,Ve.Map)(),t){switch(t.type){case ps:return e.withMutations(e=>{e.set("entry",(0,Ve.fromJS)(t.payload.entry)),e.setIn(["entry","newRecord"],!1),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!1),e.set("key",Lr())});case hs:return e.withMutations(e=>{e.set("entry",(0,Ve.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!1),e.set("key",Lr())});case ws:return e.withMutations(e=>{const t=e.get("localBackup").get("entry");e.delete("localBackup"),e.set("entry",t),e.setIn(["entry","newRecord"],!t.get("path")),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!0),e.set("key",Lr())});case xs:return e.withMutations(e=>{e.set("entry",(0,Ve.fromJS)(t.payload)),e.setIn(["entry","newRecord"],!0),e.set("mediaFiles",(0,Ve.List)()),e.set("fieldsMetaData",(0,Ve.Map)()),e.set("fieldsErrors",(0,Ve.Map)()),e.set("hasChanged",!0)});case gs:return Qa;case bs:{const{entry:n}=t.payload,r=new Ve.Map({entry:(0,Ve.fromJS)(n)});return e.set("localBackup",r)}case ms:return e.withMutations(e=>{const{field:n,value:r,metadata:o,entries:i,i18n:a}=t.payload,s=n.get("name"),l=n.get("meta"),u=a&&Zl(a.currentLocale,a.defaultLocale)||["data"];l?e.setIn(["entry","meta",s],r):(e.setIn(["entry",...u,s],r),a&&(e=su(e,n,a.locales,a.defaultLocale))),e.mergeDeepIn(["fieldsMetaData"],(0,Ve.fromJS)(o));const c=e.getIn(["entry",...u]),f=e.getIn(["entry","meta"]);e.set("hasChanged",!i.some(e=>c.equals(e.get(...u)))||!i.some(e=>f.equals(e.get("meta"))))});case ys:return 0===t.payload.errors.length?e.deleteIn(["fieldsErrors",t.payload.uniquefieldId]):e.setIn(["fieldsErrors",t.payload.uniquefieldId],t.payload.errors);case vs:{const{uniqueFieldId:n}=t.payload;return e.deleteIn(["fieldsErrors",n])}case Ss:case Ma:return e.setIn(["entry","isPersisting"],!0);case _s:case Ia:return e.deleteIn(["entry","isPersisting"]);case Da:return e.setIn(["entry","isUpdatingStatus"],!0);case La:case ja:return e.deleteIn(["entry","isUpdatingStatus"]);case Na:return e.setIn(["entry","isPublishing"],!0);case $a:case Fa:return e.deleteIn(["entry","isPublishing"]);case ks:case Aa:return e.withMutations(e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1),e.getIn(["entry","slug"])||e.setIn(["entry","slug"],t.payload.slug)});case Es:return e.withMutations(e=>{e.deleteIn(["entry","isPersisting"]),e.set("hasChanged",!1)});case Cs:return e.withMutations(e=>{const n=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],n.filterNot(e=>e.get("id")===t.payload.id).insert(0,(0,Ve.fromJS)(t.payload))),e.set("hasChanged",!0)});case Os:return e.withMutations(e=>{const n=e.getIn(["entry","mediaFiles"]);e.setIn(["entry","mediaFiles"],n.filterNot(e=>e.get("id")===t.payload.id)),e.set("hasChanged",!0)});default:return e}},medias:Xu,mediaLibrary:function(e=(0,Ve.Map)(sa),t){switch(t.type){case Ci:return e.withMutations(e=>{e.set("externalLibrary",t.payload),e.set("showMediaButton",t.payload.enableStandalone())});case _i:{const{controlID:n,forImage:r,privateUpload:o,config:i,field:a,value:s,replaceIndex:l}=t.payload,u=i||(0,Ve.Map)();return e.get("privateUpload")!==o?(0,Ve.Map)({isVisible:!0,forImage:r,controlID:n,canInsert:!!n,privateUpload:o,config:u,controlMedia:(0,Ve.Map)(),displayURLs:(0,Ve.Map)(),field:a,value:s,replaceIndex:l}):e.withMutations(e=>{e.set("isVisible",!0),e.set("forImage",r??!1),e.set("controlID",n??""),e.set("canInsert",!!n),e.set("privateUpload",o),e.set("config",u),e.set("field",a??""),e.set("value",""==s&&u.get("multiple")?[]:s??""),e.set("replaceIndex",l??!1)})}case Ei:return e.set("isVisible",!1);case Oi:{const{mediaPath:n}=t.payload,r=e.get("controlID"),o=e.get("value");if(!Array.isArray(o))return e.withMutations(e=>{e.setIn(["controlMedia",r],n)});const i=e.get("replaceIndex"),a=Array.isArray(n)?n:[n],s=o;return"number"==typeof i?s[i]=a[0]:s.push(...a),e.withMutations(e=>{e.setIn(["controlMedia",r],s)})}case Ti:{const n=t.payload.controlID;return e.setIn(["controlMedia",n],"")}case Pi:return e.withMutations(e=>{e.set("isLoading",!0),e.set("isPaginating",t.payload.page>1)});case Ri:{const{files:n=[],page:r,canPaginate:o,dynamicSearch:i,dynamicSearchQuery:a,privateUpload:s}=t.payload;if(e.get("privateUpload")!==s)return e;const l=n.map(e=>({...e,key:Lr()}));return e.withMutations(e=>{if(e.set("isLoading",!1),e.set("isPaginating",!1),e.set("page",r??1),e.set("hasNextPage",!!(o&&n.length>0)),e.set("dynamicSearch",i??!1),e.set("dynamicSearchQuery",a??""),e.set("dynamicSearchActive",!!a),r&&r>1){const t=e.get("files").concat(l);e.set("files",t)}else e.set("files",l)})}case Mi:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isLoading",!1);case Ai:return e.set("isPersisting",!0);case Ii:{const{file:n,privateUpload:r}=t.payload;return e.get("privateUpload")!==r?e:e.withMutations(e=>{const t=[{...n,key:Lr()},...e.get("files")];e.set("files",t),e.set("isPersisting",!1)})}case Di:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isPersisting",!1);case ji:return e.set("isDeleting",!0);case Li:{const{file:n,privateUpload:r}=t.payload,{key:o,id:i}=n;return e.get("privateUpload")!==r?e:e.withMutations(e=>{const t=e.get("files").filter(e=>o?e.key!==o:e.id!==i);e.set("files",t),e.deleteIn(["displayURLs",i]),e.set("isDeleting",!1)})}case Ni:return e.get("privateUpload")!==t.payload.privateUpload?e:e.set("isDeleting",!1);case $i:return e.setIn(["displayURLs",t.payload.key,"isFetching"],!0);case Fi:{const n=["displayURLs",t.payload.key];return e.setIn([...n,"isFetching"],!1).setIn([...n,"url"],t.payload.url)}case zi:{const n=["displayURLs",t.payload.key];return e.setIn([...n,"isFetching"],!1).setIn([...n,"err"],t.payload.err||!0).deleteIn([...n,"url"])}default:return e}},deploys:oc,globalUI:sc,status:dc,notifications:pc};function gc(e,t,n){return pl(e.entries,t,n)}function mc(e,t){return hl(e.entries,t)}function yc(e,t,n){return function(e,t,n){return e[`${t}.${n}`]}(e.deploys,t,n)}function vc(e,t,n){return function(e,t,n){return e&&e.getIn(["entities",`${t}.${n}`])}(e.editorialWorkflow,t,n)}function bc(e,t){return function(e,t){return e?e.get("entities").filter(e=>e.get("status")===t).valueSeq():null}(e.editorialWorkflow,t)}function wc(e,t,n){return du(e.integrations,t,n)}const xc=(0,ze.y$)((0,ze.HY)({...hc}),(0,Be.tY)((0,ze.Tw)(We,({dispatch:e,getState:t})=>{let n=[];return r=>o=>{if(o.type===He)return n.push(o),null;const i=r(o);return function(r){const o=[],i=[];for(const e of n)e.predicate(r)?o.push(e):i.push(e);n=i;for(const n of o)n.run(e,t,r)}(o),i}})));var Sc=__webpack_require__(82451),kc=__webpack_require__.n(Sc);function _c(e){return kc()({},yr("en"),yr(e))}function Ec(e){var t=null;return function(){return null==t&&(t=e()),t}}function Cc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Oc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Tc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Oc(this,"entered",[]),Oc(this,"isNodeInDocument",void 0),this.isNodeInDocument=t}var t,n;return t=e,n=[{key:"enter",value:function(e){var t=this,n=this.entered.length;return this.entered=function(e,t){var n=new Set,r=function(e){return n.add(e)};e.forEach(r),t.forEach(r);var o=[];return n.forEach(function(e){return o.push(e)}),o}(this.entered.filter(function(n){return t.isNodeInDocument(n)&&(!n.contains||n.contains(e))}),[e]),0===n&&this.entered.length>0}},{key:"leave",value:function(e){var t,n,r=this.entered.length;return this.entered=(t=this.entered.filter(this.isNodeInDocument),n=e,t.filter(function(e){return e!==n})),r>0&&0===this.entered.length}},{key:"reset",value:function(){this.entered=[]}}],n&&Cc(t.prototype,n),e}(),Pc=Ec(function(){return/firefox/i.test(navigator.userAgent)}),Rc=Ec(function(){return Boolean(window.safari)});function Mc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ac(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ic=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ac(this,"xs",void 0),Ac(this,"ys",void 0),Ac(this,"c1s",void 0),Ac(this,"c2s",void 0),Ac(this,"c3s",void 0);for(var r=t.length,o=[],i=0;i<r;i++)o.push(i);o.sort(function(e,n){return t[e]<t[n]?-1:1});for(var a,s,l=[],u=[],c=[],f=0;f<r-1;f++)a=t[f+1]-t[f],s=n[f+1]-n[f],u.push(a),l.push(s),c.push(s/a);for(var d=[c[0]],p=0;p<u.length-1;p++){var h=c[p],g=c[p+1];if(h*g<=0)d.push(0);else{a=u[p];var m=u[p+1],y=a+m;d.push(3*y/((y+m)/h+(y+a)/g))}}d.push(c[c.length-1]);for(var v,b=[],w=[],x=0;x<d.length-1;x++){v=c[x];var S=d[x],k=1/u[x],_=S+d[x+1]-v-v;b.push((v-S-_)*k),w.push(_*k*k)}this.xs=t,this.ys=n,this.c1s=d,this.c2s=b,this.c3s=w}var t,n;return t=e,n=[{key:"interpolate",value:function(e){var t=this.xs,n=this.ys,r=this.c1s,o=this.c2s,i=this.c3s,a=t.length-1;if(e===t[a])return n[a];for(var s,l=0,u=i.length-1;l<=u;){var c=t[s=Math.floor(.5*(l+u))];if(c<e)l=s+1;else{if(!(c>e))return n[s];u=s-1}}var f=e-t[a=Math.max(0,u)],d=f*f;return n[a]+r[a]*f+o[a]*d+i[a]*f*d}}],n&&Mc(t.prototype,n),e}();function Dc(e){var t=1===e.nodeType?e:e.parentElement;if(!t)return null;var n=t.getBoundingClientRect(),r=n.top;return{x:n.left,y:r}}function jc(e){return{x:e.clientX,y:e.clientY}}var Lc,Nc="__NATIVE_FILE__",$c="__NATIVE_URL__",Fc="__NATIVE_TEXT__",zc="__NATIVE_HTML__";function Bc(e,t,n){var r=t.reduce(function(t,n){return t||e.getData(n)},"");return null!=r?r:n}function Uc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var qc=(Uc(Lc={},Nc,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),Uc(Lc,zc,{exposeProperties:{html:function(e,t){return Bc(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),Uc(Lc,$c,{exposeProperties:{urls:function(e,t){return Bc(e,t,"").split("\n")},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),Uc(Lc,Fc,{exposeProperties:{text:function(e,t){return Bc(e,t,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),Lc);function Wc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Hc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Vc=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Hc(this,"item",void 0),Hc(this,"config",void 0),this.config=t,this.item={},this.initializeExposedProperties()}var t,n;return t=e,(n=[{key:"initializeExposedProperties",value:function(){var e=this;Object.keys(this.config.exposeProperties).forEach(function(t){Object.defineProperty(e.item,t,{configurable:!0,enumerable:!0,get:function(){return console.warn("Browser doesn't allow reading \"".concat(t,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(e){var t=this;if(e){var n={};Object.keys(this.config.exposeProperties).forEach(function(r){n[r]={value:t.config.exposeProperties[r](e,t.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,n)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(e,t){return t===e.getSourceId()}},{key:"endDrag",value:function(){}}])&&Wc(t.prototype,n),e}();function Kc(e){if(!e)return null;var t=Array.prototype.slice.call(e.types||[]);return Object.keys(qc).filter(function(e){return qc[e].matchesTypes.some(function(e){return t.indexOf(e)>-1})})[0]||null}function Gc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qc=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Yc(this,"ownerDocument",null),Yc(this,"globalContext",void 0),Yc(this,"optionsArgs",void 0),this.globalContext=t,this.optionsArgs=n}var t,n;return t=e,(n=[{key:"window",get:function(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}},{key:"document",get:function(){var e;return null!==(e=this.globalContext)&&void 0!==e&&e.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}}])&&Gc(t.prototype,n),e}();function Jc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jc(Object(n),!0).forEach(function(t){ef(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zc(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ef(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tf=function(){function t(e,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ef(this,"options",void 0),ef(this,"actions",void 0),ef(this,"monitor",void 0),ef(this,"registry",void 0),ef(this,"enterLeaveCounter",void 0),ef(this,"sourcePreviewNodes",new Map),ef(this,"sourcePreviewNodeOptions",new Map),ef(this,"sourceNodes",new Map),ef(this,"sourceNodeOptions",new Map),ef(this,"dragStartSourceIds",null),ef(this,"dropTargetIds",[]),ef(this,"dragEnterTargetIds",[]),ef(this,"currentNativeSource",null),ef(this,"currentNativeHandle",null),ef(this,"currentDragSourceNode",null),ef(this,"altKeyPressed",!1),ef(this,"mouseMoveTimeoutTimer",null),ef(this,"asyncEndDragFrameId",null),ef(this,"dragOverTargetIds",null),ef(this,"lastClientOffset",null),ef(this,"hoverRafId",null),ef(this,"getSourceClientOffset",function(e){var t=o.sourceNodes.get(e);return t&&Dc(t)||null}),ef(this,"endDragNativeItem",function(){o.isDraggingNativeItem()&&(o.actions.endDrag(),o.currentNativeHandle&&o.registry.removeSource(o.currentNativeHandle),o.currentNativeHandle=null,o.currentNativeSource=null)}),ef(this,"isNodeInDocument",function(e){return Boolean(e&&o.document&&o.document.body&&o.document.body.contains(e))}),ef(this,"endDragIfSourceWasRemovedFromDOM",function(){var e=o.currentDragSourceNode;null==e||o.isNodeInDocument(e)||o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),ef(this,"handleTopDragStartCapture",function(){o.clearCurrentDragSourceNode(),o.dragStartSourceIds=[]}),ef(this,"handleTopDragStart",function(e){if(!e.defaultPrevented){var t=o.dragStartSourceIds;o.dragStartSourceIds=null;var n=jc(e);o.monitor.isDragging()&&o.actions.endDrag(),o.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:o.getSourceClientOffset,clientOffset:n});var r=e.dataTransfer,i=Kc(r);if(o.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){var a=o.monitor.getSourceId(),s=o.sourceNodes.get(a),l=o.sourcePreviewNodes.get(a)||s;if(l){var u=o.getCurrentSourcePreviewNodeOptions(),c=function(e,t,n,r,o){var i,a,s="IMG"===(i=t).nodeName&&(Pc()||!(null!==(a=document.documentElement)&&void 0!==a&&a.contains(i))),l=Dc(s?e:t),u={x:n.x-l.x,y:n.y-l.y},c=e.offsetWidth,f=e.offsetHeight,d=r.anchorX,p=r.anchorY,h=function(e,t,n,r){var o=e?t.width:n,i=e?t.height:r;return Rc()&&e&&(i/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:i}}(s,t,c,f),g=h.dragPreviewWidth,m=h.dragPreviewHeight,y=o.offsetX,v=o.offsetY,b=0===v||v;return{x:0===y||y?y:new Ic([0,.5,1],[u.x,u.x/c*g,u.x+g-c]).interpolate(d),y:b?v:function(){var e=new Ic([0,.5,1],[u.y,u.y/f*m,u.y+m-f]).interpolate(p);return Rc()&&s&&(e+=(window.devicePixelRatio-1)*m),e}()}}(s,l,n,{anchorX:u.anchorX,anchorY:u.anchorY},{offsetX:u.offsetX,offsetY:u.offsetY});r.setDragImage(l,c.x,c.y)}}try{null==r||r.setData("application/json",{})}catch(e){}o.setCurrentDragSourceNode(e.target),o.getCurrentSourcePreviewNodeOptions().captureDraggingState?o.actions.publishDragSource():setTimeout(function(){return o.actions.publishDragSource()},0)}else if(i)o.beginDragNativeItem(i);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}}}),ef(this,"handleTopDragEndCapture",function(){o.clearCurrentDragSourceNode()&&o.monitor.isDragging()&&o.actions.endDrag()}),ef(this,"handleTopDragEnterCapture",function(e){if(o.dragEnterTargetIds=[],o.enterLeaveCounter.enter(e.target)&&!o.monitor.isDragging()){var t=e.dataTransfer,n=Kc(t);n&&o.beginDragNativeItem(n,t)}}),ef(this,"handleTopDragEnter",function(e){var t=o.dragEnterTargetIds;o.dragEnterTargetIds=[],o.monitor.isDragging()&&(o.altKeyPressed=e.altKey,t.length>0&&o.actions.hover(t,{clientOffset:jc(e)}),t.some(function(e){return o.monitor.canDropOnTarget(e)})&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())))}),ef(this,"handleTopDragOverCapture",function(){o.dragOverTargetIds=[]}),ef(this,"handleTopDragOver",function(e){var t=o.dragOverTargetIds;if(o.dragOverTargetIds=[],!o.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));o.altKeyPressed=e.altKey,o.lastClientOffset=jc(e),null===o.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(o.hoverRafId=requestAnimationFrame(function(){o.monitor.isDragging()&&o.actions.hover(t||[],{clientOffset:o.lastClientOffset}),o.hoverRafId=null})),(t||[]).some(function(e){return o.monitor.canDropOnTarget(e)})?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=o.getCurrentDropEffect())):o.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))}),ef(this,"handleTopDragLeaveCapture",function(e){o.isDraggingNativeItem()&&e.preventDefault(),o.enterLeaveCounter.leave(e.target)&&o.isDraggingNativeItem()&&setTimeout(function(){return o.endDragNativeItem()},0)}),ef(this,"handleTopDropCapture",function(e){var t;o.dropTargetIds=[],o.isDraggingNativeItem()?(e.preventDefault(),null===(t=o.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):Kc(e.dataTransfer)&&e.preventDefault(),o.enterLeaveCounter.reset()}),ef(this,"handleTopDrop",function(e){var t=o.dropTargetIds;o.dropTargetIds=[],o.actions.hover(t,{clientOffset:jc(e)}),o.actions.drop({dropEffect:o.getCurrentDropEffect()}),o.isDraggingNativeItem()?o.endDragNativeItem():o.monitor.isDragging()&&o.actions.endDrag()}),ef(this,"handleSelectStart",function(e){var t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))}),this.options=new Qc(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new Tc(this.isNodeInDocument)}var n,r;return n=t,(r=[{key:"profile",value:function(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}},{key:"teardown",value:function(){var e,t=this.rootElement;void 0!==t&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(e=this.window)||void 0===e||e.cancelAnimationFrame(this.asyncEndDragFrameId)))}},{key:"connectDragPreview",value:function(e,t,n){var r=this;return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),function(){r.sourcePreviewNodes.delete(e),r.sourcePreviewNodeOptions.delete(e)}}},{key:"connectDragSource",value:function(e,t,n){var r=this;this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);var o=function(t){return r.handleDragStart(t,e)},i=function(e){return r.handleSelectStart(e)};return t.setAttribute("draggable","true"),t.addEventListener("dragstart",o),t.addEventListener("selectstart",i),function(){r.sourceNodes.delete(e),r.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",o),t.removeEventListener("selectstart",i),t.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(e,t){var n=this,r=function(t){return n.handleDragEnter(t,e)},o=function(t){return n.handleDragOver(t,e)},i=function(t){return n.handleDrop(t,e)};return t.addEventListener("dragenter",r),t.addEventListener("dragover",o),t.addEventListener("drop",i),function(){t.removeEventListener("dragenter",r),t.removeEventListener("dragover",o),t.removeEventListener("drop",i)}}},{key:"addEventListeners",value:function(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return Xc({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var e=this.monitor.getSourceId();return Xc({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}},{key:"isDraggingNativeItem",value:function(){var t=this.monitor.getItemType();return Object.keys(e).some(function(n){return e[n]===t})}},{key:"beginDragNativeItem",value:function(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){var n=new Vc(qc[e]);return n.loadDataTransfer(t),n}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(e){var t=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e,this.mouseMoveTimeoutTimer=setTimeout(function(){var e;return null===(e=t.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",t.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}},{key:"clearCurrentDragSourceNode",value:function(){var e;return!!this.currentDragSourceNode&&(this.currentDragSourceNode=null,this.rootElement&&(null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)),this.mouseMoveTimeoutTimer=null,!0)}},{key:"handleDragStart",value:function(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}},{key:"handleDragEnter",value:function(e,t){this.dragEnterTargetIds.unshift(t)}},{key:"handleDragOver",value:function(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}},{key:"handleDrop",value:function(e,t){this.dropTargetIds.unshift(t)}}])&&Zc(n.prototype,r),t}(),nf=function(e,t,n){return new tf(e,t,n)};function rf(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];if(!e){var i;if(void 0===t)i=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;(i=new Error(t.replace(/%s/g,function(){return r[a++]}))).name="Invariant Violation"}throw i.framesToPop=1,i}}function of(e,t,n){var r=n.getRegistry(),o=r.addTarget(e,t);return[o,function(){return r.removeTarget(o)}]}function af(e,t,n){var r=n.getRegistry(),o=r.addSource(e,t);return[o,function(){return r.removeSource(o)}]}function sf(e){var t={};return Object.keys(e).forEach(function(r){var o=e[r];if(r.endsWith("Ref"))t[r]=e[r];else{var i=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!(0,n.isValidElement)(t)){var o=t;return e(o,r),o}var i=t;!function(e){if("string"!=typeof e.type){var t=e.type.displayName||e.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(t," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}(i);var a=r?function(t){return e(t,r)}:e;return function(e,t){var r=e.ref;return rf("string"!=typeof r,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?(0,n.cloneElement)(e,{ref:function(e){lf(r,e),lf(t,e)}}):(0,n.cloneElement)(e,{ref:t})}(i,a)}}(o);t[r]=function(){return i}}}),t}function lf(e,t){"function"==typeof e?e(t):e.current=t}function uf(e){return uf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uf(e)}function cf(e){return null!==e&&"object"===uf(e)&&Object.prototype.hasOwnProperty.call(e,"current")}function ff(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var u=i[l];if(!s(u))return!1;var c=e[u],f=t[u];if(!1===(o=n?n.call(r,c,f,u):void 0)||void 0===o&&c!==f)return!1}return!0}function df(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var hf=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pf(this,"hooks",sf({dragSource:function(e,t){n.clearDragSource(),n.dragSourceOptions=t||null,cf(e)?n.dragSourceRef=e:n.dragSourceNode=e,n.reconnectDragSource()},dragPreview:function(e,t){n.clearDragPreview(),n.dragPreviewOptions=t||null,cf(e)?n.dragPreviewRef=e:n.dragPreviewNode=e,n.reconnectDragPreview()}})),pf(this,"handlerId",null),pf(this,"dragSourceRef",null),pf(this,"dragSourceNode",void 0),pf(this,"dragSourceOptionsInternal",null),pf(this,"dragSourceUnsubscribe",void 0),pf(this,"dragPreviewRef",null),pf(this,"dragPreviewNode",void 0),pf(this,"dragPreviewOptionsInternal",null),pf(this,"dragPreviewUnsubscribe",void 0),pf(this,"lastConnectedHandlerId",null),pf(this,"lastConnectedDragSource",null),pf(this,"lastConnectedDragSourceOptions",null),pf(this,"lastConnectedDragPreview",null),pf(this,"lastConnectedDragPreviewOptions",null),pf(this,"backend",void 0),this.backend=t}var t,n;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(e){this.dragSourceOptionsInternal=e}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(e){this.dragPreviewOptionsInternal=e}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();t&&this.disconnectDragSource(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)):this.lastConnectedDragSource=e)}},{key:"reconnectDragPreview",value:function(){var e=this.dragPreview,t=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();t&&this.disconnectDragPreview(),this.handlerId&&(e?t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=e,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,e,this.dragPreviewOptions)):this.lastConnectedDragPreview=e)}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!ff(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ff(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}])&&df(t.prototype,n),e}();function gf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yf=!1,vf=!1,bf=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),mf(this,"internalMonitor",void 0),mf(this,"sourceId",null),this.internalMonitor=t.getMonitor()}var t,n;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.sourceId=e}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){rf(!yf,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return yf=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{yf=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;rf(!vf,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vf=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vf=!1}}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"isDraggingSource",value:function(e){return this.internalMonitor.isDraggingSource(e)}},{key:"isOverTarget",value:function(e,t){return this.internalMonitor.isOverTarget(e,t)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(e){return this.internalMonitor.subscribeToOffsetChange(e)}},{key:"canDragSource",value:function(e){return this.internalMonitor.canDragSource(e)}},{key:"canDropOnTarget",value:function(e){return this.internalMonitor.canDropOnTarget(e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&gf(t.prototype,n),e}();function wf(e){return wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wf(e)}function xf(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function Sf(e){return"function"==typeof e}function kf(){}function _f(e){if(!function(e){return"object"===wf(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Ef(e,t){return"string"==typeof e||"symbol"===wf(e)||!!t&&Array.isArray(e)&&e.every(function(e){return Ef(e,!1)})}var Cf=__webpack_require__(31085),Of=(0,n.createContext)({dragDropManager:void 0});function Tf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Rf(e,t,n){return t&&Pf(e.prototype,t),n&&Pf(e,n),e}function Mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Af=function(){function e(t){Tf(this,e),Mf(this,"isDisposed",!1),Mf(this,"action",void 0),this.action=Sf(t)?t:kf}return Rf(e,[{key:"dispose",value:function(){this.isDisposed||(this.action(),this.isDisposed=!0)}}],[{key:"isDisposable",value:function(e){return Boolean(e&&Sf(e.dispose))}},{key:"_fixup",value:function(t){return e.isDisposable(t)?t:e.empty}},{key:"create",value:function(t){return new e(t)}}]),e}();Mf(Af,"empty",{dispose:kf});var If=function(){function e(){Tf(this,e),Mf(this,"isDisposed",!1),Mf(this,"disposables",void 0);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];this.disposables=n}return Rf(e,[{key:"add",value:function(e){this.isDisposed?e.dispose():this.disposables.push(e)}},{key:"remove",value:function(e){var t=!1;if(!this.isDisposed){var n=this.disposables.indexOf(e);-1!==n&&(t=!0,this.disposables.splice(n,1),e.dispose())}return t}},{key:"clear",value:function(){if(!this.isDisposed){for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.disposables=[];for(var r=0;r<e;r++)t[r].dispose()}}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;for(var e=this.disposables.length,t=new Array(e),n=0;n<e;n++)t[n]=this.disposables[n];this.disposables=[];for(var r=0;r<e;r++)t[r].dispose()}}}]),e}(),Df=function(){function e(){Tf(this,e),Mf(this,"isDisposed",!1),Mf(this,"current",void 0)}return Rf(e,[{key:"getDisposable",value:function(){return this.current}},{key:"setDisposable",value:function(e){var t=this.isDisposed;if(!t){var n=this.current;this.current=e,n&&n.dispose()}t&&e&&e.dispose()}},{key:"dispose",value:function(){if(!this.isDisposed){this.isDisposed=!0;var e=this.current;this.current=void 0,e&&e.dispose()}}}]),e}();function jf(e){return jf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jf(e)}function Lf(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Nf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function $f(e,t){return $f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},$f(e,t)}function Ff(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function zf(e){return zf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},zf(e)}function Bf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uf(e){var t=e.DecoratedComponent,r=e.createHandler,o=e.createMonitor,i=e.createConnector,a=e.registerHandler,s=e.containerDisplayName,l=e.getType,u=e.collect,c=e.options.arePropsEqual,f=void 0===c?ff:c,d=t,p=t.displayName||t.name||"Component",h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$f(e,t)}(m,e);var t,s,c,h,g=(c=m,h=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=zf(c);if(h){var n=zf(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===jf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Ff(e)}(this,e)});function m(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m),Bf(Ff(t=g.call(this,e)),"decoratedRef",(0,n.createRef)()),Bf(Ff(t),"handlerId",void 0),Bf(Ff(t),"manager",void 0),Bf(Ff(t),"handlerMonitor",void 0),Bf(Ff(t),"handlerConnector",void 0),Bf(Ff(t),"handler",void 0),Bf(Ff(t),"disposable",void 0),Bf(Ff(t),"currentType",void 0),Bf(Ff(t),"handleChange",function(){var e=t.getCurrentState();ff(e,t.state)||t.setState(e)}),t.disposable=new Df,t.receiveProps(e),t.dispose(),t}return t=m,s=[{key:"getHandlerId",value:function(){return this.handlerId}},{key:"getDecoratedComponentInstance",value:function(){return rf(this.decoratedRef.current,"In order to access an instance of the decorated component, it must either be a class component or use React.forwardRef()"),this.decoratedRef.current}},{key:"shouldComponentUpdate",value:function(e,t){return!f(e,this.props)||!ff(t,this.state)}},{key:"componentDidMount",value:function(){this.disposable=new Df,this.currentType=void 0,this.receiveProps(this.props),this.handleChange()}},{key:"componentDidUpdate",value:function(e){f(this.props,e)||(this.receiveProps(this.props),this.handleChange())}},{key:"componentWillUnmount",value:function(){this.dispose()}},{key:"receiveProps",value:function(e){this.handler&&(this.handler.receiveProps(e),this.receiveType(l(e)))}},{key:"receiveType",value:function(e){if(this.handlerMonitor&&this.manager&&this.handlerConnector&&e!==this.currentType){this.currentType=e;var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Lf(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lf(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a(e,this.handler,this.manager),2),n=t[0],r=t[1];this.handlerId=n,this.handlerMonitor.receiveHandlerId(n),this.handlerConnector.receiveHandlerId(n);var o=this.manager.getMonitor().subscribeToStateChange(this.handleChange,{handlerIds:[n]});this.disposable.setDisposable(new If(new Af(o),new Af(r)))}}},{key:"dispose",value:function(){this.disposable.dispose(),this.handlerConnector&&this.handlerConnector.receiveHandlerId(null)}},{key:"getCurrentState",value:function(){return this.handlerConnector?u(this.handlerConnector.hooks,this.handlerMonitor,this.props):{}}},{key:"render",value:function(){var e=this;return(0,Cf.jsx)(Of.Consumer,{children:function(t){var n,r,o=t.dragDropManager;return e.receiveDragDropManager(o),"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(function(){var t;return null===(t=e.handlerConnector)||void 0===t?void 0:t.reconnect()}),(0,Cf.jsx)(d,Object.assign({},e.props,e.getCurrentState(),{ref:(n=d,(r=n)&&r.prototype&&"function"==typeof r.prototype.render||function(e){var t;return"Symbol(react.forward_ref)"===(null==e||null===(t=e.$$typeof)||void 0===t?void 0:t.toString())}(n)?e.decoratedRef:null)}),void 0)}},void 0)}},{key:"receiveDragDropManager",value:function(e){void 0===this.manager&&(rf(void 0!==e,"Could not find the drag and drop manager in the context of %s. Make sure to render a DndProvider component in your top-level component. Read more: http://react-dnd.github.io/react-dnd/docs/troubleshooting#could-not-find-the-drag-and-drop-manager-in-the-context",p,p),void 0!==e&&(this.manager=e,this.handlerMonitor=o(e),this.handlerConnector=i(e.getBackend()),this.handler=r(this.handlerMonitor,this.decoratedRef)))}}],s&&Nf(t.prototype,s),m}(n.Component);return Bf(h,"DecoratedComponent",t),Bf(h,"displayName","".concat(s,"(").concat(p,")")),g()(h,t)}function qf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Hf=["canDrag","beginDrag","isDragging","endDrag"],Vf=["beginDrag"],Kf=function(){function e(t,n,r){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Wf(this,"props",null),Wf(this,"spec",void 0),Wf(this,"monitor",void 0),Wf(this,"ref",void 0),Wf(this,"beginDrag",function(){if(o.props)return o.spec.beginDrag(o.props,o.monitor,o.ref.current)}),this.spec=t,this.monitor=n,this.ref=r}var t,n;return t=e,(n=[{key:"receiveProps",value:function(e){this.props=e}},{key:"canDrag",value:function(){return!!this.props&&(!this.spec.canDrag||this.spec.canDrag(this.props,this.monitor))}},{key:"isDragging",value:function(e,t){return!!this.props&&(this.spec.isDragging?this.spec.isDragging(this.props,this.monitor):t===e.getSourceId())}},{key:"endDrag",value:function(){this.props&&this.spec.endDrag&&this.spec.endDrag(this.props,this.monitor,xf(this.ref))}}])&&qf(t.prototype,n),e}();function Gf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Yf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Qf=!1,Jf=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Yf(this,"internalMonitor",void 0),Yf(this,"targetId",null),this.internalMonitor=t.getMonitor()}var t,n;return t=e,(n=[{key:"receiveHandlerId",value:function(e){this.targetId=e}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;rf(!Qf,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Qf=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Qf=!1}}},{key:"isOver",value:function(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}])&&Gf(t.prototype,n),e}();function Xf(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ed=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zf(this,"hooks",sf({dropTarget:function(e,t){n.clearDropTarget(),n.dropTargetOptions=t,cf(e)?n.dropTargetRef=e:n.dropTargetNode=e,n.reconnect()}})),Zf(this,"handlerId",null),Zf(this,"dropTargetRef",null),Zf(this,"dropTargetNode",void 0),Zf(this,"dropTargetOptionsInternal",null),Zf(this,"unsubscribeDropTarget",void 0),Zf(this,"lastConnectedHandlerId",null),Zf(this,"lastConnectedDropTarget",null),Zf(this,"lastConnectedDropTargetOptions",null),Zf(this,"backend",void 0),this.backend=t}var t,n;return t=e,(n=[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();var t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}},{key:"receiveHandlerId",value:function(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(e){this.dropTargetOptionsInternal=e}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!ff(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}])&&Xf(t.prototype,n),e}();function td(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function nd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rd=["canDrop","hover","drop"],od=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),nd(this,"props",null),nd(this,"spec",void 0),nd(this,"monitor",void 0),nd(this,"ref",void 0),this.spec=t,this.monitor=n,this.ref=r}var t,n;return t=e,(n=[{key:"receiveProps",value:function(e){this.props=e}},{key:"receiveMonitor",value:function(e){this.monitor=e}},{key:"canDrop",value:function(){return!this.spec.canDrop||this.spec.canDrop(this.props,this.monitor)}},{key:"hover",value:function(){this.spec.hover&&this.props&&this.spec.hover(this.props,this.monitor,xf(this.ref))}},{key:"drop",value:function(){if(this.spec.drop)return this.spec.drop(this.props,this.monitor,this.ref.current)}}])&&td(t.prototype,n),e}();var id="dnd-core/INIT_COORDS",ad="dnd-core/BEGIN_DRAG",sd="dnd-core/PUBLISH_DRAG_SOURCE",ld="dnd-core/HOVER",ud="dnd-core/DROP",cd="dnd-core/END_DRAG";function fd(e,t){return{type:id,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}function dd(e){return dd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dd(e)}function pd(e){return"object"===dd(e)}var hd={type:id,payload:{clientOffset:null,sourceClientOffset:null}};function gd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{publishSource:!0},r=n.publishSource,o=void 0===r||r,i=n.clientOffset,a=n.getSourceClientOffset,s=e.getMonitor(),l=e.getRegistry();e.dispatch(fd(i)),function(e,t,n){rf(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){rf(n.getSource(e),"Expected sourceIds to be registered.")})}(t,s,l);var u=function(e,t){for(var n=null,r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,s);if(null!==u){var c=null;if(i){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){rf("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),c=a(u)}e.dispatch(fd(i,c));var f=l.getSource(u).beginDrag(s,u);if(null!=f){!function(e){rf(pd(e),"Item must be an object.")}(f),l.pinSource(u);var d=l.getSourceType(u);return{type:ad,payload:{itemType:d,item:f,sourceId:u,clientOffset:i||null,sourceClientOffset:c||null,isSourcePublic:!!o}}}}else e.dispatch(hd)}}function md(e){return function(){if(e.getMonitor().isDragging())return{type:sd}}}function yd(e,t){return null===t?null===e:Array.isArray(e)?e.some(function(e){return e===t}):e===t}function vd(e){return function(t){var n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).clientOffset;!function(e){rf(Array.isArray(e),"Expected targetIds to be an array.")}(t);var r=t.slice(0),o=e.getMonitor(),i=e.getRegistry();return function(e,t,n){rf(t.isDragging(),"Cannot call hover while not dragging."),rf(!t.didDrop(),"Cannot call hover after drop.");for(var r=0;r<e.length;r++){var o=e[r];rf(e.lastIndexOf(o)===r,"Expected targetIds to be unique in the passed array."),rf(n.getTarget(o),"Expected targetIds to be registered.")}}(r,o,i),function(e,t,n){for(var r=e.length-1;r>=0;r--){var o=e[r];yd(t.getTargetType(o),n)||e.splice(r,1)}}(r,i,o.getItemType()),function(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}(r,o,i),{type:ld,payload:{targetIds:r,clientOffset:n||null}}}}function bd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bd(Object(n),!0).forEach(function(t){xd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sd(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getMonitor(),r=e.getRegistry();!function(e){rf(e.isDragging(),"Cannot call drop while not dragging."),rf(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);var o=function(e){var t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach(function(o,i){var a=function(e,t,n,r){var o=n.getTarget(e),i=o?o.drop(r,e):void 0;return function(e){rf(void 0===e||pd(e),"Drop result must either be an object or undefined.")}(i),void 0===i&&(i=0===t?{}:r.getDropResult()),i}(o,i,r,n),s={type:ud,payload:{dropResult:wd(wd({},t),a)}};e.dispatch(s)})}}function kd(e){return function(){var t=e.getMonitor(),n=e.getRegistry();!function(e){rf(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);var r=t.getSourceId();return null!=r&&(n.getSource(r,!0).endDrag(t,r),n.unpinSource()),{type:cd}}}function _d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ed(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Cd=function(){function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Ed(this,"store",void 0),Ed(this,"monitor",void 0),Ed(this,"backend",void 0),Ed(this,"isSetUp",!1),Ed(this,"handleRefCountChange",function(){var e=r.store.getState().refCount>0;r.backend&&(e&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!e&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}var t,n;return t=e,n=[{key:"receiveBackend",value:function(e){this.backend=e}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var e=this,t=this.store.dispatch,n=function(e){return{beginDrag:gd(e),publishDragSource:md(e),hover:vd(e),drop:Sd(e),endDrag:kd(e)}}(this);return Object.keys(n).reduce(function(r,o){var i,a=n[o];return r[o]=(i=a,function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var a=i.apply(e,r);void 0!==a&&t(a)}),r},{})}},{key:"dispatch",value:function(e){this.store.dispatch(e)}}],n&&_d(t.prototype,n),e}(),Od=function(e,t){return e===t};function Td(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Td(Object(n),!0).forEach(function(t){Rd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Td(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Md={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Ad(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Md,r=arguments.length>1?arguments[1]:void 0,o=r.payload;switch(r.type){case id:case ad:return{initialSourceClientOffset:o.sourceClientOffset,initialClientOffset:o.clientOffset,clientOffset:o.clientOffset};case ld:return e=n.clientOffset,t=o.clientOffset,!e&&!t||e&&t&&e.x===t.x&&e.y===t.y?n:Pd(Pd({},n),{},{clientOffset:o.clientOffset});case cd:case ud:return Md;default:return n}}var Id="dnd-core/ADD_SOURCE",Dd="dnd-core/ADD_TARGET",jd="dnd-core/REMOVE_SOURCE",Ld="dnd-core/REMOVE_TARGET";function Nd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nd(Object(n),!0).forEach(function(t){Fd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var zd={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Bd(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zd,r=arguments.length>1?arguments[1]:void 0,o=r.payload;switch(r.type){case ad:return $d($d({},n),{},{itemType:o.itemType,item:o.item,sourceId:o.sourceId,isSourcePublic:o.isSourcePublic,dropResult:null,didDrop:!1});case sd:return $d($d({},n),{},{isSourcePublic:!0});case ld:return $d($d({},n),{},{targetIds:o.targetIds});case Ld:return-1===n.targetIds.indexOf(o.targetId)?n:$d($d({},n),{},{targetIds:(e=n.targetIds,t=o.targetId,e.filter(function(e){return e!==t}))});case ud:return $d($d({},n),{},{dropResult:o.dropResult,didDrop:!0,targetIds:[]});case cd:return $d($d({},n),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return n}}function Ud(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;switch((arguments.length>1?arguments[1]:void 0).type){case Id:case Dd:return e+1;case jd:case Ld:return e-1;default:return e}}var qd=[],Wd=[];function Hd(){var e=arguments.length>1?arguments[1]:void 0;switch(e.type){case ld:break;case Id:case Dd:case Ld:case jd:return qd;default:return Wd}var t=e.payload,n=t.targetIds,r=void 0===n?[]:n,o=t.prevTargetIds,i=void 0===o?[]:o,a=function(e,t){var n=new Map,r=function(e){n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);var o=[];return n.forEach(function(e,t){1===e&&o.push(t)}),o}(r,i),s=a.length>0||!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Od;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(r,i);if(!s)return qd;var l=i[i.length-1],u=r[r.length-1];return l!==u&&(l&&a.push(l),u&&a.push(u)),a}function Vd(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0)+1}function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(t){Yd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qd(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Hd(n.dirtyHandlerIds,{type:r.type,payload:Gd(Gd({},r.payload),{},{prevTargetIds:(e=n,t=[],"dragOperation.targetIds".split(".").reduce(function(e,n){return e&&e[n]?e[n]:t||null},e))})}),dragOffset:Ad(n.dragOffset,r),refCount:Ud(n.refCount,r),dragOperation:Bd(n.dragOperation,r),stateId:Vd(n.stateId)}}function Jd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Xd(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}qd.__IS_NONE__=!0,Wd.__IS_ALL__=!0;var ep,tp=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Zd(this,"store",void 0),Zd(this,"registry",void 0),this.store=t,this.registry=n}var t,n;return t=e,n=[{key:"subscribeToStateChange",value:function(e){var t=this,n=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{handlerIds:void 0}).handlerIds;rf("function"==typeof e,"listener must be a function."),rf(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");var r=this.store.getState().stateId;return this.store.subscribe(function(){var o=t.store.getState(),i=o.stateId;try{var a=i===r||i===r+1&&!function(e,t){if(e===qd)return!1;if(e===Wd||void 0===t)return!0;var n,r=(n=e,t.filter(function(e){return n.indexOf(e)>-1}));return r.length>0}(o.dirtyHandlerIds,n);a||e()}finally{r=i}})}},{key:"subscribeToOffsetChange",value:function(e){var t=this;rf("function"==typeof e,"listener must be a function.");var n=this.store.getState().dragOffset;return this.store.subscribe(function(){var r=t.store.getState().dragOffset;r!==n&&(n=r,e())})}},{key:"canDragSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e);return rf(t,"Expected to find a valid source. sourceId=".concat(e)),!this.isDragging()&&t.canDrag(this,e)}},{key:"canDropOnTarget",value:function(e){if(!e)return!1;var t=this.registry.getTarget(e);return rf(t,"Expected to find a valid target. targetId=".concat(e)),!(!this.isDragging()||this.didDrop())&&yd(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}},{key:"isDragging",value:function(){return Boolean(this.getItemType())}},{key:"isDraggingSource",value:function(e){if(!e)return!1;var t=this.registry.getSource(e,!0);return rf(t,"Expected to find a valid source. sourceId=".concat(e)),!(!this.isDragging()||!this.isSourcePublic())&&this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}},{key:"isOverTarget",value:function(e){if(!e)return!1;var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{shallow:!1}).shallow;if(!this.isDragging())return!1;var n=this.registry.getTargetType(e),r=this.getItemType();if(r&&!yd(n,r))return!1;var o=this.getTargetIds();if(!o.length)return!1;var i=o.indexOf(e);return t?i===o.length-1:i>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,n=e.initialClientOffset,r=e.initialSourceClientOffset,t&&n&&r?Jd(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null;var e,t,n,r}},{key:"getDifferenceFromInitialOffset",value:function(){return t=(e=this.store.getState().dragOffset).clientOffset,n=e.initialClientOffset,t&&n?Jd(t,n):null;var e,t,n}}],n&&Xd(t.prototype,n),e}(),np=0;function rp(e){return rp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},rp(e)}function op(e,t){t&&Array.isArray(e)?e.forEach(function(e){return op(e,!1)}):rf("string"==typeof e||"symbol"===rp(e),t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(ep||(ep={}));const ip=void 0!==__webpack_require__.g?__webpack_require__.g:self,ap=ip.MutationObserver||ip.WebKitMutationObserver;function sp(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const lp="function"==typeof ap?function(e){let t=1;const n=new ap(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:sp;class up{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const cp=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=lp(this.flush),this.requestErrorThrow=sp(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},fp=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new up(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(cp.registerPendingError);function dp(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function pp(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hp(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gp(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function mp(e){switch(e[0]){case"S":return ep.SOURCE;case"T":return ep.TARGET;default:rf(!1,"Cannot parse handler ID: ".concat(e))}}function yp(e,t){var n=e.entries(),r=!1;do{var o=n.next(),i=o.done;if(hp(o.value,2)[1]===t)return!0;r=!!i}while(!r);return!1}var vp=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),pp(this,"types",new Map),pp(this,"dragSources",new Map),pp(this,"dropTargets",new Map),pp(this,"pinnedSourceId",null),pp(this,"pinnedSource",null),pp(this,"store",void 0),this.store=t}var t,n;return t=e,n=[{key:"addSource",value:function(e,t){op(e),function(e){rf("function"==typeof e.canDrag,"Expected canDrag to be a function."),rf("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),rf("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);var n=this.addHandler(ep.SOURCE,e,t);return this.store.dispatch(function(e){return{type:Id,payload:{sourceId:e}}}(n)),n}},{key:"addTarget",value:function(e,t){op(e,!0),function(e){rf("function"==typeof e.canDrop,"Expected canDrop to be a function."),rf("function"==typeof e.hover,"Expected hover to be a function."),rf("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);var n=this.addHandler(ep.TARGET,e,t);return this.store.dispatch(function(e){return{type:Dd,payload:{targetId:e}}}(n)),n}},{key:"containsHandler",value:function(e){return yp(this.dragSources,e)||yp(this.dropTargets,e)}},{key:"getSource",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return rf(this.isSourceId(e),"Expected a valid source ID."),t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}},{key:"getTarget",value:function(e){return rf(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}},{key:"getSourceType",value:function(e){return rf(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}},{key:"getTargetType",value:function(e){return rf(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}},{key:"isSourceId",value:function(e){return mp(e)===ep.SOURCE}},{key:"isTargetId",value:function(e){return mp(e)===ep.TARGET}},{key:"removeSource",value:function(e){var t,n=this;rf(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:jd,payload:{sourceId:e}}}(e)),t=function(){n.dragSources.delete(e),n.types.delete(e)},cp.enqueueTask(fp.create(t))}},{key:"removeTarget",value:function(e){rf(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:Ld,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}},{key:"pinSource",value:function(e){var t=this.getSource(e);rf(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}},{key:"unpinSource",value:function(){rf(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(e,t,n){var r=function(e){var t=(np++).toString();switch(e){case ep.SOURCE:return"S".concat(t);case ep.TARGET:return"T".concat(t);default:throw new Error("Unknown Handler Role: ".concat(e))}}(e);return this.types.set(r,t),e===ep.SOURCE?this.dragSources.set(r,n):e===ep.TARGET&&this.dropTargets.set(r,n),r}}],n&&dp(t.prototype,n),e}();function bp(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,(0,ze.y$)(Qd,t&&n&&n({name:"dnd-core",instanceId:"dnd-core"}))),a=new tp(i,new vp(i)),s=new Cd(i,a),l=e(s,r,o);return s.receiveBackend(l),s}var wp=["children"];function xp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Sp=0,kp=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),_p=(0,n.memo)(function(e){var t=e.children,r=function(e){if("manager"in e)return[{dragDropManager:e.manager},!1];var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ep(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=t;return o[kp]||(o[kp]={dragDropManager:bp(e,t,n,r)}),o[kp]}(e.backend,e.context,e.options,e.debugMode);return[t,!e.context]}(function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,wp)),o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xp(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(r,2),i=o[0],a=o[1];return(0,n.useEffect)(function(){if(a){var e=Ep();return++Sp,function(){0===--Sp&&(e[kp]=null)}}},[]),(0,Cf.jsx)(Of.Provider,Object.assign({value:i},{children:t}),void 0)});function Ep(){return void 0!==__webpack_require__.g?__webpack_require__.g:window}function Cp({namespace:e,...t}){const n=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(rf(Ef(e),'Expected "type" provided as the first argument to DragSource to be a string, or a function that returns a string given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',e),o=function(){return e}),rf(_f(t),'Expected "spec" provided as the second argument to DragSource to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',t);var i=function(e){return Object.keys(e).forEach(function(t){rf(Hf.indexOf(t)>-1,'Expected the drag source specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',Hf.join(", "),t),rf("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])}),Vf.forEach(function(t){rf("function"==typeof e[t],"Expected %s in the drag source specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source",t,t,e[t])}),function(t,n){return new Kf(e,t,n)}}(t);return rf("function"==typeof n,'Expected "collect" provided as the third argument to DragSource to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),rf(_f(r),'Expected "options" provided as the fourth argument to DragSource to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source',n),function(e){return Uf({containerDisplayName:"DragSource",createHandler:i,registerHandler:af,createConnector:function(e){return new hf(e)},createMonitor:function(e){return new bf(e)},DecoratedComponent:e,getType:o,collect:n,options:r})}}(e,{beginDrag:({children:e,isDragging:t,connectDragComponent:n,...r})=>r},e=>({connectDragComponent:e.dragSource()}))(({children:e,connectDragComponent:t})=>e(t));return r().createElement(n,t,t.children)}function Op({onDrop:e,namespace:t,...n}){const o=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e;"function"!=typeof e&&(rf(Ef(e,!0),'Expected "type" provided as the first argument to DropTarget to be a string, an array of strings, or a function that returns either given the current props. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',e),o=function(){return e}),rf(_f(t),'Expected "spec" provided as the second argument to DropTarget to be a plain object. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',t);var i=function(e){return Object.keys(e).forEach(function(t){rf(rd.indexOf(t)>-1,'Expected the drop target specification to only have some of the following keys: %s. Instead received a specification with an unexpected "%s" key. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',rd.join(", "),t),rf("function"==typeof e[t],"Expected %s in the drop target specification to be a function. Instead received a specification with %s: %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target",t,t,e[t])}),function(t,n){return new od(e,t,n)}}(t);return rf("function"==typeof n,'Expected "collect" provided as the third argument to DropTarget to be a function that returns a plain object of props to inject. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),rf(_f(r),'Expected "options" provided as the fourth argument to DropTarget to be a plain object when specified. Instead, received %s. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target',n),function(e){return Uf({containerDisplayName:"DropTarget",createHandler:i,registerHandler:of,createMonitor:function(e){return new Jf(e)},createConnector:function(e){return new ed(e)},DecoratedComponent:e,getType:o,collect:n,options:r})}}(t,{drop(t,n){e(n.getItem())}},(e,t)=>({connectDropTarget:e.dropTarget(),isHovered:t.isOver()}))(({children:e,connectDropTarget:t,isHovered:n})=>e(t,{isHovered:n}));return r().createElement(o,n,n.children)}Cp.propTypes={namespace:i().any.isRequired,children:i().func.isRequired},Op.propTypes={onDrop:i().func.isRequired,namespace:i().any.isRequired,children:i().func.isRequired};var Tp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Pp(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Rp=/[A-Z]|^ms/g,Mp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ap=function(e){return 45===e.charCodeAt(1)},Ip=function(e){return null!=e&&"boolean"!=typeof e},Dp=Pp(function(e){return Ap(e)?e:e.replace(Rp,"-$&").toLowerCase()}),jp=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Mp,function(e,t,n){return Np={name:t,styles:n,next:Np},t})}return 1===Tp[e]||Ap(e)||"number"!=typeof t||0===t?t:t+"px"};function Lp(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return Np={name:o.name,styles:o.styles,next:Np},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Np={name:a.name,styles:a.styles,next:Np},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Lp(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":Ip(s)&&(r+=Dp(i)+":"+jp(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=Lp(e,t,a);switch(i){case"animation":case"animationName":r+=Dp(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var u=0;u<a.length;u++)Ip(a[u])&&(r+=Dp(i)+":"+jp(i,a[u])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Np,l=n(e);return Np=s,Lp(e,t,l)}}var u=n;if(null==t)return u;var c=t[u];return void 0!==c?c:u}var Np,$p=/label:\s*([^\s;{]+)\s*(;|$)/g,Fp=!!n.useInsertionEffect&&n.useInsertionEffect,zp=Fp||function(e){return e()};Fp||n.useLayoutEffect;var Bp=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Up=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,qp=Pp(function(e){return Up.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Wp=function(e){return"theme"!==e},Hp=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?qp:Wp},Vp=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Kp=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Bp(t,n,r),zp(function(){return function(e,t,n){Bp(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)}),null},Gp=function e(t,r){var o,i,a=t.__emotion_real===t,s=a&&t.__emotion_base||t;void 0!==r&&(o=r.label,i=r.target);var l=Vp(t,r,a),u=l||Hp(s),c=!u("as");return function(){var f=arguments,p=a&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==o&&p.push("label:"+o+";"),null==f[0]||void 0===f[0].raw)p.push.apply(p,f);else{var h=f[0];p.push(h[0]);for(var g=f.length,m=1;m<g;m++)p.push(f[m],h[m])}var y=(0,Hr.withEmotionCache)(function(e,t,r){var o,a,f,d,h=c&&e.as||s,g="",m=[],y=e;if(null==e.theme){for(var v in y={},e)y[v]=e[v];y.theme=n.useContext(Hr.ThemeContext)}"string"==typeof e.className?(o=t.registered,a=m,f=e.className,d="",f.split(" ").forEach(function(e){void 0!==o[e]?a.push(o[e]+";"):e&&(d+=e+" ")}),g=d):null!=e.className&&(g=e.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Np=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Lp(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=Lp(n,t,e[a]),r&&(o+=i[a]);$p.lastIndex=0;for(var s,l="";null!==(s=$p.exec(o));)l+="-"+s[1];var u=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:u,styles:o,next:Np}}(p.concat(m),t.registered,y);g+=t.key+"-"+b.name,void 0!==i&&(g+=" "+i);var w=c&&void 0===l?Hp(h):u,x={};for(var S in e)c&&"as"===S||w(S)&&(x[S]=e[S]);return x.className=g,r&&(x.ref=r),n.createElement(n.Fragment,null,n.createElement(Kp,{cache:t,serialized:b,isStringTag:"string"==typeof h}),n.createElement(h,x))});return y.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",y.defaultProps=t.defaultProps,y.__emotion_real=y,y.__emotion_base=s,y.__emotion_styles=p,y.__emotion_forwardProp=l,Object.defineProperty(y,"toString",{value:function(){return"."+i}}),y.withComponent=function(t,n){return e(t,d({},r,n,{shouldForwardProp:Vp(y,n,!0)})).apply(void 0,p)},y}},Yp=__webpack_require__(20685),Qp=__webpack_require__.n(Yp);function Jp({title:e,config:t}){const n=t?.issue_reports?.url??"https://github.com/decaporg/decap-cms/issues/new";try{const r=function({config:e}){let t="";"string"==typeof DECAP_CMS_VERSION?t=`decap-cms@${DECAP_CMS_VERSION}`:"string"==typeof DECAP_CMS_APP_VERSION&&(t=`decap-cms-app@${DECAP_CMS_APP_VERSION}`);const n=function({version:e,provider:t,browser:n,config:r}){return`\n**Describe the bug**\n\n**To Reproduce**\n\n**Expected behavior**\n\n**Screenshots**\n\n**Applicable Versions:**\n - Decap CMS version: \`${e}\`\n - Git provider: \`${t}\`\n - Browser version: \`${n}\`\n\n**CMS configuration**\n\`\`\`\n${r}\n\`\`\`\n\n**Additional context**\n`}({version:t,provider:e.backend.name,browser:navigator.userAgent,config:dn().stringify(e)});return n}({config:t}),o=new URLSearchParams;return o.append("title",Qp()(e,{length:100})),o.append("body",Qp()(r,{length:4e3,omission:"\n..."})),o.append("labels","type: bug"),`${n}?${o.toString()}`}catch(e){return console.log(e),`${n}?template=bug_report.md`}}const Xp=Gp("div",{target:"e59ncyd2",label:"ErrorBoundaryContainer"})("padding:40px;h1{font-size:28px;color:",$e.colors.text,";}h2{font-size:20px;}strong{color:",$e.colors.textLead,";font-weight:500;}hr{width:200px;margin:30px 0;border:0;height:1px;background-color:",$e.colors.text,";}a{color:",$e.colors.active,";}"),Zp=Gp("span",{target:"e59ncyd1",label:"PrivacyWarning"})("color:",$e.colors.text,";"),eh=Gp("button",{target:"e59ncyd0",label:"CopyButton"})($e.buttons.button,";",$e.buttons.default,";",$e.buttons.gray,";display:block;margin:12px 0;");function th({entry:e,t}){return console.log(e),(0,Hr.jsx)(r().Fragment,null,(0,Hr.jsx)("hr",null),(0,Hr.jsx)("h2",null,t("ui.errorBoundary.recoveredEntry.heading")),(0,Hr.jsx)("strong",null,t("ui.errorBoundary.recoveredEntry.warning")),(0,Hr.jsx)(eh,{onClick:()=>navigator.clipboard.writeText(e)},t("ui.errorBoundary.recoveredEntry.copyButtonLabel")),(0,Hr.jsx)("pre",null,(0,Hr.jsx)("code",null,e)))}class nh extends r().Component{static propTypes={children:i().node,t:i().func.isRequired,config:i().object.isRequired};state={hasError:!1,errorMessage:"",errorTitle:"",backup:""};static getDerivedStateFromError(e){return console.error(e),{hasError:!0,errorMessage:e.stack||e.toString(),errorTitle:e.toString()}}componentDidMount(){i().checkPropTypes(nh.propTypes,this.props,"prop","ErrorBoundary")}shouldComponentUpdate(e,t){return!this.props.showBackup||this.state.errorMessage!==t.errorMessage||this.state.backup!==t.backup}async componentDidUpdate(){if(this.props.showBackup){const e=await ln.localForage.getItem("backup");e&&console.log(e),this.setState({backup:e})}}render(){const{hasError:e,errorMessage:t,backup:n,errorTitle:o}=this.state,{showBackup:i,t:a}=this.props;return e?(0,Hr.jsx)(Xp,null,(0,Hr.jsx)("h1",null,a("ui.errorBoundary.title")),(0,Hr.jsx)("p",null,(0,Hr.jsx)("span",null,a("ui.errorBoundary.details")),(0,Hr.jsx)("a",{href:Jp({title:o,config:this.props.config}),target:"_blank",rel:"noopener noreferrer","data-testid":"issue-url"},a("ui.errorBoundary.reportIt"))),(0,Hr.jsx)("p",null,a("ui.errorBoundary.privacyWarning").split("\n").map((e,t)=>(0,Hr.jsx)(r().Fragment,null,(0,Hr.jsx)(Zp,{key:t},e),(0,Hr.jsx)("br",null)))),(0,Hr.jsx)("hr",null),(0,Hr.jsx)("h2",null,a("ui.errorBoundary.detailsHeading")),(0,Hr.jsx)("p",null,t),n&&i&&(0,Hr.jsx)(th,{entry:n,t:a})):this.props.children}}const rh=(0,Fe.Tl)()(nh);function oh({label:e,imagesOnly:t,onChange:n,disabled:r,className:o}){return(0,Hr.jsx)("label",{tabIndex:"0",className:`nc-fileUploadButton ${o||""}`},(0,Hr.jsx)("span",null,e),(0,Hr.jsx)("input",{type:"file",accept:t?"image/*":"*/*",onChange:n,disabled:r}))}oh.propTypes={className:i().string,label:i().string.isRequired,imagesOnly:i().bool,onChange:i().func.isRequired,disabled:i().bool};var ih=__webpack_require__(70373),ah=__webpack_require__.n(ih),sh={name:"1o9c9d2-ReactModalGlobalStyles",styles:".ReactModal__Body--open{overflow:hidden;};label:ReactModalGlobalStyles;"};function lh(){return(0,Hr.jsx)(Hr.Global,{styles:sh})}const uh=`\n ${$e.shadows.dropDeep};\n background-color: #fff;\n border-radius: ${$e.lengths.borderRadius};\n height: 80%;\n text-align: center;\n max-width: 2200px;\n padding: 20px;\n\n &:focus {\n outline: none;\n }\n `,ch=`\n z-index: ${$e.zIndex.zIndex99999};\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n background-color: rgba(0, 0, 0, 0);\n transition: background-color ${$e.transitions.main}, opacity ${$e.transitions.main};\n `;class fh extends r().Component{static propTypes={children:i().node.isRequired,isOpen:i().bool.isRequired,className:i().string,onClose:i().func.isRequired};componentDidMount(){i().checkPropTypes(fh.propTypes,this.props,"prop","Modal"),ah().setAppElement("#nc-root")}render(){const{isOpen:e,children:t,className:n,onClose:o}=this.props;return(0,Hr.jsx)(r().Fragment,null,(0,Hr.jsx)(lh,null),(0,Hr.jsx)(Hr.ClassNames,null,({css:r,cx:i})=>(0,Hr.jsx)(ah(),{isOpen:e,onRequestClose:o,closeTimeoutMS:300,className:{base:i(r`
|
|
15
15
|
${uh};
|
|
16
16
|
`,n),afterOpen:"",beforeClose:""},overlayClassName:{base:r`
|
|
17
17
|
${ch};
|