@@ -493,7 +493,7 @@ function handler2(){}
handler2 . inline = ( el , { expression } , { cleanup : cleanup2 } ) => { let root = closestRoot ( el ) ; if ( ! root . _x _refs )
root . _x _refs = { } ; root . _x _refs [ expression ] = el ; cleanup2 ( ( ) => delete root . _x _refs [ expression ] ) ; } ; directive ( "ref" , handler2 ) ; directive ( "if" , ( el , { expression } , { effect : effect3 , cleanup : cleanup2 } ) => { let evaluate2 = evaluateLater ( el , expression ) ; let show = ( ) => { if ( el . _x _currentIfEl )
return el . _x _currentIfEl ; let clone2 = el . content . cloneNode ( true ) . firstElementChild ; addScopeToNode ( clone2 , { } , el ) ; mutateDom ( ( ) => { el . after ( clone2 ) ; initTree ( clone2 ) ; } ) ; el . _x _currentIfEl = clone2 ; el . _x _undoIf = ( ) => { clone2 . remove ( ) ; delete el . _x _currentIfEl ; } ; return clone2 ; } ; let hide = ( ) => { if ( ! el . _x _undoIf )
return ; el . _x _undoIf ( ) ; delete el . _x _undoIf ; } ; effect3 ( ( ) => evaluate2 ( ( value ) => { value ? show ( ) : hide ( ) ; } ) ) ; cleanup2 ( ( ) => el . _x _undoIf && el . _x _undoIf ( ) ) ; } ) ; mapAttributes ( startingWith ( "@" , into ( prefix ( "on:" ) ) ) ) ; directive ( "on" , skipDuringClone ( ( el , { value , modifiers , expression } , { cleanup : cleanup2 } ) => { let evaluate2 = expression ? evaluateLater ( el , expression ) : ( ) => { } ; let removeListener = on ( el , value , modifiers , ( e ) => { evaluate2 ( ( ) => { } , { scope : { $event : e } , params : [ e ] } ) ; } ) ; cleanup2 ( ( ) => removeListener ( ) ) ; } ) ) ; alpine _default . setEvaluator ( normalEvaluator ) ; alpine _default . setReactivityEngine ( { reactive : reactive2 , effect : effect2 , release : stop , raw : toRaw } ) ; var src _default = alpine _default ; window . Alpine = src _default ; queueMicrotask ( ( ) => { src _default . start ( ) ; } ) ; } ) ( ) ; window . ls . error = function ( ) { return function ( error ) { window . console . error ( error ) ; if ( window . location . pathname !== '/console' ) { window . location = '/console' ; } } ; } ; window . addEventListener ( "error" , function ( event ) { console . error ( "ERROR-EVENT:" , event . error . message , event . error . stack ) ; } ) ; document . addEventListener ( "account.deleteSession" , function ( ) { window . location = "/auth/signin" ; } ) ; document . addEventListener ( "account.create" , function ( ) { let container = window . ls . container ; let form = container . get ( 'serviceForm' ) ; let sdk = container . get ( 'console' ) ; let promise = sdk . account . createEmailSession ( form . email , form . password ) ; container . set ( "serviceForm" , { } , true , true ) ; promise . then ( function ( ) { var subscribe = document . getElementById ( 'newsletter' ) . checked ; if ( subscribe ) { let alerts = container . get ( 'alerts' ) ; let loaderId = alerts . add ( { text : 'Loading...' , class : "" } , 0 ) ; fetch ( 'https://appwrite.io/v1/newsletter/subscribe' , { method : 'POST' , headers : { 'Content-Type' : 'application/json' } , body : JSON . stringify ( { name : form . name , email : form . email , } ) , } ) . finally ( function ( ) { alerts . remove ( loaderId ) ; window . location = '/console' ; } ) ; } else { window . location = '/console' ; } } , function ( error ) { window . location = '/auth/signup?failure=1' ; } ) ; } ) ; window . addEventListener ( "load" , async ( ) => { const bars = 12 ; const realtime = window . ls . container . get ( 'realtime' ) ; const sleep = ms => new Promise ( resolve => setTimeout ( resolve , ms ) ) ; let current = { } ; window . ls . container . get ( 'console' ) . subscribe ( [ 'project' , 'console' ] , response => { if ( response . events . includes ( 'stats.connections' ) ) { for ( let project in response . payload ) { current [ project ] = response . payload [ project ] ? ? 0 ; }
return ; el . _x _undoIf ( ) ; delete el . _x _undoIf ; } ; effect3 ( ( ) => evaluate2 ( ( value ) => { value ? show ( ) : hide ( ) ; } ) ) ; cleanup2 ( ( ) => el . _x _undoIf && el . _x _undoIf ( ) ) ; } ) ; mapAttributes ( startingWith ( "@" , into ( prefix ( "on:" ) ) ) ) ; directive ( "on" , skipDuringClone ( ( el , { value , modifiers , expression } , { cleanup : cleanup2 } ) => { let evaluate2 = expression ? evaluateLater ( el , expression ) : ( ) => { } ; let removeListener = on ( el , value , modifiers , ( e ) => { evaluate2 ( ( ) => { } , { scope : { $event : e } , params : [ e ] } ) ; } ) ; cleanup2 ( ( ) => removeListener ( ) ) ; } ) ) ; alpine _default . setEvaluator ( normalEvaluator ) ; alpine _default . setReactivityEngine ( { reactive : reactive2 , effect : effect2 , release : stop , raw : toRaw } ) ; var src _default = alpine _default ; window . Alpine = src _default ; queueMicrotask ( ( ) => { src _default . start ( ) ; } ) ; } ) ( ) ; window . ls . error = function ( ) { return function ( error ) { window . console . error ( error ) ; if ( window . location . pathname !== '/console' ) { window . location = '/console' ; } } ; } ; window . addEventListener ( "error" , function ( event ) { console . error ( "ERROR-EVENT:" , event . error . message , event . error . stack ) ; } ) ; document . addEventListener ( "account.deleteSession" , function ( ) { window . location = "/auth/signin" ; } ) ; document . addEventListener ( "account.create" , function ( ) { let container = window . ls . container ; let form = container . get ( 'serviceForm' ) ; let sdk = container . get ( 'console' ) ; let promise = sdk . account . createEmailSession ( form . email , form . password ) ; container . set ( "serviceForm" , { } , true , true ) ; promise . then ( function ( ) { var subscribe = document . getElementById ( 'newsletter' ) . checked ; if ( subscribe ) { let alerts = container . get ( 'alerts' ) ; let loaderId = alerts . add ( { text : 'Loading...' , class : "" } , 0 ) ; fetch ( 'https://appwrite.io/v1/newsletter/subscribe' , { method : 'POST' , headers : { 'Content-Type' : 'application/json' } , body : JSON . stringify ( { name : form . name , email : form . email , } ) , } ) . finally ( function ( ) { alerts . remove ( loaderId ) ; window . location = '/console' ; } ) ; } else { window . location = '/console' ; } } , function ( error ) { window . location = '/auth/signup?failure=1' ; } ) ; } ) ; window . addEventListener ( "load" , async ( ) => { const bars = 12 ; const realtime = window . ls . container . get ( 'realtime' ) ; const sleep = ms => new Promise ( resolve => setTimeout ( resolve , ms ) ) ; let current = { } ; window . ls . container . get ( 'console' ) . client . subscribe ( [ 'project' , 'console' ] , response => { if ( response . events . includes ( 'stats.connections' ) ) { for ( let project in response . payload ) { current [ project ] = response . payload [ project ] ? ? 0 ; }
return ; }
if ( response . events . includes ( 'databases.*.collections.*.attributes.*' ) ) { document . dispatchEvent ( new CustomEvent ( 'databases.createAttribute' ) ) ; return ; }
if ( response . events . includes ( 'databases.*.collections.*.indexes.*' ) ) { document . dispatchEvent ( new CustomEvent ( 'databases.createIndex' ) ) ; return ; }
@@ -521,7 +521,7 @@ params=formData;break;}
return new Promise ( function ( resolve , reject ) { let request = new XMLHttpRequest ( ) , key ; request . withCredentials = true ; request . open ( method , path , true ) ; for ( key in headers ) { if ( headers . hasOwnProperty ( key ) ) { request . setRequestHeader ( key , headers [ key ] ) ; } }
request . onload = function ( ) { if ( 4 === request . readyState && 399 >= request . status ) { let data = request . response ; let contentType = this . getResponseHeader ( 'content-type' ) ; contentType = contentType . substring ( 0 , contentType . indexOf ( ';' ) ) ; switch ( contentType ) { case 'application/json' : data = JSON . parse ( data ) ; break ; }
resolve ( data ) ; } else { reject ( new Error ( request . statusText ) ) ; } } ; if ( progress ) { request . addEventListener ( 'progress' , progress ) ; request . upload . addEventListener ( 'progress' , progress , false ) ; }
request . onerror = function ( ) { reject ( new Error ( "Network Error" ) ) ; } ; request . send ( params ) ; } ) } ; return { 'get' : function ( path , headers = { } , params = { } ) { return call ( 'GET' , path + ( ( params . length > 0 ) ? '?' + buildQuery ( params ) : '' ) , headers , { } ) ; } , 'post' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'POST' , path , headers , params , progress ) ; } , 'put' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'PUT' , headers , params , progress ) ; } , 'patch' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'PATCH' , path , headers , params , progress ) ; } , 'delete' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'DELETE' , path , headers , params , progress ) ; } , 'addGlobalParam' : addGlobalParam , 'addGlobalHeader' : addGlobalHeader } } ( window . document ) ; let analytics = { create : function ( id , source , activity , url ) { return http . post ( '/analytics' , { 'content-type' : 'application/json' } , { id : id , source : source , activity : activity , url : url , version : env . VERSION , setup : env . SETUP } ) ; } , } ; return { analytics : analytics , } ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'console' , function ( window ) { var sdk = new window . Appwrite ( ) ; var endpoint = window . location . origin + '/v1' ; sdk . setEndpoint ( endpoint ) . setProject ( 'console' ) . setLocale ( APP _ENV . LOCALE ) ; return sdk ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'date' , function ( ) { function format ( format , timestamp ) { var jsdate , f
request . onerror = function ( ) { reject ( new Error ( "Network Error" ) ) ; } ; request . send ( params ) ; } ) } ; return { 'get' : function ( path , headers = { } , params = { } ) { return call ( 'GET' , path + ( ( params . length > 0 ) ? '?' + buildQuery ( params ) : '' ) , headers , { } ) ; } , 'post' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'POST' , path , headers , params , progress ) ; } , 'put' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'PUT' , headers , params , progress ) ; } , 'patch' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'PATCH' , path , headers , params , progress ) ; } , 'delete' : function ( path , headers = { } , params = { } , progress = null ) { return call ( 'DELETE' , path , headers , params , progress ) ; } , 'addGlobalParam' : addGlobalParam , 'addGlobalHeader' : addGlobalHeader } } ( window . document ) ; let analytics = { create : function ( id , source , activity , url ) { return http . post ( '/analytics' , { 'content-type' : 'application/json' } , { id : id , source : source , activity : activity , url : url , version : env . VERSION , setup : env . SETUP } ) ; } , } ; return { analytics : analytics , } ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'console' , function ( window ) { var client = new Appwrite . Client ( ) ; var endpoint = window . location . origin + '/v1' ; client . setEndpoint ( endpoint ) . setProject ( 'console' ) . setLocale ( APP _ENV . LOCALE ) ; return { client : client , account : new Appwrite . Account ( client ) , avatars : new Appwrite . Avatars ( client ) , databases : new Appwrite . Databases ( client ) , functions : new Appwrite . Functions ( client ) , health : new Appwrite . Health ( client ) , locale : new Appwrite . Locale ( client ) , projects : new Appwrite . Projects ( client ) , storage : new Appwrite . Storage ( client ) , teams : new Appwrite . Teams ( client ) , users : new Appwrite . Users ( client ) } } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'date' , function ( ) { function format ( format , timestamp ) { var jsdate , f
var txtWords = [ 'Sun' , 'Mon' , 'Tues' , 'Wednes' , 'Thurs' , 'Fri' , 'Satur' , 'January' , 'February' , 'March' , 'April' , 'May' , 'June' , 'July' , 'August' , 'September' , 'October' , 'November' , 'December' ]
var formatChr = /\\?(.?)/gi
var formatChrCb = function ( t , s ) { return f [ t ] ? f [ t ] ( ) : s }
@@ -651,7 +651,7 @@ return slf.renderToken(tokens,idx,opts);}
md . renderer . rules . strong _open = renderEm ; md . renderer . rules . strong _close = renderEm ; return md ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'rtl' , function ( ) { var rtlStock = "^ا ^ب^ت^ث^ج^ح^خ^د^ذ^ر^ز^س^ش^ص^ض^ط^ظ^ع^غ^ف^ق^ك^ل^م^ن^ه^و^ي^א^ב^ג^ד^ה^ו^ז^ח^ט^י^כ^ך^ל^מ^ם^נ^ן^ס^ע^פ^ף^צ^ץ^ק^ר^ש^ת^" ; var special = [ "\n" , " " , " " , "״" , '"' , "_" , "'" , "!" , "@" , "#" , "$" , "^" , "&" , "%" , "*" , "(" , ")" , "+" , "=" , "-" , "[" , "]" , "\\" , "/" , "{" , "}" , "|" , ":" , "<" , ">" , "?" , "," , "." , "0" , "1" , "2" , "3" , "4" , "5" , "6" , "7" , "8" , "9" ] ; var isRTL = function ( value ) { for ( var i = 0 ; i < value . length ; i ++ ) { if ( /\s/g . test ( value [ i ] ) ) { continue ; }
if ( - 1 === special . indexOf ( value [ i ] ) ) { var firstChar = value [ i ] ; break ; } }
if ( - 1 < rtlStock . indexOf ( "^" + firstChar + "^" ) ) { return true ; }
return false ; } ; return { isRTL : isRTL , } ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'sdk' , function ( window , router ) { var sdk = new window . Appwrite ( ) ; var endpoint = window . location . origin + '/v1' ; sdk . setEndpoint ( endpoint ) . setProject ( router . params . project || '' ) . setLocale ( APP _ENV . LOCALE ) . setMode ( 'admin' ) ; return sdk ; } , false ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'search' , function ( window ) { return { params : { } , path : '' , pointer : '' , selected : '' , } ; } , true , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'timezone' , function ( ) { return { convert : function ( unixTime ) { var timezoneMinutes = new Date ( ) . getTimezoneOffset ( ) ; timezoneMinutes = ( timezoneMinutes === 0 ) ? 0 : - timezoneMinutes ; return parseInt ( unixTime ) + ( timezoneMinutes * 60 ) ; } } ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'realtime' , ( ) => { return { current : null , history : null , setCurrent : function ( currentConnections ) { var scope = this ; scope . current = currentConnections ; return scope . current ; } , setHistory : function ( history ) { var scope = this ; scope . history = history ; return scope . history ; } } ; } , true , true ) ; } ) ( window ) ; window . ls . router . add ( "/auth/signin" , { template : "/auth/signin?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/signup" , { template : "/auth/signup?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/recovery" , { template : "/auth/recovery?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/recovery/reset" , { template : "/auth/recovery/reset?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/confirm" , { template : "/auth/confirm?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/join" , { template : "/auth/join?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/magic-url" , { template : "/auth/magic-url?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/oauth2/success" , { template : "/auth/oauth2/success?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/oauth2/failure" , { template : "/auth/oauth2/failure?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/console" , { template : "/console?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/account" , { template : "/console/account?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/account/:tab" , { template : "/console/account?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/home" , { template : "/console/home?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/home/:tab" , { template : "/console/home?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/platforms/:platform" , { template : function ( window ) { return window . location . pathname + "?version=" + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/notifications" , { template : "/console/notifications?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/settings" , { template : "/console/settings?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/settings/:tab" , { template : "/console/settings?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/webhooks" , { template : "/console/webhooks?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/webhooks/webhook" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/webhooks/webhook/new" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/keys" , { template : "/console/keys?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/keys/:tab" , { template : "/console/keys?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/tasks" , { template : "/console/tasks?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/tasks/:tab" , { template : "/console/tasks?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/databases" , { template : "/console/databases?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/databases/database" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/database/:tab" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/usage" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/collection" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/collection/:tab" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/document" , { template : function ( window ) Line truncated
return false ; } ; return { isRTL : isRTL , } ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'sdk' , function ( window , router ) { var client = new Appwrite . Client ( ) ; var endpoint = window . location . origin + '/v1' ; client . setEndpoint ( endpoint ) . setProject ( router . params . project || '' ) . setLocale ( APP _ENV . LOCALE ) . setMode ( 'admin' ) ; return { client : client , account : new Appwrite . Account ( client ) , avatars : new Appwrite . Avatars ( client ) , databases : new Appwrite . Databases ( client ) , functions : new Appwrite . Functions ( client ) , health : new Appwrite . Health ( client ) , locale : new Appwrite . Locale ( client ) , storage : new Appwrite . Storage ( client ) , teams : new Appwrite . Teams ( client ) , users : new Appwrite . Users ( client ) } } , false ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'search' , function ( window ) { return { params : { } , path : '' , pointer : '' , selected : '' , } ; } , true , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'timezone' , function ( ) { return { convert : function ( unixTime ) { var timezoneMinutes = new Date ( ) . getTimezoneOffset ( ) ; timezoneMinutes = ( timezoneMinutes === 0 ) ? 0 : - timezoneMinutes ; return parseInt ( unixTime ) + ( timezoneMinutes * 60 ) ; } } ; } , true ) ; } ) ( window ) ; ( function ( window ) { "use strict" ; window . ls . container . set ( 'realtime' , ( ) => { return { current : null , history : null , setCurrent : function ( currentConnections ) { var scope = this ; scope . current = currentConnections ; return scope . current ; } , setHistory : function ( history ) { var scope = this ; scope . history = history ; return scope . history ; } } ; } , true , true ) ; } ) ( window ) ; window . ls . router . add ( "/auth/signin" , { template : "/auth/signin?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/signup" , { template : "/auth/signup?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/recovery" , { template : "/auth/recovery?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/recovery/reset" , { template : "/auth/recovery/reset?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/confirm" , { template : "/auth/confirm?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/join" , { template : "/auth/join?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/magic-url" , { template : "/auth/magic-url?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/oauth2/success" , { template : "/auth/oauth2/success?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/auth/oauth2/failure" , { template : "/auth/oauth2/failure?version=" + APP _ENV . CACHEBUSTER , scope : "home" } ) . add ( "/console" , { template : "/console?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/account" , { template : "/console/account?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/account/:tab" , { template : "/console/account?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/home" , { template : "/console/home?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/home/:tab" , { template : "/console/home?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/platforms/:platform" , { template : function ( window ) { return window . location . pathname + "?version=" + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/notifications" , { template : "/console/notifications?version=" + APP _ENV . CACHEBUSTER , scope : "console" } ) . add ( "/console/settings" , { template : "/console/settings?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/settings/:tab" , { template : "/console/settings?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/webhooks" , { template : "/console/webhooks?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/webhooks/webhook" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/webhooks/webhook/new" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/keys" , { template : "/console/keys?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/keys/:tab" , { template : "/console/keys?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/tasks" , { template : "/console/tasks?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/tasks/:tab" , { template : "/console/tasks?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/databases" , { template : "/console/databases?version=" + APP _ENV . CACHEBUSTER , scope : "console" , project : true } ) . add ( "/console/databases/database" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/database/:tab" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/usage" , { template : function ( window ) { return window . location . pathname + window . location . search + '&version=' + APP _ENV . CACHEBUSTER ; } , scope : "console" , project : true } ) . add ( "/console/databases/collection" , { template : function ( window ) { return window . location . Line truncated
let size = element . dataset [ "size" ] || 80 ; let name = $value . name || $value || "" ; name = ( typeof name !== 'string' ) ? '--' : name ; return def = "/v1/avatars/initials?project=console" + "&name=" +
encodeURIComponent ( name ) + "&width=" +
size + "&height=" +
@@ -714,14 +714,15 @@ return url;}}else{if(typeof value!=="undefined"&&value!==null){var separator=url
return url ; } else { return url ; } } } ; keys = keys . split ( "," ) . map ( element => element . trim ( ) ) ; return function ( serviceForm , router , window ) { let url = window . location . href ; keys . map ( node => { node = node . split ( "=" ) ; let key = node [ 0 ] || "" ; let name = node [ 1 ] || key ; let value = getValue ( key , "param" , serviceForm ) ; url = updateQueryString ( name , value ? value : null , url ) ; } ) ; if ( url !== window . location . href ) { window . history . pushState ( { } , "" , url ) ; router . reset ( ) ; } } ; } , trigger : function ( events ) { return function ( document ) { events = events . trim ( ) . split ( "," ) ; for ( let i = 0 ; i < events . length ; i ++ ) { if ( "" === events [ i ] ) { continue ; }
document . dispatchEvent ( new CustomEvent ( events [ i ] ) ) ; } } ; } , setId : function name ( params ) { } , default : function ( ) { let collection = container . get ( 'project-collection' ) ; let document = container . get ( 'project-document' ) ; if ( collection && document && collection . $id === document . $id ) { for ( const [ key , value ] of Object . entries ( document ) ) { delete document [ key ] ; }
if ( collection . rules ) { for ( let index = 0 ; index < collection . rules . length ; index ++ ) { const element = collection . rules [ index ] ; switch ( element . type ) { case 'text' : case 'email' : case 'url' : case 'ip' : document [ element . key ] = element . default || '' ; break ; case 'numeric' : document [ element . key ] = element . default || '0' ; break ; case 'boolean' : document [ element . key ] = element . default || false ; break ; case 'document' : document [ element . key ] = element . default || { '$id' : '' , '$collection' : '' , '$permissions' : { } } ; break ; default : document [ element . key ] = null ; break ; }
if ( element . array ) { document [ element . key ] = [ ] ; } } } } } } ; let getParams = function getParams ( func ) { const REGEX _COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm ; const REGEX _FUNCTION _PARAMS = /(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m ; const REGEX _PARAMETERS _VALUES = /\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm ; let functionAsString = func . toString ( ) ; let params = [ ] ; let match ; functionAsString = functionAsString . replaceAll ( '={}' , "" ) ; functionAsString = functionAsString . replaceAll ( '=[]' , "" ) ; functionAsString = functionAsString . replace ( REGEX _COMMENTS , "" ) ; functionAsString = functionAsString . match ( REGEX _FUNCTION _PARAMS ) [ 1 ] ; if ( functionAsString . charAt ( 0 ) === "(" ) { functionAsString = functionAsString . slice ( 1 , - 1 ) ; }
if ( element . array ) { document [ element . key ] = [ ] ; } } } } } } ; let getParams = function getParams ( func ) { const REGEX _COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm ; const REGEX _FUNCTION _PARAMS = /(?:\s*(?:function\s*[^(]*)?\s*)((?:[^'"]|(?:(?:(['"])(?:(?:.*?[^\\]\2)|\2))))*?)\s*(?=(?:=>)|{)/m ; const REGEX _PARAMETERS _VALUES = /\s*([\w\\$]+)\s*(?:=\s*((?:(?:(['"])(?:\3|(?:.*?[^\\]\3)))((\s*\+\s*)(?:(?:(['"])(?:\6|(?:.*?[^\\]\6)))|(?:[\w$]*)))*)|.*?))?\s*(?:,|$)/gm ; let functionAsString = func . toString ( ) ; let params = [ ] ; let match ; let indexOfArguments = functionAsString . indexOf ( '(' ) ; if ( indexOfArguments !== - 1 ) { functionAsString = functionAsString . slice ( indexOfArguments , - 1 ) ; }
functionAsString = functionAsString . replaceAll ( '={}' , "" ) ; functionAsString = functionAsString . replaceAll ( '=[]' , "" ) ; functionAsString = functionAsString . replace ( REGEX _COMMENTS , "" ) ; functionAsString = functionAsString . match ( REGEX _FUNCTION _PARAMS ) [ 1 ] ; if ( functionAsString . charAt ( 0 ) === "(" ) { functionAsString = functionAsString . slice ( 1 , - 1 ) ; }
while ( ( match = REGEX _PARAMETERS _VALUES . exec ( functionAsString ) ) ) { params . push ( match [ 1 ] ) ; }
return params ; } ; let getValue = function ( key , prefix , data ) { let result = null ; if ( ! key ) { return null ; }
let attrKey = prefix + key . charAt ( 0 ) . toUpperCase ( ) + key . slice ( 1 ) ; if ( element . dataset [ attrKey ] ) { result = expression . parse ( element . dataset [ attrKey ] ) ; if ( element . dataset [ attrKey + "CastTo" ] === "array" ) { result = result . split ( "," ) ; } }
if ( typeof data [ key ] !== 'undefined' ) { result = data [ key ] ; }
if ( typeof result === 'undefined' ) { result = "" ; }
return result ; } ; let resolve = function ( target , prefix = "param" , data = { } ) { if ( ! target ) { return function ( ) { } ; }
let args = getParams ( target ) ; return target . apply ( target , args . map ( function ( value ) { let result = getValue ( value , prefix , data ) ; return result ? ? undefined ; } ) ) ; } ; let exec = function ( event ) { let parsedSuccess = expression . parse ( success ) ; let parsedFailure = expression . parse ( failure ) ; let parsedAction = expression . parse ( action ) ; parsedSuccess = parsedSuccess && parsedSuccess != "" ? parsedSuccess . split ( "," ) . map ( element => element . trim ( ) ) : [ ] ; parsedFailure = parsedFailure && parsedFailure != "" ? parsedFailure . split ( "," ) . map ( element => element . trim ( ) ) : [ ] ; element . $lsSkip = true ; element . classList . add ( "load-service-start" ) ; if ( ! document . body . contains ( element ) ) { element = undefined ; return false ; }
let args = getParams ( target ) ; return target . apply ( container . get ( scope ) , args . map ( function ( value ) { let result = getValue ( value , prefix , data ) ; return result ? ? undefined ; } ) ) ; } ; let exec = function ( event ) { let parsedSuccess = expression . parse ( success ) ; let parsedFailure = expression . parse ( failure ) ; let parsedAction = expression . parse ( action ) ; parsedSuccess = parsedSuccess && parsedSuccess != "" ? parsedSuccess . split ( "," ) . map ( element => element . trim ( ) ) : [ ] ; parsedFailure = parsedFailure && parsedFailure != "" ? parsedFailure . split ( "," ) . map ( element => element . trim ( ) ) : [ ] ; element . $lsSkip = true ; element . classList . add ( "load-service-start" ) ; if ( ! document . body . contains ( element ) ) { element = undefined ; return false ; }
if ( event ) { event . preventDefault ( ) ; }
if ( running ) { return false ; }
running = true ; element . style . backgroud = 'red' ; if ( confirm ) { if ( window . confirm ( confirm ) !== true ) { element . classList . add ( "load-service-end" ) ; element . $lsSkip = false ; running = false ; return false ; } }