2024-12-27 15:02:31 +01:00
/*! For license information please see static-cms-app.js.LICENSE.txt */
! function ( e , t ) { "object" == typeof exports && "object" == typeof module ? module . exports = t ( ) : "function" == typeof define && define . amd ? define ( [ ] , t ) : "object" == typeof exports ? exports . StaticCmsApp = t ( ) : e . StaticCmsApp = t ( ) } ( globalThis , ( ( ) => ( ( ) => { var _ _webpack _modules _ _ = { 29155 : ( e , t , n ) => { "use strict" ; const r = n ( 99869 ) , i = n . g . Date ; class o extends i { constructor ( e ) { super ( e ) , this . isDate = ! 0 } toISOString ( ) { return ` ${ this . getUTCFullYear ( ) } - ${ r ( 2 , this . getUTCMonth ( ) + 1 ) } - ${ r ( 2 , this . getUTCDate ( ) ) } ` } } e . exports = e => { const t = new o ( e ) ; if ( isNaN ( t ) ) throw new TypeError ( "Invalid Datetime" ) ; return t } } , 71291 : ( e , t , n ) => { "use strict" ; const r = n ( 99869 ) ; class i extends Date { constructor ( e ) { super ( e + "Z" ) , this . isFloating = ! 0 } toISOString ( ) { return ` ${ this . getUTCFullYear ( ) } - ${ r ( 2 , this . getUTCMonth ( ) + 1 ) } - ${ r ( 2 , this . getUTCDate ( ) ) } T ${ r ( 2 , this . getUTCHours ( ) ) } : ${ r ( 2 , this . getUTCMinutes ( ) ) } : ${ r ( 2 , this . getUTCSeconds ( ) ) } . ${ r ( 3 , this . getUTCMilliseconds ( ) ) } ` } } e . exports = e => { const t = new i ( e ) ; if ( isNaN ( t ) ) throw new TypeError ( "Invalid Datetime" ) ; return t } } , 54991 : e => { "use strict" ; e . exports = e => { const t = new Date ( e ) ; if ( isNaN ( t ) ) throw new TypeError ( "Invalid Datetime" ) ; return t } } , 86953 : ( e , t , n ) => { "use strict" ; const r = n ( 99869 ) ; class i extends Date { constructor ( e ) { super ( ` 0000-01-01T ${ e } Z ` ) , this . isTime = ! 0 } toISOString ( ) { return ` ${ r ( 2 , this . getUTCHours ( ) ) } : ${ r ( 2 , this . getUTCMinutes ( ) ) } : ${ r ( 2 , this . getUTCSeconds ( ) ) } . ${ r ( 3 , this . getUTCMilliseconds ( ) ) } ` } } e . exports = e => { const t = new i ( e ) ; if ( isNaN ( t ) ) throw new TypeError ( "Invalid Datetime" ) ; return t } } , 99869 : e => { "use strict" ; e . exports = ( e , t ) => { for ( t = String ( t ) ; t . length < e ; ) t = "0" + t ; return t } } , 59299 : e => { "use strict" ; const t = 1114112 ; class n extends Error { constructor ( e , t , r ) { super ( "[ParserError] " + e , t , r ) , this . name = "ParserError" , this . code = "ParserError" , Error . captureStackTrace && Error . captureStackTrace ( this , n ) } } class r { constructor ( e ) { this . parser = e , this . buf = "" , this . returned = null , this . result = null , this . resultTable = null , this . resultArr = null } } class i { constructor ( ) { this . pos = 0 , this . col = 0 , this . line = 0 , this . obj = { } , this . ctx = this . obj , this . stack = [ ] , this . _buf = "" , this . char = null , this . ii = 0 , this . state = new r ( this . parseStart ) } parse ( e ) { if ( 0 === e . length || null == e . length ) return ; let t ; for ( this . _buf = String ( e ) , this . ii = - 1 , this . char = - 1 ; ! 1 === t || this . nextChar ( ) ; ) t = this . runOne ( ) ; this . _buf = null } nextChar ( ) { return 10 === this . char && ( ++ this . line , this . col = - 1 ) , ++ this . ii , this . char = this . _buf . codePointAt ( this . ii ) , ++ this . pos , ++ this . col , this . haveBuffer ( ) } haveBuffer ( ) { return this . ii < this . _buf . length } runOne ( ) { return this . state . parser . call ( this , this . state . returned ) } finish ( ) { let e ; this . char = t ; do { e = this . state . parser , this . runOne ( ) } while ( this . state . parser !== e ) ; return this . ctx = null , this . state = null , this . _buf = null , this . obj } next ( e ) { if ( "function" != typeof e ) throw new n ( "Tried to set state to non-existent state: " + JSON . stringify ( e ) ) ; this . state . parser = e } goto ( e ) { return this . next ( e ) , this . runOne ( ) } call ( e , t ) { t && this . next ( t ) , this . stack . push ( this . state ) , this . state = new r ( e ) } callNow ( e , t ) { return this . call ( e , t ) , this . runOne ( ) } return ( e ) { if ( 0 === this . stack . length ) throw this . error ( new n ( "Stack underflow" ) ) ; void 0 === e && ( e = this . state . buf ) , this . state = this . stack . pop ( ) , this . state . returned = e } returnNow ( e ) { return this . return ( e ) , this . runOne ( ) } consume ( ) { if ( this . char === t ) throw this . error ( new n ( "Unexpected end-of-buffer" ) ) ; this . state . buf += this . _buf [ this . ii ] } error ( e ) { return e . line = this . line , e . col = this . col , e . pos = this . pos , e } parseStart ( ) { throw new n ( "Must declare a parseStart method" ) } } i . END = t , i . Error = n , e . exports = i } , 66682 : ( module , _ _unused _webpack _exports , _ _webpack _require _ _ ) => { "use strict" ; module . exports = makeParserClass ( _ _webpack _require _ _ ( 59299 ) ) , module . exports . makeParserClass = makeParserClass ; class TomlError extends Error { constructor ( e ) { super ( e ) , this . name = "TomlError" , Error . captureStackTrace && Error . captureStackTrace ( this , TomlError ) , this . fromTOML = ! 0 , this . wrapped = null } } TomlError . wrap = e => { const t = new TomlError ( e . message ) ; return t . code = e . code , t . wrapped = e , t } , module . exports . TomlError = TomlError ; const createDateTime = _ _webpack _require _ _ ( 54991 ) , createDateTimeFloat = _ _webpack _require _ _ ( 71291 ) , createDate = _ _webpack _require _ _ ( 29155 ) , createTime = _ _webpack _require _ _ ( 86953 ) , CTRL _I = 9 , CTRL _J = 10 , CT
|| ( $ { s } == "string" && $ { i } && $ { i } == + $ { i } ) ` ).assign(l,a._ ` + $ { i } ` );case"integer":return void r.elseIf(a._ ` $ { s } === "boolean" || $ { i } === null
|| ( $ { s } === "string" && $ { i } && $ { i } == + $ { i } && ! ( $ { i } % 1 ) ) ` ).assign(l,a._ ` + $ { i } ` );case"boolean":return void r.elseIf(a._ ` $ { i } === "false" || $ { i } === 0 || $ { i } === null ` ).assign(l,!1).elseIf(a._ ` $ { i } === "true" || $ { i } === 1 ` ).assign(l,!0);case"null":return r.elseIf(a._ ` $ { i } === "" || $ { i } === 0 || $ { i } === false ` ),void r.assign(l,null);case"array":r.elseIf(a._ ` $ { s } === "string" || $ { s } === "number"
|| $ { s } === "boolean" || $ { i } === null ` ).assign(l,a._ ` [ $ { i } ] ` )}}r.else(),p(e),r.endIf(),r.if(a._ ` $ { l } !== undefined ` ,(()=>{r.assign(i,l),function({gen:e,parentData:t,parentDataProperty:n},r){e.if(a._ ` $ { t } !== undefined ` ,(()=>e.assign(a._ ` $ { t } [ $ { n } ] ` ,r)))}(e,l)}))}(e,t,s):p(e)}))}return u};const c=new Set(["string","number","integer","boolean","null"]);function d(e,t,n,r=l.Correct){const i=r===l.Correct?a.operators.EQ:a.operators.NEQ;let o;switch(e){case"null":return a._ ` $ { t } $ { i } null ` ;case"array":o=a._ ` Array . isArray ( $ { t } ) ` ;break;case"object":o=a._ ` $ { t } && typeof $ { t } == "object" && ! Array . isArray ( $ { t } ) ` ;break;case"integer":o=s(a._ ` ! ( $ { t } % 1 ) && ! isNaN ( $ { t } ) ` );break;case"number":o=s();break;default:return a._ ` typeof $ { t } $ { i } $ { e } ` }return r===l.Correct?o:(0,a.not)(o);function s(e=a.nil){return(0,a.and)(a._ ` typeof $ { t } == "number" ` ,e,n?a._ ` isFinite ( $ { t } ) ` :a.nil)}}function f(e,t,n,r){if(1===e.length)return d(e[0],t,n,r);let i;const o=(0,s.toHash)(e);if(o.array&&o.object){const e=a._ ` typeof $ { t } != "object" ` ;i=o.null?e:a._ ` ! $ { t } || $ { e } ` ,delete o.null,delete o.array,delete o.object}else i=a.nil;o.number&&delete o.integer;for(const e in o)i=(0,a.and)(i,d(e,t,n,r));return i}t.checkDataType=d,t.checkDataTypes=f;const h={message:({schema:e})=> ` must be $ { e } ` ,params:({schema:e,schemaValue:t})=>"string"==typeof e?a._ ` { type : $ { e } } ` :a._ ` { type : $ { t } } ` };function p(e){const t=function(e){const{gen:t,data:n,schema:r}=e,i=(0,s.schemaRefOrVal)(e,r,"type");return{gen:t,keyword:"type",data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}(e);(0,o.reportError)(t,h)}t.reportTypeError=p},15944:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const r=n(56110),i=n(20530);function o(e,t,n){const{gen:o,compositeRule:a,data:s,opts:l}=e;if(void 0===n)return;const u=r._ ` $ { s } $ { ( 0 , r . getProperty ) ( t ) } ` ;if(a)return void(0,i.checkStrictMode)(e, ` default is ignored for : $ { u } ` );let c=r._ ` $ { u } === undefined ` ;"empty"===l.useDefaults&&(c=r._ ` $ { c } || $ { u } === null || $ { u } === "" ` ),o.if(c,r._ ` $ { u } = $ { ( 0 , r . stringify ) ( n ) } ` )}t.assignDefaults=function(e,t){const{properties:n,items:r}=e.schema;if("object"===t&&n)for(const t in n)o(e,t,n[t].default);else"array"===t&&Array.isArray(r)&&r.forEach(((t,n)=>o(e,n,t.default)))}},43750:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const r=n(42971),i=n(97349),o=n(87177),a=n(97349),s=n(15944),l=n(42e3),u=n(35678),c=n(56110),d=n(17748),f=n(66184),h=n(20530),p=n(16257);function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},o){i.code.es5?e.func(t,c._ ` $ { d . default . data } , $ { d . default . valCxt } ` ,r. $ async,(()=>{e.code(c._ ` "use strict" ; $ { g ( n , i ) } ` ),function(e,t){e.if(d.default.valCxt,(()=>{e.var(d.default.instancePath,c._ ` $ { d . default . valCxt } . $ { d . default . instancePath } ` ),e.var(d.default.parentData,c._ ` $ { d . default . valCxt } . $ { d . default . parentData } ` ),e.var(d.default.parentDataProperty,c._ ` $ { d . default . valCxt } . $ { d . default . parentDataProperty } ` ),e.var(d.default.rootData,c._ ` $ { d . default . valCxt } . $ { d . default . rootData } ` ),t.dynamicRef&&e.var(d.default.dynamicAnchors,c._ ` $ { d . default . valCxt } . $ { d . default . dynamicAnchors } ` )}),(()=>{e.var(d.default.instancePath,c._ ` "" ` ),e.var(d.default.parentData,c._ ` undefined ` ),e.var(d.default.parentDataProperty,c._ ` undefined ` ),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,c._ ` { } ` )}))}(e,i),e.code(o)})):e.func(t,c._ ` $ { d . default . data } , $ { function ( e ) { return c . _ ` { ${ d . default . instancePath } ="", ${ d . default . parentData } , ${ d . default . parentDataProperty } , ${ d . default . rootData } = ${ d . default . data } ${ e . dynamicRef ? c . _ ` , ${ d . default . dynamicAnchors } ={} ` : c . nil } }={} ` } ( i ) } ` ,r. $ async,(()=>e.code(g(n,i)).code(o)))}function g(e,t){const n="object"==typeof e&&e[t.schemaId];return n&&(t.code.source||t.code.process)?c._ ` /*# sourceURL=${n} */ ` :c.nil}function v({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const n in e)if(t.RULES.all[n])return!0;return!1}function O(e){return"boolean"!=typeof e.schema}function y(e){(0,h.checkUnknownRul
missingProperty : $ { i } ,
depsCount : $ { t } ,
2024-12-27 15:57:48 +01:00
deps : $ { n } } ` };const a={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,n]=function({schema:e}){const t={},n={};for(const r in e)"__proto__"!==r&&((Array.isArray(e[r])?t:n)[r]=e[r]);return[t,n]}(e);s(e,t),l(e,n)}};function s(e,t=e.schema){const{gen:n,data:i,it:a}=e;if(0===Object.keys(t).length)return;const s=n.let("missing");for(const l in t){const u=t[l];if(0===u.length)continue;const c=(0,o.propertyInData)(n,i,l,a.opts.ownProperties);e.setParams({property:l,depsCount:u.length,deps:u.join(", ")}),a.allErrors?n.if(c,(()=>{for(const t of u)(0,o.checkReportMissingProp)(e,t)})):(n.if(r._ ` $ { c } && ( $ { ( 0 , o . checkMissingProp ) ( e , u , s ) } ) ` ),(0,o.reportMissingProp)(e,s),n.else())}}function l(e,t=e.schema){const{gen:n,data:r,keyword:a,it:s}=e,l=n.name("valid");for(const u in t)(0,i.alwaysValidSchema)(s,t[u])||(n.if((0,o.propertyInData)(n,r,u,s.opts.ownProperties),(()=>{const t=e.subschema({keyword:a,schemaProp:u},l);e.mergeValidEvaluated(t,l)}),(()=>n.var(l,!0))),e.ok(l))}t.validatePropertyDeps=s,t.validateSchemaDeps=l,t.default=a},17498:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(56110),i=n(20530),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>r.str ` must match "${e.ifClause}" schema ` ,params:({params:e})=>r._ ` { failingKeyword : $ { e . ifClause } } ` },code(e){const{gen:t,parentSchema:n,it:o}=e;void 0===n.then&&void 0===n.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const s=a(o,"then"),l=a(o,"else");if(!s&&!l)return;const u=t.let("valid",!0),c=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},c);e.mergeEvaluated(t)}(),e.reset(),s&&l){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(c,d("then",n),d("else",n))}else s?t.if(c,d("then")):t.if((0,r.not)(c),d("else"));function d(n,i){return()=>{const o=e.subschema({keyword:n},c);t.assign(u,c),e.mergeValidEvaluated(o,u),i?t.assign(i,r._ ` $ { n } ` ):e.setParams({ifClause:n})}}e.pass(u,(()=>e.error(!0)))}};function a(e,t){const n=e.schema[t];return void 0!==n&&!(0,i.alwaysValidSchema)(e,n)}t.default=o},3698:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(81600),i=n(53609),o=n(38223),a=n(62490),s=n(97458),l=n(32790),u=n(13796),c=n(88183),d=n(11935),f=n(98289),h=n(62514),p=n(50120),m=n(16328),g=n(68302),v=n(17498),O=n(96105);t.default=function(e=!1){const t=[h.default,p.default,m.default,g.default,v.default,O.default,u.default,c.default,l.default,d.default,f.default];return e?t.push(i.default,a.default):t.push(r.default,o.default),t.push(s.default),t}},38223:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const r=n(56110),i=n(20530),o=n(57111),a={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:n}=e;if(Array.isArray(t))return s(e,"additionalItems",t);n.items=!0,(0,i.alwaysValidSchema)(n,t)||e.ok((0,o.validateArray)(e))}};function s(e,t,n=e.schema){const{gen:o,parentSchema:a,data:s,keyword:l,it:u}=e;!function(e){const{opts:r,errSchemaPath:o}=u,a=n.length,s=a===e.minItems&&(a===e.maxItems||!1===e[t]);if(r.strictTuples&&!s){const e= ` "${l}" is $ { a } - tuple , but minItems or maxItems / $ { t } are not specified or different at path "${o}" ` ;(0,i.checkStrictMode)(u,e,r.strictTuples)}}(a),u.opts.unevaluated&&n.length&&!0!==u.items&&(u.items=i.mergeEvaluated.items(o,n.length,u.items));const c=o.name("valid"),d=o.const("len",r._ ` $ { s } . length ` );n.forEach(((t,n)=>{(0,i.alwaysValidSchema)(u,t)||(o.if(r._ ` $ { d } > $ { n } ` ,(()=>e.subschema({keyword:l,schemaProp:n,dataProp:n},c))),e.ok(c))}))}t.validateTuple=s,t.default=a},62490:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(56110),i=n(20530),o=n(57111),a=n(81600),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>r.str ` must NOT have more than $ { e } items ` ,params:({params:{len:e}})=>r._ ` { limit : $ { e } } ` },code(e){const{schem
2024-12-27 15:02:31 +01:00
[ StaticCMS ] Multiple widgets registered with name "${t}" . Only the last widget registered with
this name will be used .
` ),!n)throw Error( ` Widget "${t}" registered without \ ` controlComponent \` . ` ) ; OE . widgets [ t ] = { control : n , preview : r , validator : i , converters : o , getValidValue : a , getDefaultValue : s , schema : l } } else console . error ( "`registerWidget` failed, called with incorrect arguments." ) } function SE ( e ) { return OE . widgets [ e ] } function PE ( ) { return Object . entries ( OE . widgets ) . map ( ( ( [ e , t ] ) => mE ( { name : e } , t ) ) ) } function EE ( e ) { return SE ( e || "string" ) || SE ( "unknown" ) } function TE ( e ) { return OE . widgetValueSerializers [ e ] } function CE ( e , t ) { e && t ? OE . backends [ e ] ? console . error ( ` Backend [ ${ e } ] already registered. Please choose a different name. ` ) : OE . backends [ e ] = { init : ( e , n ) => new t ( e , n ) } : console . error ( "Backend parameters invalid. example: CMS.registerBackend('myBackend', BackendClass)" ) } function $E ( e ) { return OE . backends [ e ] } function QE ( e ) { if ( ! vE . includes ( e ) ) throw new Error ( ` Invalid event name ' ${ e } ' ` ) } function RE ( e ) { const { name : t , collection : n , file : r , field : i } = e ; QE ( t ) ; const o = [ ] ; var a , s , l , u , c , d , f , h , p , m , g ; return "change" === t ? ( o . push ( ... OE . eventHandlers [ t ] . all ) , n ? ( o . push ( ... null !== ( a = OE . eventHandlers [ t ] . collections [ n ] ) && void 0 !== a ? a : [ ] ) , r || i ? ( i && o . push ( ... null !== ( f = null === ( h = OE . eventHandlers [ t ] . collectionField [ n ] ) || void 0 === h ? void 0 : h [ i ] ) && void 0 !== f ? f : [ ] ) , r ? ( o . push ( ... null !== ( s = null === ( l = OE . eventHandlers [ t ] . files [ n ] ) || void 0 === l ? void 0 : l [ r ] ) && void 0 !== s ? s : [ ] ) , i ? ( o . push ( ... null !== ( u = null === ( c = OE . eventHandlers [ t ] . fileField [ n ] ) || void 0 === c || null === ( d = c [ r ] ) || void 0 === d ? void 0 : d [ i ] ) && void 0 !== u ? u : [ ] ) , o ) : o ) : o ) : o ) : o ) : "prePublish" === t || "postPublish" === t || "preSave" === t || "postSave" === t ? ( o . push ( ... OE . eventHandlers [ t ] . all ) , n ? ( o . push ( ... null !== ( p = OE . eventHandlers [ t ] . collections [ n ] ) && void 0 !== p ? p : [ ] ) , r ? ( o . push ( ... null !== ( m = null === ( g = OE . eventHandlers [ t ] . files [ n ] ) || void 0 === g ? void 0 : g [ r ] ) && void 0 !== m ? m : [ ] ) , o ) : o ) : o ) : [ ... OE . eventHandlers [ t ] ] } async function AE ( e ) { const { name : t , data : n , collection : r , file : i , fieldName : o , field : a } = e ; if ( QE ( t ) , "mounted" === t || "logout" === t ) { console . info ( ` [StaticCMS] Firing ${ t } event ` ) ; const e = OE . eventHandlers [ t ] ; for ( const t of e ) t ( ) ; return } if ( "login" === t ) { console . info ( "[StaticCMS] Firing login event" , n ) ; const e = OE . eventHandlers [ t ] ; for ( const t of e ) t ( { author : n } ) ; return } if ( "postSave" === t || "prePublish" === t || "postPublish" === t ) { if ( ! r ) return ; const e = RE ( { name : t , collection : r , file : i } ) ; console . info ( ` [StaticCMS] Firing post save event for ${ i ? ` " ${ i } " file in ` : "" } " ${ r } " collection ` , n ) ; for ( const t of e ) t ( { data : n , collection : r , file : i } ) ; return } if ( "change" === t ) { if ( ! r || ! a || ! n ) return ; const s = RE ( { name : t , collection : r , file : i , field : a } ) ; let l = hE ( ) ( n ) ; console . info ( ` [StaticCMS] Firing change event for field " ${ null != o ? o : a } " for ${ e . file ? ` " ${ e . file } " file in ` : "" } " ${ r } " collection ` ) ; for ( const e of s ) { const t = await e ( { data : l , collection : r , file : i , field : a } ) ; void 0 !== l && t && ( l = t ) } return l } if ( ! r ) return ; let s = hE ( ) ( n ) ; console . info ( ` [StaticCMS] Firing pre save event for ${ e . file ? ` " ${ e . file } " file in ` : "" } " ${ r } " collection ` , n ) ; const l = RE ( { name : t , collection : r , file : i } ) ; for ( const e of l ) { const t = await e ( { data : s , collection : r , file : i } ) ; if ( void 0 !== s && void 0 !== t ) { const e = mE ( mE ( { } , s . entry ) , { } , { data : t } ) ; s = mE ( mE ( { } , s ) , { } , { entry : e } ) } } return s . entry . data } function jE ( e , t ) { return e . filter ( ( e => e !== t ) ) } function DE ( e , t ) { e && t ? OE . locales [ e ] = t : console . error ( "Locale parameters invalid. example: CMS.registerLocale('locale', phrases)" ) } function ME ( e ) { return OE . locales [ e ] } function zE ( e ) { var t ; return null !== ( t = OE . icons [ e ] ) && void 0 !== t ? t : null } function IE ( ) { return OE . additionalLinks } function WE ( e ) { return OE . shortcodes [ e ] } function NE ( ) { return OE . shortcodes } function LE ( ) { return OE . themes } function FE ( e , t ) { const n = "backup" ; return e ? ` ${ n } . ${ e } ${ t ? ` . ${ t } ` : "" } ` : n } const UE = { PRESENCE : "PRESENCE" , PATTERN : "PATTERN" , RANGE : "RANGE" , CUSTOM : "CUSTOM" } ; function XE ( e , t , n , r , i ) { var o ; if ( "string" == typeof n || "number" == typeof n ) return ! 1 ; const a = null !== ( o = null == n ? void 0 : n . length ) && void 0 !== o ? o : 0 ; function s ( n ) { return { type : UE . RANGE , message : e ( ` editor.editorControlPane.widget. ${ n } ` , { fieldLabel : t , minCount : r , maxCount : i , count : a } ) } } return [ r , i ] . every ( ( e => e && ! isNaN ( e ) ) ) && ( a < r || a > i ) ? s ( r === i ? "rangeCountExact" : "rangeCount" ) : r && ! isNaN ( r ) && r > 0 && a < r ? s ( "rangeMin" ) : ! ! ( i && ! isNaN
source . repository . full _name = "${this.repo}"
AND state = "${q6.OPEN}"
AND destination . branch . name = "${this.branch}"
AND comment _count > 0
AND $ { t }
` }}),r=await Promise.all(n.values.map((e=>this.getPullRequestLabel(e.id))));return n.values.filter(((e,t)=>__(r[t],this.cmsLabelPrefix)))}async getBranchPullRequest(e){const t=await this.getPullRequests(e);if(t.length<=0)throw new W_("content is not under editorial workflow",!0);return t[0]}async retrieveUnpublishedEntryData(e){const{collection:t,slug:n}=k_(e),r=T_(e),i=await this.getBranchPullRequest(r),o=await this.getDifferences(r),a=S_(await this.getPullRequestLabel(i.id),this.cmsLabelPrefix),s=i.updated_on,l=i.author.display_name;return{collection:t,slug:n,status:a,diffs:o.filter((e=>"deleted"!==e.status)).map((e=>({path:e.path,newFile:e.newFile,id:""}))),updatedAt:s,pullRequestAuthor:l,openAuthoring:!1}}async addPullRequestComment(e,t){await this.requestJSON({method:"POST",url: ` $ { this . repoURL } / pullrequests / $ { e . id } / comments ` ,headers:{"Content-Type":Y6},body:JSON.stringify({content:{raw:t}})})}async updateUnpublishedEntryStatus(e,t,n){const r=T_(w_(e,t)),i=await this.getBranchPullRequest(r);await this.addPullRequestComment(i,P_(n,this.cmsLabelPrefix))}async declinePullRequest(e){await this.requestJSON({method:"POST",url: ` $ { this . repoURL } / pullrequests / $ { e . id } / decline ` })}async deleteBranch(e){await this.request({method:"DELETE",url: ` $ { this . repoURL } / refs / branches / $ { e } ` })}async deleteUnpublishedEntry(e,t){const n=T_(w_(e,t)),r=await this.getBranchPullRequest(n);await this.declinePullRequest(r),await this.deleteBranch(n)}async mergePullRequest(e){await this.requestJSON({method:"POST",url: ` $ { this . repoURL } / pullrequests / $ { e . id } / merge ` ,headers:{"Content-Type":Y6},body:JSON.stringify({message:b_,close_source_branch:!0,merge_strategy:this.mergeStrategy})})}async publishUnpublishedEntry(e,t){const n=T_(w_(e,t)),r=await this.getBranchPullRequest(n);await this.mergePullRequest(r)}async getPullRequestStatuses(e){return(await this.requestJSON({url: ` $ { this . repoURL } / pullrequests / $ { e . id } / statuses ` ,params:{pagelen:"100"}})).values}async getStatuses(e,t){const n=T_(w_(e,t)),r=await this.getBranchPullRequest(n);return(await this.getPullRequestStatuses(r)).map((({key:e,state:t,url:n})=>({context:e,state:t===B6.Successful?F6.Success:F6.Other,target_url:n})))}async createPullRequest(e,t,n){const r=await this.requestJSON({method:"POST",url: ` $ { this . repoURL } / pullrequests ` ,headers:{"Content-Type":Y6},body:JSON.stringify({title:t,source:{branch:{name:e}},destination:{branch:{name:this.branch}},description:y_,close_source_branch:!0})});await this.addPullRequestComment(r,P_(n,this.cmsLabelPrefix))}async editorialWorkflowGit(e,t,n){const r=T_(w_(n.collectionName,t));if(n.unpublished){const t=await this.getDifferences(r),i=[];for(const n of t.filter((e=>e.binary&&"deleted"!==e.status)))e.some((e=>e.path===n.path))||i.push({path:n.path,delete:!0});await this.uploadFiles([...e,...i],{commitMessage:n.commitMessage,branch:r})}else{const t=await this.branchCommitSha(this.branch);await this.uploadFiles(e,{commitMessage:n.commitMessage,branch:r,parentSha:t}),await this.createPullRequest(r,n.commitMessage,n.status||this.initialWorkflowStatus)}}async getUnpublishedEntrySha(e,t){const n=T_(w_(e,t));return(await this.getBranchPullRequest(n)).destination.commit.hash}}var H6=c.forwardRef((function(e,t){return c.createElement(zN,nC({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 512 512"},e,{ref:t}),c.createElement("path",{fill:"currentColor",d:"M22.2 32A16 16 0 0 0 6 47.8a26.35 26.35 0 0 0 .2 2.8l67.9 412.1a21.77 21.77 0 0 0 21.3 18.2h325.7a16 16 0 0 0 16-13.4L505 50.7a16 16 0 0 0-13.2-18.3 24.58 24.58 0 0 0-2.8-.2L22.2 32zm285.9 297.8h-104l-28.1-147h157.3l-25.2 147z"}))}));H6.displayName="Bitbucket";const K6=({href:e})=>{const t=FD();return c.createElement(HD,{variant:"text",href:e,startIcon:fZ},t("ui.default.goBackToSite"))},J6=XD("Login",["root","custom-logo","static-cms-logo","error","error-icon","error-sr-label","button"]),e9=({inProgress:e=!1,login:t,icon:n,label:r,error:i,disabled:o=!1,buttonContent:a})=>{const s=FD(),l=vI(fT);return c.createElement("div",{className:J6.root},null!=l&&l
Repo "${this.repo}" not found .
Please ensure the repo information is spelled correctly .
If the repo is private , make sure you ' re logged into a Bitbucket account with access .
` ,e})))throw new Error("Your BitBucket user account does not have access to this repo.");const t=await this.api.user();return J9(J9({},t),{},{name:t.display_name,login:t.username,token:e.token,avatar_url:t.links.avatar.href,refresh_token:e.refresh_token})}getRefreshedAccessToken(){var e;if("implicit"===this.authType)throw new C_("Can't refresh access token when using implicit auth");if(this.refreshedTokenPromise)return this.refreshedTokenPromise;if(!this.authenticator){const e={base_url:this.baseUrl,site_id:this.siteId};this.authenticator=new tI(e)}return this.refreshedTokenPromise=null===(e=this.authenticator.refresh({provider:"bitbucket",refresh_token:this.refreshToken}))||void 0===e?void 0:e.then((({token:e,refresh_token:t})=>(this.token=e,this.refreshToken=t,this.refreshedTokenPromise=void 0,this.updateUserCredentials({token:e,refresh_token:t}),e))),this.refreshedTokenPromise}logout(){this.token=null}getToken(){return this.refreshedTokenPromise?this.refreshedTokenPromise:Promise.resolve(this.token)}async entriesByFolder(e,t,n){let r;const i=await this.api.defaultBranchCommitSha(),o=await MS((()=>this.api.listFiles(e,n,20,this.branch).then((({entries:e,cursor:n})=>(r=n.mergeMeta({extension:t}),e.filter((e=>X_(e,t))))))),((e,t)=>this.api.readFile(e,t,{head:i})),this.api.readFileMetadata.bind(this.api),V6);return o[M_]=r,o}async listAllFiles(e,t,n){const r=(await this.api.listAllFiles(e,n,this.branch)).filter((e=>X_(e,t)));return r}async allEntriesByFolder(e,t,n){const r=await this.api.defaultBranchCommitSha(),i=await BS({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:(e,t)=>this.api.readFile(e,t,{head:r}),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:V6,branch:this.branch,localForage:GS,folder:e,extension:t,depth:n,getDefaultBranch:()=>Promise.resolve({name:this.branch,sha:r}),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>Promise.resolve(this.api.getFileId(r,e)),filterFile:e=>X_(e,t)});return i}async entriesByFiles(e){const t=await this.api.defaultBranchCommitSha();return zS(e,((e,n)=>this.api.readFile(e,n,{head:t})),this.api.readFileMetadata.bind(this.api),V6)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listAllFiles(e,1,this.branch,t).then((e=>e.map((({id:e,name:t,path:n,type:r})=>({id:e,name:t,path:n,displayURL:{id:e,path:n},isDirectory:"commit_directory"===r}))))):[]}getLargeMediaClient(){return this._largeMediaClientPromise||(this._largeMediaClientPromise=(async()=>{const e=await this.api.readFile(".gitattributes").then((e=>vS(e))).catch((e=>(404===e.status?console.info("[StaticCMS] This 404 was expected and handled appropriately."):console.error(e),[])));return new H9(!!(this.largeMediaURL&&e.length>0),this.largeMediaURL,e,this.requestFunction)})()),this._largeMediaClientPromise}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||Wx()(10),LS(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=TS(e),n=WS(t,await NS(e,null,this.api.readFile.bind(this.api))),r=URL.createObjectURL(n);return{id:await J_(n),displayURL:r,path:e,name:t,size:n.size,file:n,url:r}}async persistEntry(e,t){const n=await this.getLargeMediaClient();return FS(this.lock,(async()=>this.api.persistFiles(e.dataFiles,n.enabled?await bS(n,e.assets):e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const{fileObj:n,path:r}=e,i=URL.createObjectURL(n),o=await this.getLargeMediaClient(),a=r.startsWith("/")?r.slice(1):r;if(!o.enabled||!o.matchPath(a))return this._persistMedia(e,t);const s=await yS(o,n,r);return J9(J9({},await this._persistMedia(s,t)),{},{displayURL:i})}async _persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([J_(n),this.api.persistFiles([],[e],t)]),i=URL.createObjectURL(n);return{displayURL:i,path:Qj()(e.path,"/k"),name:n.name,size:n.size,id:r,file:n,url:i}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this
Repo "${this.repo}" not found .
Please ensure the repo information is spelled correctly .
If the repo is private , make sure you ' re logged into a GitHub account with access .
If your repo is under an organization , ensure the organization has granted access to Netlify
CMS .
` ,e})))throw new Error("Your GitHub user account does not have access to this repo.");return O7(O7({},n),{},{token:e.token,useOpenAuthoring:this.useOpenAuthoring})}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await MS((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>X_(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),c7);return o[M_]=i,o}async allEntriesByFolder(e,t,n,r){const i=this.api.originRepoURL,o=await MS((()=>this.api.listFiles(e,{repoURL:i,depth:n}).then((e=>e.filter((e=>(!r||r.test(e.path))&&X_(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:i})),this.api.readFileMetadata.bind(this.api),c7);return o}entriesByFiles(e){const t=this.useOpenAuthoring?this.api.originRepoURL:this.api.repoURL;return zS(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),c7)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then((e=>e.map((({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"==i}))))):[]}async getMediaFile(e){const t=await NS(e,null,this.api.readFile.bind(this.api)),n=TS(e),r=WS(n,t),i=URL.createObjectURL(r);return{id:await J_(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||Wx()(10),LS(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return FS(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:Qj()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){var n,r;const i=e.meta,o=null!==(n=null===(r=e.data)||void 0===r?void 0:r.files)&&void 0!==n?n:[];let a;switch(t){case"first":default:a=this.getCursorAndFiles(o,1);break;case"last":var s;a=this.getCursorAndFiles(o,null!==(s=null==i?void 0:i.pageCount)&&void 0!==s?s:1);break;case"next":var l;a=this.getCursorAndFiles(o,null!==(l=(null==i?void 0:i.page)+1)&&void 0!==l?l:1);break;case"prev":var u;a=this.getCursorAndFiles(o,null!==(u=(null==i?void 0:i.page)-1)&&void 0!==u?u:1)}const c=await zS(a.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),c7);return{entries:c,cursor:a.cursor}}async unpublishedEntries(){return await IS((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>E_(e)))))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e)return this.api.retrieveUnpublishedEntryData(e);if(t&&n){const e=this.api.generateContentKey(t,n);return this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){return T_(this.api.generateContentKey(e,t))}async unpublishedEntryDataFile(e,t,n,r){const i=this.getBranch(e,t);return await this.api.readFile(n,r,{branch:i})}async unpublishedEntryMediaFile(e,t,n,r){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:n,id:r})}async getDeployPreview(e,t){try{const n=g_(await this.api.getStatuses(e,t),this.previewContext);if(n){const{target_url:e,state:t}=n;return{url:e,status:t}}return null}catch(e){return null}}updateUnpublishedEntryStatus(e,t,n){return FS(this.lock,(()=>this.api.updateUnpublishedEntryStatus(e,t,n)),"Failed to acquire update entry status lock")}deleteUnpublishedEntry(e,t){return FS(this.lock,(()=>this.api.deleteUnpublishedEntry(e,t
Repo "${this.repo}" not found .
Please ensure the repo information is spelled correctly .
If the repo is private , make sure you ' re logged into a GitLab account with access .
` ,e})))throw new Error("Your GitLab user account does not have access to this repo.");return M7(M7({},t),{},{login:t.username,token:e.token})}async logout(){this.token=null}getToken(){return Promise.resolve(this.token)}filterFile(e,t,n,r){const i=go()(t.path.split(e)[1]||"/","/");return X_(t,n)&&i.split("/").length<=r}async entriesByFolder(e,t,n){let r;const i=await MS((()=>this.api.listFiles(e,n>1).then((({files:i,cursor:o})=>(r=o.mergeMeta({folder:e,extension:t,depth:n}),i.filter((r=>this.filterFile(e,r,t,n))))))),this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),T7);return i[M_]=r,i}async listAllFiles(e,t,n){const r=(await this.api.listAllFiles(e,void 0,n>1)).filter((r=>this.filterFile(e,r,t,n)));return r}async allEntriesByFolder(e,t,n){const r=await BS({listAllFiles:()=>this.listAllFiles(e,t,n),readFile:this.api.readFile.bind(this.api),readFileMetadata:this.api.readFileMetadata.bind(this.api),apiName:T7,branch:this.branch,localForage:GS,folder:e,extension:t,depth:n,getDefaultBranch:()=>this.api.getDefaultBranch().then((e=>({name:e.name,sha:e.commit.id}))),isShaExistsInBranch:this.api.isShaExistsInBranch.bind(this.api),getDifferences:(e,t)=>this.api.getDifferences(e,t),getFileId:e=>this.api.getFileId(e,this.branch),filterFile:r=>this.filterFile(e,r,t,n),customFetch:void 0});return r}entriesByFiles(e){return zS(e,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),T7)}getEntry(e){return this.api.readFile(e).then((t=>({file:{path:e,id:null},data:t})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listAllFiles(e,t).then((e=>e.map((({id:e,name:t,path:n,type:r})=>({id:e,name:t,path:n,displayURL:{id:e,name:t,path:n},isDirectory:"tree"===r}))))):[]}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||Wx()(10),LS(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}async getMediaFile(e){const t=TS(e),n=await NS(e,null,this.api.readFile.bind(this.api)),r=WS(t,n),i=URL.createObjectURL(r);return{id:await J_(n),displayURL:i,path:e,name:t,size:r.size,file:r,url:i}}async persistEntry(e,t){return FS(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){const n=e.fileObj,[r]=await Promise.all([J_(n),this.api.persistFiles([],[e],t)]),{path:i}=e,o=URL.createObjectURL(n);return{displayURL:o,path:Qj()(i,"/"),name:n.name,size:n.size,file:n,url:o,id:r}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}traverseCursor(e,t){return this.api.traverseCursor(e,t).then((async({entries:t,cursor:n})=>{var r,i,o;const[a,s,l]=[null===(r=e.meta)||void 0===r?void 0:r.folder,null===(i=e.meta)||void 0===i?void 0:i.depth,null===(o=e.meta)||void 0===o?void 0:o.extension];return a&&s&&l&&(t=t.filter((e=>this.filterFile(a,e,l,s))),n=n.mergeMeta({folder:a,extension:l,depth:s})),{entries:await zS(t,this.api.readFile.bind(this.api),this.api.readFileMetadata.bind(this.api),T7),cursor:n}}))}async unpublishedEntries(){return await IS((()=>this.api.listUnpublishedBranches().then((e=>e.map((e=>E_(e)))))))}async unpublishedEntry({id:e,collection:t,slug:n}){if(e)return this.api.retrieveUnpublishedEntryData(e);if(t&&n){const e=w_(t,n);return this.api.retrieveUnpublishedEntryData(e)}throw new Error("Missing unpublished entry id or collection and slug")}getBranch(e,t){return T_(w_(e,t))}async unpublishedEntryDataFile(e,t,n,r){const i=this.getBranch(e,t);return await this.api.readFile(n,r,{branch:i})}async unpublishedEntryMediaFile(e,t,n,r){const i=this.getBranch(e,t);return await this.loadMediaFile(i,{path:n,id:r})}async updateUnpublishedEntryStatus(e,t,n){return FS(this.lock,(()=>this.api.updateUnpublishedEntryStatus(e,t,n)),"Failed to acquire update entry status lock")}async deleteUnpublishedEntry(e,t){return FS(this.lock,(()=>this.api.deleteUnpublishedEntry(e,t)),"Failed to acquire delete entry lock")}async publishUnpublishedEntry(e,t){return FS(this.lock,(()=>this.api.publishUnpublishedEntry(e,t)),"Failed to acquire publish entry lock")}async getDeployPreview(e,t){try{const n=g_(await this.api.getStatu
Repo "${this.repo}" not found .
Please ensure the repo information is spelled correctly .
If the repo is private , make sure you ' re logged into a Gitea account with access .
If your repo is under an organization , ensure the organization has granted access to Static
CMS .
2024-12-27 16:38:47 +01:00
` ,e})))throw new Error("Your Gitea user account does not have access to this repo.");return{name:n.full_name,login:n.login,avatar_url:n.avatar_url,token:e.token}}logout(){if(this.token=null,this.api&&this.api.reset&&"function"==typeof this.api.reset)return this.api.reset()}getToken(){return Promise.resolve(this.token)}async entriesByFolder(e,t,n){const r=this.api.originRepoURL;let i;const o=await MS((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>{const n=e.filter((e=>X_(e,t))),r=this.getCursorAndFiles(n,1);return i=r.cursor,r.files}))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),yee);return o[M_]=i,o}async allEntriesByFolder(e,t,n){const r=this.api.originRepoURL,i=await MS((()=>this.api.listFiles(e,{repoURL:r,depth:n}).then((e=>e.filter((e=>X_(e,t)))))),((e,t)=>this.api.readFile(e,t,{repoURL:r})),this.api.readFileMetadata.bind(this.api),yee);return i}entriesByFiles(e){const t=this.api.repoURL;return zS(e,((e,n)=>this.api.readFile(e,n,{repoURL:t}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),yee)}getEntry(e){const t=this.api.originRepoURL;return this.api.readFile(e,null,{repoURL:t}).then((t=>({file:{path:e,id:null},data:t}))).catch((()=>({file:{path:e,id:null},data:""})))}async getMedia(e=this.mediaFolder,t){return e?this.api.listFiles(e,void 0,t).then((e=>e.map((({id:e,name:t,size:n,path:r,type:i})=>({id:e,name:t,size:n,displayURL:{id:e,path:r},path:r,isDirectory:"tree"===i}))))):[]}async getMediaFile(e){const t=await NS(e,null,this.api.readFile.bind(this.api)),n=TS(e),r=WS(n,t),i=URL.createObjectURL(r);return{id:await J_(t),displayURL:i,path:e,name:n,size:r.size,file:r,url:i}}getMediaDisplayURL(e){return this._mediaDisplayURLSem=this._mediaDisplayURLSem||Wx()(10),LS(e,this.api.readFile.bind(this.api),this._mediaDisplayURLSem)}persistEntry(e,t){return FS(this.lock,(()=>this.api.persistFiles(e.dataFiles,e.assets,t)),"Failed to acquire persist entry lock")}async persistMedia(e,t){try{await this.api.persistFiles([],[e],t);const{sha:n,path:r,fileObj:i}=e,o=URL.createObjectURL(i);return{id:n,name:i.name,size:i.size,displayURL:o,path:Qj()(r,"/")}}catch(e){throw console.error(e),e}}deleteFiles(e,t){return this.api.deleteFiles(e,t)}async traverseCursor(e,t){var n,r;const i=e.meta,o=null!==(n=null===(r=e.data)||void 0===r?void 0:r.files)&&void 0!==n?n:[];let a;switch(t){case"first":default:a=this.getCursorAndFiles(o,1);break;case"last":var s;a=this.getCursorAndFiles(o,null!==(s=null==i?void 0:i.pageCount)&&void 0!==s?s:1);break;case"next":var l;a=this.getCursorAndFiles(o,null!==(l=(null==i?void 0:i.page)+1)&&void 0!==l?l:1);break;case"prev":var u;a=this.getCursorAndFiles(o,null!==(u=(null==i?void 0:i.page)-1)&&void 0!==u?u:1)}const c=await zS(a.files,((e,t)=>this.api.readFile(e,t,{repoURL:this.api.originRepoURL}).catch((()=>""))),this.api.readFileMetadata.bind(this.api),yee);return{entries:c,cursor:a.cursor}}async unpublishedEntries(){throw new Error("Editorial workflow is not yet available for Gitea")}async unpublishedEntry(){throw new Error("Editorial workflow is not yet available for Gitea")}async unpublishedEntryDataFile(){throw new Error("Editorial workflow is not yet available for Gitea")}async unpublishedEntryMediaFile(){throw new Error("Editorial workflow is not yet available for Gitea")}async updateUnpublishedEntryStatus(){throw new Error("Editorial workflow is not yet available for Gitea")}async publishUnpublishedEntry(){throw new Error("Editorial workflow is not yet available for Gitea")}async deleteUnpublishedEntry(){throw new Error("Editorial workflow is not yet available for Gitea")}async getDeployPreview(){throw new Error("Editorial workflow is not yet available for Gitea")}}const Tee=({inProgress:e=!1,onLogin:t})=>{const n=(0,c.useCallback)((e=>{e.preventDefault(),t({token:"fake_token"})}),[t]);return c.createElement(e9,{login:n,inProgress:e})};function Cee(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.
2024-12-27 15:02:31 +01:00
0 % {
transform : scale ( 0 ) ;
opacity : 0.1 ;
}
100 % {
transform : scale ( 1 ) ;
opacity : 0.3 ;
}
2024-12-27 15:57:48 +01:00
` )),OCe=uCe(hCe||(hCe=gCe `
2024-12-27 15:02:31 +01:00
0 % {
opacity : 1 ;
}
100 % {
opacity : 0 ;
}
2024-12-27 15:57:48 +01:00
` )),yCe=uCe(pCe||(pCe=gCe `
2024-12-27 15:02:31 +01:00
0 % {
transform : scale ( 1 ) ;
}
50 % {
transform : scale ( 0.92 ) ;
}
100 % {
transform : scale ( 1 ) ;
}
2024-12-27 15:57:48 +01:00
` )),bCe=WX("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),wCe=WX((function(e){const{className:t,classes:n,pulsate:r=!1,rippleX:i,rippleY:o,rippleSize:a,in:s,onExited:l,timeout:u}=e,[d,f]=c.useState(!1),h=oM(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-a/2+o,left:-a/2+i},m=oM(n.child,d&&n.childLeaving,r&&n.childPulsate);return s||d||f(!0),c.useEffect((()=>{if(!s&&null!=l){const e=setTimeout(l,u);return()=>{clearTimeout(e)}}}),[l,s,u]),(0,cM.jsx)("span",{className:h,style:p,children:(0,cM.jsx)("span",{className:m})})}),{name:"MuiTouchRipple",slot:"Ripple"})(mCe||(mCe=gCe `
2024-12-27 15:02:31 +01:00
opacity : 0 ;
position : absolute ;
& . $ { 0 } {
opacity : 0.3 ;
transform : scale ( 1 ) ;
animation - name : $ { 0 } ;
animation - duration : $ { 0 } ms ;
animation - timing - function : $ { 0 } ;
}
& . $ { 0 } {
animation - duration : $ { 0 } ms ;
}
& . $ { 0 } {
opacity : 1 ;
display : block ;
width : 100 % ;
height : 100 % ;
border - radius : 50 % ;
background - color : currentColor ;
}
& . $ { 0 } {
opacity : 0 ;
animation - name : $ { 0 } ;
animation - duration : $ { 0 } ms ;
animation - timing - function : $ { 0 } ;
}
& . $ { 0 } {
position : absolute ;
/* @noflip */
left : 0 px ;
top : 0 ;
animation - name : $ { 0 } ;
animation - duration : 2500 ms ;
animation - timing - function : $ { 0 } ;
animation - iteration - count : infinite ;
animation - delay : 200 ms ;
}
2024-12-27 15:57:48 +01:00
` ),cCe.rippleVisible,vCe,550,(({theme:e})=>e.transitions.easing.easeInOut),cCe.ripplePulsate,(({theme:e})=>e.transitions.duration.shorter),cCe.child,cCe.childLeaving,OCe,550,(({theme:e})=>e.transitions.easing.easeInOut),cCe.childPulsate,yCe,(({theme:e})=>e.transitions.easing.easeInOut)),kCe=c.forwardRef((function(e,t){const n=qX({props:e,name:"MuiTouchRipple"}),{center:r=!1,classes:i={},className:o}=n,a=BN(n,dCe),[s,l]=c.useState([]),u=c.useRef(0),d=c.useRef(null);c.useEffect((()=>{d.current&&(d.current(),d.current=null)}),[s]);const f=c.useRef(!1),h=c.useRef(0),p=c.useRef(null),m=c.useRef(null);c.useEffect((()=>()=>{h.current&&clearTimeout(h.current)}),[]);const g=c.useCallback((e=>{const{pulsate:t,rippleX:n,rippleY:r,rippleSize:o,cb:a}=e;l((e=>[...e,(0,cM.jsx)(wCe,{classes:{ripple:oM(i.ripple,cCe.ripple),rippleVisible:oM(i.rippleVisible,cCe.rippleVisible),ripplePulsate:oM(i.ripplePulsate,cCe.ripplePulsate),child:oM(i.child,cCe.child),childLeaving:oM(i.childLeaving,cCe.childLeaving),childPulsate:oM(i.childPulsate,cCe.childPulsate)},timeout:550,pulsate:t,rippleX:n,rippleY:r,rippleSize:o},u.current)])),u.current+=1,d.current=a}),[i]),v=c.useCallback(((e={},t={},n=(()=>{}))=>{const{pulsate:i=!1,center:o=r||t.pulsate,fakeElement:a=!1}=t;if("mousedown"===(null==e?void 0:e.type)&&f.current)return void(f.current=!1);"touchstart"===(null==e?void 0:e.type)&&(f.current=!0);const s=a?null:m.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let u,c,d;if(o||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)u=Math.round(l.width/2),c=Math.round(l.height/2);else{const{clientX:t,clientY:n}=e.touches&&e.touches.length>0?e.touches[0]:e;u=Math.round(t-l.left),c=Math.round(n-l.top)}if(o)d=Math.sqrt((2*l.width**2+l.height**2)/3),d%2==0&&(d+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-u),u)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-c),c)+2;d=Math.sqrt(e**2+t**2)}null!=e&&e.touches?null===p.current&&(p.current=()=>{g({pulsate:i,rippleX:u,rippleY:c,rippleSize:d,cb:n})},h.current=setTimeout((()=>{p.current&&(p.current(),p.current=null)}),80)):g({pulsate:i,rippleX:u,rippleY:c,rippleSize:d,cb:n})}),[r,g]),O=c.useCallback((()=>{v({},{pulsate:!0})}),[v]),y=c.useCallback(((e,t)=>{if(clearTimeout(h.current),"touchend"===(null==e?void 0:e.type)&&p.current)return p.current(),p.current=null,void(h.current=setTimeout((()=>{y(e,t)})));p.current=null,l((e=>e.length>0?e.slice(1):e)),d.current=t}),[]);return c.useImperativeHandle(t,(()=>({pulsate:O,start:v,stop:y})),[O,v,y]),(0,cM.jsx)(bCe,VN({className:oM(cCe.root,i.root,o),ref:m},a,{children:(0,cM.jsx)(aCe,{component:null,exit:!0,children:s})}))})),xCe=kCe;function _Ce(e){return mq("MuiButtonBase",e)}const SCe=gq("MuiButtonBase",["root","disabled","focusVisible"]),PCe=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],ECe=WX("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[ ` & . $ { SCe . disabled } ` ]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),TCe=c.forwardRef((function(e,t){const n=qX({props:e,name:"MuiButtonBase"}),{action:r,centerRipple:i=!1,children:o,className:a,component:s="button",disabled:l=!1,disableRipple:u=!1,disableTouchRipple:d=!1,focusRipple:f=!1,LinkComponent:h="a",onBlur:p,onClick:m,onContextMenu:g,onDragLeave:v,onFocus:O,onFocusVisible:y